:root {
  --ink: #0b0c0e;
  --bg: #101113;
  --panel: #18191d;
  --panel2: #26282d;
  --line: #2b2d33;
  --line2: #3a3d45;
  --text: #f4f1e8;
  --dim: #8e9098;
  --brand: #ffd23f;
  --brand-ink: #1a1400;
  --win: #35d49a;
  --lose: #ff4848;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sol: #a98bff;
  --c-common: #a3acb9;
  --c-rare: #4c9dff;
  --c-epic: #b26bff;
  --c-legendary: #ffb21e;
  --c-mythic: #ff6a00;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image: linear-gradient(#ffffff07 1px, transparent 1px), linear-gradient(90deg, #ffffff07 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--text);
  font: 500 14px/1.45 'Space Grotesk', system-ui, sans-serif;
}
body.playing { overflow: hidden; touch-action: none; }
h1, h2, h3 { margin: 0; font-weight: 400; font-family: 'Archivo Black', sans-serif; letter-spacing: -.01em; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
svg { width: 16px; height: 16px; flex: none; }

/* ---------- buttons ---------- */
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 4px; background: var(--brand); color: var(--brand-ink); font-weight: 800; letter-spacing: .01em; box-shadow: 0 3px 0 #8a6d00; transition: transform .05s; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #8a6d00; }
.btn.ghost { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2), 0 3px 0 #000; }
.btn.ghost:active:not(:disabled) { box-shadow: inset 0 0 0 1px var(--line2), 0 1px 0 #000; }
.btn.big { height: 52px; font-size: 16px; padding: 0 24px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .4; cursor: default; }
.small-btn { height: 34px; font-size: 13px; }
.sq { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 4px; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line); color: var(--dim); }
.sq:hover { color: var(--text); }

/* ---------- header ---------- */
header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; height: 60px; padding: 0 20px; background: var(--ink); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font: 400 24px 'Archivo Black', sans-serif; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.mark { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 22px; height: 22px; }
.mark i { background: var(--brand); }
.mark i:nth-child(2), .mark i:nth-child(3) { background: transparent; box-shadow: inset 0 0 0 2px var(--brand); }
nav { display: flex; gap: 2px; height: 100%; }
nav button { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 100%; color: var(--dim); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
nav button:hover { color: var(--text); }
nav button.on { color: var(--text); }
nav button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; background: var(--brand); }
nav .dot { position: absolute; top: 16px; right: 6px; width: 7px; height: 7px; background: var(--brand); }
header .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bal { display: flex; align-items: baseline; gap: 6px; height: 36px; padding: 0 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); line-height: 36px; font-variant-numeric: tabular-nums; }
.bal .lbl { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--dim); }
.bal b { font-size: 15px; }
.bal.turf b { color: var(--brand); }
.bal .tag { font-size: 9px; font-weight: 800; letter-spacing: .06em; color: var(--dim); border: 1px solid var(--line2); padding: 0 4px; line-height: 14px; align-self: center; }
#walletBtn { height: 36px; font-size: 13px; }

/* ---------- layout ---------- */
#lobby { max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.ph { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ph > span { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.wide-ph { margin-bottom: 14px; }

