/* CS2 main-menu look: dark slate glass, flat uppercase tabs, rarity-striped item tiles */
:root {
  --bg: #0c0f13;
  --bg2: #11151b;
  --panel: rgba(22, 27, 34, .82);
  --panel2: #1c222b;
  --panel3: #262d38;
  --line: rgba(255, 255, 255, .07);
  --line2: rgba(255, 255, 255, .14);
  --text: #e9edf2;
  --muted: #9aa5b4;
  --dim: #636e7d;
  --accent: #e9edf2;
  --accent2: #c8d0da;
  --accent-ink: #0c0f13;
  --go: #6ab04c;
  --go2: #4e8f35;
  --t: #d6b25f;
  --ct: #7fa7d9;
  --ok: #6ab04c;
  --danger: #e5534b;
  --gold: #e4ae39;
  --radius: 3px;
  --shadow: 0 16px 50px rgba(0, 0, 0, .55);
  --head: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
  --tile: linear-gradient(180deg, #3a414c 0%, #2b3039 55%, #23272e 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #0c0f13;
  color: var(--text);
  font: 15px/1.4 'Barlow', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  /* faint scanline grain the game menu has over its backdrop */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px);
}
#root, .toasts { position: relative; z-index: 1; }
button, input, select { font: inherit; color: inherit; }
img { user-select: none; -webkit-user-drag: none; }
a { color: var(--ct); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.26); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(480px, 100%); text-align: center; padding: 46px 38px 40px;
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.login-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: var(--go); }
.login-card h1 { font: 600 44px/1 var(--head); letter-spacing: 3px; margin: 20px 0 10px; text-transform: uppercase; }
.login-card p { color: var(--muted); margin: 0 0 30px; }
.login-art { display: flex; justify-content: center; gap: 4px; height: 96px; }
.login-art img { height: 96px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.7)); }
.steam-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 26px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--go), var(--go2)); border: 0; color: #fff;
  text-decoration: none; font: 600 17px/1 var(--head); letter-spacing: 1.5px; text-transform: uppercase;
  transition: filter .15s, box-shadow .15s;
}
.steam-btn:hover { filter: brightness(1.1); box-shadow: 0 0 24px rgba(106, 176, 76, .35); }

