/* WILDCAP /play — game HUD. Chunky rounded sticker UI over a full-screen canvas. Tokens from /shared/base.css. */
html, body.play { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.play { background: var(--sky); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; outline: none; cursor: grab; touch-action: none; }
#gl:active { cursor: grabbing; }
kbd { display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 .4em; border: 2px solid currentColor; border-radius: 7px; font: 800 .72em/1 var(--f-body); opacity: .85; }
.small { font-size: 13px; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-size: 15px; }
#hud > *, #hud .hud-tl > *, #hud .hud-tr > * { pointer-events: auto; }
#hud .hud-tl, #hud .hud-tr { pointer-events: none; }
#hud[hidden] { display: none; }
:root { --safe-t: max(14px, env(safe-area-inset-top)); --safe-b: max(14px, env(safe-area-inset-bottom)); --safe-l: max(16px, env(safe-area-inset-left)); --safe-r: max(16px, env(safe-area-inset-right)); }

/* ── name tags ── */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.tag {
  position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 6px; white-space: nowrap;
  background: #fff; border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); font: 800 13px/1 var(--f-body); color: var(--ink);
  will-change: transform; transform-origin: 50% 100%;
}
.tag::before { content: ''; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: var(--r-common); flex: none; }
.tag[data-r='uncommon']::before { background: var(--r-uncommon); }
.tag[data-r='rare']::before { background: var(--r-rare); }
.tag[data-r='epic']::before { background: var(--r-epic); }
.tag[data-r='legendary'] { background: #fff6dc; }
.tag[data-r='legendary']::before { background: var(--r-legendary); }
.tag i { font-style: normal; font-weight: 700; color: var(--ink-2); font-size: 11px; }
.tag s { text-decoration: none; color: #f0b400; }
.tag.shiny { background: var(--shiny); }
.tag.raging { box-shadow: 0 3px 0 var(--ink), 0 0 0 3px rgba(255, 111, 94, .55); }
.tag em { font-style: normal; background: var(--coral); color: #fff; border-radius: 999px; padding: 2px 6px; font-size: 10px; letter-spacing: .06em; }
.tag[hidden] { display: none; }

/* ── top left: trainer chip, caps, ticker ── */
.hud-tl { position: absolute; top: var(--safe-t); left: var(--safe-l); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: min(380px, 46vw); }
.tchip {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; background: var(--panel); border: 2px solid var(--ink); border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink); cursor: pointer;
}
.tchip-logo { width: 40px; height: 40px; border-radius: 50%; background: var(--sky-2); border: 2px solid var(--ink); padding: 3px; }
.tchip-id { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.tchip-id > b { font: 800 16px/1.1 var(--f-display); max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchip-id > span { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.tier { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--mint); border: 1.5px solid var(--ink); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.tier[data-guest='true'] { background: #eef2f8; }
.tchip .btn-sm { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.caps-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.caps { display: flex; gap: 6px; }
.cap-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; background: var(--panel); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); }
.cap-pill svg { width: 26px; height: 26px; }
.cap-pill b { font: 800 15px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.caps-reset { font-size: 12px; font-weight: 800; color: var(--ink); background: rgba(255,255,255,.7); padding: 3px 9px; border-radius: 999px; }
.ticker { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; pointer-events: none !important; }
.tk { font-size: 13px; font-weight: 700; padding: 6px 12px; background: rgba(255,255,255,.88); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 rgba(28,39,66,.25); animation: tk-in .35s cubic-bezier(.2,1.4,.4,1); transition: opacity .6s; max-width: 100%; }
.tk.old { opacity: .55; }
.tk .chip { padding: 1px 6px; font-size: 10px; border-width: 1.5px; }
.tk em { font-style: normal; color: var(--coral-deep); font-weight: 800; }
.tk-hatch { background: #fff8e2; }
.tk-rage { background: #ffe6e1; }
@keyframes tk-in { from { transform: translateX(-20px) scale(.9); opacity: 0; } }

/* ── top right ── */
.hud-tr { position: absolute; top: var(--safe-t); right: var(--safe-r); display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.topbar { display: flex; align-items: center; gap: 8px; }
.tokenbar, .sysbtns { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.ca-mini.ca { padding: 4px 4px 4px 6px; gap: 6px; flex-wrap: nowrap; box-shadow: 0 3px 0 var(--ink); }
.ca-mini .ca-label { padding: 4px 6px; font-size: 10px; }
.ca-mini .ca-addr { flex: 0 1 auto; font-size: 13px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-mini .ca-when { display: none; }
.ca-mini .ca-soon { color: var(--coral-deep); }
.ca-mini .btn-sm { min-height: 32px; padding: 4px 10px; font-size: 12px; box-shadow: 0 2px 0 var(--ink); }
.ca-mini .btn-sm svg { width: 14px; height: 14px; }
.cd-mini.countdown { gap: 4px; }
.cd-mini .cell { min-width: 38px; padding: 5px 4px 4px; border-radius: 11px; box-shadow: 0 3px 0 var(--ink); }
.cd-mini b { font-size: 16px; }
.cd-mini small { font-size: 8px; margin-top: 2px; letter-spacing: .1em; }
.tb-buy { flex-direction: column; gap: 1px; min-height: 44px; padding: 5px 14px; line-height: 1; }
.tb-buy small { font: 800 9px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
#mute-slot { display: contents; }
.sysbtns .icon-btn { width: 44px; height: 44px; }
.minimap { width: 150px; height: 150px; border-radius: 50%; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); background: var(--sky-2); }

/* ── banners, prompt, pops ── */
.offline { position: absolute; top: var(--safe-t); left: 50%; transform: translateX(-50%); margin: 0; padding: 6px 14px; background: var(--sun); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); font: 800 12px/1.2 var(--f-body); letter-spacing: .06em; white-space: nowrap; }
.isle { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none !important; opacity: 0; }
.isle.show { animation: isle 3.6s ease forwards; }
.isle h2 { margin: 4px 0 2px; font: 800 clamp(34px, 6vw, 64px)/1 var(--f-display); letter-spacing: -.02em; color: #fff; -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink); }
.isle p { margin: 0; font-weight: 800; color: var(--ink); text-shadow: 0 1px 0 #fff; }
.isle .eyebrow { color: var(--ink); opacity: .7; }
.isle small { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; background: #fff; border: 2px solid var(--ink); font-weight: 800; font-size: 12px; }
@keyframes isle { 0% { opacity: 0; transform: translate(-50%, 14px) scale(.92); } 12%, 75% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -8px); } }
.prompt {
  position: absolute; left: 50%; bottom: calc(var(--safe-b) + 104px); transform: translateX(-50%); margin: 0; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 5px 0 var(--ink); font-weight: 800; white-space: nowrap; animation: pop-in .25s cubic-bezier(.2,1.5,.4,1);
}
.prompt kbd { background: var(--sun); opacity: 1; border-color: var(--ink); }
.prompt .chip { font-size: 10px; padding: 2px 7px; }
.ring-hint { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); margin: 0; font: 800 20px/1 var(--f-display); color: #fff; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.qpop { position: absolute; left: 50%; top: 26%; transform: translateX(-50%); font: 800 clamp(36px, 7vw, 64px)/1 var(--f-display); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); opacity: 0; pointer-events: none !important; white-space: nowrap; }
.qpop[data-q='excellent'] { color: var(--sun); }
.qpop[data-q='great'] { color: #7cc6f5; }
.qpop[data-q='good'] { color: var(--mint); }
.qpop[data-q='miss'] { color: #ffd0c8; font-size: clamp(26px, 5vw, 44px); }
.qpop.show { animation: qpop 1.4s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes qpop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.4) rotate(-6deg); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.08) rotate(-3deg); } 30%, 75% { transform: translate(-50%, 0) scale(1) rotate(-3deg); opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -24px) scale(.95) rotate(-3deg); } }
@keyframes pop-in { from { transform: translateX(-50%) scale(.8); opacity: 0; } }
.coach {
  position: absolute; left: 50%; bottom: calc(var(--safe-b) + 160px); transform: translateX(-50%); width: min(440px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: var(--cream); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 5px 0 var(--ink); animation: pop-in .3s cubic-bezier(.2,1.5,.4,1);
}
.coach p { margin: 0; font-weight: 700; font-size: 14px; line-height: 1.4; flex: 1; }
.coach kbd { font-size: 11px; margin: 0 1px; background: #fff; }
.coach-n { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); font: 800 13px/1 var(--f-display); }
.coach[hidden], .prompt[hidden], .ring-hint[hidden] { display: none; }

/* ── dock ── */
.dock { position: absolute; left: 50%; bottom: var(--safe-b); transform: translateX(-50%); display: flex; gap: 8px; padding: 8px; background: rgba(255, 250, 240, .92); border: 2px solid var(--ink); border-radius: 26px; box-shadow: 0 5px 0 var(--ink); }
.dock button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 4px 4px 3px; border: 0; background: none; cursor: pointer; border-radius: 16px; font: 800 12px/1 var(--f-body); color: var(--ink); }
.dock i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--c); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); color: var(--ink); transition: transform .12s, box-shadow .12s; }
.dock i svg { width: 24px; height: 24px; }
.dock button:hover i { transform: translateY(-2px); }
.dock button:active i { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.dock button[aria-pressed='true'] i { background: #fff; }
.dock button.flash i { animation: flash .9s ease 2; }
@keyframes flash { 50% { transform: scale(1.18) rotate(-6deg); background: #fff; } }

/* ── touch controls ── */
.touch-ctl { display: none; }
body.touch .touch-ctl { display: block; pointer-events: none !important; position: absolute; inset: 0; }
.joy { pointer-events: auto; position: absolute; left: calc(var(--safe-l) + 4px); bottom: calc(var(--safe-b) + 92px); width: 128px; height: 128px; border-radius: 50%; background: rgba(255,255,255,.45); border: 3px solid rgba(28,39,66,.55); touch-action: none; }
.joy.on { background: rgba(255,255,255,.65); border-color: var(--ink); }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.act { pointer-events: auto; position: absolute; right: calc(var(--safe-r) + 4px); bottom: calc(var(--safe-b) + 104px); width: 92px; height: 92px; border-radius: 50%; border: 3px solid var(--ink); background: var(--coral); color: #fff; box-shadow: 0 5px 0 var(--ink); font: 800 14px/1.1 var(--f-body); display: grid; place-items: center; transition: transform .1s, opacity .2s; }
.act:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.act .act-i { display: none; }
.act[data-mode='idle'] { opacity: .45; background: #fff; color: var(--ink); }
.act[data-mode='idle'] .act-a { display: none; }
.act[data-mode='idle'] .act-i { display: block; font: 800 30px/1 var(--f-display); }
body.touch .prompt { bottom: calc(var(--safe-b) + 214px); }
body.touch .coach { bottom: calc(var(--safe-b) + 236px); }

/* ── encounter ── */
.enc { position: absolute; inset: 0; pointer-events: none !important; }
.enc > * { pointer-events: auto; }
.enc[hidden] { display: none; }
.enc-card { position: absolute; right: var(--safe-r); top: 50%; transform: translateY(-50%); width: 330px; padding: 16px; animation: card-in .35s cubic-bezier(.2,1.3,.4,1); }
@keyframes card-in { from { transform: translate(30px, -50%) rotate(3deg); opacity: 0; } }
.enc-head { display: flex; gap: 12px; align-items: center; }
.enc-portrait { flex: none; width: 92px; height: 92px; border-radius: 22px; border: 2px solid var(--ink); background: radial-gradient(circle at 50% 40%, #fff, var(--sky-2) 70%); overflow: hidden; display: grid; place-items: center; }
.enc[data-r='legendary'] .enc-portrait { background: radial-gradient(circle at 50% 40%, #fff, #ffe3a8 75%); }
.enc[data-r='epic'] .enc-portrait { background: radial-gradient(circle at 50% 40%, #fff, #ead9ff 75%); }
.enc[data-r='rare'] .enc-portrait { background: radial-gradient(circle at 50% 40%, #fff, #cfe6ff 75%); }
.enc-portrait img { width: 100%; height: 100%; object-fit: cover; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.enc-id { min-width: 0; }
.enc-name { margin: 0; font: 800 21px/1.05 var(--f-display); }
.enc-sym { margin: 3px 0 6px; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enc-sym b { color: var(--ink); font-size: 15px; }
.enc-chips, .cc-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.enc-chips .chip, .cc-chips .chip { font-size: 10px; padding: 2px 8px; }
.chip.mood-hyped { background: #ffe0d6; } .chip.mood-sleepy { background: #e4e9ff; } .chip.mood-calm { background: #e7f8ee; }
.chip.rage { background: var(--coral); color: #fff; }
.enc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 8px; }
.enc-stats div { background: var(--panel-2); border: 1.5px solid var(--line-2); border-radius: 12px; padding: 6px 8px; min-width: 0; }
.enc-stats dt { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.enc-stats dd { margin: 2px 0 0; font: 800 14px/1.2 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enc-first { margin: 4px 0 10px; font-size: 13px; color: var(--ink-2); min-height: 1.3em; }
.enc-buy { width: 100%; }
.enc-buy[hidden] { display: none; }
.enc-ctl { position: absolute; left: 50%; bottom: var(--safe-b); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(560px, calc(100% - 32px)); }
.enc-balls { display: flex; gap: 8px; justify-content: center; }
.ball-opt { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--ink); cursor: pointer; font: 800 13px/1 var(--f-body); }
.ball-opt svg { width: 28px; height: 28px; }
.ball-opt b { font-variant-numeric: tabular-nums; }
.ball-opt kbd { font-size: 10px; min-width: 1.6em; height: 1.6em; opacity: .5; }
.ball-opt[aria-checked='true'] { background: var(--sun); transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.ball-opt[data-empty] { opacity: .45; }
.enc-btns { display: flex; gap: 10px; align-items: center; }
.enc-throw { min-width: 200px; font-size: 20px; }
.enc-throw kbd, .enc-leave kbd { font-size: 11px; }
.enc.busy .enc-throw { opacity: .6; }
.enc-left { margin: 0; font-size: 12px; font-weight: 800; color: var(--ink); background: rgba(255,255,255,.75); padding: 2px 10px; border-radius: 999px; }
.enc-left:empty { display: none; }
body.in-enc .dock, body.in-enc .touch-ctl, body.in-enc .prompt, body.in-enc .coach:not([data-step='throw']), body.in-enc .isle { display: none !important; }
body.in-enc .coach[data-step='throw'] { bottom: calc(var(--safe-b) + 190px); }
body.in-enc #labels { opacity: 0; transition: opacity .3s; }
#labels { transition: opacity .3s; }
body.touch .enc-btns kbd { display: none; }
body.touch .ball-opt kbd { display: none; }

/* ── sheets (panels) ── */
.sheet-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(28, 39, 66, .25); padding: 16px; z-index: 30; }
.sheet-wrap[hidden] { display: none; }
.sheet { width: min(520px, 100%); max-height: min(78vh, 720px); display: flex; flex-direction: column; padding: 0; overflow: hidden; animation: sheet-in .3s cubic-bezier(.2,1.3,.4,1); }
@keyframes sheet-in { from { transform: translateY(24px) scale(.96); opacity: 0; } }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 20px; border-bottom: 2px solid var(--line); }
.sheet header h2 { margin: 0; font-size: 22px; }
.sheet-body { padding: 14px 20px 20px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; user-select: text; -webkit-user-select: text; }
.sheet-body p { margin: 0 0 12px; }
.sheet-body .h3 { margin: 18px 0 8px; font-size: 17px; }
.lead-s { font-size: 17px; }
.rows { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel-2); border: 1.5px solid var(--line-2); border-radius: 14px; }
.row > div { flex: 1; min-width: 0; }
.row .dot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.row .num { font-variant-numeric: tabular-nums; }
.row.me { background: #fff6d6; border-color: var(--ink); }
.row .rank { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--ink); font: 800 13px/1 var(--f-display); }
.board li:nth-child(1) .rank { background: var(--sun); } .board li:nth-child(2) .rank { background: #e3e8f0; } .board li:nth-child(3) .rank { background: #f3c79a; }
.missions .tick { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 900; background: #fff; }
.missions .done .tick { background: var(--grass); color: #fff; }
.bar { height: 8px; border-radius: 99px; background: var(--line); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grass); border-radius: inherit; }
.bag, .mart, .tiers { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.bag li, .mart-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--ink); }
.bag li svg, .mi-icon svg { width: 40px; height: 40px; flex: none; }
.bag li > div, .mart-item > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.bag .big { font: 800 26px/1 var(--f-display); }
.tiers li { padding: 8px 12px; background: var(--panel-2); border-radius: 12px; border: 1.5px solid var(--line-2); }
.menu-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.menu-links a { padding: 12px 14px; border: 2px solid var(--ink); border-radius: 14px; font-weight: 800; text-decoration: none; background: var(--panel-2); }
.menu-links a:hover { background: var(--sun); }
.menu-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.menu-token { display: grid; gap: 10px; margin-bottom: 12px; }
.menu-token .ca { box-shadow: 0 3px 0 var(--ink); }

/* ── catch card ── */
.catch-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(28, 39, 66, .3); z-index: 40; padding: 16px; }
.catch-wrap[hidden] { display: none; }
.catch-card { position: relative; width: min(370px, 100%); text-align: center; padding: 22px 20px 20px; animation: cc-in .5s cubic-bezier(.2,1.4,.4,1); max-height: calc(100dvh - 32px); overflow-y: auto; }
.catch-card:has(.cc-ribbon) > .eyebrow { margin-top: 30px; }
@keyframes cc-in { from { transform: scale(.6) rotate(-8deg); opacity: 0; } }
.catch-card[data-r='legendary'] { background: linear-gradient(#fff, #fff6dc); }
.catch-card[data-r='epic'] { background: linear-gradient(#fff, #f6efff); }
.cc-ribbon { position: absolute; top: 12px; right: 12px; padding: 6px 14px; background: var(--coral); color: #fff; border: 2px solid var(--ink); border-radius: 8px; font: 800 12px/1 var(--f-body); letter-spacing: .12em; transform: rotate(6deg); box-shadow: 0 3px 0 var(--ink); }
.cc-title { margin: 4px 0 6px; font: 800 44px/1 var(--f-display); letter-spacing: -.02em; color: var(--sun); -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); }
.cc-portrait { width: 190px; height: 190px; margin: 6px auto 8px; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle, #fff 30%, var(--sky-2) 72%); overflow: hidden; box-shadow: 0 5px 0 var(--ink); }
.catch-card[data-r='legendary'] .cc-portrait { background: radial-gradient(circle, #fff 30%, #ffe3a8 72%); }
.catch-card[data-r='epic'] .cc-portrait { background: radial-gradient(circle, #fff 30%, #ead9ff 72%); }
.catch-card[data-r='rare'] .cc-portrait { background: radial-gradient(circle, #fff 30%, #cfe6ff 72%); }
.cc-portrait img { width: 100%; height: 100%; object-fit: cover; }
.cc-name { margin: 0; font: 800 22px/1.1 var(--f-display); }
.cc-sym { margin: 3px 0 8px; color: var(--ink-2); font-size: 14px; }
.cc-chips { justify-content: center; }
.cc-points { margin: 10px 0 6px; font: 800 34px/1 var(--f-display); color: var(--grass-deep); }
.cc-points small { font-size: 16px; color: var(--ink-2); }
.cc-note { font-size: 13px; margin: 6px 0; }
.cc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }

/* ── picker ── */
.picker { position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; justify-content: center; padding: 16px; padding-bottom: var(--safe-b); pointer-events: none; }
.picker[hidden] { display: none; }
.picker-card { pointer-events: auto; width: min(460px, 100%); text-align: center; animation: sheet-in .4s cubic-bezier(.2,1.3,.4,1); }
.picker-card .h3 { font-size: 24px; margin-bottom: 12px; }
.picker-list { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.swatch { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--ink); padding: 0; cursor: pointer; background: linear-gradient(180deg, var(--a) 0 46%, var(--b) 46% 100%); box-shadow: 0 3px 0 var(--ink); position: relative; transition: transform .12s; }
.swatch span { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); }
.swatch[aria-checked='true'] { transform: translateY(-4px) scale(1.08); box-shadow: 0 7px 0 var(--ink), 0 0 0 4px #fff, 0 0 0 6px var(--ink); }
body.picking #hud .dock, body.picking #hud .hud-tl, body.picking #hud .touch-ctl, body.picking #hud .coach { visibility: hidden; }

/* ── loader ── */
.loader { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--sky); transition: opacity .5s, visibility .5s; }
.loader.out { opacity: 0; visibility: hidden; }
.loader[hidden] { display: none; }
.ld-art { position: absolute; inset: 0; }
.ld-art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05); }
.ld-art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(191,230,255,.35), rgba(191,230,255,.75)); }
.ld-card { position: relative; width: min(420px, 100%); text-align: center; padding: 24px 22px 20px; }
.ld-logo { width: 72px; height: 72px; margin: -58px auto 6px; background: #fff; border: 3px solid var(--ink); border-radius: 50%; padding: 6px; box-shadow: 0 4px 0 var(--ink); animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-6deg); } }
.ld-title { margin: 6px 0 16px; font: 800 26px/1.05 var(--f-display); letter-spacing: -.01em; }
.ld-bar { height: 18px; border-radius: 999px; border: 2px solid var(--ink); background: var(--sky-2); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--grass) 0 10px, #74d79d 10px 20px); border-right: 2px solid var(--ink); transition: width .3s; }
.ld-step { margin: 8px 0 12px; font-weight: 800; font-size: 14px; color: var(--ink-2); }
#ld-play { min-width: 180px; margin-bottom: 14px; }
#ld-play[hidden] { display: none; }
.ld-tip { margin: 0; font-size: 13px; color: var(--ink-2); text-align: left; background: var(--panel-2); border-radius: 14px; padding: 10px 12px; border: 1.5px solid var(--line-2); }
.ld-tip b { display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 999px; background: var(--sun); border: 1.5px solid var(--ink); font-size: 11px; color: var(--ink); }

/* ── responsive ── */
@media (max-width: 1100px) { .cd-mini { display: none; } }
@media (max-width: 900px) { .tb-social { display: none; } }
@media (max-width: 720px) {
  #hud { font-size: 14px; }
  .tokenbar { position: fixed; top: var(--safe-t); left: var(--safe-l); right: var(--safe-r); justify-content: space-between; }
  .tokenbar .ca-mini { flex: 0 1 auto; min-width: 0; }
  .tb-buy { min-height: 42px; padding: 4px 12px; }
  .hud-tl, .hud-tr { top: calc(var(--safe-t) + 54px); }
  .hud-tl { max-width: calc(100% - 130px); gap: 8px; }
  .tchip { padding: 4px 6px 4px 4px; gap: 8px; }
  .tchip-logo { width: 34px; height: 34px; }
  .tchip-id > b { font-size: 14px; max-width: 12ch; }
  .tchip-id > span { font-size: 12px; }
  .tchip .btn-sm { min-height: 30px; padding: 4px 9px; font-size: 12px; }
  .cap-pill { padding: 2px 8px 2px 3px; }
  .cap-pill svg { width: 22px; height: 22px; }
  .cap-pill b { font-size: 13px; }
  .caps-reset { font-size: 11px; }
  .ticker { display: none; }
  .ticker .tk:first-child { display: block; }
  .hud-tr { gap: 10px; }
  .minimap { width: 92px; height: 92px; border-width: 2.5px; }
  .dock { left: var(--safe-l); right: var(--safe-r); transform: none; justify-content: space-between; gap: 2px; padding: 6px; border-radius: 22px; }
  .dock button { min-width: 0; flex: 1; font-size: 10.5px; padding: 2px 0; }
  .dock i { width: 40px; height: 40px; border-radius: 12px; }
  .dock i svg { width: 21px; height: 21px; }
  .prompt { bottom: calc(var(--safe-b) + 84px); max-width: calc(100% - 32px); font-size: 13px; }
  .coach { bottom: calc(var(--safe-b) + 84px); }
  .joy { bottom: calc(var(--safe-b) + 82px); width: 118px; height: 118px; }
  .act { bottom: calc(var(--safe-b) + 92px); width: 84px; height: 84px; }
  body.touch .prompt { bottom: calc(var(--safe-b) + 214px); }
  body.touch .coach { bottom: calc(var(--safe-b) + 210px); }
  .enc-card { top: var(--safe-t); right: var(--safe-r); left: var(--safe-l); width: auto; transform: none; padding: 12px; animation: card-in-m .35s cubic-bezier(.2,1.3,.4,1); }
  @keyframes card-in-m { from { transform: translateY(-20px); opacity: 0; } }
  .enc-portrait { width: 64px; height: 64px; border-radius: 18px; }
  .enc-name { font-size: 18px; }
  .enc-stats { grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0 4px; }
  .enc-stats div { padding: 4px 6px; }
  .enc-stats dd { font-size: 12.5px; }
  .enc-first { margin: 2px 0 6px; font-size: 12px; }
  .enc-buy { min-height: 32px; font-size: 13px; }
  .enc-throw { min-width: 0; flex: 1; }
  .enc-btns { width: 100%; }
  .ball-opt { padding: 4px 8px 4px 4px; font-size: 12px; }
  .ball-opt span { display: none; }
  .qpop, .ring-hint { top: 44%; }
  .sheet-wrap { place-items: end center; padding: 0; }
  .sheet { width: 100%; max-height: 82dvh; border-radius: 24px 24px 0 0; border-bottom: 0; box-shadow: 0 -4px 0 var(--ink); }
  .isle { top: 22%; width: calc(100% - 32px); }
  .offline { top: auto; bottom: calc(var(--safe-b) + 64px); font-size: 10px; }
  body.touch .offline { bottom: calc(var(--safe-b) + 210px); }
  body.in-enc .hud-tl, body.in-enc .hud-tr, body.in-enc .offline { display: none; }
}
@media (max-width: 380px) { .dock button span { font-size: 9.5px; } .cap-pill svg { width: 20px; height: 20px; } }
@media (prefers-reduced-motion: reduce) { .ld-logo { animation: none; } }

/* ── tap targets: compact visuals, ≥ 44 px hit areas ── */
.ca-mini [data-copy], .tchip .btn-sm, .coach .btn-sm, .ball-opt { position: relative; }
.ca-mini [data-copy]::after, .tchip .btn-sm::after, .coach .btn-sm::after { content: ''; position: absolute; inset: -7px -4px; }
.coach .btn-sm { min-height: 44px; }
.tchip .btn-sm { min-height: 40px; }
.ball-opt { min-height: 44px; }

/* ── very small phones (320–360 px) ── */
@media (max-width: 360px) {
  .tchip-logo { display: none; }
  .tchip { padding-left: 10px; }
  .tchip-id > b { max-width: 9ch; }
  .tchip .btn-sm { padding: 4px 8px; font-size: 11.5px; }
  .hud-tl { max-width: calc(100% - 112px); }
  .minimap { width: 76px; height: 76px; }
  .sysbtns { gap: 6px; }
  .sysbtns .icon-btn { width: 42px; height: 42px; }
  .ca-mini .ca-addr { max-width: 70px; }
  .tb-buy { padding: 4px 10px; }
  .tb-buy .tb-buy-l { font-size: 13px; }
}

/* toasts float in the open sky under the top bar, never over the dock / joystick / throw button */
body.play .toast { top: calc(var(--safe-t) + 92px); bottom: auto; transform: translate(-50%, -12px); z-index: 120; }
body.play .toast.show { transform: translate(-50%, 0); }
@media (max-width: 720px) { body.play .toast { top: calc(var(--safe-t) + 214px); font-size: 14px; } body.play.in-enc .toast { top: auto; bottom: calc(var(--safe-b) + 176px); } }
