* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #0a0a0d;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(120, 80, 20, 0.18) 0%, transparent 70%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 60px,
      rgba(180, 140, 40, 0.03) 60px,
      rgba(180, 140, 40, 0.03) 61px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 60px,
      rgba(180, 140, 40, 0.03) 60px,
      rgba(180, 140, 40, 0.03) 61px
    );
  font-family: 'Cinzel', serif;
  overflow: hidden;
}

/* Corner decorations */
body::before, body::after {
  content: '⚔';
  position: fixed;
  font-size: 2rem;
  color: rgba(180, 140, 40, 0.25);
}
body::before { top: 24px; left: 32px; }
body::after  { bottom: 24px; right: 32px; transform: rotate(180deg); }

/* Stars canvas */
#starsCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px 80px;
}

/* Top ornament */
.ornament {
  color: #c9a84c;
  font-size: 1.4rem;
  letter-spacing: 0.6em;
  opacity: 0.7;
  margin-bottom: 8px;
  display: block;
}

/* Divider line */
.divider {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px auto;
  width: fit-content;
}
.divider::before,
.divider::after {
  content: '';
  display: block;
  width: 120px;
  height: 1px;
  background: linear-gradient(to right, transparent, #c9a84c, transparent);
}
.divider span {
  color: #c9a84c;
  font-size: 1.3rem;
}

/* Main title */
h1 {
  font-family: 'Bebas Neue', 'Cinzel Decorative', cursive;
  font-size: clamp(5rem, 14vw, 11rem);
  font-weight: 700;
  color: transparent;
  background: linear-gradient(
    180deg,
    #f0d070 0%,
    #c9a84c 40%,
    #a07830 70%,
    #c9a84c 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  letter-spacing: 0.18em;
  text-shadow: none;
  filter: drop-shadow(0 0 32px rgba(180, 130, 20, 0.45));
  animation: glow 3s ease-in-out infinite alternate;
  line-height: 1.1;
}

@keyframes glow {
  from { filter: drop-shadow(0 0 24px rgba(180, 130, 20, 0.35)); }
  to   { filter: drop-shadow(0 0 48px rgba(220, 170, 40, 0.65)); }
}

/* Subtitle / motto */
.motto {
  margin-top: 10px;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.35em;
  color: #8a6a30;
  text-transform: uppercase;
}

/* Logo */
.logo-wrapper {
  width: 180px;
  height: 180px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  filter: drop-shadow(0 0 22px rgba(180, 130, 20, 0.55));
  animation: float 4s ease-in-out infinite;
  cursor: pointer;
}
.logo-wrapper:hover {
  filter: drop-shadow(0 0 32px rgba(180, 130, 20, 0.9));
}
.logo {
  display: block;
  /* Image: 1512×1496px, black circle Ø≈1420px, centered at image center */
  /* scale = 180/1420 so circle fills wrapper; center image on wrapper center */
  width: calc(180px * 1512 / 1420);
  height: calc(180px * 1496 / 1420);
  margin-left: calc(-180px * 46 / 1420);
  margin-top:  calc(-180px * 38 / 1420);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── Request checker ── */
.request-section {
  margin-top: 48px;
  border-top: 1px solid rgba(180, 140, 40, 0.2);
  padding-top: 36px;
}

.request-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  color: #8a6a30;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.input-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.request-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 40, 0.4);
  color: #e8d090;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  padding: 12px 20px;
  width: 220px;
  text-align: center;
  letter-spacing: 0.2em;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.request-input::placeholder {
  color: rgba(180, 140, 40, 0.35);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
}

.request-input:focus {
  border-color: #c9a84c;
  box-shadow: 0 0 18px rgba(180, 130, 20, 0.25);
}

.digits-only-hint {
  display: none;
  border: 1px solid rgba(192, 80, 77, 0.4);
  padding: 14px 32px;
  color: #c0504d;
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: rgba(192, 80, 77, 0.07);
  animation: fadeIn 0.5s ease;
}
.digits-only-hint.visible {
  display: inline-block;
}

.check-btn {
  background: linear-gradient(180deg, #c9a84c 0%, #7a5a18 100%);
  color: #0a0a0d;
  border: none;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 13px 28px;
  cursor: pointer;
  text-transform: uppercase;
  transition: opacity 0.2s, transform 0.1s;
}

.check-btn:hover:not(:disabled) {
  opacity: 0.85;
  transform: translateY(-1px);
}

.check-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-box {
  margin-top: 28px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-msg {
  display: none;
  border: 1px solid rgba(180, 140, 40, 0.35);
  padding: 14px 32px;
  color: #c9a84c;
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: rgba(180, 130, 20, 0.07);
  animation: fadeIn 0.5s ease;
}

.status-msg.visible {
  display: inline-block;
}

.spinner {
  display: none;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(180, 140, 40, 0.2);
  border-top-color: #c9a84c;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.spinner.visible {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Game overlay ── */
#gameOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 100;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 14px;
}
#gameOverlay.open {
  display: flex;
}
#gameCanvas {
  border: 1px solid rgba(180,140,40,0.5);
  box-shadow: 0 0 28px rgba(180,130,20,0.35);
  background: #05050a;
}
#gameHud {
  display: flex;
  gap: 40px;
  color: #c9a84c;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
#gameCloseBtn {
  background: none;
  border: 1px solid rgba(180,140,40,0.4);
  color: #8a6a30;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  padding: 7px 20px;
  cursor: pointer;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s;
}
#gameCloseBtn:hover { color: #c9a84c; border-color: #c9a84c; }
#gameMessage {
  color: #f0d070;
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  text-align: center;
  text-shadow: 0 0 24px rgba(180,130,20,0.8);
  white-space: pre-line;
  display: none;
}
