/* ════════════ TOKENS ════════════ */
:root {
  --bg: #070b16;
  --bg2: #0b1122;
  --surface: #111a2e;
  --surface2: #182444;
  --line: #ffffff12;
  --line2: #ffffff22;

  --red: #ff4655;
  --red-dk: #d92f3e;
  --gold: #ffc531;
  --gold2: #ff9f0a;
  --green: #22e07a;
  --blue: #4fc3f7;
  --purple: #b388ff;

  --text: #eaf0ff;
  --muted: #8595b6;

  --r: 16px;
  --r-sm: 12px;
  --maxw: 480px;
  --hdr: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100svh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  line-height: 1.45;
}

/* ambient glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 45% at 12% -5%,
      rgba(255, 70, 85, 0.13),
      transparent 62%
    ),
    radial-gradient(
      ellipse 70% 45% at 92% 100%,
      rgba(79, 195, 247, 0.1),
      transparent 62%
    ),
    radial-gradient(
      ellipse 60% 35% at 50% 50%,
      rgba(179, 136, 255, 0.05),
      transparent 70%
    );
  pointer-events: none;
  z-index: 0;
}

button,
input {
  font-family: inherit;
  touch-action: manipulation;
}
button {
  cursor: pointer;
}

::selection {
  background: var(--red);
  color: #fff;
}

.fred {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
}

/* screens */
.screen {
  display: none;
  animation: fadeUp 0.35s ease both;
}
.screen.on {
  display: block;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ════════════ START / LANDING ════════════ */
#startScreen {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px calc(24px + var(--safe-b));
}
/* no top ad filled -> the landing itself must clear the phone notch */
.ad-slot.ad-top:has(ins.adsbygoogle[data-ad-status="unfilled"]) + #startScreen {
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}
/* hero sits under the top ad; text content scrolls below it */
.start-hero {
  position: relative;
  z-index: 1;
  padding: 18px 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* floating blocks */
.blocks {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.blocks i {
  position: absolute;
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 2px solid;
  opacity: 0.16;
  animation: float 9s ease-in-out infinite;
}
.blocks i:nth-child(1) {
  left: 8%;
  top: 12%;
  border-color: var(--red);
  animation-delay: 0s;
}
.blocks i:nth-child(2) {
  right: 10%;
  top: 20%;
  width: 32px;
  height: 32px;
  border-color: var(--blue);
  animation-delay: 1.4s;
}
.blocks i:nth-child(3) {
  left: 14%;
  bottom: 18%;
  width: 38px;
  height: 38px;
  border-color: var(--gold);
  animation-delay: 2.6s;
}
.blocks i:nth-child(4) {
  right: 16%;
  bottom: 12%;
  width: 54px;
  height: 54px;
  border-color: var(--purple);
  animation-delay: 0.8s;
}
.blocks i:nth-child(5) {
  left: 46%;
  top: 5%;
  width: 26px;
  height: 26px;
  border-color: var(--green);
  animation-delay: 3.4s;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-22px) rotate(14deg);
  }
}

.start-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 70, 85, 0.13);
  border: 1px solid rgba(255, 70, 85, 0.5);
  color: #ff8b95;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.brand {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(2.9rem, 15vw, 3.9rem);
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 6px;
}
.brand span {
  color: var(--red);
  text-shadow: 0 0 30px rgba(255, 70, 85, 0.55);
}
.brand-sub {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.start-tag {
  font-size: 0.95rem;
  color: #b9c6e4;
  max-width: 300px;
  margin: 0 auto 22px;
}

/* stat chips */
.start-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 330px;
  margin-bottom: 22px;
}
.sstat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 4px;
}
.sstat b {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--gold);
}
.sstat span {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* name input */
.name-wrap {
  width: 100%;
  max-width: 330px;
  margin-bottom: 14px;
  text-align: left;
}
.name-wrap label {
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  padding-left: 4px;
}
.name-wrap input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 15px;
  outline: none;
  transition: border-color 0.15s;
}
.name-wrap input:focus {
  border-color: var(--red);
}
.name-wrap input::placeholder {
  color: #55648a;
}

