@font-face { font-family: "Fredoka"; font-weight: 300 700; font-display: swap;
  src: url("/assets/products/_shared/fonts/Fredoka.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap;
  src: url("/assets/products/_shared/fonts/Poppins-Regular.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap;
  src: url("/assets/products/_shared/fonts/Poppins-Medium.ttf") format("truetype"); }

:root {
  --bg: #F6F2EA; --card: #FFFDF8; --ink: #434A57; --muted: #7D838E; --line: #E5DED1;
  --sage: #9DBBA6; --sage-d: #5F8A6E; --sage-l: #E6EFE8; --sky: #A9C3D8; --sky-d: #5F7F9C; --sky-l: #E8F0F6;
  --clay: #DDA07E; --clay-d: #B06F52; --clay-l: #F7E7DC; --sand: #EADBB8; --sand-l: #F6EFDF;
  --good: #5F8A6E; --bad: #C0705B; --radius: 18px;
  --shadow: 0 1px 0 rgba(67, 74, 87, .06), 0 8px 24px rgba(67, 74, 87, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 17px/1.5 "Poppins", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
h1, h2, h3, .title { font-family: "Fredoka", "Poppins", sans-serif; font-weight: 600; letter-spacing: .005em; margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 40px; }
.hidden { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px;
  border-radius: 999px; background: var(--sage-d); color: #fff; font-family: "Fredoka", sans-serif; font-size: 20px;
  font-weight: 600; box-shadow: 0 3px 0 #4B6F58; transition: transform .1s; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #4B6F58; }
.btn.secondary { background: var(--card); color: var(--ink); box-shadow: 0 3px 0 var(--line); border: 1.5px solid var(--line); }
.btn.clay { background: var(--clay-d); box-shadow: 0 3px 0 #8E563F; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card);
  border: 1.5px solid var(--line); }
.icon-btn svg { width: 22px; height: 22px; }

/* Top bar */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.top .grow { flex: 1; min-width: 0; }
.top h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sub { font-size: 14px; color: var(--muted); }
.stars-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--sand-l); font-family: "Fredoka", sans-serif; font-weight: 600; }
.star { color: #D4A24C; }
.star.off { color: #DDD5C4; }

/* Welcome */
.welcome { text-align: center; padding-top: 24px; }
.welcome .fox { width: 170px; height: 170px; }
.welcome h1 { font-size: 34px; margin: 8px 0 4px; }
.welcome p { color: var(--muted); margin: 0 auto 20px; max-width: 420px; }
.name-input { width: min(320px, 100%); height: 56px; border-radius: 16px; border: 2px solid var(--line); background: var(--card);
  font: 600 22px "Fredoka", sans-serif; color: var(--ink); text-align: center; margin-bottom: 16px; }
.link { color: var(--muted); text-decoration: underline; font-size: 15px; margin-top: 14px; display: inline-block; }

/* Speech bubble with the fox */
.guide { display: flex; align-items: flex-end; gap: 10px; margin: 4px 0 18px; }
.guide .fox { width: 74px; height: 74px; flex: none; }
.bubble { position: relative; background: var(--card); border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow);
  font-size: 16px; }
.bubble::before { content: ""; position: absolute; left: -8px; bottom: 16px; border: 8px solid transparent;
  border-right-color: var(--card); border-left: 0; }

/* Map */
.map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.isle { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 14px 10px 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.isle:active { transform: scale(.98); }
.isle .island-art { width: 96px; height: 96px; }
.isle h2 { font-size: 19px; line-height: 1.2; }
.isle .about { font-size: 13px; color: var(--muted); line-height: 1.35; min-height: 2.7em; }
.isle .stars { font-size: 20px; letter-spacing: 2px; }
.isle.contest { grid-column: 1 / -1; flex-direction: row; text-align: left; gap: 14px; padding: 14px 18px; background: var(--sand-l); }
.isle.contest .island-art { width: 84px; height: 84px; flex: none; }
.isle.contest .about { min-height: 0; }
@media (min-width: 640px) { .map { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Task */
.progress { display: flex; gap: 6px; }
.progress i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.progress i.done { background: var(--sage); }
.progress i.miss { background: var(--clay); }
.progress i.now { background: var(--sky-d); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px; margin-top: 14px; }
.tier { display: inline-block; font-size: 13px; font-weight: 500; color: var(--sky-d); background: var(--sky-l);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }
.question { display: flex; gap: 10px; align-items: flex-start; }
.question p { flex: 1; margin: 0; font-family: "Fredoka", sans-serif; font-size: 22px; line-height: 1.35; font-weight: 500; }
.say svg { width: 20px; height: 20px; }
.eq { margin: 18px 0 6px; text-align: center; font: 600 34px/1.5 "Fredoka", sans-serif; letter-spacing: .04em; }
.eq .box { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border: 3px dashed var(--clay-d);
  border-radius: 10px; color: var(--clay-d); background: var(--clay-l); line-height: 1; vertical-align: middle; }
.pic-wrap { display: flex; justify-content: center; margin: 16px 0 4px; }
.pic { max-width: 100%; height: auto; max-height: 220px; font-family: "Fredoka", sans-serif; }
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.answer { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 14px; border-radius: 16px;
  background: var(--card); border: 2px solid var(--line); font: 600 24px "Fredoka", sans-serif; text-align: left;
  box-shadow: 0 3px 0 var(--line); transition: transform .1s, background .2s; }
.answer .letter { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sky-l); color: var(--sky-d); font-size: 16px; }
.answer.small { font-size: 19px; }
.answer:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.answer.picked { border-color: var(--sky-d); background: var(--sky-l); }
.answer.right { border-color: var(--good); background: var(--sage-l); }
.answer.right .letter { background: var(--good); color: #fff; }
.answer.wrong { border-color: var(--bad); background: var(--clay-l); animation: shake .35s; }
.answer.wrong .letter { background: var(--bad); color: #fff; }
.answer[disabled] { cursor: default; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.feedback { display: flex; gap: 12px; align-items: center; margin-top: 18px; padding: 14px 16px; border-radius: 16px; }
.feedback .fox { width: 64px; height: 64px; flex: none; }
.feedback.good { background: var(--sage-l); }
.feedback.try { background: var(--sand-l); }
.feedback.bad { background: var(--clay-l); }
.feedback b { font-family: "Fredoka", sans-serif; font-size: 20px; display: block; }
.feedback span { font-size: 15px; }
.actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* Results */
.result { text-align: center; padding-top: 10px; }
.result .fox { width: 150px; height: 150px; }
.big-stars { font-size: 52px; letter-spacing: 6px; margin: 6px 0; }
.big-stars .star { display: inline-block; animation: pop .45s backwards; }
.big-stars .star:nth-child(2) { animation-delay: .15s; }
.big-stars .star:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.25); } }
.score { font: 600 46px "Fredoka", sans-serif; }
.score small { font-size: 22px; color: var(--muted); }
.stats { display: flex; justify-content: center; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.stats span { padding: 6px 14px; border-radius: 999px; font-size: 15px; background: var(--card); box-shadow: var(--shadow); }
.review { text-align: left; margin-top: 22px; display: grid; gap: 10px; }
.review details { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; }
.review summary { cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 500; list-style: none; }
.review summary::-webkit-details-marker { display: none; }
.review .mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  font-size: 15px; font-weight: 700; }
.review .ok { background: var(--good); } .review .no { background: var(--bad); } .review .skip { background: #C9C2B4; }
.review .body { padding-top: 10px; font-size: 15px; color: var(--muted); }
.review .body .eq { font-size: 24px; margin: 6px 0; color: var(--ink); }
.review .body .pic { max-height: 140px; }

/* Contest */
.rules { margin: 10px 0 0; padding-left: 20px; }
.rules li { margin: 6px 0; }
.nums { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.nums button { height: 38px; border-radius: 10px; background: var(--card); border: 1.5px solid var(--line); font-weight: 500; font-size: 15px; }
.nums button.answered { background: var(--sky-l); border-color: var(--sky); }
.nums button.now { border-color: var(--sky-d); border-width: 2.5px; }
.contest-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.timer { font-family: "Fredoka", sans-serif; font-weight: 600; color: var(--muted); }

/* Settings sheet */
.sheet { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 14px; }
.sheet h2 { font-size: 22px; margin-bottom: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.switch { width: 52px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.switch[aria-checked="true"] { background: var(--sage-d); }
.switch[aria-checked="true"]::after { left: 25px; }
.note { font-size: 13px; color: var(--muted); margin-top: 16px; }

@media (max-width: 420px) {
  .answers { gap: 10px; }
  .answer { font-size: 21px; min-height: 58px; padding: 6px 10px; gap: 8px; }
  .answer.small { font-size: 16px; }
  .question p { font-size: 20px; }
  .eq { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
