@font-face { font-family: "Saira Condensed"; font-weight: 500; font-display: swap; src: url(../assets/fonts/saira-condensed-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Saira Condensed"; font-weight: 600; font-display: swap; src: url(../assets/fonts/saira-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Saira Condensed"; font-weight: 700; font-display: swap; src: url(../assets/fonts/saira-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(../assets/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(../assets/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(../assets/fonts/inter-latin-600-normal.woff2) format("woff2"); }

:root {
  --bg: #0b1013; --panel: #141b20; --panel-2: #1a2329; --line: #2a353d; --line-2: #3a4852;
  --ink: #e9edf0; --muted: #93a1ab; --amber: #e8b43a; --amber-d: #b5861a; --cyan: #5cc8e8; --red: #d94a3d; --green: #7fcf6a; --violet: #8f7cf0;
  --display: "Saira Condensed", "Arial Narrow", sans-serif; --body: "Inter", system-ui, sans-serif;
  --cut: 10px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; overscroll-behavior: none; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
#app { position: fixed; inset: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--bg); }
.screen.on { display: flex; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* icons (masked so they take the text colour) */
.ic { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.18em; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.ic-star { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3 7 7 .6-5.3 4.7 1.7 7.2L12 17.8 5.6 21.5l1.7-7.2L2 9.6 9 9z'/%3E%3C/svg%3E"); color: var(--amber); }
.ic-salv { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2 3 3.5-.5.5 3.5 3 2-1.5 3.2L21 16l-3 2-.5 3.5-3.5-.5-2 3-2-3-3.5.5L6 18l-3-2 1.5-3.3L3 9.5l3-2L6.500 4 10 4.500zM12 8a4 4 0 100 8 4 4 0 000-8z'/%3E%3C/svg%3E"); color: #c9d2d8; }
.ic-intel { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l9 5v10l-9 5-9-5V7zm0 5l-4 2.300v5.400L12 17l4-2.300V9.300z'/%3E%3C/svg%3E"); color: var(--cyan); }
.ic-funds { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm1 4v1.500c1.800.3 3 1.400 3 3h-2c0-.7-.7-1.300-2-1.300s-2 .5-2 1.200c0 .8.800 1.100 2.400 1.500 2 .5 3.600 1.200 3.600 3.200 0 1.600-1.200 2.700-3 3V19h-2v-1.500c-1.900-.3-3-1.500-3-3.200h2c0 .9.800 1.500 2 1.500s2-.5 2-1.300c0-.9-.8-1.200-2.300-1.600-2-.5-3.700-1.200-3.700-3.100 0-1.500 1.100-2.600 3-2.900V6z'/%3E%3C/svg%3E"); color: var(--amber); }
.ic-base { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l8 3v6c0 5-3.400 9.200-8 11-4.600-1.800-8-6-8-11V5z'/%3E%3C/svg%3E"); color: var(--cyan); }
.ic-ad { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3l15 9-15 9z'/%3E%3C/svg%3E"); }
.ic-lock { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0110 0v3h1.500a1.500 1.500 0 011.500 1.500v9a1.500 1.500 0 01-1.500 1.500h-13A1.500 1.500 0 014 20.500v-9A1.500 1.500 0 015.500 10zm2 0h6V7a3 3 0 00-6 0z'/%3E%3C/svg%3E"); }
.ic-pause { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 4h4v16H6zm8 0h4v16h-4z'/%3E%3C/svg%3E"); }
.ic-gear { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.300 2h3.400l.5 2.600 1.800.8 2.200-1.500 2.400 2.400-1.500 2.200.8 1.800 2.600.5v3.400l-2.600.5-.8 1.800 1.500 2.200-2.400 2.400-2.200-1.500-1.800.8-.5 2.600h-3.400l-.5-2.600-1.800-.8-2.200 1.500-2.400-2.400 1.500-2.200-.8-1.800L2 13.700v-3.400l2.600-.5.8-1.800L3.900 5.800l2.400-2.400 2.200 1.500 1.800-.8zM12 8.500a3.500 3.500 0 100 7 3.500 3.500 0 000-7z'/%3E%3C/svg%3E"); }
.ic-sound { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9zm13.500 3a4.500 4.500 0 00-2.500-4v8a4.500 4.500 0 002.500-4zM14 3.200v2.100a7 7 0 010 13.400v2.100a9 9 0 000-17.600z'/%3E%3C/svg%3E"); }
.ic-mute { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9zm12.600 3l2.700-2.700-1.400-1.400L14.200 10.600l-2.700-2.700-1.400 1.400L12.800 12l-2.700 2.700 1.400 1.400 2.700-2.700 2.700 2.700 1.400-1.400z'/%3E%3C/svg%3E"); }
.ic-check { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.200L4.800 12l-1.400 1.400L9 19 21 7l-1.400-1.400z'/%3E%3C/svg%3E"); }

/* buttons */
.btn { appearance: none; border: 0; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); background: var(--panel-2); padding: 11px 18px; min-height: 44px; position: relative;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); box-shadow: inset 0 0 0 1px var(--line-2); transition: transform .08s, background .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: #222d34; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.primary { background: var(--amber); color: #1a1405; box-shadow: none; }
.btn.primary:hover { background: #f3c451; }
.btn.good { background: #2f6d33; }
.btn.ghost { background: transparent; }
.btn.small { white-space: nowrap; font-size: 16px; min-height: 38px; padding: 8px 14px; }
.btn.big { font-size: 26px; min-height: 58px; padding: 12px 26px; }
.btn[disabled], .btn.off { opacity: .45; cursor: not-allowed; }
.btn.ad { background: #1e3a2a; box-shadow: inset 0 0 0 1px #3f7a52; }
.icon-btn { appearance: none; width: 44px; height: 44px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; color: var(--ink); cursor: pointer; display: inline-grid; place-items: center; font-size: 22px; }
.icon-btn:hover { background: var(--panel-2); }
.pip { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px rgba(232,180,58,.25); margin-left: 4px; vertical-align: middle; }
.pip[hidden] { display: none; }

/* title */
#screen-title { background: #0b1013; overflow: hidden; }
#attract { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: .95; }
.title-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(11,16,19,.5) 0%, rgba(11,16,19,.8) 75%), linear-gradient(180deg, rgba(11,16,19,.1), rgba(11,16,19,.75)); }
.title-card { position: relative; margin: auto; width: min(520px, 92vw); text-align: center; padding: 22px 12px calc(22px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kicker { font-family: var(--display); letter-spacing: .32em; text-transform: uppercase; color: var(--amber); font-size: 15px; font-weight: 600; }
.logo { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(54px, 15vw, 96px); line-height: .9; letter-spacing: .02em; display: flex; flex-direction: column; align-items: center; text-shadow: 0 3px 0 #000, 0 0 40px rgba(232,180,58,.18); }
.logo span:last-child { color: var(--amber); }
.logo::after { content: ""; display: block; width: 74%; height: 9px; margin-top: 12px; background: repeating-linear-gradient(-45deg, var(--amber) 0 10px, #15191d 10px 20px); }
.lede { color: #c8d1d7; font-size: 16px; max-width: 34ch; }
.menu { display: flex; flex-direction: column; gap: 10px; width: min(380px, 100%); margin-top: 8px; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu .btn { width: 100%; }
.lock { display: none; }
.lock.on { display: inline-block; }
.title-foot { display: flex; gap: 10px; margin-top: 4px; }

/* top bars */
.topbar { display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 14px 10px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #121a1f, #0f1519); }
.bar-title { font-family: var(--display); font-size: 26px; letter-spacing: .08em; text-transform: uppercase; flex: 1; text-align: center; font-weight: 700; }
.chips { display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: .03em; }
.chip b { font-weight: 700; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 14px calc(30px + var(--safe-b)); user-select: none; }
.scroll > div { max-width: 920px; margin: 0 auto; }

/* stage map */
.sector { margin: 8px 0 22px; }
.sector-head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; }
.sector-head h3 { font-family: var(--display); font-size: 22px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); font-weight: 700; }
.sector-head span { color: var(--muted); font-size: 13px; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stage { appearance: none; position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 4px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 92px; text-align: center; transition: transform .1s, border-color .15s; }
.stage:hover { border-color: var(--line-2); }
.stage .num { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; }
.stage .nm { font-size: 11px; color: var(--muted); line-height: 1.15; min-height: 26px; display: flex; align-items: center; }
.stage .st { font-size: 14px; letter-spacing: 1px; color: #3a4650; }
.stage .st .on { color: var(--amber); }
.stage.boss { border-color: #6b4a3a; background: linear-gradient(180deg, #221615, var(--panel)); }
.stage.boss::before { content: "BOSS"; position: absolute; top: 0; right: 0; font-family: var(--display); font-size: 11px; letter-spacing: .12em; background: var(--red); color: #fff; padding: 1px 6px 1px 8px; clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%); }
.stage.next { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 0 18px rgba(232,180,58,.25); animation: nextPulse 2s ease-in-out infinite; }
.stage.locked { opacity: .5; cursor: not-allowed; background: #10161a; }
.stage.locked .num { color: #4a5660; }
.stage.locked .ic-lock { font-size: 12px; color: #7b8892; margin-right: 3px; }
.stage.cleared .num { color: #fff; }
@keyframes nextPulse { 50% { box-shadow: 0 0 0 1px var(--amber), 0 0 4px rgba(232,180,58,.1); } }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin: 4px 0 14px; }

/* base */
.tabs { display: flex; border-bottom: 1px solid var(--line); background: #0f1519; }
.tab { flex: 1; appearance: none; border: 0; background: transparent; color: var(--muted); padding: 12px 6px; font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; border-bottom: 3px solid transparent; }
.tab.on { color: var(--ink); border-bottom-color: var(--amber); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; display: flex; gap: 14px; align-items: center; }
.card .grow { flex: 1; min-width: 0; }
.card h4 { font-family: var(--display); font-size: 22px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.card .lv { font-size: 14px; color: var(--amber); letter-spacing: .08em; }
.card p { color: var(--muted); font-size: 13.500px; margin-top: 2px; line-height: 1.35; }
.card .sub { color: #c4ced5; font-size: 13px; margin-top: 4px; }
.card.hqc { border-color: #6b5a22; background: linear-gradient(135deg, #1e1b10, var(--panel)); }
.card.supply { border-color: #2f5a68; background: linear-gradient(135deg, #12252c, var(--panel)); }
.blk { width: 56px; height: 56px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 26px; flex: none; }
.blk canvas { width: 100%; height: 100%; border-radius: 7px; display: block; }
.meterbar { height: 6px; border-radius: 3px; background: #222c33; margin-top: 8px; overflow: hidden; }
.meterbar i { display: block; height: 100%; background: var(--amber); }
.unlocks { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.unl { width: 38px; height: 38px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line-2); position: relative; }
.unl canvas { width: 100%; height: 100%; display: block; }
.unl.off canvas { opacity: .28; filter: grayscale(1); }
.unl.off::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px; background: #9aa6af; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0110 0v3h1.500a1.500 1.500 0 011.500 1.500v9a1.500 1.500 0 01-1.500 1.500h-13A1.500 1.500 0 014 20.500v-9A1.500 1.500 0 015.500 10zm2 0h6V7a3 3 0 00-6 0z'/%3E%3C/svg%3E"); }
.cmd.sel { border-color: var(--amber); }
.cmd.locked { opacity: .55; }
.cmd .blk { width: 72px; height: 72px; }
.quest .prog { color: var(--muted); font-size: 13px; }
.quest.done { border-color: #3f7a52; }
.reward { display: inline-flex; gap: 8px; color: #dfe6ea; font-family: var(--display); font-weight: 600; font-size: 17px; }

/* battle */
.hud { display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 10px 8px; background: linear-gradient(180deg, #141c21, #0e1417); border-bottom: 1px solid var(--line); }
.hud-mid { flex: 1; min-width: 0; }
.hud-title { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-wave { color: var(--muted); font-size: 13px; }
.hud-wave b { color: var(--ink); font-family: var(--display); font-size: 16px; }
.hud-stat { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 22px; font-weight: 700; min-width: 70px; }
.hud-stat.integ { min-width: 120px; }
.meter { flex: 1; height: 10px; background: #222c33; border-radius: 5px; overflow: hidden; min-width: 40px; }
.meter span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #3aa3c9, var(--cyan)); transition: width .25s; }
.meter span.low { background: linear-gradient(90deg, #a33a2f, var(--red)); }
#stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; background: #0a0e11; overflow: hidden; }
#board { display: block; touch-action: none; cursor: crosshair; }
#toast { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(12,18,22,.92); border: 1px solid var(--line-2); padding: 8px 14px; border-radius: 6px; font-size: 14px; max-width: 90%; text-align: center; pointer-events: none; }
#wave-banner { position: absolute; top: 14%; left: 0; right: 0; text-align: center; font-family: var(--display); font-weight: 700; font-size: clamp(34px, 9vw, 64px); letter-spacing: .14em; text-transform: uppercase; color: #fff; text-shadow: 0 3px 0 #000; pointer-events: none; animation: banner 1.6s ease-out forwards; }
#wave-banner.boss { color: var(--red); }
#wave-banner small { display: block; font-size: .32em; letter-spacing: .3em; color: var(--amber); }
@keyframes banner { 0% { opacity: 0; transform: translateY(-14px) scale(1.06); } 14% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(6px); } }

.dock { background: linear-gradient(180deg, #12191e, #0d1316); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + var(--safe-b)); }
.dock-row { display: flex; align-items: stretch; gap: 8px; }
.build-bar { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; align-items: flex-start; align-content: flex-start; }
.build-bar::-webkit-scrollbar { display: none; }
.tbtn { appearance: none; flex: 0 0 auto; width: 62px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 5px 2px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; position: relative; color: var(--ink); }
.tbtn canvas { width: 46px; height: 46px; display: block; }
.tbtn .cost { font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1; color: var(--amber); display: flex; align-items: center; gap: 2px; }
.tbtn .hk { position: absolute; top: 2px; left: 4px; font-size: 10px; color: var(--muted); font-family: var(--display); }
.tbtn.sel { border-color: var(--amber); background: #231f10; box-shadow: 0 0 0 1px var(--amber); }
.tbtn.poor .cost { color: #b9645a; }
.tbtn.poor canvas { opacity: .6; }
.tbtn.locked { opacity: .55; cursor: not-allowed; }
.tbtn.locked .cost { color: var(--muted); font-size: 12px; }
.side-btns { display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: 112px; flex: none; }
.go { font-size: 17px; min-height: 40px; padding: 6px 4px; white-space: nowrap; }
.ability { position: relative; appearance: none; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; height: 76px; padding: 4px 2px 3px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden; color: var(--ink); }
.ability canvas { width: 46px; height: 46px; flex: none; border-radius: 6px; }
.ability .ab-name { font-family: var(--display); font-weight: 600; font-size: 14px; line-height: 1; text-align: center; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.ability .ab-cd { position: absolute; inset: 0; background: rgba(8,12,15,.7); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 24px; }
.ability .ab-cd:empty { display: none; }
.ability.ready { border-color: var(--amber); box-shadow: 0 0 12px rgba(232,180,58,.35); animation: ready 1.6s ease-in-out infinite; }
.ability.armed { background: #3a1c18; border-color: var(--red); }
@keyframes ready { 50% { box-shadow: 0 0 3px rgba(232,180,58,.2); } }
.inspect { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.inspect[hidden] { display: none; }
.inspect .ib { width: 40px; height: 40px; flex: none; }
.inspect .ib canvas { width: 100%; height: 100%; display: block; }
.inspect .info { flex: 1; min-width: 0; }
.inspect .info b { font-family: var(--display); font-size: 19px; letter-spacing: .06em; text-transform: uppercase; }
.inspect .info div { color: var(--muted); font-size: 12.5px; }
.inspect .btn { min-height: 40px; font-size: 16px; padding: 6px 12px; }

/* modals */
#modal-root { position: absolute; inset: 0; pointer-events: none; }
.modal { position: absolute; inset: 0; background: rgba(5,8,10,.78); display: grid; place-items: center; padding: 14px; pointer-events: auto; animation: fade .18s ease-out; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(480px, 100%); max-height: 100%; overflow-y: auto; background: #131a1f; border: 1px solid var(--line-2); border-radius: 10px; padding: 18px 18px 16px; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: pop .22s cubic-bezier(.2,1.2,.4,1); position: relative; }
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: repeating-linear-gradient(-45deg, var(--amber) 0 8px, #15191d 8px 16px); border-radius: 10px 10px 0 0; }
.sheet h2 { font-family: var(--display); font-size: 32px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; margin: 6px 0 2px; }
.sheet h2.win { color: var(--green); } .sheet h2.lose { color: var(--red); }
.sheet .sub { color: var(--muted); font-size: 14px; margin-bottom: 10px; line-height: 1.4; }
.sheet .stack { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.sheet .stack .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stars { display: flex; justify-content: center; gap: 8px; font-size: 40px; margin: 8px 0; }
.stars .ic { color: #2e3a43; transform: scale(.4); opacity: 0; }
.stars .ic.on { color: var(--amber); animation: starIn .45s cubic-bezier(.2,1.5,.4,1) forwards; }
.stars .ic.off { transform: none; opacity: 1; }
@keyframes starIn { to { transform: scale(1); opacity: 1; } }
.rewards { display: flex; justify-content: center; gap: 18px; margin: 6px 0 2px; font-family: var(--display); font-weight: 700; font-size: 26px; }
.rewards span { display: inline-flex; gap: 6px; align-items: center; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 14px; color: #c9d2d8; margin: 10px 0; }
.kv b { color: var(--ink); font-family: var(--display); font-size: 17px; }
.enemy-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.en { width: 54px; text-align: center; font-size: 10.500px; color: var(--muted); }
.en canvas { width: 46px; height: 46px; display: block; margin: 0 auto 2px; background: #0f1519; border: 1px solid var(--line); border-radius: 6px; }
.cmd-pick { display: flex; gap: 8px; margin: 8px 0; }
.cmd-pick button { flex: 1; appearance: none; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 6px 2px; cursor: pointer; color: var(--ink); font-family: var(--display); font-size: 14px; letter-spacing: .04em; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cmd-pick button canvas { width: 44px; height: 44px; border-radius: 6px; }
.cmd-pick button.sel { border-color: var(--amber); background: #231f10; }
.cmd-pick button.locked { opacity: .4; cursor: not-allowed; }
.share { background: #0c1115; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; white-space: pre-wrap; margin: 10px 0 0; user-select: text; color: #d6dde2; }
.mods { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.mod { padding: 4px 10px; border-radius: 4px; font-family: var(--display); font-size: 15px; letter-spacing: .05em; border: 1px solid var(--line-2); }
.mod.good { color: var(--green); border-color: #3f7a52; } .mod.bad { color: #f08a7a; border-color: #7a3f38; }
.toggle { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.switch { appearance: none; width: 48px; height: 28px; border-radius: 14px; background: #2a343b; border: 0; position: relative; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #c9d2d8; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--amber); } .switch[aria-checked="true"]::after { transform: translateX(20px); background: #1a1405; }
.how li { margin: 8px 0; line-height: 1.4; color: #cbd4da; }
.how b { color: var(--ink); }
.fine { color: var(--muted); font-size: 12px; line-height: 1.45; }

@media (max-width: 520px) {
  .stages { gap: 6px; }
  .stage { min-height: 84px; }
  .stage .nm { font-size: 10px; }
  .side-btns { width: 100px; }
  .tbtn { width: 56px; }
  .bar-title { font-size: 22px; }
  .card { padding: 12px; gap: 10px; }
  .blk { width: 48px; height: 48px; }
  .cmd .blk { width: 60px; height: 60px; }
}
@media (min-width: 900px) {
  .tbtn { width: 74px; } .tbtn canvas { width: 46px; height: 46px; }
  .side-btns { width: 150px; }
  .stage { min-height: 104px; } .stage .nm { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .stars .ic.on { transform: scale(1); opacity: 1; }
}

.btn[hidden]{display:none}