.play-btn {
  width: 100%;
  max-width: 330px;
  background: linear-gradient(135deg, var(--red), var(--red-dk));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 17px 20px;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  box-shadow:
    0 10px 30px rgba(255, 70, 85, 0.38),
    inset 0 1px 0 #ffffff33;
  transition:
    transform 0.14s,
    box-shadow 0.14s;
  animation: pulse 2.6s ease-in-out infinite;
}
.play-btn:active {
  transform: scale(0.97);
}
@keyframes pulse {
  0%,
  100% {
    box-shadow:
      0 10px 30px rgba(255, 70, 85, 0.35),
      inset 0 1px 0 #ffffff33;
  }
  50% {
    box-shadow:
      0 14px 44px rgba(255, 70, 85, 0.6),
      inset 0 1px 0 #ffffff33;
  }
}

.ghost-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 14px 10px;
}
.ghost-link:active {
  color: #fff;
}

.returning {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(255, 197, 49, 0.08);
  border: 1px solid rgba(255, 197, 49, 0.35);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 16px;
}
.returning.on {
  display: inline-flex;
}

/* ── 2-question warm-up on the landing page ── */
.intro {
  width: 100%;
  max-width: 330px;
  background: linear-gradient(145deg, #16203a, #111a2e);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 14px;
  margin: 4px 0 6px;
  text-align: left;
  animation: fadeUp 0.35s ease both;
}
.intro-head {
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--gold);
  text-align: center;
  margin-bottom: 12px;
}
.intro-step {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.intro-coins {
  color: var(--gold);
  letter-spacing: 0;
  font-size: 0.78rem;
}
.intro-q {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 12px;
}
.intro-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.intro-opt {
  min-height: 52px;
  padding: 10px 8px;
  background: var(--surface);
  border: 2px solid var(--line2);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.1s;
}
.intro-opt:active:not(:disabled) {
  transform: scale(0.97);
}
.intro-opt:disabled {
  cursor: default;
  color: var(--text);
}
.intro-opt.correct {
  border-color: var(--green);
  background: rgba(34, 224, 122, 0.14);
}
.intro-opt.wrong {
  border-color: var(--red);
  background: rgba(255, 70, 85, 0.14);
}
.intro-opt.dim {
  opacity: 0.45;
}
@media (hover: hover) and (pointer: fine) {
  .intro-opt:hover:not(:disabled) {
    border-color: var(--red);
    background: rgba(255, 70, 85, 0.07);
  }
}
.after-intro {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeUp 0.35s ease both;
}
.intro-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 224, 122, 0.1);
  border: 1px solid rgba(34, 224, 122, 0.4);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--green);
  margin: 6px 0 16px;
}
.intro-done b {
  color: var(--gold);
}

.disclaimer {
  font-size: 0.66rem;
  color: #566486;
  line-height: 1.6;
  max-width: 320px;
  margin-top: 22px;
}

/* ════════════ DISPLAY AD SLOTS ════════════ */
.ad-slot {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  text-align: center;
}
/* top banner: first thing on every page, above the header */
.ad-slot.ad-top {
  min-height: 90px; /* reserve space so the page doesn't jump when it fills */
  margin: 0;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 0 8px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--line);
}
.ad-slot.ad-mid {
  margin: 16px 0 4px;
}
/* the landing hero centres its children; the ad needs the full width */
.start-hero .ad-slot {
  width: 100%;
}
.ad-lbl {
  display: block;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4f5d7d;
  margin-bottom: 4px;
}
/* Google found no ad for this slot -> collapse the whole box */
.ad-slot:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  display: none;
}

/* ════════════ APP SHELL ════════════ */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 11, 22, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.hdr-in {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--hdr);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.logo {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.45rem;
  color: #fff;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  text-decoration: none;
}
.logo span {
  color: var(--red);
}
.hdr-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.who {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coin-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(
    135deg,
    rgba(255, 197, 49, 0.18),
    rgba(255, 159, 10, 0.1)
  );
  border: 1px solid rgba(255, 197, 49, 0.55);
  border-radius: 999px;
  padding: 6px 13px;
  font-weight: 900;
  font-size: 0.92rem;
  color: var(--gold);
  transition: transform 0.2s;
}
.coin-pill.bump {
  transform: scale(1.18);
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 14px calc(30px + var(--safe-b));
  position: relative;
  z-index: 1;
}

