@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=Crimson+Text:ital,wght@0,400;1,400&display=swap');

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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, #1a0f00 0%, #0a0500 100%);
  background-color: #0a0500;
  font-family: 'Crimson Text', serif;
  overflow: hidden;
}

/* ── Board frame ── */
.board-frame {
  width: min(96vw, 900px);
  min-height: min(96vh, 620px);
  background:
    radial-gradient(ellipse at 50% 40%, #1e5c1e 0%, #143d14 55%, #0d2b0d 100%);
  border: 6px solid #7a4f1a;
  border-radius: 18px;
  box-shadow:
    0 0 0 3px #c89a3a,
    0 0 0 8px #7a4f1a,
    0 30px 80px rgba(0,0,0,0.9),
    inset 0 0 60px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 0 32px 24px;
}

/* ── Ornamental corners ── */
.corner {
  width: 36px;
  height: 36px;
  background: radial-gradient(circle, #f0c040, #9a6010);
  border-radius: 50%;
  position: absolute;
  border: 2px solid #c89a3a;
  box-shadow: 0 0 8px rgba(200,154,58,0.6);
}
.corner-tl { top: 12px; left: 12px; }
.corner-tr { top: 12px; right: 12px; }
.corner-bl { bottom: 12px; left: 12px; }
.corner-br { bottom: 12px; right: 12px; }

/* ── Header ── */
.board-header {
  text-align: center;
  padding: 28px 0 16px;
  border-bottom: 2px solid rgba(200,154,58,0.3);
  margin-bottom: 20px;
}

.game-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.title-line {
  display: block;
  font-size: clamp(2rem, 6vw, 3.6rem);
  color: #f0e0a0;
  text-shadow: 0 0 20px rgba(240,192,64,0.5), 2px 2px 0 #4a2800;
}

.title-em {
  display: block;
  font-size: clamp(2.8rem, 8vw, 5rem);
  color: #f0c040;
  text-shadow:
    0 0 30px rgba(240,192,64,0.8),
    0 0 60px rgba(240,192,64,0.3),
    3px 3px 0 #4a2800;
}

.game-subtitle {
  margin-top: 10px;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #c8b880;
  font-style: italic;
  letter-spacing: 0.04em;
}

/* ── Main area ── */
.board-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
}

/* ── Side card stacks ── */
.cards-left, .cards-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
}

.card {
  width: 70px;
  height: 100px;
  perspective: 600px;
  cursor: default;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  border-radius: 8px;
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 8px;
  border: 2px solid #c89a3a;
}

