:root {
  --bg: #F7F0F0;
  --bg-soft: #fffafa;
  --ink: #222831;
  --ink-2: #3b4451;
  --teal: #177C77;
  --teal-2: #1f9f99;
  --teal-3: #d7f1ef;
  --gold: #d9a441;
  --gold-2: #f1c76d;
  --rose: #c75b6a;
  --red: #bc2f45;
  --red-dark: #8f2134;
  --green: #1f8f69;
  --green-dark: #166d51;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(34, 40, 49, 0.12);
  --line-strong: rgba(34, 40, 49, 0.22);
  --shadow: 0 18px 50px rgba(34, 40, 49, 0.12);
  --shadow-strong: 0 20px 60px rgba(34, 40, 49, 0.18);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Montserrat", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(31, 159, 153, 0.10) 0%, transparent 28%),
    radial-gradient(circle at 90% 15%, rgba(217, 164, 65, 0.14) 0%, transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(188, 47, 69, 0.10) 0%, transparent 24%),
    linear-gradient(180deg, #fffdfd 0%, var(--bg) 100%);
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 40, 49, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 40, 49, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.4));
}

.game-shell {
  position: relative;
  z-index: 2;
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(23, 124, 119, 0.10);
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.brand-wrap h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.tagline {
  margin: 0;
  color: var(--ink-2);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.choice-btn {
  border: 0;
  border-radius: 16px;
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    opacity 0.16s ease,
    color 0.16s ease;
}

.primary-btn {
  padding: 15px 22px;
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: white;
  box-shadow: 0 14px 28px rgba(23, 124, 119, 0.20);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.choice-btn:hover:not(:disabled):not(.eliminated) {
  transform: translateY(-2px);
}

.secondary-btn {
  padding: 15px 22px;
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #2f3742, var(--ink));
  color: white;
  box-shadow: 0 14px 28px rgba(34, 40, 49, 0.16);
}

.ghost-btn {
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.hud-card {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  min-height: 110px;
}

.hud-label {
  display: block;
  color: var(--ink-2);
  text-transform: uppercase;
  font-size: 0.77rem;
  letter-spacing: 0.14em;
  font-weight: 800;
  margin-bottom: 10px;
}

.hud-value {
  display: block;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1;
  font-weight: 900;
  color: var(--ink);
}

.lives-value {
  letter-spacing: 0.06em;
  color: var(--rose);
}

.timer-card .hud-value {
  color: var(--teal);
}

.timer-bar-wrap {
  margin-top: 14px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(34, 40, 49, 0.08);
}

.timer-bar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transition: width 0.2s linear, background 0.2s ease;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(300px, 0.95fr);
  gap: 24px;
}

.play-panel,
.scoreboard-panel {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 30px;
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

.play-panel::before,
.scoreboard-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0));
}

.play-panel {
  padding: 26px;
}

.scoreboard-panel {
  padding: 24px;
}

.definition-wrap {
  margin-bottom: 22px;
}

.definition-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.definition-label {
  color: var(--ink);
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
}

.definition-subtext {
  font-size: 0.92rem;
  color: var(--ink-2);
}

.definition-box {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(245, 252, 251, 0.95));
  border: 1px solid rgba(23, 124, 119, 0.16);
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  min-height: 154px;
  padding: 24px;
  display: flex;
  align-items: center;
  font-size: clamp(1.12rem, 2.2vw, 1.42rem);
  line-height: 1.65;
  color: var(--ink);
  font-weight: 600;
}

.choices-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.choice-btn {
  position: relative;
  min-height: 84px;
  padding: 18px 18px;
  font-size: 1rem;
  font-weight: 800;
  text-align: left;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241, 247, 248, 0.98));
  color: var(--ink);
  border: 1px solid rgba(34, 40, 49, 0.10);
  box-shadow: 0 12px 24px rgba(34, 40, 49, 0.06);
  overflow: hidden;
}

.choice-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(23, 124, 119, 0.06), transparent 45%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.choice-btn:hover:not(:disabled):not(.eliminated)::before {
  opacity: 1;
}

.choice-btn:disabled {
  cursor: not-allowed;
}

.choice-btn.eliminated {
  opacity: 0.62;
  color: #8e5c64;
  background: linear-gradient(180deg, rgba(255,240,242,0.95), rgba(246,224,228,0.95));
  border-color: rgba(188, 47, 69, 0.26);
  text-decoration: line-through;
  transform: scale(0.985);
}

.choice-btn.eliminated::after {
  content: "✕";
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--red);
}

.choice-btn.correct-reveal {
  background: linear-gradient(180deg, rgba(227, 251, 242, 0.98), rgba(212, 245, 231, 0.98));
  border-color: rgba(31, 143, 105, 0.38);
  color: var(--green-dark);
  box-shadow: 0 16px 32px rgba(31, 143, 105, 0.14);
}

.choice-btn.locked {
  pointer-events: none;
}

.status-row {
  margin-top: 18px;
}

.message-box {
  min-height: 32px;
  display: flex;
  align-items: center;
  color: var(--ink-2);
  font-weight: 700;
}

.scoreboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.scoreboard-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--ink);
}

.scoreboard-subtext {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 0.92rem;
}

.scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.score-row,
.empty-scoreboard {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 14px;
  box-shadow: 0 10px 20px rgba(34, 40, 49, 0.05);
}

.score-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
}

.score-rank {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--teal);
}

.score-name {
  font-weight: 800;
  color: var(--ink);
}

.score-subline {
  display: block;
  margin-top: 3px;
  font-size: 0.84rem;
  color: var(--ink-2);
  font-weight: 600;
}

.score-points {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--ink);
}

