:root {
  --bg: #06030b;
  --text: #fff7ff;
  --muted: #c9a8d8;
  --pink: #ff4fa3;
  --violet: #9d4edd;
  --violet-bright: #c77dff;
  --green: #39ffbc;
  --border: rgba(255, 79, 163, 0.3);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
}

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

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 18%, rgba(157, 78, 221, 0.3), transparent 20rem),
    radial-gradient(circle at 86% 38%, rgba(255, 79, 163, 0.26), transparent 22rem),
    linear-gradient(145deg, #05020a 0%, #13081d 50%, #050309 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(115deg, transparent 0 42px, rgba(255, 79, 163, 0.05) 43px 44px);
}

a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

button:hover { transform: translateY(-2px); filter: brightness(1.08); }
button:disabled { cursor: default; transform: none; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--violet-bright); outline-offset: 3px; }

.game-shell {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 34px;
  display: grid;
  gap: 16px;
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-nav { display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 950; }
.brand img { width: 38px; height: 38px; border-radius: 9px; box-shadow: 0 0 22px rgba(255,79,163,.28); }

.home-button {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255,122,200,.3);
  border-radius: 8px;
  background: rgba(16,7,25,.78);
  font-size: .82rem;
  font-weight: 900;
}

.scoreboard { display: grid; grid-template-columns: repeat(3, minmax(82px, 1fr)); gap: 8px; }
.scoreboard div {
  padding: 10px 14px;
  text-align: center;
  border: 1px solid rgba(255,79,163,.26);
  border-radius: 8px;
  background: rgba(16,7,25,.74);
}

.scoreboard span, .eyebrow, #result-label {
  color: #ff9bd3;
  font-size: .66rem;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.scoreboard strong { display: block; margin-top: 4px; color: var(--violet-bright); font-size: 1.3rem; }

.category-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.category-button {
  min-height: 40px;
  color: var(--muted);
  border: 1px solid rgba(255,122,200,.22);
  background: rgba(255,255,255,.055);
}
.category-button.is-active {
  color: #fff;
  border-color: rgba(255,79,163,.68);
  background: linear-gradient(135deg, var(--pink), var(--violet));
  box-shadow: 0 12px 28px rgba(255,79,163,.18);
}

.quiz-card {
  padding: clamp(18px, 3vw, 32px);
  display: grid;
  grid-template-columns: minmax(240px, .78fr) minmax(300px, 1.22fr);
  grid-template-areas: "copy emoji" "guess guess" "result result";
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255,79,163,.11), transparent 42%), rgba(24,9,35,.74);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter: blur(18px);
}

.clue-copy { grid-area: copy; align-self: center; }
h1, h2 {
  color: transparent;
  background: linear-gradient(90deg, #c77dff, #ff7ac8 48%, #ff3d99);
  -webkit-background-clip: text;
  background-clip: text;
  letter-spacing: 0;
}
h1 { margin-top: 10px; padding-bottom: .08em; font-size: clamp(2.25rem, 5vw, 4.2rem); line-height: 1.04; }
.clue-copy > p:last-child { margin-top: 16px; color: var(--muted); font-weight: 720; line-height: 1.5; }

.emoji-stage {
  grid-area: emoji;
  min-height: 280px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,122,200,.32);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 48%, rgba(157,78,221,.2), transparent 55%), rgba(8,4,14,.58);
}

.emoji-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,79,163,.12);
  box-shadow: 0 0 80px 35px rgba(157,78,221,.14);
  animation: glow-pulse 2600ms ease-in-out infinite;
}

#emoji-clue {
  position: relative;
  z-index: 1;
  padding: 20px;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 1.25;
  text-align: center;
  filter: drop-shadow(0 16px 24px rgba(0,0,0,.42));
  animation: clue-in 420ms cubic-bezier(.2,.9,.2,1) both;
}

#difficulty {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  color: var(--green);
  border: 1px solid rgba(57,255,188,.24);
  border-radius: 999px;
  background: rgba(8,4,14,.72);
  font-size: .7rem;
  font-weight: 900;
}