.card-front {
  background: linear-gradient(135deg, #1a0a00 0%, #2d1500 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #c89a3a;
  font-family: 'Cinzel', serif;
  box-shadow: inset 0 0 16px rgba(0,0,0,0.6);
}

.card-back {
  background:
    repeating-linear-gradient(
      45deg,
      #1a3a1a 0px,
      #1a3a1a 4px,
      #1e4a1e 4px,
      #1e4a1e 8px
    );
  transform: rotateY(180deg);
  box-shadow: inset 0 0 16px rgba(0,0,0,0.4);
}

.card-back::after {
  content: '♠';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: rgba(200,154,58,0.25);
}

/* ── Center mystery box ── */
.center-board {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.mystery-box {
  width: 160px;
  height: 200px;
  background: linear-gradient(160deg, #0e0e0e 0%, #1a1a2e 100%);
  border: 3px solid #c89a3a;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px #7a4f1a,
    0 0 30px rgba(200,154,58,0.25),
    0 8px 24px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.mystery-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(200,154,58,0.08) 0%, transparent 70%);
}

.silhouette {
  width: 90px;
  height: 150px;
  background: #111;
  clip-path: polygon(
    38% 0%, 62% 0%,
    70% 8%, 70% 22%,
    80% 30%, 82% 52%,
    68% 55%, 68% 75%,
    80% 100%, 20% 100%,
    32% 75%, 32% 55%,
    18% 52%, 20% 30%,
    30% 22%, 30% 8%
  );
  filter: drop-shadow(0 0 12px rgba(200,154,58,0.2));
  position: relative;
  z-index: 1;
}

.question-mark {
  position: absolute;
  font-family: 'Cinzel', serif;
  font-size: 5rem;
  font-weight: 900;
  color: rgba(240,192,64,0.85);
  text-shadow:
    0 0 20px rgba(240,192,64,0.6),
    0 0 50px rgba(240,192,64,0.3);
  z-index: 2;
  animation: pulse 2.4s ease-in-out infinite;
  user-select: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%       { opacity: 1;    transform: scale(1.08); }
}

/* ── Start button ── */
.start-btn {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1a0a00;
  background: linear-gradient(135deg, #f0c040 0%, #c87c10 50%, #f0c040 100%);
  background-size: 200% 100%;
  border: none;
  border-radius: 8px;
  padding: 14px 36px;
  cursor: pointer;
  box-shadow:
    0 0 0 2px #7a4f1a,
    0 4px 20px rgba(200,154,58,0.5),
    0 2px 4px rgba(0,0,0,0.6);
  transition: background-position 0.4s, transform 0.15s, box-shadow 0.15s;
}

.start-btn:hover {
  background-position: 100% 0;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 2px #c89a3a,
    0 8px 28px rgba(200,154,58,0.7),
    0 2px 4px rgba(0,0,0,0.6);
}

.start-btn:active {
  transform: translateY(1px);
}

.hint-text {
  font-size: 0.85rem;
  color: rgba(200,184,128,0.6);
  font-style: italic;
  text-align: center;
}

/* ── Kahoot-style choices ── */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.4);
  transition: transform 0.1s, box-shadow 0.1s, filter 0.15s;
  text-align: left;
}

.choice-btn:nth-child(1) { background: #e21b3c; }
.choice-btn:nth-child(2) { background: #1368ce; }
.choice-btn:nth-child(3) { background: #d89e00; }
.choice-btn:nth-child(4) { background: #8b2fc9; }

.choice-btn:hover { filter: brightness(1.15); transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0,0,0,0.4); }
.choice-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.4); }
.choice-btn:disabled { cursor: default; filter: none; transform: none; box-shadow: none; }

.choice-btn.correct { background: #26890c !important; filter: brightness(1.1); }
.choice-btn.wrong   { background: #555 !important; opacity: 0.6; }

.choice-shape {
  font-size: 1.1rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.choice-label {
  flex: 1;
}

.feedback {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  min-height: 1.4em;
  text-align: center;
  transition: color 0.3s;
}

.feedback.correct { color: #6eff6e; text-shadow: 0 0 10px rgba(110,255,110,0.5); }
.feedback.wrong   { color: #ff6e6e; text-shadow: 0 0 10px rgba(255,110,110,0.4); }

/* ── Game screen layout ── */
.hidden { display: none !important; }

#screen-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 300px;
}

.names-label {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: #c8b880;
  letter-spacing: 0.08em;
  text-align: center;
}

.name-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.name-input {
  width: 100%;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  color: #f0e0a0;
  background: rgba(0,0,0,0.4);
  border: 2px solid #7a4f1a;
  border-radius: 6px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
}
.name-input::placeholder { color: rgba(200,154,58,0.35); }
.name-input:focus { border-color: #c89a3a; }

.add-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: #c8b880;
  background: transparent;
  border: 1px dashed #7a4f1a;
  border-radius: 6px;
  padding: 6px 16px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s, color 0.2s;
}
.add-btn:hover { border-color: #c89a3a; color: #f0c040; }

/* ── Board track ── */
.track-wrap {
  width: 100%;
  max-width: 340px;
  background: rgba(0,0,0,0.3);
  border: 2px solid #7a4f1a;
  border-radius: 10px;
  padding: 10px 12px;
}

.track {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.track-name {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: #c8b880;
  width: 72px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-cells {
  display: flex;
  gap: 4px;
  flex: 1;
}

.track-cell {
  flex: 1;
  height: 18px;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(200,154,58,0.2);
  position: relative;
  transition: background 0.3s;
}

.track-cell.filled {
  background: #c89a3a;
  border-color: #f0c040;
  box-shadow: 0 0 6px rgba(240,192,64,0.4);
}

.track-cell.speed {
  background: rgba(255,140,0,0.15);
  border-color: rgba(255,140,0,0.6);
}

.track-cell.speed::before {
  content: '⚡';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
}

.track-cell.speed.filled {
  background: #d97700;
  border-color: #ffaa00;
  box-shadow: 0 0 6px rgba(255,140,0,0.5);
}

.track-cell.finish {
  background: rgba(240,192,64,0.15);
  border: 1px solid #f0c040;
}

.track-cell.finish::after {
  content: '🏁';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.current-player {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: #f0c040;
  text-shadow: 0 0 16px rgba(240,192,64,0.4);
  letter-spacing: 0.06em;
}

#screen-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.round-counter {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: #c8b880;
  letter-spacing: 0.08em;
}

.now-playing {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: #f0c040;
  letter-spacing: 0.1em;
  animation: pulse 1.2s ease-in-out infinite;
  padding: 12px 0;
}


/* ── End screen ── */
#screen-end {
  display: flex;
  align-items: center;
  justify-content: center;
}

.end-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.end-title {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: #f0c040;
  text-shadow: 0 0 20px rgba(240,192,64,0.5);
}


/* ── Footer ── */
.board-footer {
  border-top: 2px solid rgba(200,154,58,0.3);
  padding-top: 16px;
  margin-top: 16px;
}

.dice-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.die {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 4px rgba(200,154,58,0.5));
}

.clue-text {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #a08840;
  text-transform: uppercase;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .board-frame { padding: 0 12px 16px; }
  .cards-left, .cards-right { display: none; }
  .mystery-box { width: 130px; height: 170px; }
}