/* ════════════ HOME ════════════ */
.hero {
  text-align: center;
  padding: 6px 0 16px;
}
.hero h1 {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 7.5vw, 2rem);
  line-height: 1.15;
  margin-bottom: 8px;
}
.hero h1 span {
  color: var(--red);
}
.hero p {
  font-size: 0.86rem;
  color: var(--muted);
  max-width: 320px;
  margin: 0 auto;
}

/* balance card */
.bal {
  background: linear-gradient(140deg, #1b2440, #131c33);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.bal::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -60px;
  top: -70px;
  background: radial-gradient(
    circle,
    rgba(255, 197, 49, 0.18),
    transparent 70%
  );
}
.bal-num {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bal-lbl {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 5px;
}
.daily-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #201400;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 900;
  font-size: 0.85rem;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 6px 18px rgba(255, 159, 10, 0.3);
  flex-shrink: 0;
  z-index: 1;
  transition: transform 0.14s;
}
.daily-btn small {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  opacity: 0.75;
}
.daily-btn:active {
  transform: scale(0.96);
}
.daily-btn:disabled {
  background: var(--surface2);
  color: var(--muted);
  box-shadow: none;
  cursor: default;
}

.sec-lbl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 2px 10px;
}
.sec-lbl em {
  font-style: normal;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  background: var(--surface2);
  border-radius: 999px;
  padding: 3px 8px;
  color: #6d7da0;
}

