@font-face { font-family: 'Barlow'; src: url('../../assets/fonts/barlow-condensed-latin-800-italic.woff2') format('woff2'); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('../../assets/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM'; src: url('../../assets/fonts/dm-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM'; src: url('../../assets/fonts/dm-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root { --ink: #1c2240; --ink2: #5a6488; --panel: #ffffffee; --card: #eef4ff; --line: #d6e2fa; --sky: #3f9cff; --sun: #ffd23f; --sun2: #e0a800; --hot: #ff5a3c; --green: #3fbf6a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #6ec6ff; color: var(--ink); font-family: DM, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible + span { outline: 3px solid #ff5a3c; outline-offset: 3px; }
[hidden] { display: none !important; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.coin { display: inline-block; width: .8em; height: .8em; margin-right: 5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0 0 18%, #ffd23f 22% 60%, #d99a00 64%); box-shadow: inset 0 0 0 2px #c98d00; vertical-align: -1px; flex: none; font-style: normal; }
.back { position: fixed; top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); z-index: 6; padding: 10px 14px; border-radius: 999px; background: #ffffffe6; color: var(--ink); font-weight: 700; font-size: 13px; text-decoration: none; box-shadow: 0 6px 16px #0002; }
body:not(.ui-menu) .back { display: none; }

.panel { position: fixed; z-index: 5; top: 70px; right: 18px; bottom: 18px; width: min(410px, 42vw); overflow-y: auto; overscroll-behavior: contain; background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 26px; padding: 20px; box-shadow: 0 18px 50px #1c224055; border: 3px solid #fff; }
.panel.small { top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 24px); text-align: center; }
.logo { font: 800 italic 74px/.82 Barlow, sans-serif; display: flex; flex-direction: column; letter-spacing: -1px; }
.logo span { color: var(--sky); text-shadow: 3px 3px 0 #1c4a8a; }
.logo b { color: var(--hot); font-weight: 800; text-shadow: 3px 3px 0 #8a2a1a; }
.tag { margin: 10px 0 12px; color: var(--ink2); font-size: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border-radius: 999px; padding: 5px 12px; font: 800 italic 19px Barlow, sans-serif; }
.big { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 18px; border-radius: 18px; background: var(--card); font: 800 italic 36px/1 Barlow, sans-serif; letter-spacing: 1px; box-shadow: 0 6px 0 #c6d4f2; transition: transform .08s; }
.big.go { background: var(--sun); box-shadow: 0 6px 0 var(--sun2), 0 10px 24px #b0800044; }
.big span { font-size: .6em; }
.big:active { transform: translateY(4px); }
.goals { display: grid; gap: 6px; margin: 12px 0 4px; text-align: left; }
.goal { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; background: var(--card); border-radius: 14px; padding: 8px 10px; font-size: 13px; font-weight: 700; }
.goal > span { font-size: 20px; }
.goal small { display: block; color: var(--ink2); font-weight: 700; font-size: 11.5px; margin-top: 2px; }
.goal .bar { height: 6px; border-radius: 6px; background: #d6e2fa; overflow: hidden; margin-top: 4px; }
.goal .bar i { display: block; height: 100%; background: var(--green); }
.goal.done { background: #e2f7e8; }
.goal .skip { font-size: 11px; padding: 5px 8px; border-radius: 9px; background: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tile { background: var(--card); border-radius: 15px; padding: 10px 6px; font-weight: 700; font-size: 13px; }
.tile span { display: block; font-size: 22px; margin-bottom: 2px; }
.settings { display: grid; gap: 8px; margin-top: 10px; background: var(--card); border-radius: 15px; padding: 12px 14px; }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { width: 44px; height: 25px; border-radius: 999px; background: #c6d4f2; position: relative; flex: none; transition: background .2s; }
.switch > span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { left: 22px; }
.help { text-align: center; font-size: 11.5px; color: var(--ink2); margin: 12px 0 0; line-height: 1.5; }
.head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.head h2 { font: 800 italic 34px/1 Barlow, sans-serif; margin: 0; flex: 1; }
.panel.small h2 { font: 800 italic 46px/1 Barlow, sans-serif; margin: 0 0 10px; color: var(--hot); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: #fff; font: 800 18px Barlow, sans-serif; display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px #0002; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--card); padding: 4px; border-radius: 14px; margin-bottom: 10px; }
.tabs button { padding: 8px 2px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.tabs button.on { background: #fff; box-shadow: 0 2px 6px #0001; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.item { background: var(--card); border: 3px solid transparent; border-radius: 16px; padding: 6px 6px 8px; display: grid; justify-items: center; gap: 3px; }
.item canvas { width: 92px; height: 92px; }
.item b { font: 800 italic 16px/1.05 Barlow, sans-serif; text-align: center; }
.item small { font-size: 12px; font-weight: 700; display: flex; align-items: center; color: var(--ink2); }
.item.on { border-color: var(--green); background: #e2f7e8; }
.item.locked small { color: var(--ink); }
.up { grid-column: 1 / -1; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; background: var(--card); border-radius: 16px; padding: 10px 12px; text-align: left; }
.up > span { font-size: 28px; }
.up b { font: 800 italic 19px Barlow, sans-serif; display: block; }
.up small { font-size: 11.5px; color: var(--ink2); }
.pips { display: flex; gap: 3px; margin-top: 3px; }
.pips i { width: 18px; height: 6px; border-radius: 4px; background: #c6d4f2; }
.pips i.on { background: var(--sun2); }
.btn { border-radius: 12px; padding: 9px 12px; font-weight: 700; font-size: 13px; background: var(--sun); box-shadow: 0 3px 0 var(--sun2); display: inline-flex; align-items: center; white-space: nowrap; }

#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
#hud .pause { position: absolute; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); pointer-events: auto; }
.dist { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 66px; color: #fff; text-shadow: 0 3px 0 #1c224088, 0 0 10px #0004; display: flex; align-items: baseline; gap: 3px; }
.dist b { font: 800 italic 48px/1 Barlow, sans-serif; }
.dist small { font: 800 italic 22px Barlow, sans-serif; }
.coins { position: absolute; top: max(62px, calc(env(safe-area-inset-top) + 54px)); left: 68px; color: #fff; text-shadow: 0 2px 0 #1c224088; font: 800 italic 26px Barlow, sans-serif; display: flex; align-items: center; }
.powers { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); display: flex; gap: 6px; }
.pw { width: 46px; height: 46px; border-radius: 50%; background: #ffffffd0; display: grid; place-items: center; font-size: 22px; position: relative; box-shadow: 0 3px 10px #0003; }
.pw i { position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(#3fbf6a var(--p), transparent 0); -webkit-mask: radial-gradient(circle, transparent 23px, #000 24px); mask: radial-gradient(circle, transparent 23px, #000 24px); }
.hint { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); color: #fff; font: 800 italic 30px Barlow, sans-serif; text-shadow: 0 3px 0 #1c224088; text-align: center; transition: opacity .4s; white-space: nowrap; }
.goal-pop { position: absolute; top: 22%; left: 50%; transform: translate(-50%, -10px); background: #fff; border-radius: 16px; padding: 10px 16px; font-weight: 700; font-size: 14px; box-shadow: 0 10px 26px #0003; opacity: 0; transition: opacity .3s, transform .3s; white-space: nowrap; }
.goal-pop.on { opacity: 1; transform: translate(-50%, 0); }
.turn { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #ffffffd8; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }

.res-dist { font: 800 italic 80px/1 Barlow, sans-serif; color: var(--ink); }
.res-dist small { font-size: .4em; }
.res-line { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; font-weight: 700; margin: 6px 0 10px; }
.res-line .new { color: #e0a800; }

#banner { position: fixed; left: 50%; top: 32%; transform: translate(-50%, -50%) scale(.9); z-index: 8; text-align: center; color: #fff; pointer-events: none; opacity: 0; transition: opacity .3s, transform .3s; text-shadow: 0 4px 0 #1c2240aa; }
#banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner small { display: block; font: 700 16px Barlow, sans-serif; letter-spacing: 4px; }
#banner b { display: block; font: 800 italic clamp(50px, 10vw, 96px)/.95 Barlow, sans-serif; }
#toasts { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 9; display: grid; gap: 8px; pointer-events: none; width: min(420px, calc(100vw - 24px)); }
.toast { background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: 0 10px 26px #0003; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; animation: tin .3s ease; }
.toast > span { font-size: 22px; }
.toast small { display: block; font-weight: 400; color: var(--ink2); font-size: 12px; }
.toast.out { animation: tout .35s ease forwards; }
@keyframes tin { from { transform: translateY(12px); opacity: 0; } }
@keyframes tout { to { transform: translateY(12px); opacity: 0; } }

@media (max-width: 760px) and (orientation: portrait) {
  .panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 60vh; padding: 16px; }
  .panel.small { max-height: 80vh; }
  .logo { font-size: 56px; flex-direction: row; gap: 8px; }
  .tag { margin: 6px 0 10px; }
  .big { font-size: 30px; padding: 12px; }
  .dist b { font-size: 40px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .panel { top: 8px; bottom: 8px; right: 8px; width: min(380px, 48vw); padding: 14px; }
  .logo { font-size: 48px; flex-direction: row; gap: 8px; }
  .tag { display: none; }
  .big { font-size: 26px; padding: 10px; }
  .dist b { font-size: 36px; }
  .coins { top: 48px; font-size: 22px; }
  .pw { width: 38px; height: 38px; font-size: 18px; }
  .pw i { -webkit-mask: radial-gradient(circle, transparent 19px, #000 20px); mask: radial-gradient(circle, transparent 19px, #000 20px); }
}
