:root {
  --bg: #17152b;
  --panel: #24213d;
  --panel-light: #302c50;
  --text: #fffdf7;
  --muted: #aaa5c1;
  --yellow: #ffd447;
  --pink: #ff6b9d;
  --green: #60e6a8;
  --red: #ff6f70;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, rgba(255,107,157,.22), transparent 35%),
    radial-gradient(circle at 90% 30%, rgba(96,230,168,.13), transparent 30%),
    var(--bg);
  font-family: "Be Vietnam Pro", sans-serif;
}
button { font: inherit; }
.app-shell { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; padding: 0 22px; display: flex; flex-direction: column; }
header { height: 76px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; color: white; text-decoration: none; }
.logo span { font-size: 27px; }
.logo strong { font-size: 18px; letter-spacing: -.04em; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.sound-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%;
  color: var(--yellow);
  background: rgba(36,33,61,.8);
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
}
.sound-button.muted { color: var(--muted); }
.best-score { padding: 7px 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 99px; color: var(--muted); font-size: 10px; }
.best-score strong { color: var(--yellow); }
main { flex: 1; display: flex; align-items: center; justify-content: center; }
.screen { display: none; width: 100%; padding: 18px 0 32px; text-align: center; animation: enter .28s ease; }
.screen.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
.hero-emoji { height: 112px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.hero-emoji span { display: inline-grid; place-items: center; width: 78px; height: 78px; border-radius: 23px; background: var(--panel); font-size: 40px; box-shadow: 0 18px 40px rgba(0,0,0,.25); transform: rotate(-7deg); }
.hero-emoji span:nth-child(2) { z-index: 2; width: 94px; height: 94px; background: var(--yellow); transform: translateY(-8px) rotate(3deg); }
.hero-emoji span:nth-child(3) { transform: rotate(8deg); }
.eyebrow { margin: 26px 0 10px; color: var(--yellow); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.055em; line-height: 1.06; }
h1 { font-size: clamp(42px, 12vw, 64px); }
h2 { font-size: 38px; }
.intro { max-width: 390px; margin: 18px auto 26px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.mode-card { margin: 0 auto 15px; padding: 17px 18px; display: flex; justify-content: space-between; align-items: center; text-align: left; border: 1px solid rgba(255,255,255,.09); border-radius: 17px; background: rgba(36,33,61,.82); }
.mode-card span, .mode-card strong { display: block; }
.mode-card span { color: var(--muted); font-size: 10px; }
.mode-card strong { margin-top: 3px; font-size: 14px; }
.mode-icon { font-size: 30px !important; }
.primary-button, .secondary-button, .skip-button {
  width: 100%;
  min-height: 55px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 800;
}
.primary-button { display: flex; justify-content: center; align-items: center; gap: 18px; color: #1a1728; background: var(--yellow); box-shadow: 0 12px 30px rgba(255,212,71,.16); }
.primary-button:active { transform: scale(.98); }
.tiny-note { margin: 13px 0 0; color: #6f6b86; font-size: 9px; }

.game-screen { align-self: stretch; }
.game-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.game-top strong { color: var(--yellow); }
.progress { height: 5px; margin: 12px 0 22px; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.08); }
.progress i { display: block; width: 10%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pink), var(--yellow)); transition: width .3s ease; }
.timer-wrap { position: relative; width: 72px; height: 72px; margin: 0 auto 18px; }
.timer { width: 72px; height: 72px; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 8; }
.timer-bg { stroke: rgba(255,255,255,.08); }
.timer-ring { stroke: var(--yellow); stroke-linecap: round; stroke-dasharray: 276.46; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .2s; }
.timer-wrap strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; }
.puzzle-card { min-height: 185px; padding: 28px 18px; display: grid; place-items: center; align-content: center; border: 1px solid rgba(255,255,255,.1); border-radius: 25px; background: linear-gradient(145deg, var(--panel-light), var(--panel)); box-shadow: 0 22px 60px rgba(0,0,0,.2); }
.emoji-puzzle { font-size: clamp(52px, 15vw, 76px); letter-spacing: .08em; }
.puzzle-card p { margin: 20px 0 0; color: var(--muted); font-size: 10px; }
.answer-grid { margin-top: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-button { min-height: 57px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; color: white; background: var(--panel); cursor: pointer; font-size: 12px; font-weight: 700; }
.answer-button:hover { border-color: var(--yellow); }
.answer-button:disabled { cursor: default; opacity: .65; }
.skip-button { min-height: auto; margin-top: 17px; padding: 8px; color: var(--muted); background: transparent; font-size: 10px; }

.feedback-icon { margin: 0 auto 8px; display: grid; place-items: center; width: 120px; height: 120px; border-radius: 38px; background: var(--panel); font-size: 62px; transform: rotate(-4deg); }
.feedback-screen h2 { color: white; }
.feedback-screen > p:not(.eyebrow) { margin: 16px 0 30px; color: var(--muted); font-size: 12px; }
.result-burst { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 30px; }
.result-burst span:nth-child(2) { font-size: 70px; }
.score-circle { width: 190px; height: 190px; margin: 25px auto; display: grid; place-items: center; align-content: center; border: 9px solid var(--yellow); border-radius: 50%; background: var(--panel); box-shadow: 0 0 0 8px rgba(255,212,71,.08); }
.score-circle span { color: var(--muted); font-size: 10px; }
.score-circle strong { margin: 2px 0; font-size: 50px; line-height: 1; }
.score-circle small { color: var(--yellow); font-size: 10px; }
.result-stats { margin-bottom: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-stats div { padding: 14px; border-radius: 14px; background: var(--panel); }
.result-stats span, .result-stats strong { display: block; }
.result-stats span { color: var(--muted); font-size: 9px; }
.result-stats strong { margin-top: 4px; font-size: 14px; }
.share-button { background: var(--green); }
.secondary-button { margin-top: 10px; color: white; border: 1px solid rgba(255,255,255,.11); background: transparent; font-size: 12px; }
footer { padding: 18px 0; color: #6f6b86; text-align: center; font-size: 9px; }
.toast { position: fixed; left: 50%; bottom: 24px; padding: 11px 15px; color: var(--bg); background: white; border-radius: 10px; font-size: 10px; font-weight: 700; opacity: 0; transform: translate(-50%, 15px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-height: 720px) {
  header { height: 58px; }
  .screen { padding-top: 5px; }
  .hero-emoji { height: 85px; }
  .hero-emoji span { width: 62px; height: 62px; font-size: 31px; }
  .hero-emoji span:nth-child(2) { width: 75px; height: 75px; }
  .puzzle-card { min-height: 150px; }
  .timer-wrap { margin-bottom: 10px; }
}