.guess-form {
  grid-area: guess;
  padding: 16px;
  border: 1px solid rgba(255,122,200,.24);
  border-radius: 8px;
  background: rgba(8,4,14,.5);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.guess-form > label {
  display: block;
  margin-bottom: 9px;
  color: #ff9bd3;
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.guess-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
#artist-guess {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  color: var(--text);
  border: 1px solid rgba(255,122,200,.3);
  border-radius: 8px;
  outline: 0;
  background: rgba(255,255,255,.06);
  font: inherit;
  font-size: 1rem;
  font-weight: 750;
}
#artist-guess::placeholder { color: rgba(201,168,216,.58); }
#artist-guess:focus { border-color: var(--violet-bright); box-shadow: 0 0 0 3px rgba(199,125,255,.14); }
#submit-guess { min-width: 150px; color: white; background: linear-gradient(135deg, var(--pink), var(--violet)); }
#skip-round { min-height: 34px; margin-top: 9px; padding: 0; color: var(--muted); background: transparent; font-size: .78rem; }
.guess-feedback { min-height: 20px; margin-top: 8px; font-size: .82rem; font-weight: 850; }
.guess-form.is-correct { border-color: var(--green); background: rgba(19,91,65,.34); box-shadow: 0 0 34px rgba(57,255,188,.12); }
.guess-form.is-correct .guess-feedback { color: var(--green); }
.guess-form.is-wrong { border-color: #ff4964; background: rgba(104,14,38,.35); animation: shake 320ms ease; }
.guess-form.is-wrong .guess-feedback { color: #ff8193; }

.round-result {
  grid-area: result;
  display: none;
  grid-template-columns: minmax(170px, auto) 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid rgba(57,255,188,.28);
  border-radius: 8px;
  background: rgba(8,4,14,.58);
}
.round-result.is-visible { display: grid; animation: result-in 300ms ease both; }
#result-artist { display: block; margin-top: 5px; color: var(--green); font-size: 1.55rem; line-height: 1.15; }
.round-result p { color: var(--muted); font-weight: 750; line-height: 1.4; }
#next-round, #start-game, #play-again { color: white; background: linear-gradient(135deg, var(--pink), var(--violet)); }
#next-round { min-width: 132px; }

.start-screen, .finish-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(4,2,8,.86);
  backdrop-filter: blur(20px);
}
.start-screen.is-visible, .finish-screen.is-visible { display: grid; }
.start-box, .finish-box {
  width: min(470px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 28px;
  text-align: center;
  border: 1px solid rgba(255,79,163,.46);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255,79,163,.15), transparent 44%), #13091d;
  box-shadow: var(--shadow), 0 0 54px rgba(157,78,221,.18);
}
.start-home { display: flex; width: max-content; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 850; }
.start-box img { width: 92px; height: 92px; margin-top: 16px; border-radius: 20px; }
.start-box h2, .finish-box h2 { margin-top: 8px; padding-bottom: .08em; font-size: 2.5rem; line-height: 1.08; }
.start-emojis { margin: 12px 0; font-size: 2.5rem; letter-spacing: .14em; }
.start-box > p:not(.eyebrow) { color: var(--muted); font-weight: 720; line-height: 1.45; }
.category-row-start { margin-top: 18px; }
#start-game, #play-again { width: 100%; margin-top: 18px; }
#finish-score { display: block; margin-top: 18px; color: var(--pink); font-size: 4.8rem; line-height: 1; }
.finish-label { color: var(--muted); font-weight: 850; text-transform: uppercase; }
.finish-stats { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.finish-stats div { padding: 15px; border: 1px solid rgba(255,122,200,.24); border-radius: 8px; background: rgba(8,4,14,.55); }
.finish-stats strong, .finish-stats span { display: block; }
.finish-stats strong { color: var(--green); font-size: 2rem; }
.finish-stats div:last-child strong { color: #ff657d; }
.finish-stats span { margin-top: 4px; color: var(--muted); font-size: .78rem; font-weight: 850; }
.finish-box > a { display: inline-block; margin-top: 16px; color: var(--muted); font-weight: 800; }

@keyframes glow-pulse { 50% { transform: scale(1.16); opacity: .75; } }
@keyframes clue-in { from { opacity: 0; transform: scale(.82) rotate(-3deg); } to { opacity: 1; transform: scale(1); } }
@keyframes result-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes shake { 25% { transform: translateX(-5px); } 55% { transform: translateX(4px); } 80% { transform: translateX(-2px); } }

@media (max-width: 720px) {
  .game-shell { width: min(100% - 16px, 1040px); padding: 10px 0 18px; gap: 10px; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    align-items: stretch;
    flex-direction: column;
    padding: 5px 0 8px;
    background: linear-gradient(180deg, rgba(6,3,11,.98) 78%, rgba(6,3,11,0));
    backdrop-filter: blur(14px);
  }
  .page-nav { justify-content: space-between; }
  .brand span { display: none; }
  .scoreboard { grid-template-columns: repeat(3, 1fr); }
  .scoreboard div { padding: 7px; }
  .scoreboard strong { font-size: 1.08rem; }
  .category-row { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
  .category-row::-webkit-scrollbar { display: none; }
  .category-button { min-width: 82px; min-height: 36px; flex: 0 0 auto; }
  .quiz-card { padding: 13px; grid-template-columns: 1fr; grid-template-areas: "copy" "emoji" "guess" "result"; gap: 12px; }
  h1 { font-size: clamp(2rem, 11vw, 3.1rem); }
  .clue-copy > p:last-child { margin-top: 9px; font-size: .9rem; }
  .emoji-stage { min-height: 190px; }
  #emoji-clue { font-size: clamp(3rem, 15vw, 4.8rem); }
  .guess-form { padding: 12px; }
  .guess-row { grid-template-columns: 1fr; }
  #submit-guess { width: 100%; min-width: 0; }
  .round-result { grid-template-columns: 1fr; text-align: center; }
  #next-round { width: 100%; }
  .start-box, .finish-box { padding: 22px; }
  .category-row-start { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
