/* ============================================================
   Guess the Time — playful "2D game" UI theme
   Inspired by the bouncy, glossy, candy-colored look of Cut the Rope.
   (Google Fonts are loaded via <link> + preconnect in each HTML page
   for better Core Web Vitals — do not @import here.)
   ============================================================ */

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

:root {
  --sky-top: #6dd5ed;
  --sky-mid: #7fd4a8;
  --sky-bottom: #b8e986;
  --wood: #8a5a3b;
  --wood-dark: #5e3b25;
  --cream: #fff7e6;
  --card: #fffdf7;
  --ink: #3b2a1d;
  --ink-soft: #6b574a;
  --blue: #38bdf8;
  --blue-dark: #0284c7;
  --green: #34d399;
  --green-dark: #059669;
  --red: #fb7185;
  --red-dark: #e11d48;
  --gold: #fbbf24;
  --gold-dark: #d97706;
  --purple: #a78bfa;
  --orange: #fb923c;
  --border: #e7d9c3;
  --shadow: rgba(94, 59, 37, 0.28);
  --revealed: #16a34a;
  --header-h: 62px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Fredoka", "Baloo 2", "Comic Sans MS", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 15% 12%, rgba(255,255,255,.85), transparent 40%),
    radial-gradient(circle at 85% 8%, rgba(255,255,255,.6), transparent 35%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-bottom) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
/* Soft floating decorative blobs */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  filter: blur(2px);
}
body::before {
  width: 220px; height: 220px;
  top: -60px; left: -60px;
  background: radial-gradient(circle, rgba(255,255,255,.7), transparent 70%);
}
body::after {
  width: 300px; height: 300px;
  bottom: -100px; right: -80px;
  background: radial-gradient(circle, rgba(255,255,255,.45), transparent 70%);
}

a { color: var(--blue-dark); text-decoration: none; font-weight: 600; }
a:hover { color: var(--red-dark); }

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.1rem;
  position: relative;
  z-index: 1;
}
main { flex: 1; padding: 1.5rem 0 2.5rem; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(180deg, #a9683f, var(--wood));
  border-bottom: 4px solid var(--wood-dark);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 6px 0 rgba(94,59,37,.35), 0 10px 22px rgba(0,0,0,.18);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 2px 0 var(--wood-dark), 0 3px 6px rgba(0,0,0,.25);
  letter-spacing: .2px;
}
.logo:hover { color: #fff; transform: rotate(-3deg) scale(1.05); display: inline-block; transition: transform .2s; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a {
  color: #ffe9c7;
  font-size: .95rem;
  font-weight: 500;
  text-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; }
.nav-cta {
  background: linear-gradient(180deg, #fde68a, var(--gold));
  color: var(--wood-dark) !important;
  padding: .5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  border: 2px solid var(--gold-dark);
  box-shadow: 0 3px 0 var(--gold-dark), 0 5px 10px rgba(0,0,0,.2);
  text-shadow: none;
  transition: transform .08s, box-shadow .08s;
}
.nav-cta:hover { color: var(--wood-dark) !important; transform: translateY(-1px); }
.nav-cta:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-dark); }

/* ---------- Mute button ---------- */
#gtt-mute {
  font-family: inherit;
}

/* ---------- Ads ---------- */
/* Pre-approval: slots with .ad-hidden collapse completely — no height,
   no margin, no dashed box — so visitors see nothing until ads are
   turned on in assets/ads.js. */
