:root {
  --bg: #0d0a0b;
  --bg2: #140f11;
  --panel: #1b1517;
  --panel2: #231b1e;
  --panel3: #2e2327;
  --line: #2f2428;
  --line2: #413237;
  --text: #e9edf5;
  --muted: #a3939a;
  --dim: #6e5d63;
  --accent: #ef3b3b;
  --accent-hi: #ff6b6b;
  --accent-lo: #8b1a1a;
  --accent-ink: #ffffff;
  --gold: #e4ae39;
  --red: #ff5c5c;
  --green: #34d399;
  --blue: #4b69ff;
  --radius: 12px;
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Russo One', 'Rubik', sans-serif;
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--line2) var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(239, 59, 59, 0.08), transparent 70%),
    radial-gradient(900px 600px at 100% 0%, rgba(75, 105, 255, 0.07), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 16px; }
/* notched phones in landscape (viewport-fit=cover): keep content out of the rounded corners */
@supports (padding: max(0px)) {
  .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}
.main { flex: 1; padding-top: 22px; padding-bottom: 48px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--panel3); color: var(--text); font-weight: 600; cursor: pointer;
  transition: transform .08s, background .15s, border-color .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--line2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: var(--accent-ink); box-shadow: 0 6px 24px -8px rgba(239, 59, 59, .6), inset 0 -2px 0 rgba(0,0,0,.15);
}
.btn-primary:hover { background: linear-gradient(180deg, #ff8a8a, var(--accent-hi)); }
.btn-gold { background: linear-gradient(180deg, #f3c55a, var(--gold)); color: #231703; }
.btn-gold:hover { background: linear-gradient(180deg, #f8d57e, #f0bb46); }
.btn-danger { background: rgba(240, 82, 82, .14); color: #ff8a8a; border-color: rgba(240, 82, 82, .35); }
.btn-danger:hover { background: rgba(240, 82, 82, .24); }
.btn-ghost { background: transparent; border-color: var(--line2); }
.btn-ghost:hover { background: var(--panel2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 28px; font-size: 16px; border-radius: 12px; }
.btn.active { background: var(--accent); color: var(--accent-ink); }

.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2);
  background: var(--panel); cursor: pointer; font-weight: 500; font-size: 14px; color: var(--muted);
  transition: all .15s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--dim); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.input, .select {
  height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--bg2); outline: none; transition: border-color .15s; min-width: 0;
}
.input:focus, .select:focus { border-color: var(--accent); }
.select { padding-right: 10px; cursor: pointer; }
.input-sm { height: 34px; font-size: 14px; }

.coin { display: inline-block; width: 1em; height: 1em; vertical-align: -0.14em; flex: none; }
.price { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--panel3); color: var(--muted);
}
.badge-accent { background: rgba(239, 59, 59, .15); color: var(--accent); }
.badge-gold { background: rgba(228, 174, 57, .15); color: var(--gold); }
.badge-red { background: rgba(240, 82, 82, .15); color: var(--red); }
.badge-blue { background: rgba(75, 105, 255, .18); color: #8ea2ff; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-pad { padding: 18px; }
.section-head { display: flex; align-items: center; gap: 14px; margin: 26px 0 14px; flex-wrap: wrap; }
.section-head:first-child { margin-top: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--text); }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.loading { padding: 60px; display: grid; place-items: center; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ header */
.topbar {
  position: sticky; top: 0; z-index: 50; background: rgba(13, 10, 11, .88);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-size: 21px; letter-spacing: .03em; }
.logo:hover { color: var(--text); }
.logo b { color: var(--accent); font-weight: 400; }
.logo.small { font-size: 16px; gap: 8px; margin-bottom: 8px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav > a, .nav-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14.5px;
  transition: color .15s, background .15s; background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.nav > a:hover, .nav-trigger:hover, .nav-trigger[aria-expanded="true"] { color: var(--text); background: var(--panel); }
.nav > a.active, .nav-trigger.active { color: var(--accent); background: rgba(239, 59, 59, .08); }
.nav-trigger .chev { transition: transform .15s; opacity: .8; }
.nav-trigger[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-group { position: relative; }
.nav-heading { display: none; }
.nav-menu {
  display: none; position: absolute; left: 0; top: calc(100% + 8px); min-width: 210px; margin: 0; padding: 6px; list-style: none;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 20px 40px rgba(0,0,0,.5); z-index: 60;
}
.nav-menu-right { left: auto; right: 0; }
.nav-menu.open { display: block; animation: menuIn .14s ease-out; }
/* invisible bridge so the mouse can travel from the trigger to the menu without closing it */
.nav-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } }
.nav-menu a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: var(--text); font-weight: 500; font-size: 14.5px; white-space: nowrap;
}
.nav-menu a:hover, .nav-menu a:focus-visible { background: var(--panel3); color: var(--text); }
.nav-menu a.active { color: var(--accent); background: rgba(239, 59, 59, .08); }
.nav-menu svg {
  width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  color: var(--accent-hi); opacity: .9;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.balance {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 14px; min-width: 0;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.balance-amount { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balance .coin { font-size: 17px; }
.balance-amount.flash-up { animation: flashUp .8s; }
.balance-amount.flash-down { animation: flashDown .8s; }
@keyframes flashUp { 0% { color: var(--green); } 100% { color: inherit; } }
@keyframes flashDown { 0% { color: var(--red); } 100% { color: inherit; } }
.bonus-btn { height: 30px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; flex: none; }
.usermenu { position: relative; flex: none; }
.userchip {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 10px 0 5px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line2); cursor: pointer; font-weight: 600; color: var(--text);
}
.userchip:hover, .userchip[aria-expanded="true"] { border-color: var(--dim); }
.userchip .uname { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip .chev { display: inline-flex; color: var(--muted); transition: transform .15s; }
.userchip[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lvl-slot { display: inline-flex; align-items: center; }
.lvl-slot:empty { display: none; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,.5); z-index: 60;
}
.dropdown a, .dropdown button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; font-weight: 500;
}
.dropdown a:hover, .dropdown button:hover, .dropdown a:focus-visible, .dropdown button:focus-visible { background: var(--panel3); }
.usermenu .dropdown:not(.open) { display: none; }
.usermenu .dropdown.open { animation: menuIn .14s ease-out; }
.dropdown .dd-sep { height: 1px; background: var(--line2); margin: 5px 4px; }
.dropdown .dd-danger { color: #ff8a8a; }
.reconnecting { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.reconnecting .spinner { width: 16px; height: 16px; border-width: 2px; }
.burger { display: none; margin-left: 4px; width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); cursor: pointer; padding: 11px 10px; flex-direction: column; justify-content: space-between; }
.burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* keyboard focus + screen-reader helpers */
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.input:focus-visible, .select:focus-visible { outline: none; }
.item[role="button"]:focus-visible, .case-card:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; transform: translateY(-3px); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 300; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; }
.skip-link:focus { top: 10px; color: #fff; }
.main:focus { outline: none; }
/* a dialog focuses its own box when it has nothing else to focus: no ring around the whole dialog */
.modal:focus-visible { outline: none; }

.avatar {
  --h: 120; width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, hsl(var(--h) 70% 55%), hsl(calc(var(--h) + 40) 70% 35%));
  color: #fff; font-weight: 800; font-size: 13px; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.avatar.bot { background: linear-gradient(135deg, #475569, #1e293b); }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.avatar.md { width: 42px; height: 42px; font-size: 17px; }

/* ------------------------------------------------------------------ live bar */
.livebar { border-bottom: 1px solid var(--line); background: rgba(20, 15, 17, .7); }
.livebar-inner { display: flex; align-items: stretch; gap: 12px; height: 86px; }
.live-label {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px;
  font-family: var(--display); font-size: 13px; color: var(--accent); padding-right: 12px;
  border-right: 1px solid var(--line); flex: none; min-width: 64px;
}
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(239,59,59,.7); animation: pulse 1.6s infinite; margin-bottom: 4px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(239,59,59,0); } 100% { box-shadow: 0 0 0 0 rgba(239,59,59,0); } }
.online { font-family: var(--font); font-size: 11px; color: var(--muted); font-weight: 500; }
.live-track {
  display: flex; gap: 6px; overflow: hidden; align-items: center; flex: 1; min-width: 0;
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.live-item {
  --c: #888; flex: 0 0 118px; height: 72px; border-radius: 9px; position: relative; overflow: hidden;
  background: radial-gradient(90% 90% at 50% 100%, color-mix(in srgb, var(--c) 35%, transparent), transparent 75%), var(--panel);
  border: 1px solid var(--line); padding: 4px 6px; animation: dropIn .5s cubic-bezier(.2,.9,.3,1.3);
}
.live-item::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--c); }
.live-item img { height: 42px; margin: 0 auto; object-fit: contain; }
.live-item .li-name { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); text-align: center; }
.live-item .li-user {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: rgba(10,12,16,.92); opacity: 0; transition: opacity .15s; font-size: 11.5px; font-weight: 600; text-align: center; padding: 4px;
}
.live-item:hover .li-user { opacity: 1; }
@keyframes dropIn { from { transform: translateX(-60px) scale(.8); opacity: 0; } }

/* ------------------------------------------------------------------ item card */
.grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.item {
  --c: #b0c3d9; position: relative; overflow: hidden; border-radius: 11px; border: 1px solid var(--line);
  background: radial-gradient(120% 85% at 50% 105%, color-mix(in srgb, var(--c) 30%, transparent), transparent 72%), var(--panel);
  padding: 10px 11px 12px; display: flex; flex-direction: column; min-width: 0;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.item::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); box-shadow: 0 0 14px var(--c); }
.item.clickable { cursor: pointer; }
.item.clickable:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 60%, var(--line)); }
.item.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.item.selected::before {
  content: '✓'; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; display: grid; place-items: center; z-index: 2;
}
.item.disabled { opacity: .35; pointer-events: none; }
.item-top { display: flex; gap: 4px; min-height: 18px; align-items: center; font-size: 11px; font-weight: 700; }
.item-top .wear { color: var(--muted); }
.item-top .st { color: #cf6a32; }
.item-top .souv { color: #ffd700; }
.item-top .chance { margin-left: auto; color: var(--muted); font-weight: 600; }
.item-img { aspect-ratio: 4 / 3; display: grid; place-items: center; margin: 2px 0 6px; }
.item-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0,0,0,.55)); transition: transform .2s; }
.item.clickable:hover .item-img img { transform: scale(1.06); }
.item-weapon { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-skin { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-bottom { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.item-bottom .price { font-size: 14px; }
.item-bottom .btn { margin-left: auto; }
.item .float { font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.item-quick {
  position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .15s; z-index: 3;
}
.item:hover .item-quick { opacity: 1; }
/* selection toggle on inventory cards (keyboard + screen readers); the tick itself is .item.selected::before */
.item-check {
  position: absolute; top: 6px; right: 6px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; padding: 0;
  border: 2px solid var(--line2); background: rgba(13, 10, 11, .7); cursor: pointer; opacity: 0; transition: opacity .15s;
}
.item:hover .item-check, .item-check:focus-visible { opacity: 1; }
.item.selected .item-check { opacity: 1; background: transparent; border-color: transparent; }
@media (hover: none) { .item-check { opacity: .8; } }

/* ------------------------------------------------------------------ hero + case cards */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 34px 36px; margin-bottom: 26px;
  background:
    radial-gradient(600px 300px at 85% 30%, rgba(239,59,59,.22), transparent 70%),
    linear-gradient(120deg, #240d10, #10141d 55%);
  border: 1px solid var(--line); display: flex; align-items: center; gap: 30px; min-height: 210px;
}
.hero > div:first-child { min-width: 0; }
.hero h1 { font-size: 40px; line-height: 1.05; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); max-width: 520px; margin: 12px 0 20px; font-size: 16px; }
.hero-art { margin-left: auto; position: relative; width: 360px; height: 180px; flex: none; }
.hero-art img { position: absolute; width: 230px; filter: drop-shadow(0 20px 30px rgba(0,0,0,.6)); }
.hero-art img:nth-child(1) { right: 120px; top: 10px; transform: rotate(-14deg); }
.hero-art img:nth-child(2) { right: 0; top: -10px; transform: rotate(10deg); }
.hero-stats { display: flex; gap: 26px; margin-top: 4px; }
.hero-stats div { font-size: 13px; color: var(--muted); }
.hero-stats b { display: block; font-family: var(--display); font-size: 20px; color: var(--text); font-weight: 400; }

.grid-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.case-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 16px 14px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); transition: transform .18s, border-color .18s, box-shadow .18s; overflow: hidden;
}
.case-card::before {
  content: ''; position: absolute; inset: auto 10% 38% 10%; height: 50%;
  background: radial-gradient(closest-side, rgba(239,59,59,.18), transparent); filter: blur(6px); transition: opacity .2s; opacity: .5;
}
.case-card:hover { transform: translateY(-4px); border-color: var(--line2); color: var(--text); box-shadow: 0 16px 30px -18px rgba(0,0,0,.9); }
.case-card:hover::before { opacity: 1; }
.case-card img { position: relative; width: 82%; aspect-ratio: 4 / 3; object-fit: contain; transition: transform .25s; filter: drop-shadow(0 12px 16px rgba(0,0,0,.55)); }
.case-card:hover img { transform: scale(1.07) rotate(-2deg); }
.case-card .cc-name { position: relative; font-weight: 600; font-size: 14px; margin: 8px 0 10px; min-height: 40px; display: flex; align-items: center; }
.case-card .cc-price {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px;
  background: var(--panel3); font-weight: 700;
}
.case-card:hover .cc-price { background: var(--accent); color: var(--accent-ink); }
.case-card .cc-badge { position: absolute; top: 10px; left: 10px; }
.case-card.custom::before { background: radial-gradient(closest-side, rgba(228,174,57,.3), transparent); }
.case-visual { position: relative; }
.case-visual.custom {
  display: grid; place-items: center; aspect-ratio: 4 / 3; width: 82%; border-radius: 14px;
  background:
    radial-gradient(circle at 50% 40%, rgba(228,174,57,.35), transparent 65%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, #2a2413, #16140d);
  border: 2px solid rgba(228,174,57,.45); box-shadow: inset 0 0 30px rgba(0,0,0,.6);
}
.case-visual.custom img { width: 90%; }
.case-visual.custom::after {
  content: 'ROMAN'; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  font-family: var(--display); font-size: 10px; letter-spacing: .25em; color: var(--gold); opacity: .8;
}

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { flex: 1 1 220px; max-width: 360px; }

/* ------------------------------------------------------------------ case page */
.case-head { display: flex; align-items: center; gap: 22px; margin: 12px 0 20px; }
.case-head .case-visual, .case-head > img { width: 170px; flex: none; }
.case-head .case-visual img, .case-head > img { filter: drop-shadow(0 16px 20px rgba(0,0,0,.6)); }
.case-head h1 { font-size: 30px; }
.case-meta { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

.opener { padding: 20px; margin-bottom: 26px; }
.reels { display: flex; flex-direction: column; gap: 10px; }
.opener-controls { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.qty { display: flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 3px; gap: 3px; }
.qty button { width: 38px; height: 34px; border: 0; background: none; border-radius: 7px; cursor: pointer; font-weight: 700; color: var(--muted); }
.qty button:hover { color: var(--text); }
.qty button.active { background: var(--panel3); color: var(--accent); }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 14px; user-select: none; }
.toggle { position: relative; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.toggle input:focus-visible + .sw { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.toggle .sw { width: 36px; height: 20px; border-radius: 99px; background: var(--panel3); position: relative; transition: background .2s; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: all .2s; }
.toggle input:checked + .sw { background: var(--accent-lo); }
.toggle input:checked + .sw::after { left: 19px; background: var(--accent-hi); }

.results { margin-top: 18px; }
.results-inner { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.results .item { width: 180px; animation: pop .45s cubic-bezier(.2,.9,.3,1.4); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.results-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ reel */
.reel {
  position: relative; overflow: hidden; background: linear-gradient(180deg, var(--bg2), #0c0f14); border-radius: 12px;
  border: 1px solid var(--line); height: 176px; user-select: none;
}
.reel.compact { height: 132px; }
.reel-strip { position: absolute; top: 12px; left: 0; display: flex; gap: 6px; will-change: transform; }
.reel.compact .reel-strip { top: 9px; }
/* min-width 0 + overflow: a long item name must never widen a tile (the reel assumes equal steps; it widened reels on phones).
   The landed tile may overflow again so its glow and landing pulse are not cut off. */
.reel-tile { flex: 0 0 140px; min-width: 0; overflow: hidden; }
.reel .reel-tile.win { overflow: visible; }
.reel.compact .reel-tile { flex-basis: 108px; }
.reel .item { height: 150px; padding: 8px 9px 10px; }
.reel.compact .item { height: 112px; padding: 6px 7px 8px; }
.reel.compact .item-img { margin: 0 0 3px; }
.reel.compact .item-weapon { font-size: 10.5px; }
.reel.compact .item-skin { font-size: 11.5px; }
.reel-marker { position: absolute; z-index: 3; pointer-events: none; }
.reel:not(.vertical) .reel-marker { top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.reel:not(.vertical) .reel-marker::before, .reel:not(.vertical) .reel-marker::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%); border: 8px solid transparent;
}
.reel:not(.vertical) .reel-marker::before { top: 0; border-top-color: var(--gold); }
.reel:not(.vertical) .reel-marker::after { bottom: 0; border-bottom-color: var(--gold); }
.reel-fade { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(90deg, var(--bg2), transparent 18%, transparent 82%, var(--bg2)); }
.reel .reel-tile.win .item { border-color: var(--c); box-shadow: 0 0 26px -2px var(--c), inset 0 0 0 1px var(--c); transform: scale(1.04); transition: transform .3s, box-shadow .3s; }

.reel.vertical { height: 350px; }
.reel.vertical .reel-strip { flex-direction: column; top: 0; left: 10px; right: 10px; }
.reel.vertical .reel-tile { flex: 0 0 104px; }
.reel.vertical .item { height: 104px; flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; }
.reel.vertical .item-img { width: 44%; flex: none; margin: 0; }
.reel.vertical .item-info { min-width: 0; flex: 1; }
.reel.vertical .reel-marker { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.reel.vertical .reel-marker::before, .reel.vertical .reel-marker::after { content: ''; position: absolute; top: 50%; transform: translateY(-50%); border: 8px solid transparent; }
.reel.vertical .reel-marker::before { left: 0; border-left-color: var(--gold); }
.reel.vertical .reel-marker::after { right: 0; border-right-color: var(--gold); }
.reel.vertical .reel-fade { background: linear-gradient(180deg, var(--bg2), transparent 22%, transparent 78%, var(--bg2)); }

.reel-tag { position: absolute; top: 5px; left: 7px; z-index: 1; font-size: 10px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.reel-tag.st { color: #cf6a32; }

/* 2-5 cases: vertical reels side by side */
.reels.multi { display: grid; gap: 10px; }
.reels.multi .reel.vertical { height: 380px; }
.reels.multi .reel.vertical .reel-tile { flex-basis: 124px; }
.reels.multi .reel.vertical .reel-strip { left: 6px; right: 6px; }
.reels.multi .reel.vertical .item { flex-direction: column; justify-content: center; gap: 2px; text-align: center; padding: 16px 6px 8px; height: 124px; }
.reels.multi .reel.vertical .item-img { width: 100%; height: 68px; aspect-ratio: auto; }
.reels.multi .reel.vertical .item-img img { width: 100%; height: 68px; }
.reels.multi .reel.vertical .item-info { flex: none; width: 100%; }
.reels.multi .reel.vertical .item-weapon { font-size: 11px; }
.reels.multi .reel.vertical .item-skin { font-size: 12px; }

/* ------------------------------------------------------------------ upgrader */
.upgrader-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch; margin-bottom: 22px; }
.up-slot { padding: 18px; display: flex; flex-direction: column; min-height: 330px; }
.up-slot h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.up-slot-body { flex: 1; display: grid; place-items: center; text-align: center; }
.up-slot .placeholder { color: var(--dim); max-width: 220px; }
.up-slot .placeholder svg { margin: 0 auto 10px; opacity: .5; }
.up-selected { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; width: 100%; align-self: start; }
.up-selected .item { padding: 6px 7px 8px; }
.up-selected .item-skin { font-size: 11.5px; }
.up-selected .item-weapon { font-size: 10.5px; }
.up-total { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.up-target .item { width: 220px; }

.wheel-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 6px; gap: 16px; }
.wheel { position: relative; width: 290px; height: 290px; }
.wheel svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.wheel-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.wheel-center .pct { font-family: var(--display); font-size: 44px; line-height: 1; }
.wheel-center .lbl { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .12em; margin-top: 6px; }
.wheel-center .mult { color: var(--accent); font-weight: 700; margin-top: 4px; }
.wheel-pointer { position: absolute; inset: 0; pointer-events: none; }
.wheel-pointer::before {
  content: ''; position: absolute; left: 50%; top: -4px; transform: translateX(-50%);
  border: 12px solid transparent; border-top: 20px solid #fff; border-bottom: 0; filter: drop-shadow(0 0 6px rgba(255,255,255,.7));
}
.wheel.win .pct { color: var(--green); }
.wheel.lose .pct { color: var(--red); }
.mults { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.upgrader-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.upgrader-bottom .panel { padding: 16px; min-width: 0; }
.upgrader-bottom .grid-items { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); max-height: 560px; overflow-y: auto; padding: 2px 4px 2px 2px; }
.upgrader-bottom .item-skin { font-size: 12.5px; }

/* ------------------------------------------------------------------ battles */
.battle-row {
  display: grid; grid-template-columns: 150px 1fr auto auto 150px; gap: 18px; align-items: center;
  padding: 14px 18px; margin-bottom: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  transition: border-color .15s;
}
.battle-row:hover { border-color: var(--line2); }
.battle-row.finished { opacity: .65; }
.br-mode { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.br-format { font-family: var(--display); font-size: 18px; }
.br-cases { display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; }
.br-case { width: 64px; flex: none; position: relative; }
.br-case .cnt { position: absolute; right: 0; bottom: 0; font-size: 11px; font-weight: 700; background: var(--panel3); border-radius: 5px; padding: 0 5px; }
.br-more { color: var(--muted); font-weight: 600; font-size: 13px; }
.br-slots { display: flex; gap: 5px; align-items: center; }
.slot-dot { width: 32px; height: 32px; border-radius: 50%; border: 2px dashed var(--line2); }
.br-vs { color: var(--dim); font-size: 11px; font-weight: 700; margin: 0 2px; }
.br-cost { text-align: right; }
.br-cost small { display: block; color: var(--muted); font-size: 12px; }
.br-actions { display: flex; justify-content: flex-end; }

.create-grid { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.picker .grid-cases { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; max-height: 640px; overflow-y: auto; padding: 2px; }
.picker .case-card { padding: 10px; }
.picker .case-card .cc-name { font-size: 12.5px; min-height: 34px; margin: 4px 0 6px; }
.picker .case-card .cc-price { padding: 4px 10px; font-size: 13px; }
.picker .case-card .in-cart { position: absolute; top: 8px; right: 8px; background: var(--accent); color: var(--accent-ink); border-radius: 99px; min-width: 24px; height: 24px; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; z-index: 2; }
.cart { position: sticky; top: 90px; padding: 18px; }
.cart-list { display: flex; flex-direction: column; gap: 8px; max-height: 330px; overflow-y: auto; margin: 12px 0; }
.cart-row { display: flex; align-items: center; gap: 10px; background: var(--bg2); border-radius: 10px; padding: 6px 8px; }
.cart-row img { width: 48px; }
.cart-row .cr-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-row .cr-qty { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.cart-row .cr-qty button { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; }
.opt-group { margin-top: 14px; }
.opt-group label { display: block; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 7px; font-weight: 600; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--bg2); border: 1px solid var(--line2); padding: 4px; border-radius: 10px; }
.seg button { height: 34px; border: 0; border-radius: 7px; background: none; cursor: pointer; font-weight: 700; color: var(--muted); font-size: 13.5px; }
.seg button.active { background: var(--panel3); color: var(--accent); }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 12px; font-size: 16px; }

.battle-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 0 14px; }
.battle-status { font-family: var(--display); font-size: 20px; }
.battle-pot { margin-left: auto; text-align: right; }
.battle-pot small { display: block; color: var(--muted); font-size: 12px; }
.battle-pot .price { font-size: 22px; }
.round-strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px; margin-bottom: 14px; }
.round-case { flex: 0 0 78px; padding: 6px; border-radius: 10px; border: 1px solid transparent; text-align: center; opacity: .45; transition: all .25s; position: relative; }
.round-case.done { opacity: .3; }
.round-case.current { opacity: 1; border-color: var(--accent); background: rgba(239,59,59,.07); transform: translateY(-2px); }
.round-case.pending { opacity: .85; }
.round-case .rc-n { font-size: 11px; color: var(--muted); font-weight: 700; }
.arena { display: grid; gap: 12px; }
.arena.teams { gap: 12px; }
.fighter { padding: 14px; min-width: 0; transition: border-color .3s, box-shadow .3s, opacity .3s; }
.fighter.winner { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 40px -12px var(--green); }
.fighter.loser { opacity: .55; }
.fighter-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 42px; }
.fighter-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fighter-total { margin-left: auto; text-align: right; }
.fighter-total .price { font-size: 17px; }
.fighter-total small { display: block; font-size: 11px; color: var(--muted); }
.team-tag { font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 5px; }
.team-0 { background: rgba(75,105,255,.2); color: #8ea2ff; }
.team-1 { background: rgba(240,82,82,.18); color: #ff8a8a; }
.fighter-empty { height: 350px; border-radius: 12px; border: 2px dashed var(--line2); display: grid; place-content: center; gap: 10px; text-align: center; color: var(--muted); }
.fighter-drops { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 6px; margin-top: 12px; }
.fighter-drops .item { padding: 5px 6px 7px; animation: pop .4s cubic-bezier(.2,.9,.3,1.4); }
.fighter-drops .item-weapon { font-size: 10px; }
.fighter-drops .item-skin { font-size: 11px; }
.fighter-drops .item-bottom .price { font-size: 12px; }
.fighter-result { margin-top: 12px; padding: 10px; border-radius: 10px; text-align: center; font-weight: 700; }
.fighter-result.win { background: rgba(52,211,153,.12); color: var(--green); }
.fighter-result.lose { background: rgba(240,82,82,.1); color: #ff8a8a; }
.countdown { font-family: var(--display); font-size: 64px; color: var(--accent); text-align: center; animation: pop .5s; }

/* ------------------------------------------------------------------ shop / inventory / profile */
.profile { display: flex; gap: 20px; align-items: center; padding: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.profile h1 { font-size: 26px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 26px; }
.stat { padding: 14px 16px; }
.stat small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat b { font-family: var(--display); font-weight: 400; font-size: 21px; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.sticky-bar {
  position: sticky; top: 76px; z-index: 20; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px; background: rgba(27,21,23,.92); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px;
}
.load-more { display: flex; justify-content: center; margin-top: 20px; }
.load-more:empty { display: none; }
.shop-grid .item-bottom { flex-wrap: wrap; }
.player-link { color: var(--text); }
.player-link:hover { color: var(--accent-hi); }
.br-player { display: inline-flex; border-radius: 50%; }
.form-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; background: rgba(228, 174, 57, .1); border: 1px solid rgba(228, 174, 57, .35); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; font-weight: 600; }
.table td { padding: 12px 14px; border-top: 1px solid var(--line); }
.table .rank { font-family: var(--display); font-size: 18px; color: var(--muted); width: 50px; }
.table tr:nth-child(1) .rank { color: var(--gold); }
.table tr:nth-child(2) .rank { color: #cbd5e1; }
.table tr:nth-child(3) .rank { color: #d08b4f; }
.lb-best { display: flex; align-items: center; gap: 8px; }
.lb-best img { width: 54px; }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------------ admin */
.admin-table td { vertical-align: middle; }
.admin-table .input { width: 120px; }
.admin-table .select { height: 34px; }
.admin-luck { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 16px; }
.boosted { color: var(--gold); font-weight: 700; }

/* ------------------------------------------------------------------ modal / toast */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(5,6,9,.75); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px; animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 420px; padding: 26px; position: relative; animation: pop .3s cubic-bezier(.2,.9,.3,1.2); max-height: 90vh; overflow-y: auto; }
.modal.wide { max-width: 560px; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--panel3); cursor: pointer; font-size: 18px; }
.modal h2 { margin-bottom: 6px; }
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.form .input { width: 100%; }
.form-error { color: var(--red); font-size: 14px; min-height: 20px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; margin: 6px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.tabs { display: flex; gap: 4px; background: var(--bg2); border-radius: 10px; padding: 4px; margin-top: 14px; }
.tabs button { flex: 1; height: 36px; border: 0; background: none; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.active { background: var(--panel3); color: var(--text); }

#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  padding: 12px 16px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line2);
  box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 360px; animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2);
  font-weight: 500;
}
.toast b { font-weight: 700; }
.toast.error { border-color: rgba(240,82,82,.5); }
.toast.success { border-color: rgba(52,211,153,.5); }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(40px); opacity: 0; } }

.footer { border-top: 1px solid var(--line); padding: 24px 0; background: var(--bg2); }
.footer-inner { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; }
.footer p { margin: 0; font-size: 13px; max-width: 760px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .upgrader-top { grid-template-columns: 1fr 1fr; }
  .wheel-wrap { grid-column: 1 / -1; order: -1; }
  .create-grid { grid-template-columns: 1fr; }
  .cart { position: static; }
  .battle-row { grid-template-columns: 120px 1fr auto; }
  .br-slots { grid-column: 1 / 2; }
  .br-cost { grid-column: 2 / 3; text-align: left; }
}
/* phones + tablets: the burger shows everything as one flat list with section headings */
@media (max-width: 1180px) {
  .nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
    max-height: calc(100vh - 66px); max-height: calc(100dvh - 66px); overflow-y: auto; overscroll-behavior: contain;
    box-shadow: 0 24px 40px rgba(0,0,0,.5);
  }
  .nav.open { display: flex; }
  .nav > a { padding: 11px 12px; }
  .nav-trigger { display: none; }
  .nav-heading {
    display: block; margin: 12px 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--dim);
  }
  .nav-menu, .nav-menu.open {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px; position: static;
    padding: 0; background: none; border: 0; box-shadow: none; min-width: 0; animation: none;
  }
  .nav-menu::before { display: none; }
  .nav-menu a { padding: 11px 12px; color: var(--muted); font-weight: 600; }
  .nav-menu a.active { color: var(--accent); }
  .burger { display: flex; }
}
@media (max-width: 900px) {
  .hero-art { display: none; }
  .upgrader-bottom { grid-template-columns: 1fr; }
  .userchip .uname { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { gap: 10px; }
  .logo span { display: none; }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 30px; }
  .grid-cases { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .grid-items { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .upgrader-top { grid-template-columns: 1fr; }
  .wheel { width: 240px; height: 240px; }
  .case-head { flex-direction: column; text-align: center; }
  .case-meta { justify-content: center; }
  .battle-row { grid-template-columns: 1fr; gap: 12px; }
  .br-slots, .br-cost { grid-column: auto; }
  .br-actions { justify-content: stretch; }
  .br-actions .btn { width: 100%; }
  .reel-tile { flex-basis: 116px; }
  .results .item { width: 150px; }
  .footer-inner { flex-direction: column; }
  .bonus-btn .bonus-text { display: none; }
  .reels.multi { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)) !important; }
  .reels.multi .reel.vertical { height: 330px; }
  .arena { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .fighter { padding: 10px; }
  .fighter-head { flex-wrap: wrap; gap: 6px; }
  .fighter-total { margin-left: 0; text-align: left; width: 100%; }
  .reel.vertical { height: 290px; }
  .reel.vertical .item { flex-direction: column; justify-content: center; gap: 2px; text-align: center; }
  .reel.vertical .item-img { width: 70%; }
  .battle-pot { margin-left: 0; text-align: left; }
  .livebar-inner { height: 76px; }
  .live-item { flex-basis: 100px; height: 62px; }
  .live-item img { height: 34px; }
}

/* ------------------------------------------------------------------ referral + community cases */
.ref-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.ref-grid > * { min-width: 0; }
.ref-code {
  font-family: var(--display); font-size: clamp(22px, 8vw, 40px); letter-spacing: .06em; color: var(--gold);
  padding: 14px 20px; border-radius: 12px; background: var(--bg2); border: 1px dashed var(--line2); display: inline-block;
  max-width: 100%; overflow-wrap: anywhere;
}
.ref-link { margin: 14px 0 0; font-size: 13.5px; overflow-wrap: anywhere; word-break: break-all; }
.ref-claim { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: rgba(228, 174, 57, .08); border: 1px solid rgba(228, 174, 57, .3); }
.ref-claim b { font-family: var(--display); font-weight: 400; font-size: 22px; display: flex; align-items: center; gap: 6px; }
.ref-table td { vertical-align: middle; }
.ref-bar { width: 120px; height: 7px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line2); overflow: hidden; }
.ref-bar div { height: 100%; background: linear-gradient(90deg, var(--accent-lo), var(--accent-hi)); }
.table a.player-link { color: var(--text); font-weight: 700; }
.table a.player-link:hover { color: var(--accent-hi); }
.ref-progress { height: 12px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line2); overflow: hidden; margin-top: 14px; }
.ref-progress div { height: 100%; background: linear-gradient(90deg, var(--accent-lo), var(--accent-hi)); border-radius: 99px; }
.cc-by { position: relative; font-size: 12px; color: var(--muted); margin: -6px 0 10px; }
@media (max-width: 900px) { .ref-grid { grid-template-columns: 1fr; } }
.create-grid > * { min-width: 0; }
@media (max-width: 640px) {
  .cart-row img { width: 36px; }
  .cart-row .input { width: 70px !important; }
}

/* very narrow phones (320-400px): keep the header on one line */
@media (max-width: 400px) {
  .topbar-inner { gap: 8px; }
  .topbar-right { gap: 6px; }
  .balance { padding: 0 4px 0 9px; gap: 6px; }
  .balance > .coin { display: none; }
  .bonus-btn { padding: 0 8px; }
  .userchip { padding: 0 6px 0 4px; gap: 5px; }
  .userchip .lvl-slot, .userchip .chev { display: none; }
  .burger { margin-left: 0; }
  .reconnecting .rc-text { display: none; }
}
@media (max-width: 520px) {
  #toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: 100%; }
}

/* ------------------------------------------------------------------ real case pictures */
.case-photo {
  position: relative; width: 64%; aspect-ratio: 1; margin: 2px auto 0; border-radius: 16px; overflow: hidden;
  border: 2px solid var(--gold); box-shadow: 0 10px 24px -8px rgba(0,0,0,.8);
  transform: rotate(-2deg); transition: transform .25s;
}
.case-photo img, .case-card .case-photo img {
  width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; filter: none; transform: none;
}
.case-card:hover .case-photo { transform: rotate(0deg) scale(1.06); }
.case-card:hover .case-photo img { transform: none; }
.case-photo.brainrot {
  border-color: #ff2bd6;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, .55), 0 0 22px rgba(255, 43, 214, .45), 0 10px 24px -8px rgba(0,0,0,.8);
}
.case-photo.brainrot::after {
  content: 'BRAINROT'; position: absolute; top: 8px; right: -26px; transform: rotate(35deg);
  padding: 2px 30px; background: #ff2bd6; color: #fff; font: 900 9px/1.4 'Arial Black', Arial, sans-serif;
  letter-spacing: .06em; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.case-head .case-photo { width: 150px; flex: none; margin: 0; }
.case-head .case-photo img { filter: none; }

/* battle tie */
.fighter.tied { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 40px -12px var(--gold); }
.fighter-result.tie { background: rgba(228, 174, 57, .14); color: var(--gold); }

/* ------------------------------------------------------------------ event banner */
.eventbar { position: relative; z-index: 40; }
.event {
  background: linear-gradient(90deg, #7f1d1d, #b91c1c 30%, #b45309 70%, #7f1d1d);
  background-size: 200% 100%; animation: eventShine 8s linear infinite;
  border-bottom: 1px solid rgba(255, 255, 255, .12); color: #fff;
}
.event.upcoming { background: linear-gradient(90deg, #1f1a2e, #2e2645); animation: none; }
.event-boost { background-image: linear-gradient(90deg, #14532d, #16a34a 35%, #ca8a04 70%, #14532d); }
.event-gift { background-image: linear-gradient(90deg, #78350f, #d97706 35%, #b91c1c 70%, #78350f); }
@keyframes eventShine { to { background-position: -200% 0; } }
.event-inner { display: flex; align-items: center; gap: 14px; min-height: 46px; padding-top: 6px; padding-bottom: 6px; }
.event-icon { font-size: 22px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.event-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; flex: 1; }
.event-text b { font-family: var(--display); font-weight: 400; font-size: 17px; letter-spacing: .03em; text-shadow: 0 2px 6px rgba(0,0,0,.35); }
.event-text span { font-size: 13.5px; opacity: .9; }
.event-time { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(0,0,0,.28); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.event-claimed { font-size: 13px; font-weight: 700; opacity: .85; white-space: nowrap; }
.was { color: var(--muted); font-weight: 500; font-size: .85em; margin-right: 2px; }
.sale-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; }
.case-card:hover .cc-price .was { color: rgba(255,255,255,.75); }
@media (max-width: 640px) {
  .event-inner { gap: 6px 10px; flex-wrap: wrap; }
  /* title gets the first line, countdown + Claim wrap below it instead of squeezing the text */
  .event-text { flex: 1 1 calc(100% - 42px); }
  .event-text b { font-size: 15px; }
  .event-text span { display: none; }
  .event-time { margin-left: 32px; }
}

/* admin events */
.event-form { display: grid; grid-template-columns: 190px 160px 1fr 1fr; gap: 10px; align-items: end; }
.event-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.event-form .input, .event-form .select { width: 100%; }
.event-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.event-row .event-icon { font-size: 20px; }
.event-row .grow { flex: 1; min-width: 200px; }
@media (max-width: 900px) { .event-form { grid-template-columns: 1fr 1fr; } }
