/* ================= TetriWeb ================= */
:root {
  --bg: #05070d;
  --bg-2: #0a0e18;
  --panel: rgba(18, 24, 38, .72);
  --panel-2: rgba(24, 32, 50, .6);
  --line: rgba(140, 170, 220, .14);
  --line-2: rgba(140, 170, 220, .26);
  --ink: #e6ecf8;
  --ink-dim: #97a4bd;
  --ink-mute: #61708c;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --c1: #2f7df6; --c2: #f2c53d; --c3: #2fbf62; --c4: #a259e6; --c5: #e8503f;
  --radius: 14px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .85);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* backdrop ------------------------------------------------------- */
.bg-grid, .bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg-grid {
  background-image:
    linear-gradient(rgba(120, 170, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 78%);
}
.bg-glow {
  background:
    radial-gradient(50rem 30rem at 15% -10%, rgba(56, 189, 248, .16), transparent 65%),
    radial-gradient(45rem 30rem at 90% 10%, rgba(129, 140, 248, .14), transparent 65%),
    radial-gradient(60rem 40rem at 50% 120%, rgba(47, 191, 98, .1), transparent 70%);
}
body.scanlines::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  opacity: .5;
}

/* screens -------------------------------------------------------- */
.screen { display: none; position: relative; z-index: 1; height: 100%; }
.screen.is-active { display: block; }
.screen--connect {
  display: none;
  place-content: center;
  overflow: auto;
  padding: 4vh 5vw;
}
.screen--connect.is-active { display: grid; }
.screen--app.is-active {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh; height: 100dvh;
}