/* ---------- shell: transparent top bar over the scene, friends column on the right ---------- */
.app {
  display: grid; grid-template-columns: minmax(0, 1fr) 58px; grid-template-rows: 46px auto minmax(0, 1fr);
  height: 100vh; position: relative; isolation: isolate;
}
.app > * { min-width: 0; }
.scene {
  /* soft daylight backdrop drawn in CSS: sky, haze and warm ground */
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(60% 45% at 30% 18%, rgba(255, 255, 255, .55), transparent 70%),
    radial-gradient(50% 40% at 75% 30%, rgba(255, 244, 220, .45), transparent 70%),
    radial-gradient(90% 60% at 50% 110%, rgba(150, 120, 85, .55), transparent 70%),
    linear-gradient(180deg, #a9c3d3 0%, #c9d3d2 34%, #d8cdb6 58%, #bfae90 100%);
}
.scene::before {
  content: ''; position: absolute; inset: -10%; filter: blur(40px); opacity: .55;
  background:
    radial-gradient(18% 22% at 62% 48%, #8c7a5c, transparent 70%),
    radial-gradient(22% 18% at 20% 55%, #9a8a6b, transparent 70%),
    radial-gradient(16% 26% at 85% 40%, #7f8f6a, transparent 70%);
}
.scene::after {
  /* inner pages sit on a darker veil so tiles stay readable */
  content: ''; position: absolute; inset: 0; transition: background .3s;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,0) 14%), rgba(10, 13, 18, .0);
}
.scene::after { background: linear-gradient(180deg, rgba(8,10,14,.75), rgba(8,10,14,.88)); }

.topbar {
  grid-column: 1; grid-row: 1; position: relative; z-index: 6;
  display: flex; align-items: center; justify-content: center; padding: 0 14px;
}
.tb-icons { position: absolute; left: 10px; top: 0; bottom: 0; display: flex; align-items: center; gap: 4px; }
.tb-ico {
  width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer;
  color: rgba(255, 255, 255, .9); border-radius: 2px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.55));
}
.tb-ico svg { width: 19px; height: 19px; }
.tb-ico:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.tb-ico.on { color: #5aa9ff; }
.tb-menu {
  position: absolute; top: 44px; left: 0; min-width: 260px; padding: 14px; z-index: 20;
  background: rgba(18, 22, 28, .96); border: 1px solid var(--line2); box-shadow: var(--shadow);
}
.tb-menu[hidden] { display: none; }
.tb-menu .toggle { color: var(--text); margin: 0; }
.tb-tabs { display: flex; align-items: center; gap: 0; height: 100%; }
.tb-tab {
  border: 0; background: transparent; cursor: pointer; height: 100%; padding: 0 18px; position: relative;
  display: flex; align-items: center; text-decoration: none;
  font: 500 18px/1 var(--head); letter-spacing: 1.6px; text-transform: uppercase; color: rgba(255, 255, 255, .88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6); transition: color .12s;
}
.tb-tab:hover { color: #fff; }
.tb-tab.on { color: #fff; }
.tb-tab.on::before { content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 2px; background: rgba(255, 255, 255, .85); }
.tb-tab.play { font-size: 24px; letter-spacing: 2px; color: #fff; padding: 0 22px; }
.tb-tab.play::before { content: ''; position: absolute; top: 0; left: 10px; right: 10px; height: 2px; background: rgba(214, 232, 255, .9); }
.tb-tab.play:hover { text-shadow: 0 0 14px rgba(255, 255, 255, .55), 0 1px 3px rgba(0,0,0,.6); }
.tb-sep { width: 1px; height: 15px; background: rgba(255, 255, 255, .45); flex: none; }

.friends {
  grid-column: 2; grid-row: 1 / -1; z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 6px 0 10px; overflow-y: auto; background: rgba(28, 32, 38, .62); backdrop-filter: blur(8px);
  border-left: 1px solid rgba(255, 255, 255, .06);
}
.friends::-webkit-scrollbar { display: none; }
.fr-head { display: flex; flex-direction: column; align-items: center; gap: 1px; color: #fff; padding: 4px 0 6px; font: 500 11px/1 var(--head); }
.fr-head svg { width: 18px; height: 18px; }
.fr-av {
  --h: 210; width: 36px; height: 36px; flex: none; display: grid; place-items: center; overflow: hidden; cursor: default;
  background: linear-gradient(135deg, hsl(var(--h) 35% 42%), hsl(var(--h) 35% 26%));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); font: 700 13px/1 var(--head); letter-spacing: .5px; color: #fff;
}
.fr-av img { width: 100%; height: 100%; object-fit: cover; }
.fr-av.me { margin-bottom: 4px; }
.fr-av.online { box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 0 0 2px rgba(106, 176, 76, .9); }
a.fr-av:hover { filter: brightness(1.15); }
.fr-hint { cursor: help; background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); font-size: 16px; }

.subnav {
  grid-column: 1; grid-row: 2; display: flex; align-items: center; justify-content: center; gap: 18px; position: relative; z-index: 4;
  padding: 0 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); background: rgba(10, 13, 18, .35);
}
.subnav[hidden] { display: none; }
.subnav-tabs { display: flex; gap: 2px; overflow-x: auto; min-width: 0; }
.subnav-tabs::-webkit-scrollbar { display: none; }
.subnav-tabs button {
  border: 0; background: transparent; cursor: pointer; padding: 11px 14px; position: relative; white-space: nowrap;
  font: 500 15px/1 var(--head); letter-spacing: 1.3px; text-transform: uppercase; color: rgba(255, 255, 255, .62);
}
.subnav-tabs button:hover { color: #fff; }
.subnav-tabs button.on { color: #fff; }
.subnav-tabs button.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: #fff; }
.team-switch { display: flex; gap: 2px; flex: none; }
.team-switch button {
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .25); padding: 5px 12px; border-radius: 2px; cursor: pointer;
  font: 600 14px/1 var(--head); letter-spacing: 1.5px; color: rgba(255, 255, 255, .6);
}
.team-switch button:hover { color: #fff; }
.team-switch button.on[data-team="2"] { background: rgba(214, 178, 95, .22); border-color: var(--t); color: var(--t); }
.team-switch button.on[data-team="3"] { background: rgba(127, 167, 217, .22); border-color: var(--ct); color: var(--ct); }
.toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; white-space: nowrap; user-select: none; }
.toggle input { display: none; }
.toggle .sw { width: 34px; height: 18px; border-radius: 2px; background: var(--panel3); border: 1px solid var(--line2); position: relative; transition: background .2s; flex: none; }
.toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 1px; background: var(--muted); transition: all .2s; }
.toggle input:checked + .sw { background: rgba(106, 176, 76, .3); border-color: var(--go); }
.toggle input:checked + .sw::after { left: 18px; background: var(--go); }
.spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: var(--radius);
  border: 1px solid var(--line2); background: rgba(255,255,255,.05); cursor: pointer; white-space: nowrap;
  font: 600 15px/1 var(--head); letter-spacing: 1.2px; text-transform: uppercase;
  transition: background .15s, border-color .15s, filter .15s; text-decoration: none; color: var(--text);
}
.btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--go), var(--go2)); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 7px 12px; font-size: 13.5px; }
.btn:disabled { opacity: .45; cursor: default; }

