@font-face { font-family: 'Pixelify Cases'; src: url(fonts/PixelifyCases-400.ttf); font-weight: 400; }
@font-face { font-family: 'Pixelify Cases'; src: url(fonts/PixelifyCases-600.ttf); font-weight: 600; }
@font-face { font-family: 'Pixelify Cases'; src: url(fonts/PixelifyCases-700.ttf); font-weight: 700; }

:root {
  --bg: #0b0b0e;
  --bg2: #16161b;
  --bg3: #22222a;
  --fg: #e6e6e6;
  --muted: #7a7a7a;
  --accent: #f2c23a;
  --sel: #3a3a3a;
  --good: #3fdc6a;
  --bad: #eb4b4b;
  --ink: #050507;
  --line: color-mix(in srgb, var(--fg) 14%, var(--bg));
  --hi: color-mix(in srgb, #fff 9%, transparent);
  --lo: rgba(0, 0, 0, .32);
  --spring: cubic-bezier(.3, 1.8, .5, 1);
  --px: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Pixelify Cases', monospace;
  font-variant-ligatures: none;
  font-size: 16px;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: none;
}
canvas.px { image-rendering: pixelated; display: block; }
h1, h2 { margin: 0; font-weight: 600; line-height: 1; }
h1 { font-size: var(--fs-h1, 30px); }
h2 { font-size: var(--fs-h2, 22px); }
.muted { color: var(--muted); }
.grow { flex: 1; }
.center { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.center-text { text-align: center; }
.k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; line-height: 1; }
.t, .num, .v, h1, h2, .rtag, .badge, .chip, .nav-btn > span, .hud-brand > span, .st-name, .ped-name, .lv-badge, .xp-text, .k, .case-name, .case-sub, .toast { text-box: trim-both cap alphabetic; }

canvas.fx { position: fixed; inset: 0; pointer-events: none; z-index: 9000; image-rendering: pixelated; }

.app { position: fixed; inset: 0; display: grid; grid-template-rows: 68px 1fr; }

.panel {
  background: var(--bg2);
  position: relative;
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink),
    inset 0 var(--px) 0 0 var(--hi), inset 0 calc(-1 * var(--px)) 0 0 var(--lo);
}
.panel.slim { --px: 3px; }

.lift { transition: transform .22s var(--spring), filter .22s; }
.lift:hover { transform: translateY(-5px); filter: drop-shadow(0 7px 0 rgba(0,0,0,.45)); }
.spring { transition: transform .25s var(--spring), filter .2s; }
.spring.pressed { transform: scale(1.08, .86) translateY(2px) !important; transition-duration: .06s; }

.btn {
  --px: 3px;
  font: inherit; font-size: 16px; color: var(--fg); background: var(--bg3);
  border: 0; margin: 3px;
  box-shadow:
    0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink),
    inset 0 3px 0 0 var(--hi), inset 0 -4px 0 0 var(--lo);
  padding: 11px 18px 17px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1;
  transition: transform .25s var(--spring), filter .2s, opacity .2s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.15) drop-shadow(0 4px 0 rgba(0,0,0,.45)); }
.btn.pressed:not(:disabled) { transform: scale(1.08, .86) translateY(2px); transition-duration: .06s; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.accent { background: var(--accent); color: var(--bg); }
.btn.accent .coins { color: var(--bg); }
.btn.ghost { background: var(--bg2); }
.btn.small { padding: 7px 11px 13px; font-size: 14px; }
.btn.big { padding: 14px 22px 20px; font-size: 19px; }
.btn.square { padding: 8px 9px 12px; }

select, input.bet {
  font: inherit; color: var(--fg); background: var(--bg); border: 0; margin: 3px;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 3px 0 0 var(--lo);
  padding: 9px 10px; outline: none;
}
input.bet { width: 110px; }

.coins { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; line-height: 1; }
.coins canvas { flex: none; }
.coins.big { font-size: 22px; gap: 8px; }

.hud {
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  background: var(--bg2);
  box-shadow: 0 4px 0 0 var(--ink), inset 0 -4px 0 0 var(--lo);
  position: relative; z-index: 5;
}
.hud-brand { display: flex; align-items: center; gap: 10px; font: inherit; font-size: 20px; font-weight: 700; letter-spacing: 1px; color: var(--fg); background: none; border: 0; padding: 6px 4px; cursor: pointer; }
.hud-brand:hover { color: var(--accent); }
.hud-nav { display: flex; gap: 6px; margin-left: 8px; transition: opacity .3s, transform .3s var(--spring); }
.hud.on-home .hud-nav { opacity: 0; pointer-events: none; transform: translateY(-8px); }
.nav-btn {
  font: inherit; font-size: 15px; color: var(--muted); background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; line-height: 1; position: relative;
}
.nav-btn canvas { opacity: .6; }
.nav-btn:hover { color: var(--fg); transform: translateY(-2px); }
.nav-btn.on { color: var(--fg); }
.nav-btn.on canvas { opacity: 1; }
.nav-btn::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 4px; background: var(--accent); transform: scaleX(0); transition: transform .3s var(--spring); }
.nav-btn.on::after { transform: scaleX(1); }
.hud-extra { display: flex; }
.hud-level { display: flex; align-items: center; gap: 10px; padding: 7px 12px 10px; margin: 3px; }
.lv-badge { display: inline-flex; align-items: baseline; gap: 5px; font-size: 13px; color: var(--muted); }
.lv-num { font-size: 20px; color: var(--accent); font-weight: 700; text-box: trim-both cap alphabetic; }
.xp { display: flex; flex-direction: column; gap: 5px; }
.xp-bar { width: 120px; height: 8px; background: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.xp-fill { height: 100%; background: var(--accent); box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.xp-text { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hud-coins { flex: none; display: flex; align-items: center; gap: 9px; padding: 8px 14px 11px; font-size: 22px; font-variant-numeric: tabular-nums; min-width: 130px; margin: 3px; }
.hud-mute canvas { display: block; }

.screens { position: relative; overflow: hidden; }
.screen { position: absolute; inset: 0; overflow-y: auto; padding: var(--pad-top, 26px) var(--pad-x, 30px) 110px; transform-origin: 50% 40%; }
.screen.leaving { pointer-events: none; }
.screen-home { padding: 0; overflow: hidden; }

.view-head { display: flex; align-items: center; gap: 14px; margin-bottom: var(--gap-head, 22px); flex-wrap: wrap; min-height: 46px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); cursor: pointer; }
.switch { width: 46px; height: 24px; background: var(--ink); border: 0; padding: 0; cursor: pointer; position: relative; box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 2px var(--line); }
.switch .knob { position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; background: var(--muted); transition: left .25s var(--spring), background .2s; }
.switch.on .knob { left: 26px; background: var(--accent); }

.enter { animation: rise .42s var(--d, 0ms) cubic-bezier(.2,1.3,.4,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.92); } }
.pending { opacity: 0; }
.pop { animation: popin .4s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes popin { from { opacity: 0; transform: scale(.6) translateY(8px); } }

.card {
  --rc: #888;
  position: relative; background: var(--bg2);
  display: flex; flex-direction: column;
  margin: 3px;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 3px 0 0 var(--hi);
  transition: transform .22s var(--spring), filter .2s, opacity .25s;
}
.card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--rc); }
.card-art {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--rc) 24%, transparent), transparent 70%);
}
.card-name { padding: 0 10px; display: flex; flex-direction: column; gap: 6px; }
.card-base { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.1; }
.card-skin { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg); line-height: 1.1; }
.card-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 13px; font-size: 13px; }
.card-wear { color: var(--muted); }
.card-sm { width: 150px; flex: none; }
.card-sm .card-art { height: 68px; }
.card-sm .card-name { padding-bottom: 12px; }
.card-sm .card-foot { padding-top: 0; }
.card-md { width: 100%; }
.card-md .card-art { height: 92px; }
.card-lg { width: 360px; }
.card-lg .card-art { height: 200px; }
.card-lg .card-name { padding: 4px 14px 18px; text-align: center; gap: 8px; }
.card-lg .card-base { font-size: 15px; }
.card-lg .card-skin { font-size: 20px; }
.card.sel { box-shadow: 0 -3px 0 0 var(--accent), 0 3px 0 0 var(--accent), -3px 0 0 0 var(--accent), 3px 0 0 0 var(--accent), inset 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); transform: translateY(-3px); }
.card.locked .card-wear { color: var(--accent); }
.card.r5, .card.r6, .card.r7 { background: color-mix(in srgb, var(--rc) 9%, var(--bg2)); }
.item-grid .card, .contract .card, .inv-grid .card { cursor: pointer; }
.item-grid .card:hover, .inv-grid .card:hover, .contract .card:hover { transform: translateY(-5px); filter: drop-shadow(0 7px 0 rgba(0,0,0,.45)); }
.card.crumbled { animation: crumble .3s ease-in forwards; pointer-events: none; }
@keyframes crumble { to { opacity: 0; transform: scale(.7) translateY(14px); filter: brightness(2); } }
.card.dragging { opacity: .25; }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.item-grid.small { grid-template-columns: repeat(auto-fill, 156px); gap: 10px; justify-content: start; }
.item-grid.scroll { max-height: 560px; overflow-y: auto; padding: 6px 4px 6px 6px; align-content: start; }
.empty { color: var(--muted); padding: var(--sp-6, 32px) 0; grid-column: 1 / -1; text-align: center; font-size: var(--fs-label, 14px); }

