:root {
  --bg: #fff8ef; --bg2: #ffe9f3; --card: #ffffff; --text: #2b2340; --muted: #6b6280;
  --line: #eadff0; --accent: #ff5fa2; --accent2: #6c63ff; --accent3: #18c3a6; --sun: #ffc93c;
  --btn: #f4effa; --btn-hover: #ebe3f7; --shadow: 0 6px 24px rgba(108, 99, 255, 0.12);
  --radius: 18px;
  font-family: "Nunito", "Trebuchet MS", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17142a; --bg2: #241c3d; --card: #221d38; --text: #f3efff; --muted: #b4abcc;
    --line: #3a3257; --accent: #ff7ab6; --accent2: #8f88ff; --accent3: #3fe0c4; --sun: #ffd666;
    --btn: #2e2749; --btn-hover: #3a3259; --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  background-image: radial-gradient(circle at 10% 0%, var(--bg2) 0, transparent 40%), radial-gradient(circle at 95% 20%, var(--bg2) 0, transparent 35%);
  line-height: 1.5; -webkit-text-size-adjust: 100%;
}
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.hero { padding: 36px 0 12px; text-align: center; }
.hero h1 {
  margin: 0; font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1.1; letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent2) 55%, var(--accent3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.spark { -webkit-text-fill-color: initial; color: var(--sun); display: inline-block; animation: wiggle 2.5s ease-in-out infinite; }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 50% { transform: rotate(14deg) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .spark { animation: none; } html { scroll-behavior: auto; } }
.tagline { margin: 10px auto 18px; max-width: 560px; color: var(--muted); font-size: 1.1rem; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.jump a {
  text-decoration: none; color: var(--text); background: var(--card); border: 2px solid var(--line);
  padding: 8px 16px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow);
}
.jump a:hover { border-color: var(--accent2); }
.card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 22px 0; box-shadow: var(--shadow); scroll-margin-top: 12px;
}
.card h2 { margin: 0 0 14px; font-size: 1.6rem; }
.sub { margin: -6px 0 16px; color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.tabs, .seg { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; background: var(--btn); border-radius: 999px; width: fit-content; max-width: 100%; }
.tabs { margin-bottom: 18px; }
.tab, .seg-btn { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; font-weight: 700; color: var(--muted); }
.tab.active, .seg-btn.active { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.seg-btn { padding: 6px 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.btn {
  border: 2px solid var(--line); background: var(--btn); padding: 9px 16px; border-radius: 12px; font-weight: 700;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.45; cursor: default; }
.game-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; outline: none; }
.side { flex: 1 1 220px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.status { font-size: 1.2rem; font-weight: 800; }
.status.win { color: var(--accent); }
.hint { margin: 0; color: var(--muted); font-size: 0.92rem; }
.label { color: var(--muted); font-weight: 700; }

/* Memory */
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 440px; margin-bottom: 14px; }
.mcard {
  aspect-ratio: 1; border-radius: 16px; border: 2px solid var(--line); font-size: clamp(28px, 9vw, 46px);
  display: flex; align-items: center; justify-content: center; user-select: none; padding: 0;
  background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #fff; transition: transform 0.25s;
}
.mcard.open { background: var(--card); transform: rotateY(180deg); }
.mcard.open span { transform: rotateY(180deg); }
.mcard.done { opacity: 0.55; }

/* News */
.news { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.story {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text);
  border: 2px solid var(--line); border-radius: 16px; padding: 16px; background: var(--card); transition: transform 0.15s, border-color 0.15s;
}
.story:hover { transform: translateY(-2px); border-color: var(--accent2); }
.tag { align-self: flex-start; font-size: 0.75rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; color: #fff; }
.tag.Space { background: var(--accent2); } .tag.Sport { background: #f08c00; } .tag.Animals { background: #12a886; } .tag.Fun { background: var(--accent); }
.story h3 { margin: 2px 0 0; font-size: 1.08rem; line-height: 1.3; }
.story p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.meta { margin-top: auto; font-size: 0.82rem; font-weight: 700; color: var(--accent2); }
.foot { text-align: center; color: var(--muted); padding: 10px 16px 40px; }
@media (max-width: 520px) { .card { padding: 16px; } .tab { padding: 8px 12px; } }

/* Find the differences */
.spot-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.spot-level { font-size: 1.15rem; font-weight: 800; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { background: var(--btn); border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 0.95rem; }
.spot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 680px) { .spot-grid { grid-template-columns: 1fr; } }
.spot-frame { border-radius: 16px; overflow: hidden; border: 3px solid var(--line); box-shadow: var(--shadow); line-height: 0; }
.spot-pic { width: 100%; height: auto; display: block; cursor: crosshair; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.spot-msg { min-height: 1.6em; margin: 10px 0 4px; }
.spot-msg.oops { color: #e63946; }
.found-ring { fill: none; stroke: #ff006e; stroke-width: 4; animation: ring-in 0.35s ease-out; }
.hint-ring { fill: rgba(255, 210, 63, 0.25); stroke: #ffd23f; stroke-width: 4; stroke-dasharray: 8 6; animation: pulse 0.8s ease-in-out infinite alternate; }
.miss-x { stroke: #e63946; stroke-width: 5; stroke-linecap: round; animation: fade 0.8s ease-in forwards; }
@keyframes ring-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { from { opacity: 0.4; } to { opacity: 1; } }
@keyframes fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

/* Millionaire */
.quiz-screen { text-align: center; max-width: 620px; margin: 0 auto; padding: 10px 0; }
.quiz-screen p { color: var(--muted); }
.quiz-screen .btn-row { justify-content: center; }
.quiz-big { font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 900; margin-bottom: 6px; }
.btn.big { padding: 13px 26px; font-size: 1.1rem; }
.quiz-main { flex: 3 1 340px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.quiz-for { color: var(--accent2); font-weight: 800; }
.quiz-q {
  font-size: 1.3rem; font-weight: 800; padding: 18px 20px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #3c1a78, #1d3b8b); border: 3px solid #ffd23f; text-align: center;
}
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .answers { grid-template-columns: 1fr; } }
.ans {
  text-align: left; padding: 13px 16px; border-radius: 14px; border: 3px solid #5b4bb7; background: #241a57; color: #fff;
  font-weight: 700; font-size: 1.05rem; min-height: 54px; transition: background 0.15s;
}
.ans b { color: #ffd23f; margin-right: 8px; }
.ans:hover:not(:disabled) { background: #33287a; }
.ans.gone { visibility: hidden; }
.ans.picked { background: #f4a300; border-color: #ffd23f; color: #1a1a1a; }
.ans.picked b, .ans.right b, .ans.wrong b { color: inherit; }
.ans.right { background: #2bb673; border-color: #7ef0b5; color: #fff; }
.ans.wrong { background: #e63946; border-color: #ff9aa2; color: #fff; }
.ans:disabled { cursor: default; }
.lifelines { display: flex; flex-wrap: wrap; gap: 8px; }
.life { flex: 1 1 90px; min-height: 46px; border-radius: 999px; border: 2px solid var(--accent2); background: var(--btn); font-weight: 800; }
.life:disabled { opacity: 0.35; text-decoration: line-through; cursor: default; }
.quiz-help { border: 2px dashed var(--line); border-radius: 14px; padding: 14px; }
.aud { display: flex; gap: 14px; align-items: flex-end; height: 140px; padding-top: 8px; }
.aud-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-weight: 800; }
.aud-bar { width: 70%; max-width: 48px; background: linear-gradient(180deg, var(--accent), var(--accent2)); border-radius: 8px 8px 0 0; min-height: 2px; }
.ladder { flex: 1 1 200px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-variant-numeric: tabular-nums; }
.ladder li { display: flex; justify-content: space-between; padding: 4px 12px; border-radius: 8px; color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.ladder li.safe { color: var(--text); font-weight: 900; }
.ladder li.done { color: var(--accent3); }
.ladder li.now { background: #f4a300; color: #1a1a1a; }
@media (max-width: 700px) { .ladder { display: grid; grid-template-columns: repeat(3, 1fr); } .ladder li { padding: 3px 6px; font-size: 0.8rem; } }

/* Facts */
.fact {
  background: linear-gradient(135deg, var(--bg2), var(--card)); border: 2px dashed var(--accent2);
  border-radius: 18px; padding: 20px; cursor: pointer; min-height: 130px;
}
.fact-cat { font-size: 0.8rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--accent2); }
.fact-q { font-size: 1.35rem; font-weight: 800; margin: 8px 0; }
.fact-a { color: var(--muted); font-size: 1.05rem; }
.fact-a.shown { color: var(--text); animation: factpop 0.3s ease; }
@keyframes factpop { 0% { transform: scale(0.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