/* ---------- PLAY ---------- */
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.arena-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.demo-wrap { position: relative; height: 380px; background: var(--ink); border-bottom: 1px solid var(--line); }
#demo { display: block; width: 100%; height: 100%; }
.demo-label { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); background: var(--ink); padding: 5px 9px; border: 1px solid var(--line); border-radius: 3px; }
.live { width: 7px; height: 7px; background: var(--lose); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.pitch { padding: 22px 24px 4px; }
h1 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.02; }
.pitch p { margin: 8px 0 0; color: var(--dim); max-width: 560px; }
.play-buttons { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; padding: 20px 24px 24px; }
.mode-btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; height: 76px; padding: 0 20px; border-radius: 4px; text-align: left; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line2), 0 4px 0 #000; transition: transform .05s; }
.mode-btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 1px var(--line2), 0 1px 0 #000; }
.mode-btn .k { font: 400 20px 'Archivo Black', sans-serif; }
.mode-btn .v { font-size: 12px; color: var(--dim); font-weight: 600; }
.mode-btn.primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 0 #8a6d00; }
.mode-btn.primary .v { color: #5a4700; }
.mode-btn.primary:active { box-shadow: 0 1px 0 #8a6d00; }

.side { display: flex; flex-direction: column; gap: 12px; }
.me-card { display: flex; gap: 14px; align-items: center; }
#avatar { width: 56px; height: 56px; flex: none; border-radius: 4px; background: var(--ink); }
.me-info { flex: 1; min-width: 0; }
#nameInput { width: 100%; background: none; border: 0; border-bottom: 1px dashed transparent; color: var(--text); font: 400 17px 'Archivo Black', sans-serif; padding: 0 0 2px; }
#nameInput:hover { border-bottom-color: var(--line2); }
#nameInput:focus { outline: none; border-bottom-color: var(--brand); }
.lvl-row { display: flex; gap: 8px; align-items: center; margin: 4px 0 6px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
#lvlBadge { font-weight: 800; color: var(--text); }
.meter { height: 6px; background: var(--ink); border-radius: 1px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--text); transition: width .5s; }
.statline { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.statline div { padding: 10px 0; text-align: center; }
.statline div + div { border-left: 1px solid var(--line); }
.statline b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.statline span { font-size: 11px; color: var(--dim); }
.notice { text-align: left; padding: 10px 14px; border-radius: 6px; border: 1px solid #a98bff55; background: #a98bff12; color: #cbbaff; font-weight: 600; font-size: 13px; }
.notice:hover { background: #a98bff1f; }

.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.streak div { height: 38px; border-radius: 3px; background: var(--ink); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; color: var(--dim); font-variant-numeric: tabular-nums; }
.streak div b { font-size: 11px; color: var(--text); }
.streak .on { background: var(--brand); border-color: var(--brand); color: #5a4700; }
.streak .on b { color: var(--brand-ink); }
.streak .next { border-color: var(--brand); border-style: dashed; }

.mission { padding: 10px 0; border-top: 1px solid var(--line); }
.mission:first-child { border-top: 0; padding-top: 0; }
.mission .top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-weight: 600; }
.mission .rw { color: var(--brand); font-weight: 800; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mission .bot { display: flex; align-items: center; gap: 10px; height: 26px; }
.mission .meter { flex: 1; }
.mission .meter i { background: var(--brand); }
.mission .n { font-size: 12px; color: var(--dim); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.mission .btn { height: 26px; padding: 0 12px; font-size: 12px; box-shadow: 0 2px 0 #8a6d00; }
.mission.done .top span:first-child { color: var(--dim); text-decoration: line-through; }

/* ---------- tiles / skins ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tiles.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.tile canvas { display: block; width: 100%; aspect-ratio: 16 / 10; background: var(--ink); }
.tile .rb { height: 3px; }
.tile .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile .nm { font-weight: 800; }
.tile .sub { font-size: 12px; color: var(--dim); }
.tile .buy { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.tile .price { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.tile .buy .btn { height: 30px; padding: 0 14px; font-size: 12px; box-shadow: 0 2px 0 #8a6d00; }
.tile .buy .btn.ghost { box-shadow: inset 0 0 0 1px var(--line2), 0 2px 0 #000; }
button.tile:hover { border-color: var(--line2); }
.tile.sel { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.tile .flag { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; background: var(--ink); border: 1px solid var(--line2); border-radius: 2px; }
.tile .flag.eq { background: var(--text); color: var(--ink); border-color: var(--text); }
.rar { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.rar.common { color: var(--c-common); } .rar.rare { color: var(--c-rare); } .rar.epic { color: var(--c-epic); } .rar.legendary { color: var(--c-legendary); } .rar.mythic { color: var(--c-mythic); text-shadow: 0 0 10px #ff6a0066; }
.empty { padding: 40px 20px; text-align: center; color: var(--dim); border: 1px dashed var(--line2); border-radius: 6px; grid-column: 1 / -1; }

/* ---------- CRATES ---------- */
.crate-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.crate-stage { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 40px 24px 28px; text-align: center; }
.crate-stage h2 { font-size: 32px; margin-top: 24px; }
.crate-stage p { margin: 6px auto 0; max-width: 420px; }
.crate-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.crate-art { position: relative; width: 200px; height: 170px; margin: 0 auto; }
.crate-art .box { position: absolute; left: 10px; right: 10px; bottom: 0; height: 120px; background: var(--brand); border: 4px solid var(--ink); box-shadow: inset 0 -18px 0 #e0b000, 8px 8px 0 #000; display: grid; place-items: center; }
.crate-art .box::before, .crate-art .box::after { content: ''; position: absolute; top: 0; bottom: 0; width: 14px; background: var(--ink); opacity: .9; }
.crate-art .box::before { left: 28px; } .crate-art .box::after { right: 28px; }
.crate-art .box span { position: relative; z-index: 1; font: 400 26px 'Archivo Black', sans-serif; color: var(--brand-ink); background: var(--brand); padding: 0 8px; }
.crate-art .lid { position: absolute; left: 0; right: 0; top: 18px; height: 34px; background: var(--brand); border: 4px solid var(--ink); box-shadow: inset 0 -8px 0 #e0b000, 8px 8px 0 #000; z-index: 2; transform-origin: 10% 100%; }
.crate-art.shake { animation: crateShake .35s ease-in-out infinite; }
@keyframes crateShake { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.odds .row-o { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.odds .row-o:first-of-type { border-top: 0; }
.odds .sw { width: 12px; height: 12px; }
.odds .pct { font-weight: 800; font-variant-numeric: tabular-nums; }
.odds .skins { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.odds .skins span { font-size: 11px; color: var(--dim); background: var(--ink); border: 1px solid var(--line); padding: 1px 6px; border-radius: 2px; }

/* ---------- MARKET ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: flex; border: 1px solid var(--line2); border-radius: 4px; overflow: hidden; }
.seg button { height: 34px; padding: 0 12px; font-size: 12px; font-weight: 700; color: var(--dim); }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--text); color: var(--ink); }
select { height: 34px; padding: 0 10px; background: var(--panel2); color: var(--text); border: 1px solid var(--line2); border-radius: 4px; font: inherit; font-size: 12px; font-weight: 700; }
#faucetBtn { margin-left: auto; }
.market-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.sales { list-style: none; margin: 0; padding: 0; }
.sales li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sales li:first-child { border-top: 0; }
.sales .sw { width: 10px; height: 10px; }
.sales .who { font-size: 11px; color: var(--dim); display: block; }
.sales .p { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.sales .none { display: block; color: var(--dim); }

/* ---------- LOCKER ---------- */
.locker-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.detail { position: sticky; top: 80px; }
#detailCanvas { display: block; width: 100%; height: auto; background: var(--ink); border-radius: 4px; margin-bottom: 14px; }
.d-name { display: flex; align-items: baseline; justify-content: space-between; }
.d-name b { font: 400 22px 'Archivo Black', sans-serif; }
#dInfo { margin: 4px 0 14px; }
.sell { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.sell label { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.sell-row { display: flex; gap: 8px; align-items: center; }
.sell-row input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; background: var(--ink); border: 1px solid var(--line2); border-radius: 4px; color: var(--text); font: inherit; font-weight: 800; font-size: 15px; }
.sell-row input:focus { outline: none; border-color: var(--brand); }
.sell-row span { font-size: 12px; color: var(--dim); font-weight: 700; }
#sellHint { margin: 8px 0 0; }

/* ---------- RANKS ---------- */
.ranks-head { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 12px; margin-bottom: 20px; }
.big-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; }
.big-stat span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.big-stat b { display: inline-block; font: 400 30px 'Archivo Black', sans-serif; margin-top: 6px; font-variant-numeric: tabular-nums; }
.big-stat em { font-style: normal; color: var(--dim); font-weight: 700; margin-left: 6px; font-size: 13px; }
.big-stat.you { border-color: var(--brand); }
.big-stat.you em { display: block; margin: 2px 0 0; color: var(--brand); }
.ranks-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.table-panel { padding: 0; overflow: hidden; }
table.ranks { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ranks th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 800; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.ranks td { padding: 11px 16px; border-bottom: 1px solid var(--line); }
.ranks tr:last-child td { border-bottom: 0; }
.ranks .num { text-align: right; }
.ranks td.r { width: 48px; font-weight: 800; color: var(--dim); }
.ranks tr:nth-child(1) td.r { color: #ffd23f; } .ranks tr:nth-child(2) td.r { color: #d7dbe2; } .ranks tr:nth-child(3) td.r { color: #e3a46c; }
.ranks .pl { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.ranks .pl i { width: 12px; height: 12px; flex: none; }
.ranks td.est { color: var(--brand); font-weight: 800; }
.ranks tr.me td { background: #ffd23f12; }
.ranks .empty-row td { text-align: center; color: var(--dim); padding: 40px 16px; }
.rules ol { margin: 12px 0; padding-left: 18px; }
.rules li { margin-bottom: 10px; color: #c9cbd2; }
.rules li b { color: var(--text); }

/* ---------- ARENA ---------- */
#arena { display: flex; flex-direction: column; align-items: center; height: calc(100vh - 60px); padding: 12px 16px 16px; }
#hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; max-width: var(--board, 640px); }
.side-h { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-weight: 700; }
.side-h.opp { justify-content: flex-end; }
.side-h b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-h em { font: 400 20px 'Archivo Black', sans-serif; font-style: normal; font-variant-numeric: tabular-nums; }
.side-h .sw { width: 12px; height: 12px; flex: none; }
#timer { font: 400 30px 'Archivo Black', sans-serif; min-width: 60px; text-align: center; font-variant-numeric: tabular-nums; }
#timer.low { color: var(--lose); }
.split { display: flex; width: 100%; max-width: var(--board, 640px); height: 4px; background: var(--ink); margin: 8px 0 10px; }
.split i { display: block; height: 100%; transition: width .3s; }
.split i:last-child { margin-left: auto; }
#stage { position: relative; flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
#game { display: block; border: 1px solid var(--line2); }
.overlay { position: absolute; inset: 0; margin: auto; width: var(--board, 100%); height: var(--board, 100%); max-width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: rgba(12, 13, 17, .9); padding: 16px; }
.overlay.clear { background: transparent; pointer-events: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.loader { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 36px; height: 36px; margin-bottom: 16px; }
.loader i { background: var(--brand); animation: cell 1.2s infinite; }
.loader i:nth-child(2) { animation-delay: .3s; } .loader i:nth-child(4) { animation-delay: .6s; } .loader i:nth-child(3) { animation-delay: .9s; }
@keyframes cell { 0%, 60%, 100% { opacity: .15; } 30% { opacity: 1; } }
#waitText { margin: 0 0 16px; }
#countNum { font: 400 150px 'Archivo Black', sans-serif; color: var(--text); -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; animation: pop .9s ease-out; }
@keyframes pop { from { transform: scale(1.8); opacity: 0; } 25% { opacity: 1; transform: scale(.95); } to { transform: scale(1); } }
#result h2 { font-size: 64px; line-height: 1; animation: pop .5s ease-out; }
h2.win { color: var(--win); } h2.lose { color: var(--lose); } h2.tie { color: var(--brand); }
#resultReason { color: var(--dim); margin: 6px 0 16px; }
.score-bar { display: flex; width: min(360px, 90%); height: 10px; background: var(--ink); border: 1px solid var(--line2); }
.score-bar i { display: block; height: 100%; width: 0; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.score-bar i:last-child { margin-left: auto; }
#resultScore { font-weight: 800; font-size: 17px; margin: 10px 0 14px; font-variant-numeric: tabular-nums; }
.rewards { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: 34px; }
.rewards div { height: 34px; line-height: 34px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 3px; font-weight: 800; background: var(--panel); animation: rise .4s both; }
.rewards div:nth-child(2) { animation-delay: .12s; } .rewards div:nth-child(3) { animation-delay: .24s; }
.rewards .p { color: var(--brand); } .rewards .x { color: var(--win); } .rewards .lu { background: var(--text); color: var(--ink); border-color: var(--text); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.chips span { font-size: 12px; font-weight: 800; color: var(--brand-ink); background: var(--brand); border-radius: 2px; padding: 3px 8px; animation: rise .4s .35s both; }
#resultPay { min-height: 20px; margin: 12px 0 16px; }
#resultPay a, .toast a { color: var(--brand); }

/* ---------- crate opening ---------- */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(8, 9, 12, .95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 16px; }
.reel-box { position: relative; width: min(1000px, 100%); height: 170px; overflow: hidden; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); background: var(--ink); }
.reel-box::before, .reel-box::after { content: ''; position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2; pointer-events: none; }
.reel-box::before { left: 0; background: linear-gradient(90deg, var(--ink), transparent); }
.reel-box::after { right: 0; background: linear-gradient(-90deg, var(--ink), transparent); }
.reel-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--brand); z-index: 3; }
.reel-marker::before, .reel-marker::after { content: ''; position: absolute; left: -7px; border: 8px solid transparent; }
.reel-marker::before { top: 0; border-top-color: var(--brand); } .reel-marker::after { bottom: 0; border-bottom-color: var(--brand); }
.reel { display: flex; gap: 8px; height: 100%; padding: 12px 0; will-change: transform; }
.reel .it { flex: none; width: 140px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.reel .it canvas { width: 100%; height: 106px; display: block; }
.reel .it .rb { height: 4px; }
.reel .it span { padding: 4px 8px; font-size: 12px; font-weight: 800; }
.reel .it.win { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.reveal { text-align: center; animation: rise .4s both; }
.reveal h2 { font-size: 44px; margin: 4px 0 18px; }
.rar.big { font-size: 14px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 40; width: max-content; max-width: calc(100% - 32px); pointer-events: none; }
.toast { pointer-events: auto; background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--text); padding: 10px 14px; border-radius: 3px; font-weight: 600; animation: rise .25s both; }
.toast.good { border-left-color: var(--brand); }
.toast.good b { color: var(--brand); }
.toast.bad { border-left-color: var(--lose); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .play-grid, .crate-grid, .market-grid, .locker-grid, .ranks-grid { grid-template-columns: 1fr; }
  .detail { position: static; }
  nav button { padding: 0 10px; }
  nav button svg { display: none; }
  .bal.turf .tag { display: none; }
}
@media (max-width: 720px) {
  header { height: auto; flex-wrap: wrap; padding: 10px 16px 0; gap: 10px; }
  nav { order: 3; width: 100%; overflow-x: auto; height: 44px; }
  header .right { gap: 6px; }
  .bal { padding: 0 8px; }
  .bal .lbl { display: none; }
  #lobby { padding: 16px 16px 40px; }
  .play-buttons { grid-template-columns: 1fr; padding: 16px; }
  .pitch { padding: 18px 16px 0; }
  .demo-wrap { height: 260px; }
  .ranks-head { grid-template-columns: 1fr; }
  .ranks th:nth-child(3), .ranks td:nth-child(3) { display: none; }
  .ranks td, .ranks th { padding: 10px; }
  #result h2 { font-size: 46px; }
  #faucetBtn { margin-left: 0; }
  #arena { height: calc(100vh - 110px); }
}
.sales li.nil { display: block; color: var(--dim); }

/* ---------- v4: tiers, challenges, search bar ---------- */
.stake-col { display: flex; flex-direction: column; gap: 8px; }
.seg.tiers { align-self: stretch; }
.seg.tiers button { flex: 1; height: 32px; }
.play-buttons { align-items: start; }
.play-buttons > .mode-btn { height: 100%; min-height: 76px; }
.online { display: flex; align-items: center; gap: 8px; padding: 0 24px 20px; font-size: 12px; color: var(--dim); font-weight: 700; }
.online .live { background: var(--win); }
.challenge { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; background: var(--brand); color: var(--brand-ink); border-radius: 6px; }
.challenge > div { flex: 1; display: flex; flex-direction: column; }
.challenge b { font: 400 18px 'Archivo Black', sans-serif; }
.challenge span { font-weight: 600; font-size: 13px; }
.challenge .btn { background: var(--ink); color: var(--text); box-shadow: 0 3px 0 #000; }
.challenge .sq { background: transparent; box-shadow: inset 0 0 0 1px #0004; color: var(--brand-ink); }
.searchbar { position: sticky; top: 60px; z-index: 9; display: flex; align-items: center; gap: 12px; padding: 8px 20px; background: var(--panel2); border-bottom: 1px solid var(--brand); font-weight: 700; }
.searchbar #searchTxt { flex: 1; }
.loader.sm { width: 18px; height: 18px; gap: 2px; margin: 0; }
.room { width: min(520px, 100%); }
.room h2 { font-size: 28px; }
.room p { margin: 6px 0 16px; }
.room .sell-row input { font-size: 13px; }
.row.left { justify-content: flex-start; margin-top: 14px; }
a.btn { text-decoration: none; }
@media (max-width: 720px) { .searchbar { top: 0; flex-wrap: wrap; } .online { padding: 0 16px 16px; } }
.mission .n { line-height: 1; }

/* ---------- v5: ready checklist, X tasks ---------- */
.ready { border-color: var(--brand); }
.step { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.step:first-of-type { border-top: 0; padding-top: 0; }
.step i { width: 18px; height: 18px; border: 2px solid var(--line2); border-radius: 3px; }
.step.done i { background: var(--win); border-color: var(--win); box-shadow: inset 0 0 0 3px var(--panel); }
.step.done span { color: var(--dim); }
.step .btn { height: 30px; padding: 0 12px; font-size: 12px; box-shadow: 0 2px 0 #8a6d00; }
.step.done .btn { display: none; }
.ready .dev { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line2); }
.ready .dev p { margin: 0 0 8px; }
.ready.pulse { animation: readyPulse .6s 2; }
@keyframes readyPulse { 50% { box-shadow: 0 0 0 3px var(--brand); } }
.task { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; padding-top: 0; }
.task .lb { font-weight: 600; }
.task .rw { grid-column: 1; font-size: 12px; font-weight: 800; color: var(--brand); }
.task .act { grid-row: 1 / span 2; grid-column: 2; }
.task .act .btn { height: 30px; padding: 0 12px; font-size: 12px; box-shadow: 0 2px 0 #8a6d00; }
.task .act .btn.ghost { box-shadow: inset 0 0 0 1px var(--line2), 0 2px 0 #000; }
.task .ok { font-size: 12px; font-weight: 800; color: var(--win); }
.task.done .lb { color: var(--dim); }
.xname { font-size: 12px; color: var(--dim); font-weight: 600; }
#nameInput[readonly] { cursor: default; border-bottom-color: transparent; }
.avatar-wrap { position: relative; flex: none; }
.avatar-wrap img { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--panel); background: var(--ink); }

/* ---------- v6: KLAIM brand ---------- */
.logo { gap: 9px; }
.logo .logo-mark { width: 24px; height: 30px; }
.logo .logo-word { width: 92px; height: 25px; overflow: visible; }
.logo .logo-word text { font: 400 26px 'Archivo Black', sans-serif; fill: var(--text); letter-spacing: -.5px; }
.logo:hover .logo-mark { transform: rotate(-6deg); transition: transform .15s; }
h1 span { color: var(--brand); }
h1 { letter-spacing: -.02em; }
#timer, .bal b, .tile .price, .odds .pct, .statline b, .sales .p, .ranks td.num, .big-stat b, #resultScore, .mission .n, .mission .rw, .task .rw, .side-h em, #countNum, .breakdown td:last-child, .tier-card b, .tier-card em { font-family: var(--mono); }
#timer { font-weight: 700; }
.big-stat b { font-weight: 700; }
.tier-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tier-card { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 12px; border-radius: 4px; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line2); text-align: left; }
.tier-card span { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--dim); }
.tier-card b { font-size: 20px; font-weight: 700; }
.tier-card b small { font-size: 11px; color: var(--dim); font-weight: 600; }
.tier-card em { font-style: normal; font-size: 11px; color: var(--win); font-weight: 600; }
.tier-card.on { box-shadow: inset 0 0 0 2px var(--brand); background: #ffd23f14; }
.tier-card.on span { color: var(--brand); }
.stake-col .ph { margin-bottom: 0; }
.mode-btn .k { letter-spacing: .01em; }
.count-sub { font: 400 18px 'Archivo Black', sans-serif; letter-spacing: .04em; color: var(--brand); margin-top: -10px; text-shadow: 0 3px 0 #000; }
.confirm { width: min(440px, 100%); }
.confirm h2 { font-size: 30px; margin: 2px 0 14px; }
.breakdown { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.breakdown td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.breakdown td:last-child { text-align: right; font-weight: 600; }
.breakdown tr.win td { border-bottom: 0; font-weight: 800; color: var(--win); font-size: 16px; }
.confirm .row.left { margin-top: 16px; }
.rar.big.quick { color: var(--dim); } .rar.big.pro { color: var(--brand); } .rar.big.high { color: var(--lose); }
@media (max-width: 720px) { .tier-card b { font-size: 16px; } .tier-card { padding: 8px; } }
.mnote { margin: -6px 0 10px; }
.sub-h { margin: 16px 0 10px; padding-top: 14px; border-top: 1px solid var(--line2); }
