/* Capy Quest: tokens */
:root {
  --bg: #FBF7FF; --surface: #FFFFFF; --ink: #2A2140; --muted: #6E6385; --line: rgb(42 33 64 / .08);
  --brand: #7445F5; --brand-deep: #5428D6; --brand-soft: #F1EBFF; --pink: #FF4F9A; --gold: #FFB938; --good: #1F9D67; --try: #E8890C;
  --r-lg: 28px; --r: 20px; --r-sm: 14px;
  --shadow: 0 1px 0 rgb(255 255 255 / .9) inset, 0 18px 40px -12px rgb(76 48 140 / .18), 0 2px 6px rgb(76 48 140 / .06);
  --shadow-sm: 0 8px 22px -10px rgb(76 48 140 / .22);
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif; --body: 'Nunito', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top); --safe-b: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; color: var(--ink); font: 600 17px/1.5 var(--body); background: var(--bg); }
body { min-height: 100vh; background:
  radial-gradient(900px 600px at -10% -10%, #EDE3FF 0%, transparent 60%),
  radial-gradient(800px 600px at 110% 20%, #FFE6F1 0%, transparent 55%),
  radial-gradient(700px 500px at 50% 120%, #FFEBD9 0%, transparent 60%), var(--bg); background-attachment: fixed; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0 0 .3em; line-height: 1.08; letter-spacing: -0.015em; }
h1 { font-size: clamp(30px, 5vw, 46px); } h2 { font-size: 24px; } h3 { font-size: 19px; }
p { margin: 0 0 .6em; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 12px; }
img { max-width: 100%; }
.coco { height: auto; display: block; filter: drop-shadow(0 14px 18px rgb(60 30 10 / .16)); user-select: none; -webkit-user-drag: none; }
.muted { color: var(--muted); } .tiny { font-size: 14px; }
.eyebrow { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--brand); margin: 0 0 6px; }
.eyebrow.light { color: rgb(255 255 255 / .9); }
main { max-width: 1040px; margin: 0 auto; padding: 18px 20px calc(48px + var(--safe-b)); }
.card { background: rgb(255 255 255 / .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; border: 1px solid rgb(255 255 255 / .7); }
.row { display: flex; gap: 10px; flex-wrap: wrap; } .center { justify-content: center; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 28px; border-radius: 999px;
  font: 600 19px var(--display); color: #fff; background: linear-gradient(180deg, #8A5CFF, var(--brand)); box-shadow: 0 5px 0 var(--brand-deep), 0 14px 24px -8px rgb(116 69 245 / .55);
  transition: transform .12s ease-out, box-shadow .12s ease-out; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--brand-deep), 0 6px 12px -6px rgb(116 69 245 / .5); }
.btn:disabled { opacity: .55; }
.btn.big { min-height: 62px; font-size: 21px; padding: 0 32px; } .btn.wide { width: 100%; }
.btn.soft { background: var(--brand-soft); color: var(--brand-deep); box-shadow: 0 4px 0 #DCCFFF; }
.link { color: var(--brand-deep); font-weight: 800; padding: 12px; text-decoration: underline; text-underline-offset: 3px; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-t)) 20px 10px;
  background: rgb(251 247 255 / .78); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; font: 600 21px var(--display); } .logo .coco { width: 40px; filter: none; }
.iconbtn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: var(--shadow-sm); }
.bar-right { display: flex; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; background: #fff; border-radius: 999px; padding: 7px 14px 7px 10px; font: 600 16px var(--display); box-shadow: var(--shadow-sm); }
.gem { width: 18px; height: 18px; border-radius: 5px; transform: rotate(45deg) scale(.82); background: linear-gradient(135deg, #8BF0B4, #1F9D67); box-shadow: inset -2px -2px 0 rgb(0 0 0 / .12), inset 2px 2px 0 rgb(255 255 255 / .55); display: inline-block; vertical-align: -3px; margin-right: 2px; }
.bead-dot { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, #FF8CC0 30%, var(--pink) 75%); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 110px 20px 24px; max-width: none;
  background: linear-gradient(180deg, rgb(251 247 255 / .1) 0%, rgb(251 247 255 / .55) 40%, var(--bg) 78%), url(/img/art/world-read.webp) center top / cover no-repeat; }
.login-card { width: min(420px, 100%); text-align: center; background: rgb(255 255 255 / .86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-radius: 32px; padding: 0 26px 22px; box-shadow: var(--shadow); }
.login-card .coco { margin: -90px auto 4px; }
.login-card h1 { font-size: 40px; margin-bottom: 2px; }
.lbl { display: block; text-align: left; font-weight: 800; font-size: 15px; margin: 16px 0 6px; color: var(--muted); }
input.txt, #nm { width: 100%; font: 700 21px var(--body); padding: 14px 18px; border-radius: 16px; border: 2px solid #E6DEF5; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input.txt:focus, #nm:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(116 69 245 / .15); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 4px 0 12px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; background: #E6DEF5; transition: background .15s, transform .15s; } .pin-dots i.on { background: var(--brand); transform: scale(1.15); }
.err { color: #C0245F; font-weight: 800; min-height: 1.5em; margin: 10px 0 0; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 18px; }
.numpad { grid-template-columns: repeat(4, 1fr); max-width: 440px; }
.key { min-height: 58px; border-radius: 18px; background: #fff; font: 600 25px var(--display); box-shadow: 0 3px 0 #E4DBF4, 0 8px 16px -10px rgb(76 48 140 / .3); transition: transform .08s; }
.key:active { transform: translateY(3px); box-shadow: 0 0 0 #E4DBF4; }
.key.fn { background: var(--brand-soft); color: var(--brand-deep); font-size: 19px; }

/* home */
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 30px 34px; border-radius: 34px; overflow: hidden;
  background: linear-gradient(120deg, #6E3FF0 0%, #9B55F2 45%, #FF6FAE 100%); color: #fff; box-shadow: 0 24px 50px -18px rgb(116 69 245 / .6); }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(500px 300px at 85% 60%, rgb(255 255 255 / .28), transparent 60%), radial-gradient(300px 200px at 10% 0%, rgb(255 255 255 / .18), transparent 70%); pointer-events: none; }
.hero .eyebrow { color: #FFE3F0; }
.hero h1 { font-size: clamp(34px, 5.4vw, 52px); }
.hero .lede { font-size: 19px; opacity: .95; max-width: 34ch; margin-bottom: 20px; }
.hero .btn { background: #fff; color: var(--brand-deep); box-shadow: 0 5px 0 #D9CBFF, 0 16px 28px -10px rgb(30 0 80 / .45); }
.hero-text, .hero-art { position: relative; } .hero-art { flex: none; margin: -10px -6px -30px 0; }
.worlds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 22px 0; }
.world { display: flex; flex-direction: column; text-align: left; background: #fff; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease-out, box-shadow .18s; }
.world:active { transform: scale(.98); }
.world-img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; }
.world-body { display: flex; flex-direction: column; padding: 14px 18px 16px; gap: 2px; }
.world-name { font: 600 23px var(--display); color: var(--c); filter: brightness(.82); }
.world-sub { color: var(--muted); font-size: 15px; margin-bottom: 8px; }
.world-meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.meter { display: block; height: 10px; background: #F0EBF7; border-radius: 9px; overflow: hidden; } .meter i { display: block; height: 100%; background: var(--c); border-radius: 9px; }
.tour-card { cursor: pointer; } .tour-card h2 { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.mini { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 18px; }
.mini b { display: block; font: 600 19px var(--display); } .mini .muted { font-size: 14px; }
.mini-art .coco { width: 84px; } .mini-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(135deg, #FFD36E, #FF9A3C); color: #fff; flex: none; }
.foot { text-align: center; margin-top: 18px; }

/* world pages */
.world-head { position: relative; border-radius: 30px; overflow: hidden; box-shadow: var(--shadow); min-height: 210px; display: flex; align-items: flex-end; }
.world-head img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.world-head::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 82%, black 10%) 0%, color-mix(in srgb, var(--c) 55%, transparent) 45%, transparent 75%); }
.world-head-text { position: relative; z-index: 1; color: #fff; padding: 26px 28px; max-width: 520px; }
.world-head-text h1 { font-size: clamp(32px, 5vw, 46px); text-shadow: 0 2px 12px rgb(0 0 0 / .18); } .world-head-text p { margin: 0; opacity: .95; }
.obby { display: flex; flex-direction: column; gap: 12px; padding: 22px 0 8px; position: relative; }
.obby::before { content: ''; position: absolute; left: 50%; top: 30px; bottom: 20px; border-left: 3px dashed #E2D8F3; }
.stage { position: relative; display: flex; align-items: center; gap: 14px; width: min(76%, 470px); background: #fff; border-radius: 22px; padding: 12px 18px 12px 12px; box-shadow: var(--shadow); text-align: left; }
.stage.r { align-self: flex-end; } .stage.l { align-self: flex-start; }
.stage-num { flex: none; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; font: 600 22px var(--display); color: #A79BBD; background: #F2EEF8; box-shadow: inset 0 -4px 0 rgb(0 0 0 / .06); }
.stage.started .stage-num { color: #fff; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 70%, white), var(--c)); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .15), 0 6px 14px -6px var(--c); }
.stage-txt { display: flex; flex-direction: column; } .stage-txt b { font: 600 18px var(--display); }
.stage-meta { display: flex; align-items: center; gap: 10px; } .stage-meta small { color: var(--muted); font-size: 13px; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 17px; } .stars .off { color: #E7E0EF; }
.venues { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.venue { display: flex; gap: 14px; align-items: center; text-align: left; } .venue b { display: block; font: 600 18px var(--display); } .venue .muted { font-size: 14px; }
.venue-icon { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, #FF8AC0, var(--pink)); }
.venue.new .venue-icon { background: linear-gradient(140deg, #A98BFF, var(--brand)); }
.sub { margin-top: 28px; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 8px; } .chip { background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 15px; box-shadow: var(--shadow-sm); }
.tour-hero { display: flex; align-items: center; gap: 18px; } .tour-hero h1 { font-size: clamp(28px, 4vw, 40px); }
.cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.city { background: rgb(255 255 255 / .55); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; color: #A79BBD; }
.city b { font: 600 17px var(--display); } .city small { font-size: 13px; }
.city.got { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); } .city.got .city-ic { color: var(--gold); }
.city.next { background: #fff; color: var(--ink); box-shadow: 0 0 0 2px var(--brand), var(--shadow-sm); } .city.next .city-ic { color: var(--brand); }
section.card { margin-top: 16px; }

/* wardrobe */
.shop-head { margin-bottom: 18px; }
.wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.look { background: #fff; border-radius: 26px; padding: 14px 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .15s; }
.look-art { height: 160px; display: grid; place-items: end center; } .look-art .coco { max-height: 160px; width: auto !important; }
.look b { font: 600 17px var(--display); }
.look-tag { font-size: 14px; font-weight: 800; color: var(--brand-deep); background: var(--brand-soft); border-radius: 999px; padding: 4px 12px; }
.look.on { box-shadow: 0 0 0 3px var(--brand), var(--shadow); } .look.on .look-tag { background: var(--brand); color: #fff; }
.look { position: relative; } .look.locked .coco { filter: saturate(.75) drop-shadow(0 14px 18px rgb(60 30 10 / .16)); opacity: .9; }
.look.locked::after { content: ''; position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237445F5' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='3'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center/18px no-repeat; box-shadow: var(--shadow-sm); } .look.locked .look-tag { color: #156E49; background: #E3F7EC; }

/* questions */
.progress { display: flex; gap: 5px; margin: 6px 0; }
.progress i { flex: 1; height: 10px; border-radius: 99px; background: #E9E2F2; }
.progress i.ok { background: var(--good); } .progress i.try { background: #F5B14A; } .progress i.now { background: var(--brand); box-shadow: 0 0 0 3px rgb(116 69 245 / .2); }
.qcount { margin: 6px 0 14px; color: var(--muted); font-weight: 800; font-size: 15px; }
.q-layout.with-passage { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.qcard { background: #fff; position: relative; overflow: hidden; }
.qcard::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--c); }
.qtag { font: 600 14px var(--display); color: var(--c); filter: brightness(.8); margin-top: 4px; }
.prompt { font-size: 22px; line-height: 1.45; margin: 10px 0 18px; font-weight: 700; } .prompt i { color: #4F4566; }
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .82em; margin: 0 3px; line-height: 1.1; }
.fr span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px 1px; }
.gap { display: inline-block; min-width: 50px; border: 2.5px dashed var(--brand); border-radius: 10px; text-align: center; color: var(--brand); padding: 0 6px; }
.ansbox { font: 600 32px var(--display); min-height: 66px; border-radius: 18px; padding: 10px 18px; background: var(--brand-soft); box-shadow: inset 0 0 0 2px #DCCFFF; max-width: 440px; margin-bottom: 10px; white-space: pre; }
.ansbox .ph { color: #A99BC9; font-size: 18px; font-weight: 600; font-family: var(--body); }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; background: #fff; border-radius: 16px; padding: 15px 18px; font-size: 18px; min-height: 56px; box-shadow: inset 0 0 0 2px #EAE3F5; transition: box-shadow .12s, background .12s; }
.opt.on { background: var(--brand-soft); box-shadow: inset 0 0 0 2.5px var(--brand); }
.opt.multi::before { content: ''; display: inline-block; width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 0 0 2px #CBBDE8; margin-right: 12px; vertical-align: -3px; }
.opt.multi.on::before { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center/14px no-repeat; box-shadow: none; }
.sentence { font-size: 22px; line-height: 2.4; }
.word { background: #fff; border-radius: 12px; padding: 3px 10px; margin: 2px 0; font-size: 21px; box-shadow: inset 0 0 0 2px #EAE3F5; }
.word.on { background: #FFF1C9; box-shadow: inset 0 0 0 2.5px var(--gold); }
.word.static { box-shadow: none; padding: 0 2px; background: none; }
.ins { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; }
.gapbtn { width: 28px; height: 42px; border-radius: 10px; margin: 0 2px; font: 600 24px var(--display); color: var(--brand); box-shadow: inset 0 0 0 2px #E1D7F4; }
.gapbtn.on { background: var(--brand-soft); box-shadow: inset 0 0 0 2.5px var(--brand); }
table.rows { border-collapse: separate; border-spacing: 0 8px; width: 100%; }
.rows th { font: 600 14px var(--display); color: var(--muted); padding: 2px 4px; } .rows td { background: #F8F5FC; padding: 8px; }
.rows td:first-child { border-radius: 14px 0 0 14px; font-size: 17px; width: 48%; } .rows td:last-child { border-radius: 0 14px 14px 0; }
.tick { width: 44px; height: 44px; border-radius: 12px; display: block; margin: auto; background: #fff; box-shadow: inset 0 0 0 2px #E1D7F4; }
.tick.on { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center/22px no-repeat; box-shadow: none; }
textarea.area { width: 100%; font: 600 19px var(--body); padding: 14px 16px; border-radius: 16px; border: 2px solid #E6DEF5; resize: vertical; color: var(--ink); }
.spell-sent { font-size: 22px; } .gapline { color: var(--brand); font-weight: 800; letter-spacing: 2px; }
#hear { margin-bottom: 14px; min-height: 48px; font-size: 17px; }
.actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hint { background: #FFF6DD; border-radius: 16px; padding: 12px 16px; margin-top: 12px; box-shadow: inset 0 0 0 2px #FBE3A2; }
.locked { pointer-events: none; }
.fb { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 12px 18px 12px 10px; border-radius: 22px; animation: pop .28s ease-out; }
.fb h3 { margin: 0 0 2px; font-size: 22px; } .fb p { margin: 4px 0; }
.fb .coco { width: 96px; flex: none; margin: -14px 0 -10px; }
.fb.good { background: #E7F8EF; box-shadow: inset 0 0 0 2px #B5E8CD; } .fb.good h3 { color: #157A50; }
.fb.try { background: #FFF4E2; box-shadow: inset 0 0 0 2px #FBD9A1; } .fb.try h3 { color: #A85A00; }
.fb.self, .fb.wait { background: var(--brand-soft); box-shadow: inset 0 0 0 2px #DCCFFF; }
.tip { font-weight: 800; } .aifb { font-style: italic; }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* reading booklet */
.booklet { font-size: 18px; line-height: 1.65; background: #FFFDF9; }
.booklet h4 { font: 600 20px var(--display); margin: 16px 0 2px; color: #B4236A; }
.booklet .kind { font: 600 14px var(--display); color: var(--pink); margin: 0; }
details.booklet summary { font: 600 19px var(--display); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.booklet summary::-webkit-details-marker { display: none; }
details.booklet summary::before { content: '▸'; color: var(--pink); transition: transform .15s; } details.booklet[open] summary::before { transform: rotate(90deg); }
details.booklet summary small { color: var(--muted); font: 600 13px var(--body); }
details.side[open] { max-height: 72vh; overflow: auto; position: sticky; top: 84px; }
.diary-date { font-family: 'Patrick Hand', cursive; font-size: 23px; color: #B4236A; margin-bottom: 0; }
.reader .btn { margin-top: 18px; }

/* done */
.celebrate { text-align: center; padding-top: 10px; } .celebrate .coco { margin: 0 auto -6px; }
.big-score { font: 600 46px var(--display); color: var(--brand); margin: 0; letter-spacing: -0.02em; }
.newbead { background: #FFF0F7; border-radius: 20px; padding: 10px; margin: 12px auto 0; max-width: 420px; } .city-unlock { font: 600 20px var(--display); color: #B4236A; margin-top: 10px; }
.diary { margin-top: 18px; background: #FFFEF8 repeating-linear-gradient(#FFFEF8 0 33px, #D6E6F7 33px 35px); border-left: 8px solid #FFA9CB; }
.diary h2 { font-family: 'Patrick Hand', cursive; font-size: 36px; color: #B4236A; font-weight: 400; }
.hand { font-family: 'Patrick Hand', cursive; font-size: 21px; line-height: 35px; font-weight: 400; } .hand li { margin-bottom: 10px; }
.done .row { margin-top: 20px; }
.center-screen { text-align: center; padding-top: 10vh; } .center-screen .coco { margin: 0 auto; }
.loader { display: flex; gap: 8px; justify-content: center; margin-top: 10px; } .loader i { width: 14px; height: 14px; background: var(--brand); border-radius: 50%; animation: hop 1s infinite; } .loader i:nth-child(2) { animation-delay: .15s; background: var(--pink); } .loader i:nth-child(3) { animation-delay: .3s; background: var(--gold); }
@keyframes hop { 50% { transform: translateY(-12px); } }

#toast { opacity: 0; visibility: hidden; position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 999px; font-weight: 800; transition: all .22s ease-out; z-index: 20; max-width: 90vw; text-align: center; }
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 12px; border-radius: 50%; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { top: 110vh; transform: translateX(30px) rotate(540deg); } }

/* phones */
@media (max-width: 700px) {
  body { font-size: 16px; } main { padding: 14px 14px calc(40px + var(--safe-b)); }
  .hero { flex-direction: column-reverse; text-align: center; padding: 18px 20px 26px; border-radius: 30px; }
  .hero-art { margin: 0 auto -8px; } .hero-art .coco { width: 170px !important; }
  .hero .lede { margin-left: auto; margin-right: auto; } .hero .btn { width: 100%; }
  .worlds, .two { grid-template-columns: 1fr; }
  .q-layout.with-passage { grid-template-columns: 1fr; }
  details.side[open] { position: static; max-height: 46vh; }
  .stage { width: 94%; } .obby::before { display: none; }
  .prompt { font-size: 20px; }
  .tick { width: 38px; height: 38px; } .rows td { padding: 6px 3px; }
  .bar .logo b { display: none; }
  .world-head { min-height: 180px; } .world-head-text { padding: 20px; }
  .tour-hero { flex-direction: column; text-align: center; }
  .wardrobe { grid-template-columns: 1fr 1fr; gap: 12px; } .look-art { height: 120px; } .look-art .coco { max-height: 120px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Arcade ---------- */
.arcade-card { position: relative; display: flex; align-items: flex-end; width: 100%; min-height: 170px; margin-top: 16px; border-radius: var(--r-lg); overflow: hidden; text-align: left; box-shadow: var(--shadow); color: #fff; }
.arcade-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.arcade-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(84 40 214 / .92), rgb(116 69 245 / .5) 55%, transparent 85%); }
.arcade-txt { position: relative; z-index: 1; padding: 20px 22px; display: flex; flex-direction: column; gap: 2px; max-width: 460px; }
.arcade-txt b { font: 600 26px var(--display); } .arcade-txt span:last-child { opacity: .92; font-size: 15px; }
.ticket-bar { display: flex; flex-direction: column; gap: 8px; } .ticket-bar p { margin: 0; }
.arcade { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-top: 18px; }
.gcab { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; background: #fff; border-radius: 26px; padding: 0 14px 16px; box-shadow: var(--shadow); overflow: hidden; }
.gcab-art { width: calc(100% + 28px); height: 120px; display: grid; place-items: center; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--gc) 35%, white), color-mix(in srgb, var(--gc) 12%, white)); margin-bottom: 8px; }
.gcab-art img { max-height: 96px; max-width: 70%; object-fit: contain; filter: drop-shadow(0 10px 12px rgb(0 0 0 / .15)); }
.gcab b { font: 600 19px var(--display); } .gcab .muted { font-size: 14px; line-height: 1.35; min-height: 2.7em; }
.gcab-tag { margin-top: 4px; font-size: 13px; font-weight: 800; color: #fff; background: var(--gc); border-radius: 999px; padding: 4px 12px; }
.gcab .meter { width: 80%; height: 8px; margin-top: 6px; --c: #B9A9DA; }
.gcab.locked .gcab-art { background: #F2EEF8; } .gcab.locked .gcab-art img { filter: grayscale(1) opacity(.45); }
.gcab.locked b::before { content: '🔒 '; font-size: 15px; }

/* ---------- Game overlay ---------- */
body.noscroll { overflow: hidden; }
.game-ov { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #FBF7FF; animation: pop .25s ease-out; padding-top: var(--safe-t); padding-bottom: var(--safe-b); touch-action: none; user-select: none; -webkit-user-select: none; }
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: color-mix(in srgb, var(--gc) 92%, black 8%); color: #fff; }
.gbtn { width: 46px; height: 46px; border-radius: 50%; background: rgb(255 255 255 / .2); color: #fff; font-size: 20px; }
.gstat { display: flex; flex-direction: column; align-items: center; line-height: 1; } .gstat span { font: 600 28px var(--display); } .gstat small { font-size: 12px; opacity: .85; margin-top: 2px; }
.game-stage { position: relative; flex: 1; overflow: hidden; }
.g-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.game-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, 90vw); background: #fff; border-radius: 30px; box-shadow: 0 30px 60px -20px rgb(42 33 64 / .45); padding: 22px 24px 24px; text-align: center; z-index: 2; }
.game-card[hidden] { display: none; }
.g-thumb { height: 110px; margin: -70px auto 6px; display: block; filter: drop-shadow(0 12px 14px rgb(0 0 0 / .18)); }
.game-card h2 { font-size: 30px; color: color-mix(in srgb, var(--gc) 75%, black 25%); }
.game-card .btn { width: 100%; margin-top: 8px; }
.g-eyebrow { font: 600 15px var(--display); color: var(--pink); margin: 0; } .g-best { color: var(--muted); } .g-score { font: 600 30px var(--display); color: var(--brand); margin: 0 0 4px; }

/* hot spring */
.g-spring { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2%; padding: 4% 3%; align-content: center; background: linear-gradient(#E3F7F1, #CDEFE6); }
.pool { position: relative; aspect-ratio: 1; max-height: 26vh; justify-self: center; width: 100%; max-width: 180px; touch-action: none; }
.pool-water { position: absolute; left: 0; right: 0; bottom: 6%; height: 48%; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, #BFF3EA, #5CC9B8 70%); box-shadow: 0 0 0 6px #EADFD2, 0 10px 18px -6px rgb(0 0 0 / .2); }
.pop { position: absolute; left: 4%; right: 4%; bottom: 22%; height: 86%; display: grid; place-items: end center; transform: translateY(30%) scale(.4); opacity: 0; transition: transform .16s ease-out, opacity .16s; clip-path: inset(-50% -50% 18% -50%); }
.pop img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.pool.up .pop { transform: none; opacity: 1; } .pool.booped .pop { transform: scale(1.1) rotate(-6deg); } .pool.ouch .pop { filter: hue-rotate(160deg); }

/* memory */
.g-memory { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px; align-content: center; max-width: 560px; margin: 0 auto; }
.mcard { aspect-ratio: 3 / 4; perspective: 600px; position: relative; max-height: 19vh; }
.mback, .mfront { position: absolute; inset: 0; border-radius: 16px; display: grid; place-items: center; backface-visibility: hidden; transition: transform .3s; box-shadow: var(--shadow-sm); }
.mback { background: linear-gradient(140deg, #A98BFF, var(--brand)); } .mback::after { content: ''; width: 34%; aspect-ratio: 1; border-radius: 50%; border: 3px solid rgb(255 255 255 / .5); }
.mfront { background: #fff; transform: rotateY(180deg); } .mfront b { font: 600 34px var(--display); color: var(--pink); }
.mbead { width: 46%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--b) 40%); box-shadow: inset -4px -6px 0 rgb(0 0 0 / .12); }
.mcard.flip .mback, .mcard.done .mback { transform: rotateY(180deg); } .mcard.flip .mfront, .mcard.done .mfront { transform: rotateY(360deg); }
.mcard.done .mfront { box-shadow: 0 0 0 3px var(--good); }

/* echo */
.g-echo { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(circle at 50% 40%, #F4EEFF, #E6DCFB); }
.echo-msg { font: 600 24px var(--display); margin: 0; } .echo-lives { font-size: 26px; color: var(--pink); margin: 0; }
.echo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: min(340px, 78vw); }
.ebead { aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / .8) 0 10%, var(--b) 45%); box-shadow: inset -8px -12px 0 rgb(0 0 0 / .15), 0 12px 20px -8px var(--b); opacity: .6; transition: transform .1s, opacity .1s, filter .1s; touch-action: none; }
.ebead.lit { opacity: 1; transform: scale(1.08); filter: brightness(1.25) saturate(1.2); }

/* slide puzzle */
.g-slide { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.slide-board { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; width: min(360px, 82vw, 58vh); aspect-ratio: 1; background: #E6DCFB; padding: 4px; border-radius: 18px; }
.stile { border-radius: 12px; background-image: url(/img/art/coco-cheer-sq.webp); background-size: 300% 300%; box-shadow: var(--shadow-sm); position: relative; }
.stile i { position: absolute; left: 6px; top: 4px; font: 600 13px var(--display); color: #fff; font-style: normal; text-shadow: 0 1px 3px rgb(0 0 0 / .5); }
.stile.gap { background: transparent; box-shadow: none; } .slide-moves { font: 600 18px var(--display); color: var(--muted); }

.bracelet-empty { margin: 14px 0 4px; padding: 14px; text-align: center; color: var(--muted); border: 2px dashed #E2D8F3; border-radius: 16px; }
