@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: #f4f1ff; --ink2: #b9b2dc; --panel: #160f38e6; --card: #2a2160; --card2: #362b78; --line: #ffffff22; --pink: #ff4fa8; --cyan: #3fe0ff; --sun: #ffd23f; --sun2: #d9a400; --green: #4fe08a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #120b2e; 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 var(--sun); outline-offset: 3px; }
[hidden] { display: none !important; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.gem { display: inline-block; width: .72em; height: .72em; margin-right: 6px; background: linear-gradient(135deg, #fff 0 12%, #ff8fd0 18% 48%, #ff2f98 52% 100%); transform: rotate(45deg); border-radius: 2px; box-shadow: 0 0 8px #ff4fa888; 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: #160f38d8; color: var(--ink); font-weight: 700; font-size: 13px; text-decoration: none; box-shadow: 0 6px 16px #0006; border: 1px solid var(--line); }
body:not(.ui-menu) .back { display: none; }

.panel { position: fixed; z-index: 5; top: 70px; right: 18px; bottom: 18px; width: min(420px, 42vw); overflow-y: auto; overscroll-behavior: contain; background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 26px; padding: 20px; box-shadow: 0 18px 60px #0009; border: 1px solid #ffffff2a; }
.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 76px/.82 Barlow, sans-serif; display: flex; flex-direction: column; letter-spacing: -1px; }
.logo span { color: var(--cyan); text-shadow: 3px 3px 0 #1d4f8a, 0 0 24px #3fe0ff66; }
.logo b { color: var(--pink); font-weight: 800; text-shadow: 3px 3px 0 #7a1a52, 0 0 24px #ff4fa866; }
.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; color: var(--sun); }
.chip b { color: var(--ink); font-weight: 800; }
.chip small { color: var(--ink2); font-size: 14px; }
.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 #160f38; transition: transform .08s; text-decoration: none; color: var(--ink); }
.big.go { background: var(--sun); color: #2a1a00; box-shadow: 0 6px 0 var(--sun2), 0 10px 26px #ffd23f33; }
.big span { font-size: .6em; }
.big:active { transform: translateY(4px); }
.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; border: 1px solid var(--line); }
.tile span { display: block; font-size: 24px; margin-bottom: 2px; }
.tile small { display: block; color: var(--ink2); font-size: 11px; font-weight: 700; margin-top: 2px; }
.wide-tile { width: 100%; margin-top: 8px; padding: 9px; }
.settings { display: grid; gap: 9px; margin-top: 8px; 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: #4a3f8a; 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: 12px; }
.head h2 { font: 800 italic 34px/1 Barlow, sans-serif; margin: 0; flex: 1; }
.panel.small h2 { font: 800 italic 48px/1 Barlow, sans-serif; margin: 0 0 10px; color: var(--sun); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--card2); font: 800 18px Barlow, sans-serif; display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px #0005; border: 1px solid var(--line); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #0d0826; padding: 4px; border-radius: 14px; margin-bottom: 10px; }
.tabs.two-tabs { grid-template-columns: 1fr 1fr; }
.tabs button { padding: 8px 2px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--ink2); }
.tabs button.on { background: var(--card2); color: var(--ink); box-shadow: 0 2px 8px #0004; }
.tabs button small { display: block; font-size: 10.5px; opacity: .8; }
.world-info { font-size: 13px; color: var(--ink2); margin: 0 0 10px; line-height: 1.45; min-height: 38px; }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lvl { aspect-ratio: 1 / 1.05; border-radius: 16px; background: var(--card); border: 2px solid var(--line); display: grid; place-content: center; gap: 2px; text-align: center; }
.lvl b { font: 800 italic 30px/1 Barlow, sans-serif; }
.lvl small { font-size: 13px; letter-spacing: 1px; color: #6a5fa8; }
.lvl small i { font-style: normal; color: var(--sun); }
.lvl.locked { opacity: .45; }
.lvl.next { border-color: var(--sun); box-shadow: 0 0 18px #ffd23f44; }
.lvl .shape { font-size: 10px; color: var(--ink2); letter-spacing: 0; }
.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: 10px 6px; display: grid; justify-items: center; gap: 4px; }
.item .pic { font-size: 40px; line-height: 1; }
.item .sw { width: 42px; height: 42px; border-radius: 50%; box-shadow: inset -6px -6px 0 #0003, 0 0 0 3px #ffffff33; }
.item b { font: 800 italic 17px/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: #1f4a49; }
.item.locked small { color: var(--sun); }

#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; }
.track { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(420px, 46vw); text-align: center; }
.track-label { font: 800 italic 18px Barlow, sans-serif; letter-spacing: 1px; color: #fff; text-shadow: 0 2px 6px #000a; margin-bottom: 5px; white-space: nowrap; }
.track .bar { position: relative; height: 12px; border-radius: 8px; background: #0008; border: 1px solid #ffffff44; }
.track .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: linear-gradient(90deg, var(--cyan), var(--pink)); }
.track .bar b { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; }
#hTicks span { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; background: #7fe9ff; border-radius: 2px; }
#hTicks span.on { background: var(--green); }
.loot { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); text-align: right; color: #fff; text-shadow: 0 2px 6px #000a; }
.gems { font: 800 italic 30px/1 Barlow, sans-serif; display: flex; align-items: center; justify-content: flex-end; }
.cry { display: flex; gap: 5px; justify-content: flex-end; margin-top: 6px; }
.cry i { width: 18px; height: 22px; clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); background: #ffffff33; }
.cry i.on { background: linear-gradient(160deg, #fff6b0, #ffc21f 55%, #e08a00); filter: drop-shadow(0 0 6px #ffd23f); }
.hearts { font-size: 22px; margin-top: 4px; letter-spacing: 2px; }
.hint { position: absolute; left: 50%; top: max(84px, calc(env(safe-area-inset-top) + 76px)); transform: translateX(-50%); color: #fff; font: 800 italic 30px/1.1 Barlow, sans-serif; text-shadow: 0 3px 0 #160f38, 0 0 18px #000c; text-align: center; transition: opacity .4s; width: min(640px, 90vw); opacity: 0; }
#flash { position: fixed; inset: 0; z-index: 4; background: #fff; opacity: 0; pointer-events: none; }

#touch { position: fixed; inset: auto 0 0 0; z-index: 4; pointer-events: none; padding: 0 max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: flex-end; }
#touch button { pointer-events: auto; touch-action: none; border-radius: 26px; background: #ffffff26; border: 2px solid #ffffff55; color: #fff; font: 800 italic 34px Barlow, sans-serif; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
#touch button.down { background: #ffffff66; transform: scale(.96); }
.pad-lr { display: flex; gap: 12px; }
#tL, #tR { width: 92px; height: 92px; }
#tJ { width: 150px; height: 104px; letter-spacing: 2px; font-size: 30px; }

.pause-info { color: var(--ink2); font-size: 14px; margin: -2px 0 14px; }
.res-stars { font-size: 54px; letter-spacing: 6px; margin: 2px 0 6px; }
.res-stars i { font-style: normal; color: #ffffff2a; display: inline-block; }
.res-stars i.on { color: var(--sun); text-shadow: 0 0 18px #ffd23f99; animation: pop .5s backwards; }
.res-stars i:nth-child(2) { animation-delay: .25s; }
.res-stars i:nth-child(3) { animation-delay: .5s; }
@keyframes pop { from { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.3); } }
.res-rows { display: grid; gap: 6px; margin: 4px 0 14px; text-align: left; }
.res-rows div { display: flex; justify-content: space-between; align-items: center; background: var(--card); border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: 14px; }
.res-rows div b { font: 800 italic 20px Barlow, sans-serif; display: flex; align-items: center; }
.res-rows .yes { color: var(--green); }
.res-big { font: 800 italic 76px/1 Barlow, sans-serif; }
.res-big small { font-size: .4em; }
.res-note { color: var(--sun); font-weight: 700; margin: 2px 0 12px; }

#banner { position: fixed; left: 50%; top: 42%; 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 #160f38, 0 0 24px #000a; }
#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(46px, 9vw, 92px)/.95 Barlow, sans-serif; white-space: nowrap; }
#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)); }
body.touch-play #toasts { bottom: 130px; }
.toast { background: #221a52; border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; box-shadow: 0 10px 26px #0006; 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: 62vh; padding: 16px; }
  .panel.small { max-height: 84vh; }
  .logo { font-size: 58px; flex-direction: row; gap: 8px; }
  .tag { margin: 6px 0 10px; }
  .big { font-size: 30px; padding: 12px; }
  .track { width: 52vw; left: auto; right: 14px; transform: none; top: max(64px, calc(env(safe-area-inset-top) + 56px)); }
  .track-label { font-size: 15px; text-align: right; }
  .loot { top: max(12px, env(safe-area-inset-top)); }
  .gems { font-size: 26px; }
  .hint { font-size: 24px; top: max(124px, calc(env(safe-area-inset-top) + 116px)); }
  #tL, #tR { width: 76px; height: 84px; }
  #tJ { width: 118px; height: 96px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .panel { top: 8px; bottom: 8px; right: 8px; width: min(380px, 48vw); padding: 14px; }
  .logo { font-size: 50px; flex-direction: row; gap: 8px; }
  .tag { display: none; }
  .big { font-size: 26px; padding: 10px; }
  .levels { gap: 6px; }
  .lvl b { font-size: 24px; }
  .track-label { font-size: 14px; }
  .gems { font-size: 24px; }
  .hint { font-size: 22px; top: 66px; }
  #tL, #tR { width: 78px; height: 78px; }
  #tJ { width: 128px; height: 86px; }
  .panel.small { padding: 12px 16px; width: min(540px, calc(100vw - 24px)); }
  .panel.small h2 { font-size: 32px; margin-bottom: 2px; }
  .res-stars { font-size: 34px; margin: 0; }
  .res-rows { grid-template-columns: 1fr 1fr; gap: 5px; margin: 4px 0 8px; }
  .res-rows div { padding: 5px 10px; font-size: 12.5px; }
  .res-rows div b { font-size: 17px; }
  .res-note { margin: 0 0 6px; font-size: 13px; }
  .res-big { font-size: 50px; }
  .panel.small .two { margin-top: 6px; }
  .panel.small .tile { padding: 6px; }
  .panel.small .tile span { font-size: 18px; }
  .pause-info { margin-bottom: 8px; }
}