/* ---------------- connect screen ---------------- */
.brand { text-align: center; margin-bottom: 26px; }
.brand h1 {
  font-size: clamp(38px, 7vw, 68px); margin: 10px 0 6px; letter-spacing: -.03em; font-weight: 800;
  background: linear-gradient(120deg, #fff 10%, var(--accent) 55%, var(--accent-2) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* No opacity on this span. The h1 paints a gradient clipped to its text with
 * background-clip:text and color:transparent; giving a descendant its own opacity
 * makes it a separate painting context, the parent's clipped background never
 * reaches it, and the transparent text becomes genuinely invisible - "TetriWeb"
 * renders as "Tetri". */
.brand h1 span { }
.brand__sub { color: var(--ink-dim); margin: 0; font-size: 15px; }
.brand__blocks { display: flex; gap: 7px; justify-content: center; }
.bk {
  width: 26px; height: 26px; border-radius: 7px; display: block;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(0,0,0,.35), 0 6px 18px -6px currentColor;
  animation: bob 2.4s ease-in-out infinite;
}
.bk--1 { background: linear-gradient(180deg, #8fbcff, var(--c1)); color: var(--c1); animation-delay: 0s; }
.bk--2 { background: linear-gradient(180deg, #ffe89b, var(--c2)); color: var(--c2); animation-delay: .15s; }
.bk--3 { background: linear-gradient(180deg, #9bf0b8, var(--c3)); color: var(--c3); animation-delay: .3s; }
.bk--4 { background: linear-gradient(180deg, #dcb6ff, var(--c4)); color: var(--c4); animation-delay: .45s; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-9px) } }

.card {
  background: linear-gradient(180deg, rgba(24,32,50,.86), rgba(14,19,31,.9));
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.card--connect {
  width: min(720px, 100%); margin: 0 auto; padding: 26px;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 3; }
.field--wide { grid-column: span 6; }
.field--narrow { grid-column: span 2; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }
.field small { color: var(--ink-mute); font-size: 11px; }
input, select {
  font: inherit; color: var(--ink); background: rgba(6, 10, 18, .8);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,.18); }
input.is-locked {
  background: rgba(255,255,255,.035); color: var(--ink-dim); cursor: default;
  border-style: dashed; border-color: var(--line);
}
input.is-locked:focus { box-shadow: none; border-color: var(--line); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%), linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.connect-actions { grid-column: span 6; display: flex; gap: 12px; align-items: center; }
.connect-status { grid-column: span 6; margin: 0; min-height: 20px; font-size: 13px; color: var(--warn); }
.connect-status.is-error { color: var(--danger); }
.foot { text-align: center; color: var(--ink-mute); font-size: 12px; margin-top: 20px; }
.foot code { color: var(--accent); font-family: var(--mono); }

/* buttons -------------------------------------------------------- */
.btn {
  font: inherit; font-weight: 600; font-size: 13px; color: var(--ink);
  background: linear-gradient(180deg, rgba(56,72,104,.75), rgba(30,40,60,.85));
  border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 14px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 6px 14px -8px rgba(0,0,0,.8);
  transition: transform .1s, filter .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn--primary { background: linear-gradient(180deg, #4cc4fb, #1f8fd0); border-color: #61d1ff; color: #04202e; }
.btn--ok { background: linear-gradient(180deg, #4ade80, #17a34a); border-color: #6ee7a0; color: #052912; }
.btn--danger { background: linear-gradient(180deg, #fb7185, #cf3d51); border-color: #ff9aa7; color: #2a0409; }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink-dim); box-shadow: none; }
.btn--lg { padding: 12px 24px; font-size: 15px; }
.btn--icon { padding: 6px 10px; }

kbd {
  font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 5px;
  background: rgba(255,255,255,.08); border: 1px solid var(--line-2); border-bottom-width: 2px;
}
.muted { color: var(--ink-mute); font-weight: 400; }

/* ---------------- topbar ---------------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12,17,28,.95), rgba(9,13,22,.8));
  backdrop-filter: blur(10px);
}
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo-mini { font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.logo-mini span { color: var(--accent); }
.pill {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.28); color: #9fdcff;
  font-family: var(--mono);
}
.pill--proto { background: rgba(129,140,248,.1); border-color: rgba(129,140,248,.3); color: #c3c9ff; }
.pill--you { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.3); color: #9df3d1; }

/* link quality ---------------------------------------------------- */
.pill--ping {
  display: inline-flex; align-items: center; gap: 6px; cursor: help;
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.05); border-color: var(--line-2); color: var(--ink-dim);
}
.pill--ping b { font-weight: 700; min-width: 2ch; text-align: right; }
.pill--ping .dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: currentColor; box-shadow: 0 0 8px -1px currentColor;
}
.pill--ping.is-good    { background: rgba(52,211,153,.1);  border-color: rgba(52,211,153,.32); color: #6ee7b7; }
.pill--ping.is-ok      { background: rgba(56,189,248,.1);  border-color: rgba(56,189,248,.32); color: #7dd3fc; }
.pill--ping.is-far     { background: rgba(251,191,36,.1);  border-color: rgba(251,191,36,.32); color: #fcd34d; }
.pill--ping.is-bad     { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.36); color: #fca5a5; }
.pill--ping.is-stalled { background: rgba(248,113,113,.18); border-color: rgba(248,113,113,.6); color: #fecaca; }
.pill--ping.is-stalled .dot { animation: blip .7s steps(1) infinite; }
@keyframes blip { 0%,49% { opacity: 1 } 50%,100% { opacity: .15 } }

/* ---------------- stage ---------------- */
.stage {
  display: grid; grid-template-columns: 232px minmax(0,1fr) 300px;
  gap: 14px; padding: 14px; min-height: 0; overflow: hidden;
}
.rail { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.rail::-webkit-scrollbar { width: 8px; }
.rail::-webkit-scrollbar-thumb { background: rgba(140,170,220,.18); border-radius: 4px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; backdrop-filter: blur(10px); box-shadow: 0 10px 30px -20px #000;
}
.panel h3 {
  margin: 0 0 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-dim); display: flex; justify-content: space-between; align-items: baseline;
}
.panel--next { display: flex; flex-direction: column; align-items: center; }
.next-canvas { display: block; width: 104px; height: 104px; }

.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.stats li { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-dim); }
.stats b { font-family: var(--mono); font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats b.bump { animation: bump .3s ease; }
@keyframes bump { 0% { transform: scale(1) } 40% { transform: scale(1.35); color: var(--accent) } 100% { transform: scale(1) } }

/* specials queue ------------------------------------------------- */
.special-queue { display: flex; flex-wrap: wrap; gap: 5px; min-height: 40px; align-content: flex-start; }
.sp {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; font-family: var(--mono);
  background: linear-gradient(180deg, #2a344a, #141a26);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 4px 10px -6px #000;
  animation: pop-in .22s cubic-bezier(.2,1.5,.4,1);
  position: relative;
}
.sp:first-child { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: 0 0 14px -2px rgba(56,189,248,.7); }
.sp[data-ch="a"] { color: #ff8f8f } .sp[data-ch="c"] { color: #63e6be } .sp[data-ch="n"] { color: #ffd43b }
.sp[data-ch="r"] { color: #74c0fc } .sp[data-ch="s"] { color: #f783ac } .sp[data-ch="b"] { color: #8ce99a }
.sp[data-ch="g"] { color: #ffa94d } .sp[data-ch="q"] { color: #e599f7 } .sp[data-ch="o"] { color: #ff8787 }
@keyframes pop-in { from { transform: scale(.3) rotate(-12deg); opacity: 0 } to { transform: none; opacity: 1 } }
.hint { font-size: 11px; color: var(--ink-mute); margin: 9px 0 0; line-height: 1.6; }

.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 11.5px; }
.legend li { display: flex; gap: 8px; align-items: center; color: var(--ink-dim); }
.legend i {
  width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center;
  font-style: normal; font-weight: 800; font-size: 10px; font-family: var(--mono);
  background: #141a26; border: 1px solid rgba(255,255,255,.12); flex: none;
}

/* playfield ------------------------------------------------------ */
/* min-height/min-width 0 stop this grid item from being forced wider than its
   column by its own contents; overflow hidden keeps a mid-resize canvas from
   briefly enlarging the cell it is measured against. */
.field-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 0; min-width: 0; overflow: hidden;
}
.field-frame {
  position: relative; padding: 8px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(40,52,76,.9), rgba(12,17,28,.95));
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 26px 60px -24px #000, inset 0 1px 0 rgba(255,255,255,.1);
  transition: box-shadow .2s;
}
.field-frame.is-danger { box-shadow: 0 0 0 1px rgba(248,113,113,.5), 0 0 46px -6px rgba(248,113,113,.45), inset 0 1px 0 rgba(255,255,255,.1); }
.field-frame canvas { display: block; border-radius: 10px; }
.field-under { width: 100%; max-width: 340px; }
.attack-meter { height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; display: flex; }
.attack-meter__bar { height: 100%; transition: width .3s ease; width: 0; }
.attack-meter__bar--sent { background: linear-gradient(90deg, #34d399, #10b981); }
.attack-meter__bar--recv { background: linear-gradient(90deg, #f87171, #dc2626); margin-left: auto; }

/* opponents ------------------------------------------------------ */
.opponents { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.opp {
  border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  background: rgba(8,12,20,.7); position: relative; overflow: hidden;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.opp.is-you { border-color: rgba(52,211,153,.5); }
.opp.is-target { border-color: var(--accent); box-shadow: 0 0 16px -4px rgba(56,189,248,.7); transform: translateY(-2px); }
.opp.is-hit { animation: hit .45s ease; }
@keyframes hit { 0%,100% { transform: none } 20% { transform: translate(-3px,2px) } 45% { transform: translate(3px,-2px) } 70% { transform: translate(-2px,-1px) } }
/* No opacity here. The renderer already draws a dark wash and a red cross over a
   knocked-out field, and dimming the whole card on top of that left the stack
   almost unreadable. One treatment, not two. */
.opp.is-dead .opp__nick { color: var(--ink-mute); text-decoration: line-through; }
.opp.is-stale { border-color: rgba(251,191,36,.45); }
.opp.is-stale canvas { filter: saturate(.45) brightness(.8); }
.opp__head { display: flex; align-items: center; gap: 5px; font-size: 11px; margin-bottom: 4px; }
.opp__lag {
  display: none; flex: none; font-size: 9px; font-family: var(--mono); font-weight: 700;
  padding: 1px 5px; border-radius: 4px; letter-spacing: .02em;
  background: rgba(251,191,36,.16); color: #fcd34d; border: 1px solid rgba(251,191,36,.35);
}
.opp.is-stale .opp__lag { display: inline-block; animation: pop-in .2s ease; }
.opp__num {
  width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; flex: none;
  background: var(--accent); color: #04202e; font-weight: 800; font-size: 10px; font-family: var(--mono);
}
.opp__nick { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp__team { color: var(--ink-mute); font-size: 10px; margin-left: auto; flex: none; }
/* The renderer sets explicit pixel dimensions from the 12x22 aspect, which
   overrides any width declared here. `margin: 0 auto` is therefore what centres
   it: without it the canvas hugs the left edge of the card, and the knocked-out
   cross - which spans the canvas, not the card - reads as off-centre. */
.opp canvas {
  display: block; margin: 0 auto; border-radius: 4px; background: #070a12;
  /* Safety net. If the measured size were ever wrong again, this scales the
     canvas down rather than letting overflow:hidden clip its right-hand columns
     off - a clipped field looks off-centre, which is far harder to diagnose than
     one that is merely a few pixels small. */
  max-width: 100%;
}
.opp__empty { display: grid; place-items: center; color: var(--ink-mute); font-size: 11px; height: 100%; min-height: 90px; }

.winlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12px; counter-reset: w; }
.winlist li { display: flex; gap: 8px; align-items: baseline; color: var(--ink-dim); }
.winlist li::before { counter-increment: w; content: counter(w) "."; color: var(--ink-mute); font-family: var(--mono); width: 20px; flex: none; }
.winlist b { margin-left: auto; font-family: var(--mono); color: var(--ink); }
.winlist .is-team::after { content: "team"; font-size: 9px; padding: 1px 5px; border-radius: 4px; background: rgba(129,140,248,.16); color: #c3c9ff; }

/* chat ----------------------------------------------------------- */
.chatbar {
  border-top: 1px solid var(--line); background: rgba(9,13,22,.9);
  display: grid; grid-template-rows: 1fr auto; max-height: 200px; min-height: 120px;
}
.log {
  overflow-y: auto; padding: 8px 14px; font-size: 13px; line-height: 1.55;
  scrollbar-width: thin; font-family: var(--mono); font-size: 12px;
}
.log::-webkit-scrollbar { width: 8px; }
.log::-webkit-scrollbar-thumb { background: rgba(140,170,220,.18); border-radius: 4px; }
.log p { margin: 0; animation: slide-in .18s ease; word-wrap: break-word; }
@keyframes slide-in { from { opacity: 0; transform: translateX(-6px) } to { opacity: 1; transform: none } }
.log .who { font-weight: 700; }
.log .t-sys { color: var(--ink-mute); }
.log .t-err { color: var(--danger); }
.log .t-ok { color: var(--ok); }
.log .t-game { color: var(--warn); }
.log .t-act { color: #f0abfc; font-style: italic; }
.log .t-me .who { color: var(--ok); }
.p-c1 { color: #7fb2ff } .p-c2 { color: #ffe08a } .p-c3 { color: #7ee2a8 }
.p-c4 { color: #cfa8f5 } .p-c5 { color: #ff9d92 } .p-c6 { color: #7dd3fc }

.chat-form { display: flex; gap: 8px; padding: 8px 14px 12px; align-items: center; }
.chat-mode {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em; padding: 4px 8px; border-radius: 6px;
  background: rgba(56,189,248,.12); color: #9fdcff; border: 1px solid rgba(56,189,248,.25); flex: none;
}
.chat-form input { flex: 1; }

/* modal ---------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(3,5,10,.7); backdrop-filter: blur(3px); }
.modal__box {
  position: relative; width: min(680px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(22,29,45,.98), rgba(12,17,28,.99));
  border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow);
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { transform: translateY(14px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal__head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font-size: 17px; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab {
  font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-dim); cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 12px;
}
.tab.is-active { color: var(--ink); background: rgba(56,189,248,.12); border-color: rgba(56,189,248,.3); }
.modal__body { padding: 16px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; }
.tabpane { display: none; }
.tabpane.is-active { display: block; }
.note { font-size: 12px; color: var(--ink-dim); margin: 0 0 12px; }
.row { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 13px; flex-wrap: wrap; }
.row--repeat { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 16px 0; }
.row--repeat label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-dim); }
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
output { font-family: var(--mono); color: var(--ink); }

/* keymap --------------------------------------------------------- */
.keygroup { margin-bottom: 14px; }
.keygroup h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); }
.keyrow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; border-radius: 9px; background: rgba(255,255,255,.03); margin-bottom: 4px;
}
.keyrow span { font-size: 13px; }
.keycap {
  font-family: var(--mono); font-size: 12px; font-weight: 700; min-width: 74px; text-align: center;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--ink);
  background: linear-gradient(180deg, #39465e, #202a3d);
  border: 1px solid var(--line-2); border-bottom-width: 3px;
  transition: filter .15s, transform .08s;
}
.keycap:hover { filter: brightness(1.2); }
.keycap:active { transform: translateY(1px); }
.keycap.is-listening { background: linear-gradient(180deg, #4cc4fb, #1f8fd0); color: #04202e; animation: listen 1s ease-in-out infinite; }
.keycap.is-unset { color: var(--danger); }
@keyframes listen { 0%,100% { box-shadow: 0 0 0 0 rgba(56,189,248,.6) } 50% { box-shadow: 0 0 0 6px rgba(56,189,248,0) } }

/* toasts --------------------------------------------------------- */
.toast-stack { position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast {
  padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: rgba(18,24,38,.94); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  animation: toast-in .2s ease, toast-out .3s ease 2.2s forwards;
}
.toast--in { border-color: rgba(248,113,113,.5); color: #ffc9c9; }
.toast--out { border-color: rgba(52,211,153,.5); color: #a7f3d0; }
.toast--info { border-color: rgba(56,189,248,.5); color: #bae6fd; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) } to { opacity: 1; transform: none } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) } }

/* responsive ----------------------------------------------------- */
@media (max-width: 1180px) {
  .stage { grid-template-columns: 200px minmax(0,1fr) 236px; gap: 10px; padding: 10px; }
  .opponents { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow-y: auto; }
  .rail { flex-direction: row; overflow-x: auto; }
  .panel { min-width: 170px; }
  .chatbar { max-height: 150px; }
  .card--connect { grid-template-columns: repeat(2, 1fr); }
  .field, .field--wide, .field--narrow { grid-column: span 2; }
  .connect-actions, .connect-status { grid-column: span 2; }
}