.inv-area { min-height: calc(100% - 70px); padding: 6px; touch-action: none; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; align-content: start; }
.chips { display: flex; gap: 6px; align-items: center; }
.chip {
  font: inherit; font-size: 14px; color: var(--muted); background: var(--bg2); border: 0; cursor: pointer; margin: 2px;
  min-width: 32px; padding: 8px 11px 13px; display: inline-block; text-align: center; line-height: 1;
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), inset 0 -3px 0 0 var(--lo);
}
.chip:hover { color: var(--fg); transform: translateY(-2px); }
.chip.on { color: var(--bg); background: var(--accent); }
.chip.dot { padding: 7px 8px 10px; }
.chip .pip { display: block; width: 12px; height: 12px; background: var(--rc); box-shadow: 0 0 0 2px var(--ink); }
.chip.dot.on { background: var(--rc); }
.chip.dot.on .pip { background: #fff; }
.selbar {
  position: fixed; left: 50%; bottom: 22px; translate: -50% 140px; z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; min-width: 560px;
  transition: translate .35s var(--spring);
}
.selbar.show { translate: -50% 0; }
.sel-info { display: flex; align-items: center; gap: 6px; }
.sellzone {
  position: fixed; left: 50%; bottom: 22px; translate: -50% 160px; z-index: 21; width: 460px; height: 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: color-mix(in srgb, var(--bad) 18%, var(--bg2));
  transition: translate .35s var(--spring), background .2s, scale .2s var(--spring);
}
.sellzone.show { translate: -50% 0; }
.sellzone.hot { background: color-mix(in srgb, var(--bad) 40%, var(--bg2)); scale: 1.08; }
.zone-label { font-size: 18px; text-box: trim-both cap alphabetic; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 8000; pointer-events: none; filter: drop-shadow(0 14px 0 rgba(0,0,0,.4)); }
.drag-ghost .card { margin: 0; }
.ghost-n { position: absolute; right: -10px; top: -10px; background: var(--accent); color: var(--bg); min-width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 15px; box-shadow: 0 0 0 3px var(--ink); padding: 0 6px; }
.lasso { position: fixed; z-index: 30; pointer-events: none; background: color-mix(in srgb, var(--accent) 12%, transparent); outline: 2px dashed var(--accent); }
.peek {
  position: fixed; z-index: 60; width: 300px; padding: 16px; pointer-events: none;
  display: flex; flex-direction: column; gap: 12px;
  animation: popin .22s cubic-bezier(.2,1.4,.4,1);
}
.peek.out { opacity: 0; transition: opacity .12s; }
.peek-art { height: 120px; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%); }
.peek-name { font-size: 17px; line-height: 1.15; }
.peek-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.peek-row { display: flex; justify-content: space-between; align-items: center; }
.peek .wearbar { width: 100%; }

.rtag { color: var(--rc); box-shadow: 0 0 0 2px var(--rc); padding: 5px 8px; font-size: 13px; line-height: 1; display: inline-block; margin: 2px; }
.badge { padding: 5px 8px; font-size: 13px; line-height: 1; box-shadow: 0 0 0 2px; margin: 2px; }
.badge.special { color: #7fe7ff; }
.badges { display: flex; gap: 10px; justify-content: center; }

.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; z-index: 50; animation: fade .18s; }
.backdrop.out { opacity: 0; transition: opacity .15s; }
.modal { padding: 26px; max-height: 88vh; overflow-y: auto; max-width: 600px; }
.modal.wide { max-width: 1060px; width: 92vw; }
@keyframes fade { from { opacity: 0; } }