/* category cards */
.quiz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qcat {
  position: relative;
  border-radius: var(--r);
  border: 1px solid var(--line2);
  padding: 15px 11px 13px;
  text-align: center;
  overflow: hidden;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition:
    transform 0.16s,
    box-shadow 0.16s;
}
.qcat:active {
  transform: scale(0.975);
}
.qcat .emoji {
  font-size: 1.9rem;
  line-height: 1;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
}
.qcat h3 {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.2px;
}
.qcat .meta {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}
.qcat .cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--gold);
  margin-top: 3px;
}
.qcat .cost.free {
  color: var(--green);
  background: rgba(34, 224, 122, 0.12);
}
.qcat .best {
  font-size: 0.63rem;
  font-weight: 800;
  color: var(--green);
  margin-top: 2px;
  min-height: 14px;
}
.qcat.locked {
  opacity: 0.62;
}
.qcat.locked::after {
  content: "🔒";
  position: absolute;
  top: 8px;
  right: 9px;
  font-size: 0.8rem;
}
.qc-1 {
  background: linear-gradient(150deg, #1d1533, #2f1d52);
}
.qc-2 {
  background: linear-gradient(150deg, #0d2030, #0e3454);
}
.qc-3 {
  background: linear-gradient(150deg, #152a10, #24461a);
}
.qc-4 {
  background: linear-gradient(150deg, #2c1a02, #4b3005);
}
.qc-1 h3 {
  color: var(--purple);
}
.qc-2 h3 {
  color: var(--blue);
}
.qc-3 h3 {
  color: var(--green);
}
.qc-4 h3 {
  color: var(--gold);
}

/* leaderboard */
.lboard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px 14px;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.lb-row:last-child {
  border: none;
}
.lb-rank {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  width: 22px;
  text-align: center;
  color: var(--muted);
}
.lb-name {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-score {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--gold);
}
.lb-row.me {
  background: rgba(255, 70, 85, 0.08);
  margin: 0 -14px;
  padding-left: 14px;
  padding-right: 14px;
  border-left: 3px solid var(--red);
}
.lb-row.me .lb-name {
  color: var(--red);
}

/* ════════════ TEXT CONTENT (start page) ════════════ */
.content {
  margin-top: 8px;
}
.content h2 {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 24px 0 8px;
  text-wrap: balance;
}
.content h2:first-child {
  margin-top: 0;
}
.content h2 span {
  color: var(--red);
}
.content p,
.content li {
  font-size: 0.87rem;
  color: #b9c6e4;
  line-height: 1.7;
}
.content p {
  margin-bottom: 10px;
}
.content ul {
  padding-left: 18px;
  margin: 2px 0 12px;
}
.content li {
  margin-bottom: 5px;
}
.content b {
  color: var(--text);
}
.cat-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}
.cat-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--purple);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin: 0;
}
.cat-list li:nth-child(2) {
  border-left-color: var(--blue);
}
.cat-list li:nth-child(3) {
  border-left-color: var(--green);
}
.cat-list li:nth-child(4) {
  border-left-color: var(--gold);
}
.cat-list b {
  display: block;
  margin-bottom: 2px;
}
.faq {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  margin-bottom: 8px;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq[open] summary::after {
  transform: rotate(45deg);
}
.faq p {
  padding: 0 14px 12px;
  margin: 0;
}

/* ════════════ QUIZ ════════════ */
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.icon-btn {
  background: var(--surface);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 1rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.icon-btn:active {
  background: var(--surface2);
}
.q-cat-label {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timer {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 10px;
  height: 40px;
  padding: 0 12px;
  font-weight: 900;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.timer.danger {
  color: var(--red);
  border-color: var(--red);
  animation: shake 0.5s ease-in-out infinite;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

.segs {
  display: flex;
  gap: 3px;
  margin-bottom: 8px;
}
.segs i {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--surface2);
  transition: background 0.3s;
}
.segs i.ok {
  background: var(--green);
}
.segs i.no {
  background: var(--red);
}
.segs i.now {
  background: #fff;
}

.tbar {
  height: 3px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.tbar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--red));
  border-radius: 999px;
}

.q-card {
  background: linear-gradient(145deg, #16203a, #111a2e);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 18px 16px;
  margin-bottom: 14px;
}
.q-num {
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--red);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.q-text {
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.45;
}

.opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.opt-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 52px;
  background: var(--surface);
  border: 2px solid var(--line2);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 0.93rem;
  font-weight: 700;
  text-align: left;
  color: var(--text);
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.1s;
}
.opt-btn:active:not(:disabled) {
  transform: scale(0.985);
}
.opt-btn .ol {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface2);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 900;
  flex-shrink: 0;
  border: 1px solid var(--line2);
  transition: all 0.15s;
}
.opt-btn .mark {
  margin-left: auto;
  font-size: 1rem;
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.opt-btn.correct {
  border-color: var(--green);
  background: rgba(34, 224, 122, 0.12);
}
.opt-btn.correct .ol {
  background: var(--green);
  color: #04210f;
  border-color: var(--green);
}
.opt-btn.wrong {
  border-color: var(--red);
  background: rgba(255, 70, 85, 0.12);
}
.opt-btn.wrong .ol {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.opt-btn.correct .mark,
.opt-btn.wrong .mark {
  opacity: 1;
  transform: scale(1);
}
.opt-btn.dim {
  opacity: 0.45;
}
.opt-btn:disabled {
  cursor: default;
}

.next-wrap {
  margin-top: 14px;
  min-height: 52px;
}
.next-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--red), var(--red-dk));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  box-shadow: 0 8px 22px rgba(255, 70, 85, 0.32);
  display: none;
  animation: fadeUp 0.25s ease both;
}
.next-btn.on {
  display: block;
}
.next-btn:active {
  transform: scale(0.98);
}

/* +coin float */
.plusfly {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  font-family: "Fredoka", sans-serif;
  font-size: 1.6rem;
  color: var(--gold);
  font-weight: 600;
  pointer-events: none;
  z-index: 400;
  animation: fly 1s ease-out forwards;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
@keyframes fly {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.7);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -10px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70px) scale(1);
  }
}

