*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fdf3e1;
  --bg2: #f9e8c9;
  --panel: #fffaf1;
  --card: #ffffff;
  --sand: #f6e8cf;
  --sand2: #efdcbb;
  --line: rgba(122,86,44,.13);
  --line2: rgba(122,86,44,.24);
  --text: #4a3426;
  --muted: #8f7660;
  --dim: #bea98f;
  --accent: #ffbe3b;
  --accent-d: #e0951a;
  --accent-ink: #4a2c05;
  --accent-h: #3d8fe0;
  --sky: #3d8fe0;
  --sky-d: #2a6cb3;
  --leaf: #5cb85c;
  --leaf-d: #3f8f3f;
  --gold: #f2b636;
  --red: #ef5f67;
  --red-d: #c2414a;
  --green: #4fae55;
  --font: "Nunito", ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --disp: var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --base: 0 4px 0 var(--sand2);
  --soft: 0 14px 40px rgba(120,80,30,.16);
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px);
  --sa-r: env(safe-area-inset-right, 0px);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 600 15px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  position: fixed;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
svg { display: block; fill: currentColor; }
.hidden { display: none !important; }
input { -webkit-user-select: text; user-select: text; }

#app { position: fixed; top: 0; right: 0; bottom: 0; left: 0; }
.screen { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; flex-direction: column; background: radial-gradient(circle at 15% 0%, #fff8ea 0, transparent 45%), radial-gradient(circle at 100% 100%, #f8e2c0 0, transparent 50%), var(--bg); }
.screen.active { display: flex; }

.coin { width: 13px; height: 13px; border-radius: 50%; background: var(--gold); box-shadow: inset -2px -2px 0 rgba(160,100,10,.35); flex-shrink: 0; display: inline-block; }
.gem { width: 11px; height: 11px; background: var(--gold); border-radius: 3px; transform: rotate(45deg); flex-shrink: 0; display: inline-block; }

.chunky {
  font: 800 17px/1 var(--font);
  color: var(--text); background: var(--card);
  border: 1.5px solid var(--line2);
  box-shadow: 0 4px 0 var(--sand2);
  border-radius: 16px;
  padding: 14px 26px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .08s, box-shadow .08s, background .15s, filter .15s;
  position: relative; white-space: nowrap;
}
.chunky svg { width: 18px; height: 18px; }
.chunky:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--sand2); }
.chunky.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 4px 0 var(--accent-d); }
.chunky.primary:active:not(:disabled) { box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 1px 0 var(--accent-d); }
.chunky.yellow { background: var(--sky); color: #fff; border-color: transparent; box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 4px 0 var(--sky-d); }
.chunky.yellow:active:not(:disabled) { box-shadow: 0 1px 0 var(--sky-d); }
.chunky.yellow small { font: 700 12px var(--font); display: block; opacity: .85; margin-top: 4px; }
.chunky.red { background: var(--red); color: #fff; border-color: transparent; box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 4px 0 var(--red-d); }
.chunky.red:active:not(:disabled) { box-shadow: 0 1px 0 var(--red-d); }
.chunky:disabled { opacity: .45; filter: saturate(.6); }
.chunky.small { font-size: 14px; padding: 10px 16px; border-radius: 13px; }
.chunky.small svg { width: 15px; height: 15px; }
.chunky.back { gap: 6px; padding-left: 13px; }
.chunky.danger { color: var(--red); }
.chunky.wide { min-width: 210px; }
.chunky.big { font-size: 20px; padding: 17px 30px; border-radius: 18px; }

#menu-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; }
.menu-top { position: absolute; top: calc(14px + var(--sa-t)); right: calc(18px + var(--sa-r)); z-index: 5; }
.menu-center { position: relative; z-index: 2; margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px; }
#logo-ball { width: 118px; height: 118px; cursor: pointer; touch-action: manipulation; }
.logo {
  font: 900 clamp(64px, 11vw, 110px)/0.95 var(--font);
  letter-spacing: -.02em; color: var(--text);
  text-shadow: 0 5px 0 #f2c86a;
  display: flex;
}
.logo span { display: inline-block; animation: bounce 2.8s ease-in-out infinite; }
.logo { color: #f2a516; text-shadow: 0 5px 0 #c47a0a, 0 10px 18px rgba(150,90,10,.18); }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 12% { transform: translateY(-10px); } 24% { transform: translateY(0); } 34% { transform: translateY(-4px); } 46% { transform: translateY(0); } }
.sticker {
  font: 800 15px var(--font);
  background: var(--card); color: var(--muted);
  padding: 6px 16px; border-radius: 999px;
  border: 1.5px solid var(--line2);
}
.menu-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 22px; }
.menu-actions > .chunky { min-width: 250px; }
.tile-row { display: flex; gap: 12px; }
.tile {
  width: 94px; height: 80px;
  background: var(--card); border: 1.5px solid var(--line2); border-radius: 20px;
  box-shadow: var(--base);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  font: 800 13px var(--font); color: var(--muted);
  position: relative; transition: transform .08s, box-shadow .08s, color .15s;
}
.tile svg { width: 24px; height: 24px; color: #e89b1c; }
#m-vs svg { color: var(--sky); }
#m-ranks svg { color: var(--gold); }
#m-settings svg { color: var(--muted); }
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sand2); color: var(--text); }
.tile .dot { position: absolute; top: 9px; right: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px #fff; }
.version { position: absolute; bottom: calc(14px + var(--sa-b)); left: calc(18px + var(--sa-l)); font: 700 12px var(--font); color: var(--dim); z-index: 5; }

.modal { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; background: rgba(90,60,30,.32); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 18px; }
.sheet {
  background: var(--panel); border: 1.5px solid var(--line);
  box-shadow: var(--soft); border-radius: 26px;
  padding: 22px 24px; width: min(500px, 94vw); max-height: calc(100vh - 60px); overflow-y: auto;
  animation: sheetIn .26s cubic-bezier(.2,1.25,.4,1);
}
@keyframes sheetIn { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sheet-head h2 { font: 900 26px var(--font); }
.field { margin-bottom: 14px; }
.field label { display: block; font: 800 13px var(--font); color: var(--muted); margin-bottom: 7px; }
.field input, .vs-card input, .submit input {
  width: 100%; height: 48px; border-radius: 14px; border: 1.5px solid var(--line2);
  background: var(--card); color: var(--text);
  font: 700 16px var(--font); padding: 0 15px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .vs-card input::placeholder { color: var(--dim); }
.field input:focus, .vs-card input:focus, .submit input:focus { border-color: var(--accent-d); box-shadow: 0 0 0 4px rgba(255,190,59,.3); }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 12px 14px; font: 700 14px var(--font);
  transition: transform .08s, background .15s;
}
.opt:active { transform: scale(.98); }
.opt b { width: 48px; height: 28px; border-radius: 999px; background: var(--sand2); position: relative; flex-shrink: 0; transition: background .18s; }
.opt b::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(90,60,20,.2); transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.opt.on b { background: var(--leaf); }
.opt.on b::after { transform: translateX(20px); }
.howto { margin-top: 20px; border-top: 1.5px dashed var(--line2); padding-top: 16px; }
.howto h3 { font: 900 16px var(--font); color: var(--text); margin-bottom: 10px; }
.howto ol { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.howto li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.howto li b { font: 900 12px var(--font); color: var(--accent-ink); background: var(--accent); flex-shrink: 0; width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; }
.sheet-foot { display: flex; gap: 10px; margin-top: 20px; }
.sheet-foot .chunky { flex: 1; }

.bar {
  height: calc(64px + var(--sa-t)); padding: var(--sa-t) calc(16px + var(--sa-r)) 0 calc(16px + var(--sa-l));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0;
}
.bar > :first-child, .bar > :last-child { min-width: 110px; }
.bar > :last-child { display: flex; justify-content: flex-end; }
.bar h2 { font: 900 24px var(--font); }
.pill {
  height: 40px; padding: 0 15px; border-radius: 999px;
  background: var(--card); border: 1.5px solid var(--line2); box-shadow: 0 3px 0 var(--sand2);
  display: flex; align-items: center; gap: 8px;
  font: 800 15px var(--font); font-variant-numeric: tabular-nums; color: var(--text);
}
.pill svg { width: 14px; height: 14px; color: var(--muted); }
.c-blue { color: var(--sky) !important; }
.c-red { color: var(--red) !important; }
.c-gold { color: #c98a0e; }

.md-label { font: 900 13px var(--font); color: var(--muted); margin: 2px 2px 8px; letter-spacing: .02em; }
.diff-note { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.split { flex: 1; display: flex; min-height: 0; }

.maps-wrap { flex: 1; display: flex; gap: 18px; min-height: 0; padding: 4px calc(18px + var(--sa-r)) calc(18px + var(--sa-b)) calc(18px + var(--sa-l)); }
.map-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-content: start; overflow-y: auto; padding: 4px 4px 12px; min-width: 0; }
.map-tile { display: flex; flex-direction: column; background: var(--card); border: 2px solid transparent; border-radius: 18px; box-shadow: var(--base), 0 0 0 1.5px var(--line) inset; overflow: hidden; text-align: left; transition: transform .1s, border-color .15s; }
.map-tile:active { transform: scale(.97); }
.map-tile.active { border-color: var(--accent-d); box-shadow: 0 4px 0 var(--accent-d); }
.mt-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--sand); }
.mt-cv { width: 100%; height: 100%; display: block; }
.map-tile.locked .mt-cv { filter: saturate(.35) brightness(1.08); }
.mt-lock { position: absolute; inset: 0; display: grid; place-items: center; }
.mt-lock svg { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: rgba(255,250,240,.92); color: var(--muted); box-shadow: 0 3px 8px rgba(90,60,20,.2); }
.mt-info { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px 10px; }
.mt-info b { font: 800 14.5px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-info .price { font-size: 13px; }
.mt-best { display: inline-flex; align-items: center; gap: 4px; font: 800 12px var(--font); color: #c98a0e; white-space: nowrap; }
.mt-new { font: 800 11px var(--font); color: var(--leaf-d); background: rgba(92,184,92,.15); padding: 2px 8px; border-radius: 999px; }
.map-detail { width: min(430px, 42vw); flex-shrink: 0; background: var(--panel); border: 1.5px solid var(--line); border-radius: 26px; box-shadow: var(--soft); padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.md-prev { position: relative; }
#map-preview { width: 100%; height: auto; border-radius: 16px; display: block; background: var(--sand); }
.md-best { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; font: 800 13px var(--font); color: var(--muted); background: rgba(255,250,240,.94); padding: 5px 11px; border-radius: 999px; }
.md-best.has { color: #b67a07; }
.map-meta h3 { font: 900 26px/1.1 var(--font); }
.map-meta p { color: var(--muted); margin-top: 3px; }
.diff-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dcard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); transition: border-color .15s, background .15s, transform .08s; }
.dcard:active { transform: scale(.96); }
.dcard b { font: 900 14px var(--font); color: var(--dc); }
.dcard small { font: 700 11.5px var(--font); color: var(--muted); }
.dcard.active { border-color: var(--dc); background: color-mix(in srgb, var(--dc) 13%, white); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line2); font: 800 13.5px var(--font); color: var(--muted); transition: background .15s, color .15s, border-color .15s; }
.chips button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.map-detail .chunky.big { margin-top: auto; width: 100%; }

.seg { display: inline-flex; background: var(--sand); border-radius: 15px; padding: 4px; gap: 3px; }
.seg button { padding: 9px 16px; border-radius: 11px; color: var(--muted); font: 800 14px var(--font); transition: color .15s, background .15s; }
.seg button:active { background: rgba(255,255,255,.6); }
.seg button.active { background: var(--card); color: var(--text); box-shadow: 0 2px 0 var(--sand2), 0 0 0 1.5px var(--line2); }

.tabs-wrap { padding: 2px calc(20px + var(--sa-r)) 0 calc(20px + var(--sa-l)); flex-shrink: 0; display: flex; justify-content: center; }
.scroll-body { flex: 1; overflow-y: auto; padding: 16px calc(20px + var(--sa-r)) calc(32px + var(--sa-b)) calc(20px + var(--sa-l)); -webkit-overflow-scrolling: touch; }
.section-note { color: var(--muted); font-size: 14px; margin: 0 auto 16px; max-width: 1020px; text-align: center; }
.pips { display: flex; gap: 5px; margin-top: 4px; }
.pips i { flex: 1; max-width: 26px; height: 8px; background: var(--sand2); border-radius: 4px; }
.pips i.on { background: var(--sky); }
.price { display: inline-flex; align-items: center; gap: 6px; font: 900 15px var(--font); }
.price .coin { width: 12px; height: 12px; }
.progress { height: 8px; background: var(--sand2); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.progress.big { height: 14px; }

.rank-wrap { flex: 1; overflow-y: auto; padding: 6px calc(18px + var(--sa-r)) calc(24px + var(--sa-b)) calc(18px + var(--sa-l)); }
.rank-inner { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.rank-pick { background: var(--panel); border: 1.5px solid var(--line); border-radius: 24px; padding: 14px 16px 16px; box-shadow: var(--soft); display: flex; flex-direction: column; gap: 14px; }
.rp-row { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rp-row.two { flex-direction: row; flex-wrap: wrap; gap: 18px; }
.rp-row.two > div { display: flex; flex-direction: column; gap: 8px; }
.rp-label { font: 900 13px var(--font); color: var(--muted); }
.rank-maps { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.rmap { flex-shrink: 0; width: 132px; display: flex; flex-direction: column; gap: 6px; padding: 5px 5px 8px; border-radius: 16px; background: var(--card); border: 2px solid var(--line); text-align: left; transition: border-color .15s, transform .08s; }
.rmap:active { transform: scale(.97); }
.rmap-t { display: block; aspect-ratio: 16 / 9; border-radius: 11px; overflow: hidden; background: var(--sand); }
.rmap-t canvas { width: 100%; height: 100%; display: block; }
.rmap b { font: 800 13px var(--font); color: var(--muted); padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmap.active { border-color: var(--accent-d); box-shadow: 0 3px 0 var(--accent-d); }
.rmap.active b { color: var(--text); }
.rank-board { background: var(--panel); border: 1.5px solid var(--line); border-radius: 24px; padding: 18px 18px 14px; box-shadow: var(--soft); }
.rb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rb-head h3 { font: 900 26px/1.1 var(--font); }
.rb-head p { font: 700 14px var(--font); color: var(--muted); margin-top: 3px; }
.rank-status { font: 800 12px var(--font); color: var(--leaf-d); background: rgba(92,184,92,.14); padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.rank-status.off { color: var(--muted); background: var(--sand); }
.rank-main { max-width: 760px; margin: 0 auto; padding: 0 4px calc(24px + var(--sa-b)); }
.rank-main.solo .rank-status { display: block; width: max-content; margin: 0 auto 6px; }
.rank-list { margin: 6px auto 0; max-width: 760px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding-top: 16px; }
.pod { flex: 1; max-width: 210px; display: flex; flex-direction: column; align-items: center; text-align: center; animation: popUp .4s cubic-bezier(.2,1.4,.4,1) backwards; }
.pod.p1 { animation-delay: .05s; } .pod.p2 { animation-delay: .15s; } .pod.p3 { animation-delay: .25s; }
.pod-medal { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: 900 20px var(--font); color: #fff; box-shadow: inset 0 -4px 0 rgba(0,0,0,.14), 0 3px 0 rgba(90,60,20,.18); margin-bottom: 8px; }
.pod.p1 .pod-medal { width: 56px; height: 56px; font-size: 24px; }
.pod-name { font: 900 16px var(--font); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-v { font: 900 26px var(--font); line-height: 1.15; }
.pod-v small { font: 800 12px var(--font); color: var(--muted); margin-left: 4px; }
.pod-sub { font: 700 12px var(--font); color: var(--muted); margin-bottom: 8px; }
.pod-step { width: 100%; border-radius: 16px 16px 0 0; background: var(--card); box-shadow: 0 0 0 1.5px var(--line2) inset; height: 56px; }
.pod.p1 .pod-step { height: 92px; background: linear-gradient(#fff4d2, #ffe8a6); }
.pod.p2 .pod-step { height: 70px; background: linear-gradient(#fbfbfc, #eceef2); }
.pod.p3 .pod-step { height: 50px; background: linear-gradient(#fff2e6, #f6dcc4); }
.pod.you .pod-name { color: #c98a0e; }
.rank-rest { display: flex; flex-direction: column; gap: 6px; background: var(--sand); border-radius: 0 0 20px 20px; padding: 10px; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--card); border-radius: 14px; }
.podium.n1, .podium.n2 { padding-bottom: 0; }
.rank-pos { font: 900 16px var(--font); width: 28px; color: var(--dim); }
.rank-name { flex: 1; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-wave { font: 900 18px var(--font); min-width: 74px; text-align: right; }
.rank-wave small { font: 800 12px var(--font); color: var(--muted); }
.rank-pops { font: 700 13px var(--font); color: var(--muted); text-align: right; }
.rank-row.you { box-shadow: 0 0 0 2px var(--accent) inset; }
.rank-empty { color: var(--muted); padding: 40px 12px; font-size: 14px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.rank-empty b { font: 900 18px var(--font); color: var(--text); }
.rank-empty.small { padding: 14px 4px; align-items: flex-start; text-align: left; }

#game { flex-direction: column; background: var(--bg); }
#game .stage { position: relative; background: var(--bg); overflow: hidden; flex: 1; }
#cv { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.hud-tl { position: absolute; top: calc(10px + var(--sa-t)); left: calc(12px + var(--sa-l)); display: flex; gap: 8px; z-index: 5; }
.hud-tr { position: absolute; top: calc(10px + var(--sa-t)); right: calc(12px + var(--sa-r)); display: flex; gap: 8px; z-index: 5; }
.hud-tl .pill, .hud-tr .rbtn { background: rgba(255,250,240,.94); }
.rbtn {
  width: 44px; height: 40px; border-radius: 999px;
  background: var(--card); border: 1.5px solid var(--line2); box-shadow: 0 3px 0 var(--sand2);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text);
  transition: transform .08s, box-shadow .08s;
}
.rbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sand2); }
.rbtn svg { width: 15px; height: 15px; }
.rbtn.wide { width: auto; padding: 0 14px; gap: 6px; font: 800 14px var(--font); }
.pill.bump, .rbtn.bump { animation: bump .25s; }
@keyframes bump { 30% { transform: scale(1.12); } }
.pill.low { border-color: var(--red); background: #ffe3e3 !important; animation: lowpulse 1s infinite; }
@keyframes lowpulse { 50% { transform: scale(1.07); } }

.effects { position: absolute; top: calc(60px + var(--sa-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; z-index: 5; }
.fx { background: rgba(255,250,240,.95); border: 1.5px solid var(--line2); border-radius: 12px; padding: 6px 11px 8px; font: 800 12px var(--font); min-width: 100px; }
.fx i { display: block; height: 5px; margin-top: 5px; border-radius: 3px; }

.banner { position: absolute; top: 32%; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 6; opacity: 0; }
.banner b { font: 900 54px var(--font); color: #fff; text-shadow: 0 4px 0 rgba(90,60,30,.55), 0 0 24px rgba(90,60,30,.35); display: block; }
.banner span { font: 800 17px var(--font); color: #fff; text-shadow: 0 2px 0 rgba(90,60,30,.55), 0 0 10px rgba(90,60,30,.4); }
.banner.show { animation: bannerIn 2.4s ease-out forwards; }
@keyframes bannerIn { 0% { opacity: 0; transform: translateY(24px) scale(.94); } 12% { opacity: 1; transform: none; } 78% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }
.banner.boss b { color: #ffd1d3; text-shadow: 0 4px 0 #a8343c, 0 0 24px rgba(168,52,60,.4); }

.toast, .gtoast { position: absolute; bottom: calc(118px + var(--sa-b)); left: 50%; transform: translate(-50%, 8px); opacity: 0; background: var(--text); color: #fff8ec; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 800; transition: opacity .18s, transform .18s; pointer-events: none; white-space: nowrap; z-index: 6; box-shadow: 0 8px 24px rgba(90,60,30,.25); }
.toast.show, .gtoast.show { opacity: 1; transform: translate(-50%, 0); }
.gtoast { position: fixed; bottom: calc(30px + var(--sa-b)); z-index: 850; }

.pop {
  position: absolute; z-index: 8; transform: translate(-50%, -100%);
  display: flex; align-items: stretch; gap: 8px; padding: 10px;
  background: var(--panel); border: 1.5px solid var(--line2);
  border-radius: 20px; box-shadow: var(--soft);
  animation: popIn .18s cubic-bezier(.2,1.4,.4,1);
}
.pop.below { transform: translate(-50%, 0); }
@keyframes popIn { from { transform: translate(-50%, -90%) scale(.8); opacity: 0; } }
.pop.below { animation-name: popInB; }
@keyframes popInB { from { transform: translate(-50%, 10%) scale(.8); opacity: 0; } }
.pop::after { content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 8px solid transparent; border-top: 8px solid var(--panel); border-bottom: 0; }
.pop.below::after { bottom: auto; top: -8px; border-top: 0; border-bottom: 8px solid var(--panel); }
.pop-info { min-width: 134px; padding: 2px 4px; }
.pop-name { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 900; font-size: 15px; }
.pop-lv { font: 800 11px var(--font); color: var(--accent-ink); background: var(--accent); padding: 2px 8px; border-radius: 999px; }
.pop-stats { display: grid; grid-template-columns: auto auto; gap: 2px 10px; font-size: 12.5px; margin-top: 7px; }
.pop-stats i { font-style: normal; color: var(--muted); }
.pop-stats b { text-align: right; font-weight: 800; }
.pop-stats b em { font-style: normal; color: var(--green); font-size: 11px; margin-left: 3px; }
.pbtn {
  min-width: 66px; padding: 8px 8px 9px; border-radius: 14px;
  background: var(--card); border: 1.5px solid var(--line2); box-shadow: 0 3px 0 var(--sand2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: 800 12px var(--font); color: var(--text);
  transition: transform .08s, box-shadow .08s;
}
.pbtn:active { transform: translateY(3px); box-shadow: none; }
.pbtn svg { width: 17px; height: 17px; color: var(--muted); }
.pbtn small { font: 700 11px var(--font); color: var(--muted); }
.pbtn.sell svg { color: var(--gold); }
.pbtn.up { background: var(--accent); border-color: transparent; box-shadow: 0 3px 0 var(--accent-d); }
.pbtn.up span, .pbtn.up svg { color: var(--accent-ink); }
.pbtn.up small { color: rgba(74,44,5,.7); }
.pbtn:disabled { opacity: .45; }

.overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(253,243,225,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 20; }
.ov-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; max-width: 92vw; }
.big-title { font: 900 58px/1 var(--font); color: var(--text); text-shadow: 0 4px 0 #f2c86a; animation: popUp .34s cubic-bezier(.2,1.4,.4,1); text-align: center; }
@keyframes popUp { from { transform: scale(.7); opacity: 0; } }
.big-title.red { color: var(--red); text-shadow: 0 4px 0 #f8c2c5; }
.ov-sub { font: 700 15px var(--font); color: var(--muted); text-align: center; }
.round-row { display: flex; gap: 18px; margin-top: 10px; }
.round { display: flex; flex-direction: column; align-items: center; gap: 8px; font: 800 13px var(--font); color: var(--muted); }
.round i { width: 74px; height: 74px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--line2); box-shadow: 0 5px 0 var(--sand2); display: grid; place-items: center; color: var(--text); transition: transform .08s, box-shadow .08s; }
.round i svg { width: 26px; height: 26px; }
.round:active i { transform: translateY(4px); box-shadow: 0 1px 0 var(--sand2); }
.round.primary { color: var(--text); }
.round.primary i { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 5px 0 var(--accent-d); }
.round.primary:active i { box-shadow: 0 1px 0 var(--accent-d); }
.text-btn { margin-top: 10px; font: 800 14px var(--font); color: var(--muted); padding: 8px 16px; border-radius: 999px; transition: background .15s, color .15s; }
.text-btn:active { background: var(--sand); color: var(--text); }
#over-ball { width: 76px; height: 76px; animation: obob .5s ease-in-out infinite alternate; }
@keyframes obob { to { transform: translateY(-12px) scale(1.04, .96); } }
.over-stats { display: flex; gap: 10px; }
.ostat { background: var(--card); border: 1.5px solid var(--line2); box-shadow: 0 3px 0 var(--sand2); border-radius: 18px; padding: 12px 18px; text-align: center; min-width: 94px; }
.ostat b { font: 900 26px var(--font); display: block; }
.ostat i { font: 800 12px var(--font); color: var(--muted); font-style: normal; }
.submit { display: flex; align-items: center; gap: 10px; margin-top: 4px; min-height: 40px; }
.submit input { width: 170px; height: 42px; }
.submit .done { font: 800 14px var(--font); color: var(--leaf-d); background: rgba(92,184,92,.14); padding: 6px 14px; border-radius: 999px; }

.tray {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: 6px calc(52px + var(--sa-r)) calc(6px + var(--sa-b)) calc(10px + var(--sa-l));
  background: var(--panel); border-top: 1.5px solid var(--line2); box-shadow: 0 -6px 20px rgba(120,80,30,.08);
}
.tray-towers { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 5px; }
.tray-towers::-webkit-scrollbar { display: none; }
.tray-sep { width: 1.5px; align-self: stretch; background: var(--line2); flex-shrink: 0; margin: 6px 2px; }
.tray-pots { display: flex; gap: 6px; }
.tray-wave { margin-left: auto; display: flex; align-items: center; }
.tray-wave > div:not(.hidden) { display: flex; align-items: center; gap: 10px; }
.tcard {
  width: 52px; flex-shrink: 0; padding: 4px 2px 4px; border-radius: 14px;
  background: var(--card); border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--sand2);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font: 900 12px var(--font); color: #c98a0e;
  transition: transform .08s, box-shadow .08s, border-color .15s, background .15s;
  touch-action: none; position: relative;
}
.tcard:active { transform: translateY(3px); box-shadow: none; }
.tcard.armed { border-color: var(--accent-d); background: #fff4d6; }
.tcard.poor { opacity: .42; }
.tcard canvas { width: 34px; height: 34px; }
.tcard .tn { display: none; }
.tcard .tc { font-size: 12px; line-height: 1.1; }
.pot {
  width: 46px; height: 52px; border-radius: 14px;
  background: var(--card); border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--sand2);
  position: relative; display: grid; place-items: center;
  transition: transform .08s, border-color .15s;
}
.pot:active:not(:disabled) { transform: translateY(3px); }
.pot:disabled { opacity: .4; }
.pot span { position: absolute; bottom: 3px; right: 7px; font: 900 12px var(--font); color: var(--text); }
.pot.active-fx, .pot.armed { border-color: var(--accent-d); background: #fff4d6; }
.wave-top { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.wave-preview { display: flex; gap: 8px; min-height: 18px; }
.wp { display: flex; align-items: center; gap: 4px; font: 800 12px var(--font); color: var(--muted); }
.wp.boss { color: var(--red); }
.auto-btn { font: 800 12px var(--font); color: var(--muted); background: var(--sand); border-radius: 999px; padding: 4px 11px; transition: background .15s, color .15s; }
.auto-btn.on { color: #fff; background: var(--leaf); }
.wave-btn { font-size: 16px; padding: 12px 20px; min-width: 160px; }

.vs-body { flex: 1; display: flex; align-items: stretch; justify-content: center; gap: 16px; padding: 8px calc(18px + var(--sa-r)) calc(18px + var(--sa-b)) calc(18px + var(--sa-l)); overflow-y: auto; }
.vs-col { width: min(440px, 46vw); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.vs-card { background: var(--panel); border: 1.5px solid var(--line); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--soft); }
.vs-card.grow { flex: 1; min-height: 0; }
.vs-card-t { font: 900 18px var(--font); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vs-card-t .text-btn { margin: -6px -8px -6px 0; }
.vs-card .field { margin: 0; flex: 1; }
.vs-card .seg { display: flex; flex-wrap: wrap; }
.vs-card .seg button { flex: 1 0 auto; }
.find-card { padding: 12px; gap: 10px; }
.find-btn { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 4px 0 var(--accent-d); border-radius: 18px; padding: 12px; cursor: pointer; transition: transform .08s, box-shadow .08s; }
.find-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-d); }
.find-btn:disabled { opacity: .45; }
.find-map { position: relative; width: 74px; height: 56px; flex-shrink: 0; border-radius: 13px; overflow: hidden; background: #a7d47f; box-shadow: inset 0 0 0 2px rgba(90,60,20,.15); }
.find-map::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.55) 1.2px, transparent 1.2px); background-size: 10px 10px; }
.find-mag { position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: var(--text); z-index: 2; }
.find-mag svg { width: 22px; height: 22px; }
.find-btn .find-mag { animation: magSweep 3.4s ease-in-out infinite; }
.find-mag.anim { animation: magSweep 1.4s ease-in-out infinite; }
@keyframes magSweep { 0%,100% { transform: translate(2px, 2px) rotate(-8deg); } 30% { transform: translate(40px, 4px) rotate(6deg); } 60% { transform: translate(34px, 24px) rotate(-4deg); } 80% { transform: translate(6px, 22px) rotate(8deg); } }
.find-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.find-tx b { font: 900 18px var(--font); }
.find-tx small { font-size: 13px; opacity: .8; line-height: 1.35; font-weight: 700; }
.find-live { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 18px; background: #fff4d6; border: 1.5px solid var(--accent); }
.find-live .find-tx small { color: var(--muted); }
.find-live .find-tx { flex: 1; }
.find-live .rbtn { flex-shrink: 0; }
.room-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.room-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.room-row.live { border-color: rgba(239,95,103,.5); }
.room-code { font: 900 16px var(--mono); letter-spacing: .1em; color: var(--sky); min-width: 62px; display: flex; flex-direction: column; gap: 3px; }
.live-tag { font: 800 11px var(--font); letter-spacing: 0; color: var(--red); font-style: normal; }
.room-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.room-mid b { font-size: 14px; font-weight: 900; }
.room-mid span { font: 700 12px var(--font); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-n { font: 800 14px var(--font); color: var(--muted); text-align: right; display: flex; flex-direction: column; gap: 2px; }
.room-n i { font: 700 11px var(--font); color: var(--dim); font-style: normal; }
.room-row .chunky { min-width: 74px; }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; min-width: 0; }
.vs-lobby { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.lobby-card { width: min(620px, 94vw); background: var(--panel); border: 1.5px solid var(--line); border-radius: 26px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--soft); }
.lobby-top { display: flex; gap: 18px; align-items: flex-start; }
.lobby-top > div:first-child { flex-shrink: 0; }
.vs-code-big { font: 900 44px var(--mono); letter-spacing: .18em; color: var(--sky); }
.vs-via { font: 700 13px var(--font); color: var(--muted); margin-top: 2px; }
.vs-players { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.vname { padding: 12px 16px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.vname i { margin-left: auto; font: 800 12px var(--font); color: var(--accent-ink); font-style: normal; background: var(--accent); padding: 2px 9px; border-radius: 999px; }
.vname.dead { opacity: .45; text-decoration: line-through; }
.vname.empty { color: var(--dim); border-style: dashed; border-color: var(--line2); background: transparent; }
.vname.spec { font: 700 13px var(--font); color: var(--muted); border-style: dashed; background: transparent; }
.lobby-set { display: flex; flex-direction: column; gap: 12px; }
.lobby-btns { display: flex; align-items: center; gap: 14px; }
.lobby-btns .chunky { flex: 1; }
.lobby-btns .text-btn { margin-top: 0; }
.seg.wrap { flex-wrap: wrap; }
#vs-pill { cursor: pointer; }
#vs-pill svg { color: var(--red); }
#vs-pill b { font-size: 13px; }

#panic {
  position: fixed; bottom: calc(12px + var(--sa-b)); right: calc(12px + var(--sa-r));
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--red); border: 0;
  box-shadow: 0 3px 0 var(--red-d); z-index: 950; opacity: .55;
  transition: transform .08s, opacity .15s;
}
#panic:active { transform: translateY(3px); box-shadow: none; }
#blackout { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #000; z-index: 900; display: flex; align-items: center; justify-content: center; animation: boIn .12s ease-out; }
@keyframes boIn { from { opacity: 0; } }
.bo-inner { text-align: center; padding: 30px; }
.bo-small { font: 800 14px var(--font); color: #fff; opacity: .6; }
.bo-big { font: 900 clamp(44px, 8vw, 84px)/0.95 var(--font); color: #fff; margin-top: 20px; }

.modal { z-index: 300; }
.screen.active { animation: scrIn .22s ease-out; }
@keyframes scrIn { from { opacity: 0; transform: scale(.99); } }
.menu-actions > * { animation: riseIn .45s cubic-bezier(.2,1.3,.4,1) backwards; }
.menu-actions > :nth-child(2) { animation-delay: .06s; }
.menu-actions > :nth-child(3) { animation-delay: .12s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } }

.menu-tl { position: absolute; top: calc(14px + var(--sa-t)); left: calc(18px + var(--sa-l)); z-index: 5; display: flex; gap: 8px; }
.rk-gem { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.rk-bar { width: 46px; height: 7px; border-radius: 999px; background: var(--sand2); overflow: hidden; display: inline-block; margin-left: 3px; }
.rk-bar i { display: block; height: 100%; border-radius: 999px; }
.pill.net { font: 800 13px var(--font); color: var(--muted); }
.pill.net .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); }
.pill.net.on { color: var(--text); }
.pill.net.on .dot { background: var(--leaf); box-shadow: 0 0 0 3px rgba(92,184,92,.22); }
.play-row { display: flex; gap: 12px; }
.play-row .chunky { min-width: 200px; }
.chunky.red span { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.chunky.red small, .chunky.wide small { font: 700 12px var(--font); opacity: .85; }
.chunky.wide small { display: block; margin-top: 5px; }
.chunky.wide:has(small) { flex-direction: column; gap: 0; }

.gem.blue { background: var(--sky); }
.star { width: 14px; height: 14px; display: inline-block; background: var(--sand2); clip-path: polygon(50% 0, 61% 36%, 98% 36%, 68% 58%, 79% 94%, 50% 72%, 21% 94%, 32% 58%, 2% 36%, 39% 36%); flex-shrink: 0; }
.star.on { background: var(--gold); }
.stars { display: flex; align-items: center; gap: 3px; }
.stars b { margin-left: 6px; font-size: 14px; }
#p-stars .star { width: 16px; height: 16px; }
.pill.core svg { color: var(--sky); }

.net-field { margin-top: 18px; }
.s-net { font: 700 13px var(--font); color: var(--muted); margin-top: 8px; }
.s-net:empty { display: none; }
.s-net.ok { color: var(--leaf-d); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opts .opt { font-size: 13.5px; padding: 11px 12px; text-align: left; }
@media (max-width: 700px) { .opts { grid-template-columns: 1fr; } }

.onboard { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.onboard h2 { font: 900 32px var(--font); }
.onboard .section-note { margin: 0; }
.onboard input { width: 100%; height: 54px; border-radius: 16px; border: 1.5px solid var(--line2); background: var(--card); color: var(--text); font: 800 20px var(--font); padding: 0 14px; outline: none; text-align: center; transition: border-color .15s, box-shadow .15s; }
.onboard input:focus { border-color: var(--accent-d); box-shadow: 0 0 0 4px rgba(255,190,59,.3); }
.ob-msg { min-height: 18px; color: var(--red); font-size: 13.5px; font-weight: 800; }
#ob-ball { width: 80px; height: 80px; animation: obob .6s ease-in-out infinite alternate; }

.tw-info { font: 800 13px var(--font); color: var(--muted); white-space: nowrap; }
.tw-row { display: flex; gap: 8px; }
.tw-row .wave-btn { min-width: 150px; }
.tcard.troop canvas { width: 28px; height: 28px; margin: 3px 0; }
.tcard.troop .tn { display: block; font: 800 10px var(--font); color: var(--text); }
.pot.send { width: 58px; }
.pot.send span { font-size: 11px; color: #c98a0e; }
.seg.small button { padding: 8px 11px; font-size: 13px; }

.raid-stars { display: flex; gap: 10px; align-items: flex-end; height: 72px; }
.bigstar { width: 56px; height: 56px; background: var(--sand2); clip-path: polygon(50% 0, 61% 36%, 98% 36%, 68% 58%, 79% 94%, 50% 72%, 21% 94%, 32% 58%, 2% 36%, 39% 36%); animation: starIn .4s cubic-bezier(.2,1.6,.4,1) backwards; }
.bigstar:nth-child(2) { width: 70px; height: 70px; }
.bigstar.on { background: var(--gold); }
@keyframes starIn { from { transform: scale(0) rotate(-40deg); } }

#raid-note {
  position: fixed; top: calc(60px + var(--sa-t)); left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px;
  background: #fff0ef; border: 2px solid var(--red); box-shadow: var(--soft); border-radius: 18px;
  font-weight: 900; color: var(--text); animation: noteIn .35s cubic-bezier(.2,1.4,.4,1);
}
@keyframes noteIn { from { transform: translate(-50%, -30px); opacity: 0; } }

.bw-pills { display: flex; gap: 8px; }
.bw-off { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 20px; }
.bw-off .big-title { font-size: 40px; }
.bw-off .section-note { margin: 0 auto; max-width: 420px; font-size: 15px; }
.bw-main { flex: 1; display: flex; gap: 16px; min-height: 0; padding: 4px calc(16px + var(--sa-r)) calc(16px + var(--sa-b)) calc(16px + var(--sa-l)); }
.bw-side { width: 320px; flex-shrink: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 2px 8px; }
.bw-right { flex: 1; display: flex; flex-direction: column; min-width: 0; gap: 10px; }
.bw-right .tabs-wrap { padding: 0; justify-content: flex-start; }
.bw-me { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 22px; padding: 12px 14px; box-shadow: var(--soft); }
.bw-ava { width: 56px; height: 56px; flex-shrink: 0; background: #fff1cc; border-radius: 50%; }
.bw-me > div { min-width: 0; }
.bw-name { font: 900 22px/1.1 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bw-sub span { display: inline-flex; align-items: center; gap: 4px; font: 800 12px var(--font); color: var(--muted); background: var(--sand); padding: 3px 9px; border-radius: 999px; }
.bw-sub .bw-shield { background: #e2f0ff; color: var(--sky-d); }
.bw-mine { background: var(--panel); border: 1.5px solid var(--line); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bw-mine.full { border-color: var(--gold); background: #fff6dd; }
.bw-mine-top { display: flex; align-items: center; gap: 10px; }
.bw-mine-top > div { flex: 1; display: flex; flex-direction: column; }
.bw-mine-top b { font: 900 15px var(--font); }
.bw-mine-top span { font: 700 12.5px var(--font); color: var(--muted); }
.bw-mine-top strong { font: 900 24px var(--font); color: #c98a0e; }
.bw-mine-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bw-mine-foot span { font: 800 12.5px var(--font); color: var(--muted); }
.bw-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--uc) 18%, white); color: var(--uc); }
.bw-ico svg { width: 20px; height: 20px; }
.bw-side .md-label { margin: 6px 4px 0; }
.bw-up { --uc: var(--sky); display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; }
.bw-up > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bw-up b { font: 900 15px var(--font); display: flex; align-items: center; gap: 6px; }
.bw-up b em { font: 800 11px var(--font); font-style: normal; color: var(--uc); background: color-mix(in srgb, var(--uc) 14%, white); padding: 1px 7px; border-radius: 999px; }
.bw-up span { font: 700 12px var(--font); color: var(--muted); }
.bw-up .chunky { min-width: 86px; gap: 7px; }
.bw-up .gem { width: 9px; height: 9px; }
.bw-side > .chunky.wide { margin-top: 6px; width: 100%; }
.bw-world { flex: 1; position: relative; border-radius: 26px; overflow: hidden; box-shadow: var(--soft), 0 0 0 4px #fff inset; min-height: 0; background: #a7d47f; }
.bw-world::after { content: ''; position: absolute; inset: 0; border-radius: 26px; box-shadow: inset 0 0 0 4px rgba(255,255,255,.85); pointer-events: none; }
#world-cv { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.bw-card {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(420px, 90%); z-index: 2;
  background: var(--panel); border: 1.5px solid var(--line2); border-radius: 22px; padding: 15px;
  box-shadow: var(--soft); animation: cardIn .22s cubic-bezier(.2,1.4,.4,1);
}
@keyframes cardIn { from { transform: translate(-50%, 18px); opacity: 0; } }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-name { font: 900 22px/1.1 var(--font); display: flex; align-items: center; gap: 8px; }
.card-you { font: 800 11px var(--font); background: var(--accent); color: var(--accent-ink); padding: 2px 8px; border-radius: 999px; }
.on-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--leaf); display: inline-block; box-shadow: 0 0 0 3px rgba(92,184,92,.22); }
.card-sub { font: 700 13px var(--font); color: var(--muted); margin-top: 4px; }
.card-btns { display: flex; gap: 8px; margin-top: 12px; }
.card-btns .chunky { flex: 1; }
.card-why { font: 700 13px var(--font); color: var(--muted); margin-top: 8px; text-align: center; }
#bw-log { padding: 4px 4px 20px; }
#bw-log h3 { font: 900 16px var(--font); color: var(--text); margin: 4px 0 10px; }
#bw-log h3:not(:first-child) { margin-top: 24px; }
.log-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; margin-bottom: 6px; max-width: 780px; font-size: 14px; }
.log-row.bad { border-left: 5px solid var(--red); }
.log-row.good { border-left: 5px solid var(--leaf); }
.log-row em { font: 800 13px var(--font); color: var(--muted); font-style: normal; }
.log-row .log-v { margin-left: auto; font: 800 13px var(--font); }
.log-row i { font: 700 12px var(--font); color: var(--dim); font-style: normal; min-width: 56px; text-align: right; }
.stars-s { display: flex; gap: 2px; }

.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; max-width: 1060px; margin: 0 auto; width: 100%; }
.scard { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1.5px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 4px 0 var(--sand2); transition: transform .12s; }
.scard:active { transform: scale(.985); }
.scard.owned { border-color: rgba(92,184,92,.55); }
.scard.bought { animation: bought .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes bought { 40% { transform: scale(1.04); } }
.sc-art { height: 110px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--c) 45%, white) 0, color-mix(in srgb, var(--c) 14%, white) 60%); }
.sc-art canvas, .sc-art svg { display: block; filter: drop-shadow(0 4px 4px rgba(90,60,20,.18)); }
.sc-badge { position: absolute; top: 10px; right: 10px; font: 900 12px var(--font); background: rgba(255,255,255,.92); color: var(--muted); padding: 3px 10px; border-radius: 999px; }
.scard.owned .sc-badge { color: #fff; background: var(--leaf); }
.sc-body { padding: 12px 15px 4px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.sc-name { font: 900 18px var(--font); color: var(--text); display: flex; align-items: center; gap: 8px; }
.sc-name::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.sc-desc { font-size: 13.5px; color: var(--muted); line-height: 1.4; min-height: 16px; }
.sc-stats { display: flex; gap: 6px; margin-top: auto; }
.sc-stats span { flex: 1; display: flex; flex-direction: column; background: var(--sand); border-radius: 12px; padding: 6px 9px; font: 900 15px var(--font); }
.sc-stats i { font: 800 11px var(--font); color: var(--muted); font-style: normal; }
.sc-stats em { font: 800 11px var(--font); color: var(--leaf-d); font-style: normal; }
.sc-stats em::before { content: 'max '; color: var(--dim); }
.sc-meta { font: 700 12px var(--font); color: var(--muted); }
.sc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.tag { font: 800 12px var(--font); padding: 4px 10px; border-radius: 999px; background: var(--sand); color: var(--muted); }
.tag.throw { color: var(--sky-d); background: #e2f0ff; }
.sc-buy { margin: 10px 15px 15px; }
.up-ico { width: 64px; height: 64px; border-radius: 22px; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--sky); box-shadow: 0 4px 0 rgba(61,143,224,.25); }

#rotate { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  #rotate { display: flex; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 999; background: var(--bg); align-items: center; justify-content: center; padding: 40px; text-align: center; }
}

@media (max-width: 1000px) {
  .bw-side { width: 270px; }
  .play-row .chunky { min-width: 170px; }
}
@media (max-width: 900px) {
  .vs-body { flex-direction: column; align-items: center; }
  .vs-col { width: min(560px, 94vw); }
}
@media (max-width: 880px) {
  .tcard { width: 48px; }
  .tcard canvas { width: 30px; height: 30px; }
  .pot { width: 42px; height: 48px; }
  .wave-btn { min-width: 130px; font-size: 15px; }
  .wave-preview { display: none; }
  .map-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