main { grid-column: 1; grid-row: 3; overflow-y: auto; padding: 24px 28px 70px; }
.page-head { display: flex; align-items: end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font: 600 34px/1 var(--head); letter-spacing: 2.5px; margin: 0 0 6px; text-transform: uppercase; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.search {
  background: rgba(0,0,0,.35); border: 1px solid var(--line2); border-radius: var(--radius); padding: 9px 12px 9px 34px; min-width: 260px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aa5b4' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center; outline: none;
}
.search:focus { border-color: rgba(255,255,255,.4); background-color: rgba(0,0,0,.5); }

/* ---------- inventory tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.grid.sm { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.card {
  --r: #b0c3d9;
  position: relative; border-radius: var(--radius); cursor: pointer; overflow: hidden;
  background: var(--tile); box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.25);
  transition: filter .12s, box-shadow .12s, transform .12s;
}
.card::before {
  /* rarity glow rising from the bottom stripe */
  content: ''; position: absolute; inset: auto 0 0; height: 55%; pointer-events: none;
  background: linear-gradient(0deg, color-mix(in srgb, var(--r) 22%, transparent), transparent);
  opacity: .55; transition: opacity .12s;
}
.card:hover { filter: brightness(1.14); box-shadow: 0 0 0 1px rgba(255,255,255,.35), 0 8px 20px rgba(0,0,0,.4); }
.card:hover::before { opacity: 1; }
.card.on { box-shadow: 0 0 0 2px #fff, 0 8px 20px rgba(0,0,0,.4); }
.card .pic { aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 12px 14px 4px; position: relative; }
.card .pic img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.card .meta { padding: 6px 10px 12px; position: relative; }
.card .w { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { font: 600 16px/1.2 var(--head); letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.card .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--r); }
.marks { position: absolute; top: 7px; right: 7px; display: flex; gap: 3px; z-index: 1; pointer-events: none; }
.mark { font: 700 11px/1 var(--head); letter-spacing: .5px; padding: 3px 5px; border-radius: 2px; background: rgba(0,0,0,.55); }
.mark[data-team="2"] { color: var(--t); box-shadow: inset 0 0 0 1px rgba(214,178,95,.5); }
.mark[data-team="3"] { color: var(--ct); box-shadow: inset 0 0 0 1px rgba(127,167,217,.5); }
.badges { position: absolute; top: 7px; left: 7px; right: 60px; display: flex; gap: 3px; flex-wrap: wrap; pointer-events: none; z-index: 1; }
.badge {
  font: 700 11px/1 var(--head); letter-spacing: .7px; padding: 3px 6px; border-radius: 2px;
  background: rgba(0,0,0,.55); color: var(--text); text-transform: uppercase;
}
.badge.st { color: #cf6a32; }
.badge.eq { color: #8fd16c; }
.badge.cm { color: var(--gold); }
.empty { color: var(--muted); padding: 44px; text-align: center; background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: var(--radius); }
.section-title { font: 600 20px/1 var(--head); letter-spacing: 2px; text-transform: uppercase; margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title .dot { width: 4px; height: 18px; border-radius: 0; }

/* ---------- item workbench (inspect screen) ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(5, 7, 10, .82); backdrop-filter: blur(8px); z-index: 50;
  display: grid; place-items: center; padding: 20px; animation: fade .15s;
}
@keyframes fade { from { opacity: 0; } }
.wb {
  width: min(1360px, 100%); height: min(880px, 100%); display: grid; grid-template-columns: 1fr 430px; grid-template-rows: auto 1fr;
  background: #0f1318; border: 1px solid var(--line2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.wb-head {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 12px 18px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #1a1f27, #141920);
}
.wb-head h3 { margin: 0; font: 600 26px/1 var(--head); letter-spacing: 1.5px; text-transform: uppercase; }
.wb-head .skin { color: var(--muted); }
.chips { display: flex; gap: 4px; }
.chip {
  padding: 6px 12px; border-radius: var(--radius); border: 1px solid var(--line2); background: transparent; cursor: pointer;
  font: 600 14px/1 var(--head); letter-spacing: 1.2px; color: var(--muted);
}
.chip.on[data-team="2"] { border-color: var(--t); color: var(--t); background: rgba(214,178,95,.12); }
.chip.on[data-team="3"] { border-color: var(--ct); color: var(--ct); background: rgba(127,167,217,.12); }
.x { width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--line2); background: transparent; cursor: pointer; font-size: 16px; color: var(--muted); }
.x:hover { color: #fff; background: rgba(255,255,255,.08); }

.stage-wrap { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.stage {
  flex: 1; position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(65% 60% at 50% 48%, #3a4350 0%, #20262e 55%, #12161b 100%);
}
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage-status {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); background: rgba(15, 19, 24, .55); pointer-events: none;
}
.stage-status .spin { margin: 0 0 10px; }
.stage-status[hidden], .stage-fallback[hidden] { display: none; }
.stage-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; }
.stage-fallback img { width: min(80%, 640px); max-height: 70%; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0,0,0,.7)); }
.stage-hint { position: absolute; left: 14px; bottom: 12px; color: var(--dim); font-size: 12.5px; pointer-events: none; text-shadow: 0 1px 2px #000; }

.slots { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #141920; align-items: center; overflow-x: auto; }
.slot {
  width: 70px; height: 70px; flex: none; border-radius: var(--radius); border: 1px dashed var(--line2); background: rgba(0,0,0,.3);
  display: grid; place-items: center; cursor: pointer; position: relative; color: var(--dim); font-size: 22px;
}
.slot:hover { border-color: rgba(255,255,255,.3); color: var(--muted); }
.slot img { width: 80%; height: 80%; object-fit: contain; }
.slot.filled { border-style: solid; background: var(--tile); }
.slot.sel { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.slot .i { position: absolute; top: 4px; left: 6px; font: 700 11px/1 var(--head); color: var(--dim); }
.slot.kcs { border-radius: 50%; }
.slots .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }

.side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #12161c; }
.tabs { display: flex; padding: 0 8px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.tabs button {
  flex: 1; border: 0; background: transparent; padding: 14px 4px 12px; cursor: pointer; color: var(--muted); font: 600 14.5px/1 var(--head);
  letter-spacing: .6px; text-transform: uppercase; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: #fff; border-bottom-color: #fff; }
.tab { flex: 1; overflow-y: auto; padding: 16px; min-height: 0; }
.side-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex: none; background: #141920; }
.side-foot .btn.primary { flex: 1; padding: 12px; font-size: 17px; }

.pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.pick.two { grid-template-columns: repeat(2, 1fr); }
.pi {
  --r: #b0c3d9;
  position: relative; border-radius: var(--radius); background: var(--tile); cursor: pointer; padding: 6px 6px 10px; text-align: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5); transition: filter .12s, box-shadow .12s; min-width: 0; overflow: hidden;
}
.pi::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--r); }
.pi:hover { filter: brightness(1.15); }
.pi.on { box-shadow: 0 0 0 2px #fff; }
.pi img { width: 100%; aspect-ratio: 4/3; object-fit: contain; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.pi .l { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.pi.on .l { color: #fff; }
.more { height: 1px; }

.field { margin-bottom: 18px; }
.field > label, .lbl { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font: 600 13px/1.2 var(--head); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.field > label.toggle { justify-content: flex-start; color: var(--text); font: 15px 'Barlow', sans-serif; text-transform: none; letter-spacing: 0; }
.field > label b, .lbl b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.input { width: 100%; background: rgba(0,0,0,.35); border: 1px solid var(--line2); border-radius: var(--radius); padding: 9px 11px; outline: none; }
.input:focus { border-color: rgba(255,255,255,.4); }
select.input option { background: #1c222b; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 0; background: var(--panel3); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 18px; border-radius: 1px; background: #fff; border: 0; cursor: pointer; box-shadow: 0 0 0 2px rgba(0,0,0,.6); }
input[type=range]::-moz-range-thumb { width: 12px; height: 18px; border-radius: 1px; background: #fff; border: 0; cursor: pointer; }
.wear-scale { display: flex; height: 5px; overflow: hidden; margin-top: 10px; }
.wear-scale span { display: block; }
.wear-tiers { display: flex; justify-content: space-between; font: 700 12px/1 var(--head); color: var(--dim); margin-top: 6px; letter-spacing: .8px; }
.presets { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.note { background: rgba(127,167,217,.08); border-left: 3px solid var(--ct); color: #c3d4ea; padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 14px; }
.note.warn { background: rgba(228,174,57,.08); border-left-color: var(--gold); color: #f0d9a4; }
.sel-head { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); background: var(--tile); margin-bottom: 16px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.sel-head img { width: 64px; height: 48px; object-fit: contain; }
.sel-head .t { flex: 1; min-width: 0; }
.sel-head .t div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sel-head .t small { color: var(--muted); }

/* ---------- admin ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font: 600 13px/1 var(--head); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); background: rgba(0,0,0,.25); }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(255,255,255,.025); }
.table img { width: 64px; height: 44px; object-fit: contain; }
.table code { color: var(--muted); font-size: 12px; }
.form-card { background: var(--panel); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }

/* ---------- console ---------- */
.term { background: rgba(0,0,0,.6); border: 1px solid var(--line2); border-radius: var(--radius); overflow: hidden; }
.term-out {
  height: 420px; overflow-y: auto; padding: 14px 16px; font: 12.5px/1.55 ui-monospace, 'JetBrains Mono', Consolas, monospace;
  white-space: pre-wrap; word-break: break-word;
}
.term-cmd { color: #8fd16c; margin-top: 10px; }
.term-res { color: #c9d3e3; }
.term-err { color: var(--danger); }
.term-in { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: rgba(255,255,255,.03); }
.term-in input { flex: 1; background: transparent; border: 0; outline: none; font: 13px ui-monospace, Consolas, monospace; color: var(--text); }
.term-prompt { color: #8fd16c; font: 700 14px ui-monospace, monospace; }

/* ---------- toast / misc ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: rgba(24, 29, 36, .96); border: 1px solid var(--line2); border-left: 3px solid var(--go); padding: 12px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow); max-width: 380px; animation: slide .2s;
}
.toast.err { border-left-color: var(--danger); }
@keyframes slide { from { transform: translateX(16px); opacity: 0; } }
.spin { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.12); border-top-color: #fff; border-radius: 50%; animation: rot .8s linear infinite; margin: 60px auto; }
@keyframes rot { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
kbd { background: var(--panel3); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 2px; padding: 0 5px; font-size: 11px; }

@media (max-width: 1000px) {
  .wb { grid-template-columns: 1fr; grid-template-rows: auto minmax(300px, 45%) 1fr; height: 100%; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .tb-tab { padding: 0 11px; font-size: 16px; letter-spacing: 1.1px; }
  .tb-tab.play { font-size: 20px; }
  .tb-icons { position: static; }
  .topbar { justify-content: flex-start; gap: 8px; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 46px auto auto minmax(0, 1fr); }
  .topbar { overflow-x: auto; padding: 0 6px; }
  .topbar::-webkit-scrollbar { display: none; }
  .tb-icons { gap: 0; }
  .tb-tab { padding: 0 9px; font-size: 14px; letter-spacing: .8px; white-space: nowrap; }
  .tb-tab.play { font-size: 17px; padding: 0 12px; }
  .friends { grid-column: 1; grid-row: 2; flex-direction: row; padding: 6px 10px; overflow-x: auto; border-left: 0; border-bottom: 1px solid rgba(255,255,255,.06); }
  .fr-head { flex-direction: row; gap: 4px; padding: 0 6px 0 0; }
  .fr-av { width: 30px; height: 30px; font-size: 11px; }
  .subnav { grid-row: 3; justify-content: space-between; gap: 8px; padding: 0 8px; }
  main { grid-row: 4; padding: 18px 16px 60px; }
  .page-head h2 { font-size: 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .search { min-width: 0; width: 100%; }
  .modal-bg { padding: 0; }
  .wb { border-radius: 0; }
}

/* ---------- refresh prompt (frosted grey window with contour lines) ---------- */
.dlg-veil {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .35);
  animation: dlg-fade .15s ease-out;
}
.dlg {
  width: min(460px, 100%);
  border-radius: 6px;
  overflow: hidden;
  color: #e6e9ee;
  background:
    repeating-radial-gradient(ellipse 140% 90% at 12% 0%, transparent 0 22px, rgba(255, 255, 255, .045) 23px 24px),
    repeating-radial-gradient(ellipse 120% 100% at 100% 110%, transparent 0 26px, rgba(255, 255, 255, .035) 27px 28px),
    linear-gradient(180deg, rgba(92, 98, 108, .9), rgba(70, 75, 84, .92));
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.dlg-head {
  position: relative;
  padding: 22px 52px 16px;
  text-align: center;
  font: 500 22px/1.1 var(--head);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #eef1f5;
}
.dlg-x {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px;
  border: 0; background: none; cursor: pointer;
  color: #dfe3e8; font-size: 32px; line-height: 1; opacity: .85;
}
.dlg-x:hover { opacity: 1; color: #fff; }
.dlg-body {
  margin: 0 18px;
  padding: 16px 6px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  text-align: center;
  font-size: 14px; line-height: 1.45; color: #c9ced6;
}
.dlg-foot {
  display: flex; justify-content: center; gap: 12px;
  padding: 6px 18px 22px;
}
.dlg-btn {
  min-width: 120px;
  padding: 9px 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 3px;
  background: rgba(30, 34, 41, .55);
  color: #e6e9ee;
  font: 600 14px var(--head);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.dlg-btn:hover { background: rgba(30, 34, 41, .8); color: #fff; }
.dlg-btn.go { background: rgba(90, 169, 255, .2); border-color: rgba(90, 169, 255, .45); color: #7cbcff; }
.dlg-btn.go:hover { background: rgba(90, 169, 255, .32); color: #a8d2ff; }
.dlg-btn:focus-visible, .dlg-x:focus-visible { outline: 2px solid #7cbcff; outline-offset: 2px; }
@keyframes dlg-fade { from { opacity: 0; } }

/* DUPA.TV match picker */
.dlg.dlg-wide { width: min(680px, 100%); }
.mp-list { max-height: min(60vh, 560px); overflow-y: auto; text-align: left; display: grid; gap: 8px; }
.mp-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: rgba(20, 23, 29, .45); border: 1px solid rgba(255, 255, 255, .08); border-radius: 3px; }
.mp-row:hover { border-color: rgba(255, 255, 255, .2); }
.mp-row .btn { flex: none; }
.mp-main { flex: 1; min-width: 0; display: grid; gap: 7px; }
.mp-teams { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mp-team { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.mp-team img { width: 24px; height: 24px; object-fit: contain; }
.mp-team b { font: 600 16px/1.2 var(--head); color: #fff; overflow-wrap: anywhere; }
.mp-vs { color: var(--muted); font: 600 14px var(--head); }
.mp-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.mp-meta .badge { position: static; }
.mp-bo { color: var(--gold); }
.mp-live { color: var(--danger); }
.mp-maps { display: flex; gap: 5px; flex-wrap: wrap; }
.mp-map { padding: 2px 8px; font-size: 12.5px; text-transform: capitalize; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 3px; }
.mp-map.done { opacity: .55; }
@media (max-width: 520px) { .mp-row { flex-direction: column; align-items: stretch; } }

.sec-title {
  margin: 28px 0 12px;
  font: 600 17px var(--head);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
/* custom knife previews are large square renders; pin them to the tile box */
.card[data-ck] .pic { overflow: hidden; }
.card[data-ck] .pic img { width: 100%; height: 100%; min-height: 0; }