.detail-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.detail-titles { display: flex; flex-direction: column; gap: 10px; }
.detail-crate canvas { animation: bob 1.8s ease-in-out infinite; }
.odds-row { margin-bottom: 16px; }
.odds-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pct { color: var(--muted); font-variant-numeric: tabular-nums; text-box: trim-both cap alphabetic; }
.odds-items { display: flex; flex-wrap: wrap; gap: 10px; }
.mini { width: 112px; background: var(--bg2); padding: 10px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 3px; box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 -4px 0 0 var(--rc); }
.mini > canvas, .mini-q { height: 40px; }
.mini > canvas { object-fit: none; }
.mini-q { font-size: 30px; color: var(--rc); display: flex; align-items: center; }
.mini-name { font-size: 12px; text-align: center; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mini.unseen { opacity: .75; }

.stage { position: fixed; inset: 0; background: rgba(0,0,0,.84); z-index: 40; display: flex; align-items: center; justify-content: center; animation: fade .2s; }
.stage.closing { opacity: 0; transition: opacity .2s; }
.stage-box { width: 1010px; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 22px 20px 20px; }
.stage-head { display: flex; align-items: center; gap: 14px; align-self: flex-start; padding-left: 6px; }
.stage-titles { display: flex; flex-direction: column; gap: 9px; }
.stage-title { font-size: 24px; font-weight: 600; text-box: trim-both cap alphabetic; }
.stage-hint { color: var(--muted); text-box: trim-both cap alphabetic; }
.stage-body { display: flex; flex-direction: column; align-items: center; min-height: 464px; justify-content: center; width: 100%; }
.stage-foot { display: flex; justify-content: center; min-height: 0; }
.stage-foot:empty { display: none; }
.arena { width: 960px; height: 460px; background: var(--bg); position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 60px rgba(0,0,0,.5); }
.arena > * { transition: transform 1.4s cubic-bezier(.2,.8,.3,1); }
.arena.zoom > * { transform: scale(1.16); }
.arena.zoom-top > * { transform-origin: 50% 0; transform: scale(1.12); }
.arena::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.55)); opacity: 0; transition: opacity 1s; }
.arena.zoom::after { opacity: 1; }

.reel-window { width: 960px; height: 220px; overflow: hidden; position: relative; display: flex; align-items: center; }
.reel-strip { display: flex; gap: 2px; will-change: transform; padding-left: 3px; }
.reel-strip .card-foot { display: none; }
.reel-strip .card.won { box-shadow: 0 -3px 0 0 var(--rc), 0 3px 0 0 var(--rc), -3px 0 0 0 var(--rc), 3px 0 0 0 var(--rc); transform: scale(1.06); }
.reel-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--accent); box-shadow: 0 0 0 2px var(--ink), 0 0 16px var(--accent); z-index: 2; }

.wheel-wrap { position: relative; width: 440px; height: 440px; }
.wheel-pointer { position: absolute; left: 50%; top: -6px; margin-left: -14px; width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid var(--accent); filter: drop-shadow(0 2px 0 var(--ink)); }