.empty-scoreboard {
  color: var(--ink-2);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(34, 40, 49, 0.34);
  backdrop-filter: blur(6px);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  border-radius: 30px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(251, 248, 248, 0.98));
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow: 0 24px 60px rgba(34, 40, 49, 0.22);
}

.modal-badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(188, 47, 69, 0.12);
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.modal-card h2 {
  margin: 0 0 14px;
  font-size: 2rem;
  color: var(--ink);
}

.modal-stat {
  margin: 10px 0;
  font-size: 1.06rem;
  color: var(--ink-2);
  font-weight: 600;
}

.name-entry {
  margin: 22px 0;
}

.name-entry label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.name-entry input {
  width: 100%;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--ink);
  font-size: 1rem;
  font-family: "Montserrat", sans-serif;
}

.modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fx-overlay.hidden {
  display: none;
}

.fx-word {
  position: absolute;
  text-align: center;
  line-height: 0.92;
  opacity: 0;
  transform: scale(0.6) rotate(0deg);
}

.fx-word-top {
  top: 15%;
  left: 50%;
  transform: translateX(-50%) scale(0.6);
  font-size: clamp(2rem, 6vw, 5.5rem);
  font-weight: 900;
  letter-spacing: 0.1em;
}

.fx-word-main {
  top: 34%;
  left: 50%;
  transform: translateX(-50%) scale(0.6);
  font-size: clamp(3.4rem, 12vw, 10rem);
  font-weight: 900;
  white-space: nowrap;
}

.fx-word-bottom {
  top: 68%;
  left: 50%;
  transform: translateX(-50%) scale(0.6);
  font-size: clamp(1.8rem, 5vw, 4.6rem);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.fx-overlay.good .fx-word-top,
.fx-overlay.good .fx-word-bottom {
  color: var(--green-dark);
  text-shadow: 0 10px 30px rgba(31, 143, 105, 0.16);
}

.fx-overlay.good .fx-word-main {
  color: var(--green);
  text-shadow:
    0 12px 34px rgba(31, 143, 105, 0.18),
    0 0 0 rgba(0,0,0,0);
}

.fx-overlay.bad .fx-word-top,
.fx-overlay.bad .fx-word-bottom {
  color: var(--red-dark);
  text-shadow: 0 10px 30px rgba(188, 47, 69, 0.16);
}

.fx-overlay.bad .fx-word-main {
  color: var(--red);
  text-shadow:
    0 12px 34px rgba(188, 47, 69, 0.20),
    0 0 0 rgba(0,0,0,0);
}

.fx-overlay.good .fx-word-top {
  font-family: "Cinzel", serif;
}

.fx-overlay.good .fx-word-main {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
}

.fx-overlay.good .fx-word-bottom {
  font-family: "Playfair Display", serif;
  font-style: italic;
}

.fx-overlay.bad .fx-word-top {
  font-family: "Playfair Display", serif;
  font-style: italic;
}

.fx-overlay.bad .fx-word-main {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.05em;
}

.fx-overlay.bad .fx-word-bottom {
  font-family: "Cinzel", serif;
}

.fx-overlay.burst .fx-word-top {
  animation: burstTop 0.95s ease forwards;
}

.fx-overlay.burst .fx-word-main {
  animation: burstMain 1.1s cubic-bezier(0.18, 0.82, 0.2, 1) forwards;
}

.fx-overlay.burst .fx-word-bottom {
  animation: burstBottom 1.12s ease forwards;
}

.gameover-curtain {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background:
    radial-gradient(circle at 50% 50%, rgba(188, 47, 69, 0.24) 0%, rgba(34, 40, 49, 0.94) 50%, rgba(18, 15, 20, 0.98) 100%);
  color: white;
  text-align: center;
  padding: 20px;
  animation: deathPulse 1.3s ease forwards;
}

.gameover-curtain.hidden {
  display: none;
}

.gameover-skull {
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 1;
  animation: skullDrop 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.gameover-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(3rem, 11vw, 8rem);
  letter-spacing: 0.08em;
  color: #ffd9de;
  text-shadow: 0 14px 40px rgba(188, 47, 69, 0.32);
}

.gameover-subtitle {
  font-family: "Cinzel", serif;
  font-size: clamp(1rem, 2.4vw, 1.45rem);
  color: rgba(255,255,255,0.85);
}

@keyframes burstTop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(16px) scale(0.4) rotate(-8deg);
    filter: blur(12px);
  }
  45% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.06) rotate(-2deg);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-18px) scale(1.16) rotate(2deg);
  }
}

@keyframes burstMain {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.3) rotate(-5deg);
    filter: blur(20px);
  }
  38% {
    opacity: 1;
    transform: translateX(-50%) scale(1.22) rotate(1deg);
    filter: blur(0);
  }
  65% {
    opacity: 1;
    transform: translateX(-50%) scale(1.08) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(1.34) rotate(1deg);
  }
}

@keyframes burstBottom {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.45) rotate(6deg);
    filter: blur(10px);
  }
  48% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.02) rotate(1deg);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(1.14) rotate(-2deg);
  }
}

@keyframes deathPulse {
  0% {
    opacity: 0;
    transform: scale(1.08);
    filter: saturate(0.6);
  }
  40% {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1);
  }
}

@keyframes skullDrop {
  0% {
    opacity: 0;
    transform: translateY(-60px) scale(0.5) rotate(-20deg);
  }
  65% {
    opacity: 1;
    transform: translateY(8px) scale(1.14) rotate(5deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@media (max-width: 980px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .game-shell {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .choices-grid {
    grid-template-columns: 1fr;
  }

  .hud {
    grid-template-columns: 1fr 1fr;
  }

  .definition-box {
    min-height: 180px;
  }
}