/* ════════════ RESULT ════════════ */
.result-card {
  background: linear-gradient(145deg, #16203a, #111a2e);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 24px 18px;
  text-align: center;
}
.ring-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 12px;
}
.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring circle {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}
.ring .bg {
  stroke: var(--surface2);
}
.ring .fg {
  stroke: var(--green);
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 1s cubic-bezier(0.25, 1, 0.5, 1);
}
.ring-in {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
}
.ring-in b {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 2rem;
  line-height: 1;
}
.ring-in span {
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}
.res-emoji {
  font-size: 2.4rem;
}
.res-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.6rem;
  margin: 2px 0;
}
.res-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.res-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.rstat {
  background: var(--surface2);
  border-radius: 12px;
  padding: 11px 6px;
}
.rstat b {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
}
.rstat span {
  font-size: 0.6rem;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.res-coins {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 197, 49, 0.1);
  border: 1px solid rgba(255, 197, 49, 0.4);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--gold);
}
.newbest {
  display: none;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--green);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.newbest.on {
  display: block;
}
.res-btns {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.rbtn {
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-weight: 900;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--red), var(--red-dk));
  color: #fff;
  box-shadow: 0 8px 22px rgba(255, 70, 85, 0.28);
}
a.rbtn {
  display: block;
  text-align: center;
  text-decoration: none;
}
/* 🎬 opt-in reward buttons */
.rbtn.gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #201400;
  box-shadow: 0 8px 22px rgba(255, 159, 10, 0.3);
}
.double-btn {
  width: 100%;
  margin-bottom: 8px;
}
[hidden] {
  display: none !important;
}
.rbtn:active {
  transform: scale(0.98);
}
.rbtn.ghost {
  background: none;
  border: 1px solid var(--line2);
  color: var(--muted);
  box-shadow: none;
}
.res-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* review list */
.review {
  margin-top: 14px;
  text-align: left;
}
.review > summary {
  list-style: none;
  cursor: pointer;
  background: var(--surface2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.review > summary::-webkit-details-marker {
  display: none;
}
.review[open] > summary {
  border-radius: 12px 12px 0 0;
}
.rev-list {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 0 0 12px 12px;
  padding: 6px 14px 10px;
}
.rev-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}
.rev-item:last-child {
  border: none;
}
.rev-q {
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.4;
}
.rev-a {
  color: var(--green);
  font-weight: 800;
}
.rev-a.bad {
  color: var(--red);
}
.rev-a small {
  color: var(--muted);
  font-weight: 700;
}

/* ════════════ MODAL ════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(3, 6, 14, 0.7);
  backdrop-filter: blur(4px);
  padding: 14px;
  padding-bottom: calc(14px + var(--safe-b));
}
.modal.on {
  display: flex;
  animation: fadeUp 0.2s ease both;
}
.sheet {
  width: 100%;
  max-width: var(--maxw);
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 22px 18px 18px;
  animation: slideUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes slideUp {
  from {
    transform: translateY(40px);
  }
  to {
    transform: none;
  }
}
.sheet h3 {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 8px;
}
.sheet p,
.sheet li {
  font-size: 0.88rem;
  color: #b9c6e4;
  line-height: 1.65;
}
.sheet ul {
  padding-left: 18px;
  margin: 8px 0;
}
.sheet li {
  margin-bottom: 5px;
}
.sheet-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

/* ════════════ TOAST / RAIN ════════════ */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px);
  background: #1d2b4a;
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.25s;
  z-index: 300;
  pointer-events: none;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

#rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 350;
  overflow: hidden;
}
.rc {
  position: absolute;
  top: -40px;
  animation: rf linear forwards;
}
@keyframes rf {
  from {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: translateY(105svh) rotate(540deg);
    opacity: 0.7;
  }
}

/* ════════════ FOOTER ════════════ */
footer {
  text-align: center;
  font-size: 0.66rem;
  color: #4f5d7d;
  line-height: 1.7;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.foot-links {
  margin-top: 8px;
  font-size: 0.76rem;
}
.foot-links a {
  display: inline-block;
  padding: 6px 4px;
  color: #8c9bc0;
  font-weight: 700;
  text-decoration: none;
}
.foot-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ════════════ PRIVACY / TERMS (no ads on these pages) ════════════ */
.hdr-link {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 7px 14px;
}
.legal h1 {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 6px 0 4px;
}
.legal h1 span {
  color: var(--red);
}
.legal .legal-date {
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.legal h2 {
  font-size: 1.08rem;
  margin-top: 22px;
}
.content a {
  color: var(--blue);
  overflow-wrap: anywhere;
}

/* ════════════ DESKTOP POLISH ════════════ */
@media (hover: hover) and (pointer: fine) {
  .qcat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  }
  .opt-btn:hover:not(:disabled) {
    border-color: var(--red);
    background: rgba(255, 70, 85, 0.07);
  }
  .play-btn:hover,
  .rbtn:hover,
  .next-btn:hover {
    transform: translateY(-2px);
  }
  .daily-btn:hover:not(:disabled) {
    transform: translateY(-2px);
  }
}
@media (min-width: 560px) {
  body {
    background: radial-gradient(
      ellipse at top,
      #0d1426 0%,
      var(--bg) 60%
    );
  }
}
@media (max-width: 340px) {
  .qcat h3 {
    font-size: 0.88rem;
  }
  .opt-btn {
    font-size: 0.86rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
