/* ============================================= Brain Games, account & legal */

/* ---- subject colors */
.subject-tab.active.games { background: #ef476f; color: #fff; box-shadow: 0 5px 0 #c42a52; }
.games .island-emoji { background: #ffe3ea; }
.subject-card.games { border-top-color: #ef476f; }
.games .chip { background: #ffe3ea; }
.footer-grid { grid-template-columns: 2fr 1fr 1fr 1.4fr; }
.site-footer a { overflow-wrap: anywhere; }

/* ---- shared game chrome */
.game { background: #fff; border-radius: 26px; padding: 22px; box-shadow: var(--shadow-lg); }
.center-game { text-align: center; }
.game-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; text-align: left; }
.game-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: 18px; }
.big-icon { font-size: 4.5rem; line-height: 1; }

/* ---- Petal Puzzles */
.flower { position: relative; width: min(360px, 86vw); aspect-ratio: 1; margin: 10px auto; }
.petal-center {
  position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%);
  display: grid; place-items: center; border-radius: 50%; background: #ffd166; box-shadow: inset 0 -6px 0 #f4a261;
  font-family: var(--font-head); font-weight: 800; font-size: 2.6rem; color: #8a4b00;
}
.petal {
  position: absolute; left: 50%; top: 50%; width: 27%; aspect-ratio: 1; margin: -13.5% 0 0 -13.5%;
  transform: rotate(var(--a)) translateY(-118%) rotate(calc(-1 * var(--a)));
  border: 0; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; cursor: pointer;
  background: #ffe3ea; box-shadow: 0 5px 0 #f5b5c4; color: var(--ink);
  font-family: var(--font-head); font-weight: 800; font-size: clamp(1.4rem, 5vw, 2rem);
  transition: background .15s, box-shadow .15s;
}
.petal:hover { background: #ffd0dc; }
.petal.hinted { background: #fff3c4; box-shadow: 0 5px 0 #f2c94c, 0 0 0 4px #ffd166; }
.petal.wrong { background: #ececec; box-shadow: 0 5px 0 #ccc; color: #999; }
.petal.right { background: var(--green); color: #fff; box-shadow: 0 5px 0 #2a8c57, 0 0 0 6px #bfeccc; }
.flower.final .petal { background: #e7f0ff; box-shadow: 0 5px 0 #b9cdf5; }
.flower.final .petal-center { background: #7c5cff; color: #fff; box-shadow: inset 0 -6px 0 #5b3cc4; }
.collected { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-bottom: 6px; }
.collected span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: #f0edf8; font-family: var(--font-head); font-weight: 800; color: #b3abcf; }
.collected span.got { background: #ffd166; color: #8a4b00; }
.collected small { flex-basis: 100%; color: var(--muted); font-weight: 700; }

/* ---- Speed Sums */
.speed-bar { height: 14px; background: var(--purple-soft); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.speed-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ef476f, #ffd166); transition: width .2s linear; }
.speed-q { font-family: var(--font-head); font-weight: 800; font-size: clamp(2.6rem, 9vw, 4.2rem); margin: 6px 0 18px; }
.speed-choices { max-width: 520px; margin: 0 auto; }

/* ---- Hit the Target */
.target { display: inline-block; font-family: var(--font-head); font-size: 2.4rem; background: #fff1d6; border-radius: 999px; padding: .1em .9em; margin-bottom: 14px; }
.target b { font-size: 3.2rem; color: #ef476f; }
.target.hit { animation: bump .5s; background: #effbf2; }
.expr { min-height: 64px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 800; font-size: 2rem; background: #faf8ff; border: 3px dashed var(--line); border-radius: 18px; padding: 8px 14px; margin-bottom: 16px; }
.expr .op { color: #ef476f; }
.expr .muted { font-size: 1rem; font-family: var(--font-body); }
.expr-eq { color: var(--purple-2); margin-left: 8px; }
.tiles, .ops { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 12px; }
.tiles .tile, .ops .op {
  min-width: 74px; height: 74px; border: 0; border-radius: 20px; cursor: pointer;
  font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: var(--ink);
}
.tile { background: #fff3c4; box-shadow: 0 5px 0 #f2c94c; }
.tile:disabled { opacity: .3; cursor: default; }
.ops .op { min-width: 64px; height: 60px; background: var(--purple-soft); box-shadow: 0 5px 0 #d8cdfb; color: var(--purple); }
.tile:active:not(:disabled), .ops .op:active { transform: translateY(3px); box-shadow: none; }

/* ---- Mini Sudoku */
.sudoku { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(420px, 88vw); aspect-ratio: 1; margin: 0 auto 16px; border: 4px solid var(--ink); border-radius: 14px; overflow: hidden; background: var(--ink); gap: 2px; }
.cell { border: 0; background: #fff; font-family: var(--font-head); font-weight: 800; font-size: clamp(1.3rem, 6vw, 2.2rem); cursor: pointer; color: var(--purple-2); padding: 0; }
.cell.given { background: #f4f1fb; color: var(--ink); cursor: default; }
.cell.sel { background: #fff3c4; box-shadow: inset 0 0 0 3px #ffb020; }
.cell.bad { background: #ffe1e1; color: var(--coral); }
.cell.edge-r { margin-right: 3px; }
.cell.edge-b { margin-bottom: 3px; }
.sudoku.solved { border-color: var(--green); box-shadow: 0 0 0 6px #bfeccc; }
.sudoku.solved .cell { background: #effbf2; }
.sudoku-pad { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sudoku-pad .key { width: 64px; }

/* ---- Copy Cat */
.copy-pads { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 14px; width: min(420px, 86vw); margin: 0 auto 10px; }
.copy-pad {
  aspect-ratio: 1; border: 0; border-radius: 28px; cursor: pointer; font-size: clamp(2.4rem, 10vw, 3.6rem);
  background: var(--c); box-shadow: 0 6px 0 rgba(0, 0, 0, .18); filter: saturate(.45) brightness(1.15);
  transition: filter .12s, transform .12s, box-shadow .12s;
}
.copy-pad.lit { filter: none; transform: scale(1.06); box-shadow: 0 0 0 6px #fff, 0 0 28px var(--c); }
.copy-pads.watching .copy-pad { cursor: default; }

/* ---- Bubble Pop */
.rule-banner { display: inline-block; background: #fff1d6; border-radius: 999px; padding: .3em 1em; margin-bottom: 14px; font-family: var(--font-head); font-weight: 800; font-size: clamp(1.15rem, 4vw, 1.5rem); }
.bubble-field { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 14px; min-height: 260px; padding: 18px 10px; border-radius: 22px; background: linear-gradient(180deg, #e3f4ff, #f3eeff); }
.pop-bubble {
  width: 84px; height: 84px; border-radius: 50%; border: 3px solid #9fd3ff; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 30% 28%, #fff 0 12%, rgba(190, 228, 255, .7) 35%, rgba(124, 92, 255, .22));
  font-family: var(--font-head); font-weight: 800; font-size: 1.6rem; color: var(--ink);
  animation: bubble-bob 3s ease-in-out infinite; animation-delay: var(--d);
}
.pop-bubble.long { font-size: 1.05rem; }
.pop-bubble.wrong { border-color: var(--coral); background: #ffe1e1; }
.pop-bubble.popped { animation: bubble-pop .35s forwards; pointer-events: none; }
@keyframes bubble-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes bubble-pop { to { transform: scale(1.6); opacity: 0; } }

/* ---- Word Builder */
.wb-picture { font-size: clamp(4rem, 16vw, 5.5rem); line-height: 1.1; }
.wb-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 18px; }
.wb-slot { width: 54px; height: 64px; display: grid; place-items: center; border: 3px dashed var(--line); border-radius: 14px; background: #faf8ff; font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: var(--purple-2); }
.wb-slot.filled { border-style: solid; border-color: var(--purple-2); background: #fff; }
.wb-slot .guide { color: #d8d2ea; }
.wb-slots.solved .wb-slot { border-color: var(--green); color: var(--green); animation: bump .5s; }
.tile.hinted { box-shadow: 0 5px 0 #f2c94c, 0 0 0 5px #7c5cff; }

/* ---- Number Line Hop */
.nl-wrap { background: #faf8ff; border-radius: 20px; padding: 6px 4px; margin-bottom: 8px; }
.nl-svg { display: block; width: 100%; height: auto; cursor: pointer; touch-action: manipulation; }
.nl-feedback { min-height: 1.6em; font-weight: 700; }

/* ---- Number Pairs */
.pairs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; max-width: 520px; margin: 0 auto; }
.pair-card { height: 74px; border: 0; border-radius: 18px; cursor: pointer; background: #e7f0ff; box-shadow: 0 5px 0 #b9cdf5; font-family: var(--font-head); font-weight: 800; font-size: 1.8rem; color: var(--ink); }
.pair-card.sel { background: #fff3c4; box-shadow: 0 5px 0 #f2c94c, 0 0 0 4px #ffd166; }
.pair-card.done { background: #effbf2; box-shadow: none; color: #9fd8b4; cursor: default; }

/* ---- auth, account & legal */
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: .9rem; line-height: 1.4; }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--purple); }
.forgot-link { text-align: right; margin: -6px 0 10px; font-weight: 700; font-size: .92rem; }
.notice { border-radius: 16px; padding: 14px 16px; font-weight: 600; margin-bottom: 18px; }
.notice.good { background: #effbf2; color: #1f6b3e; }
.notice.warn { background: #fff8e1; color: #6b4e00; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 800; color: var(--purple); text-decoration: underline; cursor: pointer; }
.verify-line { margin: -4px 0 12px; font-weight: 700; }
.danger-zone { border: 3px solid #ffd0d0; }
.danger-zone h2 { color: #c62828; }
.legal article { max-width: 820px; margin: 0 auto; padding: 34px clamp(20px, 5vw, 48px); }
.legal h2 { margin-top: 1.6em; font-size: 1.5rem; }
.legal h3 { margin-top: 1.2em; font-size: 1.15rem; }
.legal li { margin-bottom: 6px; }
.legal-foot { margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--line); font-weight: 700; }

/* ---- ads (grown-up pages, Free plan only) */
.ad-box { margin: 26px 0; padding: 10px 14px 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.ad-label { display: flex; justify-content: space-between; gap: 10px; font-size: .72rem; font-weight: 700; color: #9a95b3; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.ad-label a { color: var(--purple); text-transform: none; letter-spacing: 0; font-size: .8rem; }
.ad-box ins.adsbygoogle { min-height: 90px; }
.house-ad { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); background: linear-gradient(135deg, #fff8e1, #f3eeff); border-radius: 14px; padding: 14px 16px; }
.house-ad b { display: block; font-family: var(--font-head); font-size: 1.15rem; }
.house-ad small { color: var(--muted); font-weight: 600; }
.house-ad > span:nth-child(2) { flex: 1; }
.house-emoji { font-size: 2.2rem; }
.muted-li { color: var(--muted); }
.plan li.muted-li::before { content: 'ⓘ'; color: var(--muted); }

@media (max-width: 720px) {
  .house-ad { flex-wrap: wrap; }
  .footer-grid { grid-template-columns: 1fr; }
  .tiles .tile, .ops .op { min-width: 60px; height: 60px; font-size: 1.6rem; }
  .game { padding: 16px 12px; }
  .sudoku-pad .key { width: 52px; height: 52px; }
  .pop-bubble { width: 70px; height: 70px; font-size: 1.35rem; }
  .bubble-field { gap: 10px; }
  .wb-slot { width: 40px; height: 50px; font-size: 1.5rem; }
}