.scratch-box { position: relative; width: 520px; height: 304px; }
.scratch-prize { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.scratch-prize .card-lg { width: 514px; height: 298px; }
.scratch-prize .card-lg .card-art { height: 210px; }
.foil { position: absolute; inset: 0; cursor: crosshair; touch-action: none; transition: opacity .4s; }
.foil.gone { opacity: 0; }

.slot-machine { display: flex; gap: 14px; padding: 20px; background: var(--bg3); box-shadow: 0 0 0 3px var(--ink); position: relative; }
.slot-reel { width: 120px; height: 252px; overflow: hidden; background: var(--bg); box-shadow: inset 0 0 0 3px var(--ink); }
.slot-strip { will-change: transform; }
.slot-sym { height: 84px; display: flex; align-items: center; justify-content: center; }
.slot-line { position: absolute; left: 12px; right: 12px; top: 50%; height: 4px; margin-top: -2px; background: var(--accent); opacity: .5; }
.slot-line.hit { background: var(--rc); opacity: 1; animation: blink .25s 4; }
@keyframes blink { 50% { opacity: .2; } }

.chests { display: flex; gap: 50px; align-items: flex-end; height: 100%; padding-bottom: 50px; }
.chest { display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; transition: transform .2s var(--spring), opacity .3s; }
.chest:not(.picked-mode):hover { transform: translateY(-8px); }
.chest-prize { height: 180px; display: flex; align-items: flex-end; }
.chest.open .chest-img { filter: drop-shadow(0 -10px 18px var(--rc)); }
.chest.dim { opacity: .4; }
.chest.shake .chest-img { animation: shake .12s infinite; }
@keyframes shake { 25% { transform: translate(-3px, 1px) rotate(-2deg); } 75% { transform: translate(3px, -1px) rotate(2deg); } }
.note { position: absolute; bottom: 14px; color: var(--muted); }
canvas.shake { animation: shake .15s 1; }

.reveal { display: flex; flex-direction: column; align-items: center; gap: 16px; position: relative; padding: 6px 0 4px; }
.reveal-glow { position: absolute; top: -80px; width: 680px; height: 460px; background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 45%, transparent), transparent); pointer-events: none; opacity: 0; transition: opacity .4s; }
.reveal.shown .reveal-glow { opacity: 1; animation: throb 1.6s infinite; }
@keyframes throb { 50% { transform: scale(1.08); } }
.flip { perspective: 900px; position: relative; }
.flip-inner { position: relative; transform-style: preserve-3d; width: 366px; }
.face { backface-visibility: hidden; }
.face.front { transform: rotateY(180deg); }
.face.back { position: absolute; inset: 3px; }
.back-art {
  width: 100%; height: 100%;
  background:
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--rc) 30%, var(--bg2)) 0 8px, var(--bg2) 8px 16px);
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 0 0 6px color-mix(in srgb, var(--rc) 70%, var(--bg)), inset 0 0 30px var(--rc);
}
.flip.charging .flip-inner { animation: charge .09s linear infinite; }
.flip.charging .back-art { animation: chargeglow .5s ease-in-out infinite alternate; }
@keyframes charge { 0% { translate: calc(-1 * var(--amp)) 0; } 50% { translate: var(--amp) calc(-1 * var(--amp)); } 100% { translate: 0 var(--amp); } }
@keyframes chargeglow { to { filter: brightness(1.5) drop-shadow(0 0 18px var(--rc)); } }
.reveal-name { font-size: 24px; text-align: center; position: relative; line-height: 1.15; text-box: trim-both cap alphabetic; max-width: min(560px, calc(100vw - 32px)); text-wrap: balance; color: color-mix(in srgb, var(--rc) 55%, #fff); text-shadow: 0 3px 0 #000; }
.reveal.shown .flip { animation: rv-land .36s steps(3); }
.reveal.hi.shown .flip { animation: rv-land .5s steps(4); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--rc) 70%, transparent)); }
@keyframes rv-land { from { filter: brightness(2.2) saturate(.6) drop-shadow(0 0 26px var(--rc)); } }
.reveal-stats { display: flex; gap: 26px; justify-content: center; position: relative; }
.reveal-stats > div, .tu-sum > div, .stats > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.reveal-value { position: relative; }
.reveal-actions { display: flex; gap: 12px; justify-content: center; position: relative; margin-top: 4px; min-height: 50px; }
.crumbled { animation: crumble .3s ease-in forwards; }
.item-detail { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.inspect-tilt { transition: transform .2s ease-out; cursor: grab; }
.wearbar { width: 360px; height: 10px; position: relative; background: linear-gradient(90deg, #3fdc6a 0 7%, #9bdc3f 7% 15%, #e8c84a 15% 38%, #e8913f 38% 45%, #eb4b4b 45%); box-shadow: 0 0 0 3px var(--ink); margin: 6px 0; }
.wearpin { position: absolute; top: -6px; width: 4px; height: 22px; margin-left: -2px; background: var(--fg); box-shadow: 0 0 0 2px var(--ink); }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 12px; z-index: 100; pointer-events: none; align-items: flex-end; }
.toast { background: var(--bg3); padding: 13px 16px 13px 18px; animation: slide .3s var(--spring); transition: opacity .3s, translate .3s; box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 5px 0 0 0 var(--muted); }
.toast.good { box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 5px 0 0 0 var(--good); }
.toast.bad { box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 5px 0 0 0 var(--bad); }
.toast.out { opacity: 0; translate: 20px 0; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

.col { display: grid; grid-template-columns: 250px 1fr; gap: 26px; }
.col-side { display: flex; flex-direction: column; gap: 6px; }
.col-case { font: inherit; color: var(--fg); display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; background: none; border: 0; text-align: left; }
.col-case > span { text-box: trim-both cap alphabetic; }
.col-case:hover { background: var(--bg2); transform: translateX(4px); }
.col-case.on { background: var(--bg2); box-shadow: inset 4px 0 0 0 var(--accent); }
.progress { flex: none; width: 200px; height: 12px; background: var(--ink); box-shadow: 0 0 0 3px var(--ink); }
.progress > div { height: 100%; background: var(--accent); transition: width 1s cubic-bezier(.2,.9,.3,1); box-shadow: inset 0 -3px 0 rgba(0,0,0,.3); }
.book { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; padding: 4px; }
.book-slot { --px: 3px; margin: 3px; padding: 14px 10px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.book-slot::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--rc); }
.book-art { height: 64px; display: flex; align-items: center; }
.book.sq .book-art { height: 100px; }
.book-name { font-size: 15px; text-align: center; text-box: trim-both cap alphabetic; }
.book-meta { color: var(--muted); font-size: 12px; text-box: trim-both cap alphabetic; }
.book-slot.missing::after { background: var(--line); }
.book-slot.missing { background: color-mix(in srgb, var(--bg2) 60%, var(--bg)); }
.book-slot.to-stamp .book-art, .book-slot.to-stamp .book-name { opacity: 0; }
.book-slot.stamp .book-art, .book-slot.stamp .book-name { opacity: 1; animation: stamp .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes stamp { from { opacity: 0; transform: scale(2.2) rotate(-10deg); } 60% { transform: scale(.92) rotate(2deg); } }
.stats { display: flex; gap: var(--sp-6, 32px); margin: var(--gap-section, 28px) 3px 3px; padding: 18px 22px; flex-wrap: wrap; }
.stats > div { align-items: flex-start; }

.subtabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.subtab {
  --rc: var(--muted);
  font: inherit; font-size: 14px; color: var(--fg); background: var(--bg2); border: 0; cursor: pointer; margin: 3px;
  padding: 10px 13px 16px; line-height: 1; text-box: trim-both cap alphabetic;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 -4px 0 0 var(--rc);
}
.subtab:hover { transform: translateY(-3px); }
.subtab.on { background: var(--bg3); box-shadow: 0 -3px 0 0 var(--accent), 0 3px 0 0 var(--accent), -3px 0 0 0 var(--accent), 3px 0 0 0 var(--accent), inset 0 -4px 0 0 var(--rc); }

.tu { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
.contract { display: grid; grid-template-columns: repeat(5, 156px); gap: 10px; }
.slot-empty { width: 150px; height: 124px; margin: 3px; outline: 3px dashed var(--line); outline-offset: -3px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.slot-empty span { text-box: trim-both cap alphabetic; }
.tu-sum { display: flex; align-items: center; gap: 22px; margin: 20px 4px; padding: 12px 16px; }
.tu-outs { display: flex; flex-direction: column; gap: 6px; }
.tu-out { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--bg2); box-shadow: inset 4px 0 0 0 var(--rc); font-size: 14px; }
.tu-out .pct { width: 54px; }
.tu-right { display: flex; flex-direction: column; gap: 12px; }
.tu-right .item-grid { max-height: 600px; overflow-y: auto; grid-template-columns: repeat(2, 156px); padding: 4px; }
.tu-run { width: 700px; height: 460px; display: flex; align-items: center; justify-content: center; }
.machine { position: relative; width: 420px; height: 300px; }
.machine-core { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 60%, transparent), transparent); animation: throb .5s infinite; }
.machine-in { position: absolute; left: 135px; top: 80px; animation: suck 1.2s calc(var(--k) * 60ms) both; }
@keyframes suck { from { transform: translate(calc((var(--k) - 4.5) * 40px), -60px) rotate(calc((var(--k) - 4.5) * 4deg)); } to { transform: scale(.4); opacity: 0; } }
.machine.shake { animation: shake .12s infinite; }

.arcade-body { display: flex; justify-content: center; }
.game { display: flex; gap: 30px; align-items: center; justify-content: center; width: 100%; }
.game.col { flex-direction: column; gap: 18px; display: flex; }
.stagearea { width: 520px; height: 440px; background: var(--bg2); box-shadow: 0 0 0 4px var(--ink), inset 0 0 50px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.controls { display: flex; flex-direction: column; gap: 16px; min-width: 300px; align-items: flex-start; }
.controls.row { flex-direction: row; align-items: center; flex-wrap: wrap; justify-content: center; }
.row { display: flex; gap: 10px; }
.betbox { display: flex; align-items: center; gap: 6px; }
.side { font: inherit; color: var(--fg); background: var(--bg2); border: 0; margin: 3px; padding: 10px 14px; line-height: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; box-shadow: 0 0 0 3px var(--ink); transition: transform .25s var(--spring); }
.side:hover { transform: translateY(-3px); }
.side.on { box-shadow: 0 0 0 3px var(--accent); }
.flipcoin { will-change: transform; }
.hist { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; align-items: center; }
.auto { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.upg { display: grid; grid-template-columns: 1fr 320px 1fr; gap: 20px; width: 100%; }
.upg-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.upg-col .item-grid { grid-template-columns: repeat(auto-fill, 156px); }
.col-title { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.upg-mid { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 30px; }

.rl-window { width: 960px; height: 96px; overflow: hidden; position: relative; background: var(--bg2); box-shadow: 0 0 0 4px var(--ink); display: flex; align-items: center; }
.rl-strip { display: flex; will-change: transform; }
.rl-tile { width: 72px; height: 72px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: inset 0 0 0 2px var(--ink), inset 0 -5px 0 0 rgba(0,0,0,.3); }
.rl-tile.red, .rl-dot.red, .btn.red { background: #b8323a; color: #fff; }
.rl-tile.black, .rl-dot.black, .btn.black { background: #24242c; color: #fff; }
.rl-tile.green, .rl-dot.green, .btn.green { background: #2f9a4f; color: #fff; }
.rl-tile.won { box-shadow: inset 0 0 0 4px var(--accent); }
.rl-dot { width: 28px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; box-shadow: 0 0 0 2px var(--ink); margin: 2px; }
.rl-bet { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rl-pile { font-size: 13px; height: 18px; display: flex; align-items: center; }
.btn.red, .btn.black, .btn.green { min-width: 110px; }

canvas.crash { background: var(--bg2); box-shadow: 0 0 0 4px var(--ink); }
.cr-dot { font-size: 13px; padding: 4px 6px; box-shadow: 0 0 0 2px var(--line); color: var(--muted); margin: 2px; }
.cr-dot.hi { color: var(--good); box-shadow: 0 0 0 2px var(--good); }

.mines { display: grid; grid-template-columns: repeat(5, 72px); gap: 10px; }
.mine { width: 72px; height: 72px; background: var(--bg3); border: 0; box-shadow: 0 0 0 3px var(--ink), inset 0 -5px 0 rgba(0,0,0,.35), inset 0 3px 0 var(--hi); cursor: pointer; display: flex; align-items: center; justify-content: center; font: inherit; color: var(--fg); padding: 0; transition: transform .2s var(--spring), filter .15s; }
.mine:hover:not(:disabled) { filter: brightness(1.3); transform: translateY(-3px); }
.mine:disabled { cursor: default; }
.mine.opened { animation: popin .3s cubic-bezier(.2,1.6,.4,1); }
.mine.boom { background: #5a1c1c; }
.mine.gem { background: var(--bg2); }
.mine:not(.opened).boom, .mine:not(.opened).gem { opacity: .55; }
.bomb { font-size: 28px; color: var(--bad); }

.fanfare { position: fixed; inset: 0; z-index: 70; background: color-mix(in srgb, var(--bg) 94%, transparent); display: flex; align-items: center; justify-content: center; animation: fade .25s; transition: opacity .25s; }
.fanfare.out { opacity: 0; }
.fan-box { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.fan-title { display: flex; font-size: 64px; font-weight: 700; letter-spacing: 6px; color: var(--accent); text-shadow: 0 6px 0 var(--ink); }
.fan-title span { display: inline-block; animation: slam .5s calc(var(--i) * 55ms) cubic-bezier(.2,1.6,.4,1) both, wave 1.8s calc(.6s + var(--i) * 80ms) ease-in-out infinite; text-box: trim-both cap alphabetic; }
@keyframes slam { from { opacity: 0; transform: translateY(-80px) scale(1.8); } }
.fan-num { font-size: 120px; font-weight: 700; color: var(--fg); text-shadow: 0 8px 0 var(--ink); line-height: 1; text-box: trim-both cap alphabetic; }
.fan-reward { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fan-unlocks { display: flex; gap: 26px; }
.fan-case { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fan-crate canvas { animation: bob 1.6s ease-in-out infinite; filter: drop-shadow(0 0 16px rgba(255,255,255,.35)); }
.fan-case-name { font-size: 18px; text-box: trim-both cap alphabetic; }
.fan-actions { display: flex; justify-content: center; min-height: 50px; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); }
::-webkit-scrollbar-track { background: transparent; }
.odds[hidden] { display: none; }
.btn.help { font-size: 19px; padding: 14px 0 20px; width: 53px; margin-right: 12px; }
.btn.help.on { background: var(--accent); color: var(--bg); }

body { image-rendering: pixelated; }
.btn > *, .sign > h1 { position: relative; top: var(--kdy, 0px); }
.k-button .btn:not(.red):not(.black):not(.green) { background: none; }
.k-button .btn { padding: 3px 6px; }
.k-button .btn.small { padding: 2px 4px; }
.k-button .btn.big { padding: 6px 10px; }
.k-button .btn.square { padding: 2px; }
.k-button .btn.help { width: auto; padding: 4px; margin-right: 12px; }
.btn.help canvas { display: block; }
.btn.red, .btn.black, .btn.green { border-image: none !important; box-shadow: 0 0 0 3px var(--ink) !important; }
.k-panel_wood .modal { padding: 6px; }
.k-panel_wood .stage-box { width: 1018px; padding: 4px 5px 5px; }
.k-panel_wood .hud-coins { padding: 2px 6px; }
.k-panel_wood .hud-level { padding: 2px 6px; }
.k-panel_wood .stats { padding: 4px 10px; }
.k-panel_wood .tu-sum { padding: 2px 6px; }
.k-panel_paper .peek { padding: 4px; }
.k-panel_paper .peek, .k-panel_paper .odds, .tag { --fg: #2b2118; --muted: #6e5a44; color: var(--fg); }
.k-panel_paper .odds { padding: 6px; margin-top: 4px; }
.k-panel_paper .odds .mini { background: rgba(0,0,0,.08); box-shadow: inset 0 -4px 0 0 var(--rc); }
.k-panel_paper .odds .rtag { color: color-mix(in srgb, var(--rc) 40%, #2b2118); }
.k-panel_paper .odds .rtag.rt7 { color: #7a1f5a; }
.k-panel_metal .selbar { padding: 0 6px; }
.k-panel_metal .inv-area { padding: 8px; }
.k-frame_wall .book-slot { padding: 4px 2px 6px; background: none; }
.k-frame_wall .book-slot.missing { background: none; opacity: .6; }
.k-card .card { background: none; }
.k-card .card-name { padding: 0 2px; }
.k-card .card-name:last-child { padding-bottom: 9px; }
.k-card .card-foot { padding: 6px 2px 4px; }
.k-card .card.card-lg .card-name { padding: 4px 4px 10px; }
.k-tab .nav-btn { padding: 2px 6px; }
.k-tab .nav-btn::after { display: none; }
.k-tab .subtab { padding: 2px 6px; }
.k-tab .chip { padding: 1px 4px; }
.k-tab .chip.dot { padding: 1px; }
.k-tab .col-case { padding: 2px 6px; }
.nav-btn canvas.kit { opacity: .75; }
.xp-slot { display: flex; }
.coin-slot { display: flex; }

.k-wall .hud { background: linear-gradient(rgba(5,4,10,.7), rgba(5,4,10,.7)), var(--tile-wall); }
.k-wall .screens { background: radial-gradient(ellipse 80% 70% at 50% 40%, rgba(5,4,10,.35), rgba(5,4,10,.75)), var(--tile-wall); }
.k-floor .screens::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tile-floor-h) * 2); background: linear-gradient(rgba(5,4,10,.4), rgba(5,4,10,.4)), var(--tile-floor); background-position: 0 0; }

.sign-hang { display: inline-flex; animation: swing 7s steps(1, end) infinite; }
@keyframes swing { 0%, 50%, 100% { translate: 0 0; } 58% { translate: var(--S, 3px) 0; } 66% { translate: 0 0; } 74% { translate: calc(var(--S, 3px) * -1) 0; } 82% { translate: 0 0; } }
.k-sign .sign { padding: 5px 12px; }
.k-sign.k-chain .sign-hang { position: relative; }
.k-sign.k-chain .sign-hang::before, .k-sign.k-chain .sign-hang::after { content: ''; position: absolute; bottom: 100%; width: var(--tile-chain-w); height: 600px; pointer-events: none; background: var(--tile-chain) repeat-y 0 100%; }
.k-sign.k-chain .sign-hang::before { left: var(--S); }
.k-sign.k-chain .sign-hang::after { right: calc(var(--S) * 2); }
.k-sign .view-head h1 { text-shadow: 0 3px 0 rgba(0,0,0,.5); }

.shop { position: absolute; inset: 0; overflow: hidden; background: #0d0b14; }
.shop .layer { position: absolute; inset: 0; will-change: transform; }
.shop .layer > * { position: absolute; }
.shop .l-front { pointer-events: none; }
.wallbg {
  inset: calc(var(--S) * -4);
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 31px, color-mix(in srgb, var(--fg) 3%, transparent) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, color-mix(in srgb, var(--fg) 3%, transparent) 31px 32px),
    var(--bg);
}
.k-wall .wallbg { background: var(--tile-wall); background-position: calc(var(--S) * 4) calc(var(--S) * 4); }
.floorbg { left: calc(var(--S) * -4); right: calc(var(--S) * -4); bottom: calc(var(--S) * -4); background: linear-gradient(#6b4320 0 var(--S), #4a2c14 var(--S)); box-shadow: 0 calc(var(--S) * -1) 0 0 var(--ink); }
.k-floor .floorbg { background: var(--tile-floor); background-position: calc(var(--S) * 4) 0; box-shadow: none; }
.shop canvas, .shop .fb { display: block; }
.fb { background: color-mix(in srgb, var(--fg) 7%, var(--bg2)); box-shadow: inset 0 0 0 var(--S) var(--ink); }
.fb-shelf { background: linear-gradient(#8a5a2b 0 33%, #6b4320 33% 75%, #4a2c14 75%); }
.fb-pedestal { background: linear-gradient(color-mix(in srgb, var(--cc, #888) 40%, var(--bg3)) 0 30%, var(--bg3) 30%); }
.fb-lamp { background: linear-gradient(90deg, transparent 45%, var(--ink) 45% 55%, transparent 55%) 0 0 / 100% 60% no-repeat, linear-gradient(#3a3a44, #24242c) 0 100% / 100% 40% no-repeat; box-shadow: none; }
.fb-window { background: linear-gradient(#0b1430, #1d2450); }
.fb-cat, .fb-keeper, .fb-plant_a, .fb-plant_b { opacity: 0; }
.fb-neon_open { background: none; box-shadow: inset 0 0 0 var(--S) var(--accent); }
.hot { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; color: var(--fg); }
.hot:hover > canvas, .hot:hover > .fb, .pedestal:hover .ped-crate, .st-frames:hover .wall-frame, .case-tile:not(.locked):hover .case-crate > canvas.px:not(.case-lock), .cab.on .cab-art > * {
  filter: drop-shadow(var(--S, 3px) 0 0 var(--accent)) drop-shadow(calc(var(--S, 3px) * -1) 0 0 var(--accent)) drop-shadow(0 var(--S, 3px) 0 var(--accent)) drop-shadow(0 calc(var(--S, 3px) * -1) 0 var(--accent));
}
.hot-label {
  position: absolute; left: 0; bottom: calc(100% + var(--S) * 3); z-index: 3;
  white-space: nowrap; pointer-events: none; padding: 7px 9px; font-size: 15px; line-height: 1; text-box: trim-both cap alphabetic;
  background: var(--ink); color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, var(--ink));
  opacity: 0; translate: 0 6px; transition: opacity .15s, translate .2s var(--spring);
}
.hot:hover .hot-label { opacity: 1; translate: 0 0; }
.wall-frame { position: absolute; top: 0; display: flex; align-items: center; justify-content: center; background: #1b1620; box-shadow: inset 0 0 0 var(--S) #5a3a1e; }
.k-frame_wall .wall-frame { background: none; box-shadow: none; }
.pedestal { z-index: 1; }
.ped-crate-wrap, .ped-base { position: absolute; }
.ped-crate-wrap { animation: pbob 2.4s calc(var(--i, 0) * -.37s) infinite steps(1); }
.pedestal:hover .ped-crate-wrap { animation-duration: .8s; }
@keyframes pbob { 0%, 100% { translate: 0 0; } 25%, 75% { translate: 0 calc(var(--S) * -1); } 50% { translate: 0 calc(var(--S) * -2); } }
.ped-crate { position: relative; }
.daily-glow { position: absolute; inset: calc(var(--S) * -9); background: radial-gradient(closest-side, rgba(242,194,58,.5), transparent); animation: throb 1.4s infinite; pointer-events: none; }
.tag { position: absolute; left: 0; white-space: nowrap; font-size: 13px; line-height: 1; padding: 5px 6px; background: #e8dcc0; box-shadow: 0 0 0 2px var(--ink); pointer-events: none; }
.k-panel_paper .tag { padding: 0 2px; background: none; box-shadow: none; }
.tag .coins { gap: 4px; }
.tag .num, .tag .free { text-box: trim-both cap alphabetic; }
.free { color: #a8740a; font-weight: 700; }
.neon { filter: drop-shadow(0 0 calc(var(--S) * 2) var(--accent)) drop-shadow(0 0 calc(var(--S) * 6) color-mix(in srgb, var(--accent) 55%, transparent)); }
.neon.dim { filter: drop-shadow(0 0 var(--S) color-mix(in srgb, var(--accent) 35%, transparent)); }
.lamp .cone, .lamp .bulb { position: absolute; pointer-events: none; will-change: opacity; }
.lamp .bulb { width: calc(var(--S) * 44); height: calc(var(--S) * 44); margin: calc(var(--S) * -22); background: radial-gradient(closest-side, rgba(255,214,140,.32), transparent); }
.lamp > canvas.kit, .lamp > .fb { position: relative; }
.mote { width: var(--S); height: var(--S); background: rgba(255,230,180,.75); opacity: 0; animation: mote var(--dur) var(--delay) steps(30) infinite; }
@keyframes mote { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .8; } 85% { opacity: .5; } 100% { transform: translate(var(--dx), calc(var(--S) * -30)); opacity: 0; } }

.shelf-wall { display: flex; flex-wrap: wrap; gap: 30px 44px; padding: 8px 4px; }
.shelf-unit { position: relative; }
.unit-shelf { position: absolute; left: 0; }
.unit-shelf canvas, .unit-shelf .fb, .case-ped canvas, .case-ped .fb { display: block; }
.unit-row { display: flex; position: relative; }
.case-tile { position: relative; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--fg); cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.case-stand { position: relative; width: 100%; }
.case-crate { position: absolute; left: calc(var(--S) * 6); z-index: 1; animation: pbob 2.8s calc(var(--i, 0) * -.4s) infinite steps(1); }
.case-crate canvas { display: block; }
.case-tile:hover .case-crate { animation-duration: .8s; }
.case-ped { position: absolute; left: calc(var(--S) * 4); bottom: 0; }
.case-lock { position: absolute; left: calc(var(--S) * 8); top: calc(var(--S) * 2); }
.case-tile.locked .case-crate { animation: none; }
.case-tile.locked .case-crate > canvas:not(.case-lock), .case-tile.locked .case-ped { filter: brightness(.38) saturate(.3); }
.case-tile.locked .case-label { opacity: .55; }
.case-label { display: flex; flex-direction: column; align-items: center; gap: 9px; white-space: nowrap; }

.vault-room { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: start; }
.vault-side { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.vault-door canvas, .vault-door .fb { display: block; }
.vault-stats { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 14px; align-self: stretch; }
.k-panel_metal .vault-stats { padding: 2px 4px; }
.vault-side .chips { flex-wrap: wrap; justify-content: center; max-width: 244px; }
.inv-area { min-height: 460px; }
.bench { display: flex; justify-content: center; margin-bottom: 4px; }
.bench canvas, .bench .fb { display: block; }

.cabinets { display: flex; gap: 16px; align-items: flex-end; }
.cab { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--muted); cursor: pointer; display: flex; flex-direction: column-reverse; align-items: center; gap: 10px; }
.cab-art canvas, .cab-art .fb { display: block; --S: 2px; }
.cab:not(.on) .cab-art { filter: brightness(.6); }
.cab:hover .cab-art { filter: none; }
.cab.on { color: var(--fg); }
.cab-name { font-size: 14px; line-height: 1; text-box: trim-both cap alphabetic; }

@media (prefers-reduced-motion: reduce) {
  .ped-crate-wrap, .case-crate, .sign-hang, .mote, .daily-glow { animation: none; }
}
.back-art.kit-back { background: none; box-shadow: none; }
.back-art.kit-back canvas { display: block; }
.k-button .btn { color: #2b1d10; }
.k-tab_on .subtab.on, .k-tab_on .chip.on, .k-tab_on .col-case.on, .k-tab_on .nav-btn.on { color: #2b1d10; }
.k-tab_on .col-case.on .muted { color: #6e5a44; }
.k-wall .wallbg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(12,8,30,.62), rgba(12,8,30,.5)); }
.app { grid-template-columns: minmax(0, 1fr); }
.hud { gap: 10px; padding: 0 14px; }
.hud-brand, .nav-btn { white-space: nowrap; }
.hud-nav { gap: 4px; }
.xp-bar { width: 100px; }
.shelf-wall { gap: 30px 32px; }
.k-panel_wood .modal { overflow: hidden; display: flex; flex-direction: column; }
.k-panel_wood .modal > * { overflow-y: auto; min-height: 0; padding-right: 4px; }
.shop .layer { pointer-events: none; }
.shop .layer > .hot { pointer-events: auto; }
.hud { gap: 8px; }
.k-tab .nav-btn { padding: 2px 4px; gap: 6px; font-size: 14px; }
.xp-bar { width: 84px; }
.hud-level { gap: 8px; }
.slot-empty { background: rgba(5,4,10,.45); outline-color: color-mix(in srgb, var(--fg) 22%, transparent); }
.tu-sum .k { white-space: nowrap; }
.k-wall .wallbg::after { background: linear-gradient(rgba(12,8,30,.38), rgba(12,8,30,.24)); }
.win-glow { background: radial-gradient(closest-side, rgba(120,150,255,.16), transparent); pointer-events: none; }
.cab-glow { background: radial-gradient(closest-side, rgba(90,220,255,.28), transparent); pointer-events: none; will-change: opacity; }
.k-card .card::before, .k-frame_wall .book-slot::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--rc) 14%, transparent), color-mix(in srgb, var(--rc) 5%, transparent) 70%); pointer-events: none; }
.k-frame_wall .book-slot.missing::before { display: none; }
.card > *, .book-slot > * { position: relative; }
.cab.on .cab-art { filter: drop-shadow(0 0 10px rgba(90,220,255,.35)); }
.shop .tag { font-size: 16px; }
.ped-crate-wrap, .case-crate, .sign-hang { will-change: translate; }
.mote { will-change: transform, opacity; }
.sellzone .icon { margin-right: 10px; }

.inspect { display: flex; flex-direction: column; align-items: center; gap: 18px; --rc: #888; }
.insp-stage { position: relative; width: 100%; min-height: 240px; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; user-select: none; background: radial-gradient(ellipse at 50% 55%, color-mix(in srgb, var(--rc) 22%, transparent), transparent 68%); }
.insp-stage.drag { cursor: grabbing; }
.insp-hint { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; opacity: .7; }
.insp-title { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.insp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; width: 100%; max-width: 860px; }
.insp-stats, .insp-feats { display: flex; flex-direction: column; gap: 12px; }
.insp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.insp-row .v { text-align: right; }
.insp-float { position: relative; padding-bottom: 16px; }
.insp-float .wearbar { width: 100%; }
.insp-scale { position: relative; height: 10px; }
.insp-scale span { position: absolute; transform: translateX(-50%); top: 6px; }
.insp-stickers { display: flex; align-items: center; gap: 12px; }
.insp-slot { width: 46px; height: 46px; display: grid; place-items: center; background: var(--bg2); color: var(--muted); font-size: 20px; box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 2px color-mix(in srgb, var(--fg) 12%, transparent); cursor: pointer; }
.insp-slot.on { box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 2px var(--rc); }
.insp-slot.arm { box-shadow: 0 0 0 3px #eb4b4b; }
.sticker-drawer { display: flex; flex-direction: column; gap: 18px; align-items: center; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; width: min(560px, 80vw); max-height: 50vh; overflow-y: auto; padding: 4px; }
.sticker-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; background: var(--bg2); box-shadow: 0 0 0 3px var(--ink), inset 0 -4px 0 0 var(--rc); cursor: pointer; }
.sticker-name { font-size: 14px; }
.badge.souvenir { color: #f2c23a; }
.badge.ed-shiny { color: #e8f4ff; }
.badge.ed-holo { color: #d07bff; }
.badge.ed-golden { color: #f2c23a; }
.badge.effect { color: #7fffb0; }
canvas.item { flex: none; }
.card canvas.item { pointer-events: none; }
.peek .badges { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
.card.r7::after { background: linear-gradient(90deg, #ff6fc8, #f2c23a 50%, #ff6fc8); background-size: 200% 100%; animation: prism 2.4s linear infinite; }
@keyframes prism { to { background-position: -200% 0; } }
.rtag.rt7 { color: #ffd2ee; box-shadow: 0 0 0 2px #f2c23a, inset 0 0 0 2px #ff6fc8; background: linear-gradient(90deg, rgba(255,111,200,.25), rgba(242,194,58,.25)); }
.xp-text { white-space: nowrap; }
.hud-level { flex: none; }
.hud-nav { min-width: 0; }
@media (max-width: 1380px) {
  .hud { gap: 6px; padding: 0 10px; }
  .hud-nav { margin-left: 0; gap: 2px; }
  .nav-btn > span { display: none; }
  .nav-btn { padding: 10px 9px; }
  .nav-btn::after { left: 9px; right: 9px; }
  .xp-bar { width: 72px; }
  .hud-coins { min-width: 0; padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 1000px) {
  .hud-brand > span { display: none; }
  .hud-level { padding-left: 8px; padding-right: 8px; gap: 6px; }
  .xp-bar { width: 56px; }
}

.case-sub.has-badge { display: flex; align-items: center; gap: 6px; }
.tier-badge { display: block; }
.shelf-break { flex-basis: 100%; height: 0; }

.pity { display: flex; flex-direction: column; gap: 7px; min-width: 210px; }
.pity-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.pity-label .k { color: var(--muted); }
.pity-label .v { color: var(--fg); }
.pity-frame { position: relative; height: 18px; box-sizing: border-box; background: #0c0c10; border: 2px solid #3a3a44; image-rendering: pixelated; }
.pity-frame.kit { background-clip: padding-box; }
.pity-fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--pc) 0 6px, color-mix(in srgb, var(--pc) 72%, #000) 6px 8px); transition: width .7s cubic-bezier(.3,.9,.3,1); }
.pity.hot .pity-fill { animation: pity-hot 1s steps(2) infinite; }
.pity.full .pity-fill { background: repeating-linear-gradient(90deg, #ffe08a 0 6px, var(--pc) 6px 8px); animation: pity-full .5s steps(2) infinite; }
.pity.full .pity-label .v { color: var(--pc); }
@keyframes pity-hot { 50% { filter: brightness(1.35); } }
@keyframes pity-full { 50% { filter: brightness(1.6); } }
.stage-head .pity { margin-left: 18px; }

.announcer { position: fixed; left: 0; right: 0; top: 10px; z-index: 70; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.callout { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 34px; background: #121217; border: 3px solid var(--ac); box-sizing: border-box; image-rendering: pixelated; max-width: calc(100vw - 16px); text-align: center; }
.callout.kit { background: none; padding: 4px 22px; }
.co-text { font-size: clamp(18px, 8.4vw, 34px); font-weight: 700; color: var(--ac); text-shadow: 0 3px 0 #000; letter-spacing: 1px; line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; text-box: trim-both cap alphabetic; }
.co-sub { font-size: 14px; color: var(--fg); line-height: 1.2; text-wrap: balance; overflow-wrap: anywhere; text-box: trim-both cap alphabetic; }
@media (max-width: 440px) { .callout { padding: 12px 14px; } .callout.kit { padding: 2px 6px; } }
.callout.lv5 .co-text, .callout.lv6 .co-text, .callout.lv7 .co-text { font-size: clamp(22px, 10vw, 46px); }
.callout.dual .co-text { background: linear-gradient(90deg, var(--ac), var(--ac2), var(--ac)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 3px 0 #000); animation: co-shine 1.4s linear infinite; }
.callout.pulse .co-text { animation: co-pulse .4s steps(2) infinite; }
.callout.dual.pulse .co-text { animation: co-shine 1.4s linear infinite, co-pulse .4s steps(2) infinite; }
@keyframes co-shine { to { background-position: -200% 0; } }
@keyframes co-pulse { 50% { filter: brightness(1.4) drop-shadow(0 3px 0 #000); } }