.ad-hidden,
[data-ad].ad-hidden {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

.ad-slot {
  width: 100%;
  margin: 1.1rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  clear: both;
}

/* Reserve space for REAL ads before they fill, to prevent layout shift
   (a Core Web Vitals / CLS ranking factor). These apply to the live
   AdSense <ins> and its wrapper. The .ad-hidden class (pre-approval)
   overrides everything to collapse the slot. */
.ad-slot ins.adsbygoogle,
[data-ad] > ins.adsbygoogle {
  min-height: 100px;
}
/* In-content/game rectangles hold a 300x250 area. */
[data-ad="middle"],
[data-ad="game"] {
  min-height: 250px;
}
[data-ad="middle"] ins.adsbygoogle,
[data-ad="game"] ins.adsbygoogle {
  min-height: 250px;
}
/* Top/bottom banners are shorter. */
[data-ad="top"],
[data-ad="bottom"] {
  min-height: 90px;
}

.ad-placeholder {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  border: 2px dashed rgba(94,59,37,.35);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(94,59,37,.6);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(255,255,255,.4);
}
[data-ad="middle"] .ad-placeholder,
[data-ad="game"] .ad-placeholder { min-height: 250px; }
@media (max-width: 640px) {
  /* Phone banners ~50px tall (+ breathing room); rectangles 250. */
  [data-ad="top"], [data-ad="bottom"] { min-height: 70px; }
  [data-ad="top"] .ad-placeholder, [data-ad="bottom"] .ad-placeholder { min-height: 60px; }
  [data-ad="middle"], [data-ad="game"] { min-height: 250px; max-width: 340px; margin-left: auto; margin-right: auto; }
  [data-ad="middle"] .ad-placeholder, [data-ad="game"] .ad-placeholder { min-height: 250px; max-width: 320px; }
}
@media (min-width: 641px) {
  /* Tablets/desktop allow a taller banner (up to 90px leaderboard). */
  [data-ad="top"], [data-ad="bottom"] { min-height: 100px; }
}
.ad-slot ins.adsbygoogle {
  display: block; width: 100%; min-width: 280px; max-width: 100%;
  margin: 0 auto; text-align: center;
}

/* ---------- Mobile anchor ad ---------- */
.ad-anchor {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: none; justify-content: center; align-items: center;
  padding: 6px;
  background: linear-gradient(180deg, #fff7e6, #ffe9c7);
  border-top: 3px solid var(--wood);
  box-shadow: 0 -6px 18px rgba(0,0,0,.25);
  min-height: 60px;
}
.ad-anchor.visible { display: flex; }
.ad-anchor .anchor-inner { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; max-width: 360px; }
.ad-anchor ins.adsbygoogle { display: block; width: 320px; max-width: 100%; min-height: 50px; }
.ad-anchor .anchor-placeholder {
  width: 320px; max-width: 100%; min-height: 50px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(94,59,37,.6); font-size: .7rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.ad-anchor .anchor-close {
  position: absolute; top: -12px; right: -6px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff; background: var(--red); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.3);
}
.ad-anchor .anchor-close:hover { background: var(--red-dark); }
@media (max-width: 820px) {
  .ad-anchor.visible { display: flex; }
  body.ad-anchor-active { padding-bottom: 76px; }
}
@media (min-width: 821px) { .ad-anchor { display: none !important; } }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 1.5rem 0 .8rem; animation: dropIn .6s cubic-bezier(.2,.9,.3,1.3) both; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: .7rem;
  color: #fff;
  text-shadow: 0 3px 0 var(--wood-dark), 0 5px 0 rgba(0,0,0,.18), 0 8px 18px rgba(0,0,0,.25);
}
.hero p {
  color: #2f4a3a;
  font-size: 1.1rem;
  font-weight: 500;
  max-width: 580px;
  margin: 0 auto 1.4rem;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.hero-cta { display: inline-flex; gap: .8rem; flex-wrap: wrap; justify-content: center; }

/* ---------- Buttons (glossy 3D) ---------- */
.btn-hero, .btn {
  font-family: inherit;
  font-weight: 700;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  position: relative;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  text-align: center;
}
.btn-hero {
  display: inline-block;
  padding: .85rem 1.6rem;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(180deg, #34d399, var(--green-dark));
  border: 3px solid #047857;
  box-shadow: 0 5px 0 #065f46, 0 9px 18px rgba(0,0,0,.25);
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.btn-hero:hover { filter: brightness(1.05); color: #fff; transform: translateY(-2px); }
.btn-hero:active { transform: translateY(3px); box-shadow: 0 2px 0 #065f46; }
.btn-hero.secondary {
  background: linear-gradient(180deg, #60a5fa, var(--blue-dark));
  border-color: #075985;
  box-shadow: 0 5px 0 #0c4a6e, 0 9px 18px rgba(0,0,0,.25);
}
.btn-hero.secondary:active { box-shadow: 0 2px 0 #0c4a6e; }

.btn {
  width: 100%;
  padding: .9rem 1.2rem;
  font-size: 1.1rem;
  color: #fff;
  border-width: 3px;
  border-style: solid;
  text-shadow: 0 2px 0 rgba(0,0,0,.22);
  margin-top: .6rem;
  letter-spacing: .3px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-start {
  background: linear-gradient(180deg, #34d399, var(--green-dark));
  border-color: #047857;
  box-shadow: 0 5px 0 #065f46, 0 8px 14px rgba(0,0,0,.2);
}
.btn-start:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-2px); }
.btn-start:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #065f46; }
.btn-stop {
  background: linear-gradient(180deg, #fb7185, var(--red-dark));
  border-color: #9f1239;
  box-shadow: 0 5px 0 #881337, 0 8px 14px rgba(0,0,0,.2);
}
.btn-stop:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-2px); }
.btn-stop:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #881337; }
.btn-again {
  background: linear-gradient(180deg, #fbbf24, var(--gold-dark));
  border-color: #92400e;
  color: #4a2a06;
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
  box-shadow: 0 5px 0 #78350f, 0 8px 14px rgba(0,0,0,.2);
}
.btn-again:hover { filter: brightness(1.05); transform: translateY(-2px); color: #4a2a06; }
.btn-again:active { transform: translateY(3px); box-shadow: 0 2px 0 #78350f; color: #4a2a06; }
.btn-ghost {
  background: linear-gradient(180deg, #e7d9c3, #cbb79b);
  border-color: #8a755c;
  color: var(--wood-dark);
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
  box-shadow: 0 5px 0 #6b5743, 0 8px 14px rgba(0,0,0,.18);
}
.btn-ghost:hover { filter: brightness(1.03); transform: translateY(-2px); color: var(--wood-dark); }
.btn-ghost:active { transform: translateY(3px); box-shadow: 0 2px 0 #6b5743; color: var(--wood-dark); }
.btn-skip {
  background: transparent;
  color: var(--ink-soft);
  border: 2px dashed var(--border);
  font-weight: 600;
  padding: .65rem;
  margin-top: .4rem;
  box-shadow: none;
  text-shadow: none;
  font-size: .95rem;
}
.btn-skip:hover { color: var(--wood-dark); border-color: var(--wood); background: rgba(255,255,255,.5); transform: none; }
.btn-skip:active { transform: scale(.98); box-shadow: none; }

/* ---------- Section titles ---------- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin: 2rem 0 1rem;
  color: #fff;
  text-shadow: 0 2px 0 var(--wood-dark), 0 4px 10px rgba(0,0,0,.2);
}

/* ---------- Cards (white/cream panels) ---------- */
.card {
  background: var(--card);
  border: 4px solid var(--wood);
  border-radius: 26px;
  padding: 1.5rem;
  box-shadow: 0 8px 0 var(--wood-dark), 0 18px 35px rgba(94,59,37,.35),
              inset 0 2px 0 rgba(255,255,255,.7);
  position: relative;
  animation: popIn .45s cubic-bezier(.2,.9,.3,1.4) both;
}
.card h1, .card h2 { color: var(--wood-dark); }

/* ---------- Mode cards ---------- */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
}
.mode-card {
  background: var(--card);
  border: 4px solid var(--wood);
  border-radius: 22px;
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  height: 100%;
  box-shadow: 0 6px 0 var(--wood-dark), 0 14px 24px rgba(94,59,37,.3),
              inset 0 2px 0 rgba(255,255,255,.7);
  transition: transform .12s, box-shadow .12s, border-color .15s;
  animation: popIn .5s cubic-bezier(.2,.9,.3,1.4) both;
}
.mode-card:nth-child(2) { animation-delay: .08s; }
.mode-card:nth-child(3) { animation-delay: .16s; }
.mode-card:nth-child(4) { animation-delay: .24s; }
.mode-card:hover {
  transform: translateY(-4px) rotate(-1deg);
  border-color: var(--gold-dark);
  color: var(--ink);
  box-shadow: 0 10px 0 var(--wood-dark), 0 20px 30px rgba(94,59,37,.35);
}
.mode-card:active { transform: translateY(2px); box-shadow: 0 4px 0 var(--wood-dark); }
.mode-icon { font-size: 2.2rem; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.15)); animation: wobble 3s ease-in-out infinite; }
.mode-card:hover .mode-icon { animation: wiggle .5s ease; }
.mode-name { font-size: 1.15rem; font-weight: 700; color: var(--wood-dark); }
.mode-desc { color: var(--ink-soft); font-size: .9rem; line-height: 1.4; }

/* ---------- Info blocks / prose ---------- */
.prose-home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
  margin-top: 1rem;
}
.info-block {
  background: var(--card);
  border: 4px solid var(--wood);
  border-radius: 20px;
  padding: 1.2rem;
  box-shadow: 0 6px 0 var(--wood-dark), 0 14px 24px rgba(94,59,37,.28);
}
.info-block h3 { font-size: 1.1rem; margin-bottom: .4rem; color: var(--wood-dark); }
.info-block p { color: var(--ink-soft); font-size: .92rem; }

/* ---------- Game wrapper ---------- */
.game-wrap { max-width: 540px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.back-link {
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(94,59,37,.55);
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.5);
  text-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.back-link:hover { color: #fff; background: var(--wood-dark); transform: translateX(-2px); }
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  flex: 1;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 0 var(--wood-dark), 0 4px 8px rgba(0,0,0,.25);
}

/* ---------- Setup ---------- */
.setup-intro { color: var(--ink-soft); font-size: .95rem; margin-bottom: 1.1rem; text-align: center; }
.setup-body { display: grid; gap: 1.1rem; }
.setup-section h3 { font-size: 1rem; margin-bottom: .5rem; color: var(--wood-dark); }
.counter { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.counter button {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 3px solid var(--wood-dark);
  background: linear-gradient(180deg, #fbbf24, var(--gold-dark));
  color: #4a2a06;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #78350f;
  font-family: inherit;
}
.counter button:hover:not(:disabled) { filter: brightness(1.06); }
.counter button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #78350f; }
.counter button:disabled { opacity: .4; cursor: not-allowed; box-shadow: 0 2px 0 #78350f; }
.counter .count-label { flex: 1; font-weight: 700; color: var(--wood-dark); }
.name-list { display: grid; gap: .5rem; margin-top: .5rem; }
.name-input {
  width: 100%;
  padding: .7rem .9rem;
  border-radius: 14px;
  border: 3px solid var(--border);
  background: #fffdf7;
  color: var(--ink);
  font-size: .98rem;
  font-family: inherit;
  font-weight: 500;
  box-shadow: inset 0 2px 4px rgba(94,59,37,.12);
}
.name-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(56,189,248,.25); }
.team-block {
  background: #fff8e8;
  border: 3px dashed #c9a87a;
  border-radius: 18px;
  padding: .9rem;
  margin-bottom: .85rem;
}
.team-block h4 {
  font-size: .9rem;
  color: var(--wood-dark);
  margin-bottom: .5rem;
  font-weight: 700;
}

/* ---------- Target / display ---------- */
.target-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
  padding: .6rem 1rem;
  background: linear-gradient(180deg, #fff3cf, #ffe29a);
  border: 3px solid #d6a94a;
  border-radius: 16px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.7);
}
.label {
  color: var(--wood-dark);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.target {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue-dark);
  text-shadow: 0 2px 0 rgba(255,255,255,.6);
}
.target.revealed { color: var(--revealed); }

.display {
  background:
    radial-gradient(circle at 50% 25%, #3b4a6b, #1e293b 70%);
  border: 5px solid #0f172a;
  border-radius: 50%;
  width: min(260px, 78vw);
  height: min(260px, 78vw);
  margin: 0 auto 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 6px 18px rgba(255,255,255,.12),
    inset 0 -10px 24px rgba(0,0,0,.5),
    0 10px 0 #0b1220,
    0 18px 30px rgba(0,0,0,.4);
  position: relative;
}
.display::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 3px dashed rgba(255,255,255,.12);
  pointer-events: none;
}
.display.big { width: min(280px, 80vw); height: min(280px, 80vw); }
.display-text {
  font-size: 2.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: block;
  color: #fff;
  text-shadow: 0 0 14px rgba(56,189,248,.7);
  z-index: 1;
}
.display-text.running {
  color: #7dd3fc;
  animation: runPulse .55s ease-in-out infinite, digitPop .12s ease;
}
.display-text.countdown {
  color: #fde047;
  font-size: 4rem;
  text-shadow: 0 0 24px rgba(253,224,71,.8), 0 4px 0 rgba(0,0,0,.3);
  animation: countBounce .8s cubic-bezier(.2,.9,.3,1.4);
}
.display-text.done {
  color: #86efac;
  text-shadow: 0 0 22px rgba(134,239,172,.8);
  animation: donePop .5s cubic-bezier(.2,.9,.3,1.5);
}
/* Emoji flicker (Stopwatch) — emojis render smaller than digits, so bump size */
.display-text.symbols {
  font-size: clamp(2.6rem, 11vw, 3.4rem);
}
/* Live team standings between rounds */
.round-standings {
  margin-top: 1rem;
  background: rgba(255,255,255,.55);
  border: 2px dashed rgba(94,59,37,.25);
  border-radius: 14px;
  padding: .8rem 1rem .9rem;
}
.round-standings h4 {
  margin: 0 0 .4rem;
  font-size: 1rem;
}
.round-standings ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.round-standings li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  padding: .32rem 0;
  font-size: .95rem;
  border-top: 1px solid rgba(0,0,0,.07);
}
.round-standings li:first-child {
  border-top: 0;
  font-weight: 600;
}
.round-standings li span:last-child {
  color: var(--muted);
  font-size: .88rem;
  white-space: nowrap;
}
.revealed-time { color: var(--revealed); font-weight: 700; }
@keyframes runPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes digitPop {
  0% { transform: scale(.9); }
  100% { transform: scale(1); }
}
@keyframes countBounce {
  0% { transform: scale(.2); opacity: 0; }
  60% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes donePop {
  0% { transform: scale(.3) rotate(-12deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}
.play-info { color: var(--ink-soft); font-size: .88rem; text-align: center; margin-bottom: 1rem; font-weight: 500; }

/* ---------- Results rows (stopwatch) ---------- */
.result {
  margin-top: .6rem;
  padding: 1rem;
  background: #fdf3de;
  border: 3px solid #e0c589;
  border-radius: 18px;
  text-align: left;
  animation: popIn .4s ease both;
}
.result-row { display: flex; justify-content: space-between; align-items: center; padding: .3rem 0; }
.value { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--wood-dark); }
.score { color: var(--green-dark); font-size: 1.15rem; }
.verdict { margin-top: .6rem; text-align: center; font-weight: 700; color: var(--wood-dark); font-size: 1.05rem; }

/* ---------- Guess form / numpad ---------- */
.guess-form { display: grid; gap: .5rem; }
.guess-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1rem;
  font-weight: 700;
  color: var(--wood-dark);
  gap: .5rem;
  flex-wrap: wrap;
}
.guess-hint { color: var(--ink-soft); font-size: .82rem; font-weight: 500; }
.guess-input {
  width: 100%;
  padding: 1rem;
  font-size: 2.4rem;
  font-weight: 700;
  text-align: center;
  border-radius: 18px;
  border: 4px solid var(--blue-dark);
  background: #eff8ff;
  color: var(--blue-dark);
  font-variant-numeric: tabular-nums;
  cursor: default;
  font-family: inherit;
  box-shadow: inset 0 3px 8px rgba(2,132,199,.18), 0 4px 0 #075985;
  text-shadow: 0 2px 0 rgba(255,255,255,.6);
  animation: popIn .3s ease both;
}
.guess-input[readonly] { caret-color: transparent; }
.guess-input:focus { outline: none; box-shadow: inset 0 3px 8px rgba(2,132,199,.22), 0 0 0 5px rgba(56,189,248,.3), 0 4px 0 #075985; }

.error-text { color: var(--red-dark); font-size: .9rem; text-align: center; font-weight: 700; animation: shake .4s; }

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
  margin-top: .5rem;
  user-select: none;
}
.numpad button {
  padding: .5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 16px;
  border: 3px solid var(--wood-dark);
  background: linear-gradient(180deg, #fff, #f0e2c8);
  color: var(--wood-dark);
  cursor: pointer;
  min-height: 60px;
  touch-action: manipulation;
  font-family: inherit;
  box-shadow: 0 4px 0 var(--wood-dark), 0 6px 10px rgba(0,0,0,.15);
  transition: transform .06s, box-shadow .06s, background .1s;
}
.numpad button:hover { background: linear-gradient(180deg, #fff, #f9efdb); }
.numpad button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--wood-dark);
  background: linear-gradient(180deg, #fde68a, #fbbf24);
}
.numpad .key-back { font-size: 1.25rem; }
.numpad .numpad-clear {
  grid-column: span 3;
  min-height: 46px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #fb7185, var(--red-dark));
  border-color: #9f1239;
  box-shadow: 0 4px 0 #881337;
}
.numpad .numpad-clear:active { box-shadow: 0 1px 0 #881337; }
@media (min-width: 520px) {
  .numpad button { font-size: 1.7rem; min-height: 66px; }
}

/* ---------- Pass device ---------- */
.pass-screen { text-align: center; animation: popIn .4s ease both; }
.pass-check {
  width: 76px; height: 76px;
  margin: .4rem auto 1rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #34d399, var(--green-dark));
  border: 4px solid #047857;
  color: #fff;
  font-size: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 0 #065f46, 0 10px 18px rgba(0,0,0,.2);
  animation: bounceIn .5s cubic-bezier(.2,.9,.3,1.5);
}
.pass-locked { font-size: 1.2rem; font-weight: 700; margin-bottom: .25rem; color: var(--wood-dark); }
.pass-next { color: var(--ink-soft); margin-bottom: 1rem; font-weight: 500; }

/* ---------- Results table ---------- */
.result-table { width: 100%; border-collapse: collapse; margin-bottom: .5rem; }
.result-table th {
  text-align: left;
  color: var(--wood-dark);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .55rem .5rem;
  border-bottom: 3px solid #e7d9c3;
  font-weight: 700;
}
.result-table td {
  padding: .6rem .5rem;
  border-bottom: 2px solid #f1e6d2;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.result-table tr.winner td {
  color: #b45309;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(251,191,36,.18), transparent);
}
.result-table tr.winner td:first-child { border-radius: 12px 0 0 12px; }
.result-table .pos { color: var(--ink-soft); width: 1.9rem; }
.result-table .guess, .result-table .off { text-align: right; }
.result-table .off { color: var(--ink-soft); font-weight: 600; }
.winner-banner {
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin: .5rem 0 1rem;
  text-shadow: 0 2px 0 rgba(255,255,255,.6);
  animation: popIn .5s cubic-bezier(.2,.9,.3,1.4);
}
.team-section { margin-bottom: 1rem; animation: popIn .4s ease both; }
.team-section h4 {
  color: var(--wood-dark);
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .35rem;
  display: flex; justify-content: space-between;
}
.result-actions { margin-top: 1rem; display: grid; gap: .5rem; }

/* ---------- Content / article pages ---------- */
.article {
  background: var(--card);
  border: 4px solid var(--wood);
  border-radius: 26px;
  padding: 1.75rem;
  max-width: 780px;
  margin: 0 auto;
  box-shadow: 0 8px 0 var(--wood-dark), 0 18px 35px rgba(94,59,37,.3);
  animation: popIn .45s ease both;
}
.article h1 { font-size: 1.9rem; margin-bottom: .4rem; color: var(--wood-dark); }
.article .lead { color: var(--ink-soft); font-size: 1.08rem; margin-bottom: 1.2rem; font-weight: 500; }
.article h2 { font-size: 1.35rem; margin: 1.4rem 0 .5rem; color: var(--wood-dark); }
.article h3 { font-size: 1.1rem; margin: 1rem 0 .3rem; color: var(--wood-dark); }
.article p { margin-bottom: .8rem; color: var(--ink); }
.article ul, .article ol { margin: 0 0 1rem 1.3rem; color: var(--ink); }
.article li { margin-bottom: .35rem; }
.article strong { color: var(--wood-dark); }
.article code {
  background: #f3e8d2; padding: .1rem .35rem; border-radius: 6px;
  font-size: .9em; color: var(--wood-dark);
}
.article .cta-row { margin-top: 1.4rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.faq { border-top: 3px dashed #e7d9c3; margin-top: 1.2rem; padding-top: .5rem; }
.faq details { padding: .75rem 0; border-bottom: 2px solid #f1e6d2; }
.faq summary {
  cursor: pointer; font-weight: 700; font-size: 1.02rem; color: var(--wood-dark);
  list-style: none; position: relative; padding-right: 1.8rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 0;
  color: var(--gold-dark); font-size: 1.4rem; font-weight: 700;
  transition: transform .2s;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: .5rem; color: var(--ink-soft); font-size: .94rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: linear-gradient(180deg, var(--wood), var(--wood-dark));
  border-top: 4px solid #3d2516;
  padding: 2rem 0 1.25rem;
  margin-top: 2rem;
  color: #ffe9c7;
  box-shadow: 0 -6px 18px rgba(0,0,0,.2);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; }
.site-footer h4 {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .06em;
  color: #ffd591; margin-bottom: .5rem; font-weight: 700;
}
.site-footer a { display: block; color: #ffe9c7; font-size: .92rem; margin-bottom: .3rem; font-weight: 500; }
.site-footer a:hover { color: #fff; }
.site-footer .logo { color: #fff; margin-bottom: .4rem; display: inline-block; }
.site-footer p { color: #e8cfa6; font-size: .9rem; max-width: 320px; }
.copyright {
  text-align: center; color: #d7b483; font-size: .85rem;
  margin-top: 1.4rem; padding-top: 1rem; border-top: 2px solid rgba(255,255,255,.12);
}

/* ---------- Share row ---------- */
.share-row { margin-top: .85rem; text-align: center; animation: popIn .35s ease both; }
.share-main { display: inline-block; width: 100%; }
.share-alt {
  display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .5rem;
}
.share-chip {
  font-family: inherit;
  font-weight: 600;
  font-size: .85rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--wood-dark);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--border);
  transition: transform .06s, box-shadow .06s;
}
.share-chip:hover { border-color: var(--wood); transform: translateY(-1px); }
.share-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
.share-toast {
  margin-top: .6rem;
  color: var(--green-dark);
  font-weight: 700;
  font-size: .9rem;
  animation: popIn .25s ease both;
}

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: .75rem; }

/* ---------- Animations ---------- */
@keyframes popIn {
  0% { opacity: 0; transform: scale(.8) translateY(10px); }
  60% { opacity: 1; transform: scale(1.03) translateY(0); }
  100% { transform: scale(1) translateY(0); }
}
@keyframes dropIn {
  0% { opacity: 0; transform: translateY(-30px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(.3); }
  50% { opacity: 1; transform: scale(1.15); }
  70% { transform: scale(.95); }
  100% { transform: scale(1); }
}
@keyframes wiggle {
  0%,100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}
@keyframes wobble {
  0%,100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-4px) rotate(4deg); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .article { padding: 1.25rem; }
  .page-title { font-size: 1.3rem; }
  .hero h1 { font-size: 2rem; }
  .display-text { font-size: 2.1rem; }
  .display-text.countdown { font-size: 3rem; }
  .card { padding: 1.2rem; border-radius: 22px; }
}
