@charset "UTF-8";

/* Phase 3.1: materials adapted from the owner's Figma-informed design brief.
   Numeric values are NEON ARENA proposals, not extracted Figma tokens.
   Refined material: lightweight translucent sheets, selective optical blur.
   Diagnostics, inputs and Canvas retain a stable reading surface. */
:root {
  color-scheme: light;
  --bg: #f4f7fc;
  --surface: #fff;
  --surface-soft: #f8fafc;
  --surface-glass: #ffffff;
  --glass-bg: rgb(255 255 255 / .42);
  --glass-subtle: rgb(255 255 255 / .54);
  --glass-elevated: rgb(255 255 255 / .7);
  --sheet-bg: rgb(255 255 255 / .56);
  --content-bg: rgb(255 255 255 / .86);
  --glass-stroke: rgb(255 255 255 / .86);
  --glass-inner-stroke: rgb(71 102 151 / .13);
  --glass-blur: 24px;
  --glass-saturate: 150%;
  --glass-reflection: linear-gradient(118deg, #ffffff73, #ffffff0a 24%, #ffffff00 50%, #e4edff12 78%, #ffffff3d), linear-gradient(180deg, #ffffff47, #ffffff00 48px);
  --glass-shadow: 0 18px 44px #314c801f, 0 3px 9px #314c8009;
  --glass-rim: inset 0 1px 1px #fffffffa, inset 1px 0 0 #ffffff85, inset 0 -1px 2px var(--glass-inner-stroke);
  --panel: var(--surface);
  --panel-alt: #f0f4fa;
  --border: #dfe5ee;
  --border-soft: #eaf0f6;
  --text: #172238;
  --muted: #50627c;
  --subtle: #566982;
  --accent: #2868d8;
  --accent-hover: #1f55b7;
  --accent-soft: #edf4ff;
  --player-a: #2867cc;
  --player-b: #a66125;
  --success: #227552;
  --success-soft: #edf8f2;
  --warning: #956020;
  --warning-soft: #fff6e8;
  --danger: #b4404e;
  --danger-soft: #fff0f1;
  /* Compatibility aliases for existing DOM/renderer bindings. */
  --cyan: var(--accent);
  --purple: var(--player-b);
  --pink: var(--danger);
  --green: var(--success);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: var(--font);
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --radius-sm: 13px;
  --radius: 22px;
  --radius-lg: 26px;
  --radius-xl: 28px;
  --shadow-sm: 0 8px 20px #314c8010, 0 2px 5px #314c8005;
  --shadow: 0 16px 40px #314c8017, 0 3px 8px #314c8008;
  --shadow-float: 0 28px 76px #28446e26, 0 6px 18px #28446e0d;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --ease: cubic-bezier(.2,.75,.25,1);
  --motion-fast: 160ms;
  --motion: 240ms;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { min-height: 100vh; margin: 0; color: var(--text); font: 15px/1.6 var(--font); background: radial-gradient(ellipse at 4% 12%, #c2d8fbb3, transparent 46%), radial-gradient(ellipse at 97% 4%, #d6cdf299, transparent 40%), radial-gradient(ellipse at 76% 82%, #cfe7e8a3, transparent 47%), linear-gradient(116deg, transparent 25%, #ffffff94 43%, transparent 61%), var(--bg); }
button, input, select, textarea { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
button:disabled { opacity: .65; transform: none !important; box-shadow: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 2px; }
::selection { background: #cdddff; color: #162c50; }
code, pre { font-family: var(--mono); }
code { color: #31517c; background: #edf2f8; padding: 2px 5px; border-radius: 5px; font-size: .88em; }
pre { tab-size: 2; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.cyan { color: var(--accent); }
.purple { color: var(--player-b); }
.pink { color: var(--danger); }
.green { color: var(--success); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.nav-icon, .button-icon, .stat-symbol svg, .upload-glyph svg, .standby-icon svg, .victory-icon svg, .active-bot-art svg, .dialog-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.skip-link { position: fixed; top: -70px; left: 20px; background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 100; }
.skip-link:focus { top: 16px; }

/* Reusable material layers. Solid fallback works without backdrop-filter.
   Reflections are CSS backgrounds, never overlays that can intercept input.
   Subtle sheets use no filter; only foreground chrome gets optical blur. */
.glass-surface {
  --material-bg: var(--glass-bg);
  --material-blur: var(--glass-blur);
  background-color: var(--surface-glass);
  background-image: var(--glass-reflection);
  border: 1px solid var(--glass-stroke);
  box-shadow: var(--glass-shadow), var(--glass-rim), 0 0 0 1px #456aa30a;
}
.glass-subtle { --material-bg: var(--glass-subtle); box-shadow: var(--shadow), var(--glass-rim); }
.glass-elevated { --material-bg: var(--glass-elevated); box-shadow: var(--shadow-float), var(--glass-rim); }
.glass-frame > .padded-form { margin: 0 8px 8px; background: var(--surface); border: 1px solid var(--glass-stroke); border-radius: 16px; box-shadow: inset 0 1px #fff; }

/* Floating application shell */
.sidebar { width: 236px; position: fixed; inset: 18px auto 18px 18px; z-index: 10; padding: 27px 16px 18px; display: flex; flex-direction: column; border-radius: var(--radius-xl); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #bccde1 transparent; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.9px; line-height: 1.1; }
.brand-mark { width: 41px; height: 43px; display: grid; place-items: center; position: relative; border-radius: 14px; background: linear-gradient(145deg,#80aefe,#306bda); color: #fff; box-shadow: inset 0 1px 1px #ffffff88, 0 5px 10px #3678db20; font-size: 38px; font-weight: 650; letter-spacing: -4px; padding-right: 5px; padding-bottom: 6px; flex-shrink: 0; }
.brand-mark span { position: absolute; right: 5px; top: 4px; font-size: 12px; letter-spacing: 0; }
.brand-sub { display: block; font-size: 8px; letter-spacing: 1.7px; font-weight: 600; color: var(--subtle); margin-top: 8px; }
.sidebar-caption { display: flex; align-items: center; justify-content: space-between; margin: 42px 12px 14px; color: var(--subtle); font-size: 11px; font-weight: 500; }
.sidebar-caption span { padding: 1px 7px; background: #eef2f8; border-radius: 6px; font-size: 10px; }
.sidebar nav { display: flex; flex-direction: column; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 13px 12px; color: #536581; border: 1px solid transparent; border-radius: 13px; font-size: 13px; font-weight: 550; transition: background var(--motion-fast), color var(--motion-fast); }
.nav-item:hover { background: #eef3fa; color: var(--text); }
.nav-item.active { background: linear-gradient(115deg,#ffffffc4,#eaf2ff80); color: var(--accent-hover); border-color: #ffffffed; box-shadow: inset 0 1px #fff, 0 5px 12px #3d69ad14, 0 0 0 1px #7fa5dc24; }
.nav-item.active .nav-icon { stroke-width: 2; }
.nav-number { font-size: 10px; margin-left: auto; opacity: .65; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; padding-top: 34px; }
.sidebar-help { background: linear-gradient(150deg,#ffffffad,#e9f0ff75); border: 1px solid #ffffffc9; border-radius: 18px; padding: 19px 16px; box-shadow: inset 0 1px #fff, 0 6px 14px #456aa306; }
.sidebar-help > svg { color: var(--accent); margin-bottom: 12px; }
.sidebar-help strong { display: block; font-size: 14px; line-height: 1.6; font-weight: 600; letter-spacing: -.2px; }
.sidebar-help p { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 9px 0 15px; }
.sidebar-help .text-button { font-size: 12px; }
.docs-link { display: flex; justify-content: space-between; padding: 22px 10px 17px; color: var(--muted); font-size: 12px; }
.docs-link:hover { color: var(--accent); }
.sidebar-footer { padding: 15px 9px 0; border-top: 1px solid var(--border-soft); color: var(--subtle); font-size: 11px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--success); margin-right: 7px; vertical-align: middle; flex-shrink: 0; }
.shell { margin-left: 274px; }
.topbar { --material-blur: 16px; height: 56px; margin: 18px 38px 14px; padding: 0 18px; border-radius: 19px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.breadcrumb { color: var(--subtle); font-size: 13px; white-space: nowrap; }
.breadcrumb span { color: #a0aec0; margin: 0 12px; }
.breadcrumb strong { font-weight: 550; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 21px; }
.connection { font-size: 12px; color: var(--muted); display: flex; align-items: center; }
.clock { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; background: #e8effc; border: 1px solid #d6e1f5; color: var(--accent); border-radius: 50%; font-size: 14px; font-weight: 650; letter-spacing: -.8px; }
main { max-width: 1540px; margin: auto; padding: 4px 38px 0; }
.view { display: none; }
.view.active { display: block; animation: enter var(--motion) var(--ease); }
.eyebrow { font-size: 10px; font-weight: 650; letter-spacing: 1.7px; color: var(--subtle); line-height: 1.5; }
:where(.panel) { background-color: var(--surface); background-image: var(--glass-reflection); border: 1px solid var(--glass-stroke); border-radius: var(--radius); box-shadow: var(--shadow), var(--glass-rim); overflow: hidden; min-width: 0; }
.panel-heading { min-height: 64px; padding: 18px 22px; background: linear-gradient(110deg,#ffffff47,#ffffff0a); border-bottom: 1px solid #dee7f3a3; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-heading h2 { font-size: 14px; font-weight: 650; letter-spacing: -.15px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.tag { display: inline-flex; align-items: center; width: max-content; max-width: 100%; gap: 5px; font-size: 10px; font-weight: 550; padding: 4px 8px; background: #f1f4f9; border: 1px solid #e7ecf3; color: var(--muted); border-radius: 7px; line-height: 1.4; letter-spacing: .15px; }
.tag::before { content: none; }

/* Identity and competition context; real server state is supplied by app.js. */
.identity-bar { display: flex; align-items: center; gap: 20px; padding: 12px 18px; margin-bottom: 14px; border-radius: var(--radius); min-width: 0; }
.identity-copy { flex: 1; min-width: 0; }
.identity-bar .eyebrow { letter-spacing: .6px; font-size: 10px; }
.identity-bar .tag { margin-left: 8px; font-size: 9px; padding: 2px 7px; color: var(--accent); background: var(--accent-soft); border-color: #dfe9fa; }
.identity-bar strong { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.4px; margin-top: 2px; overflow-wrap: anywhere; }
.identity-bar small { display: block; color: var(--subtle); font-size: 10px; overflow-wrap: anywhere; }
.identity-bar form { width: 230px; min-width: 0; }
.identity-bar label { color: var(--subtle); font-size: 11px; }
.identity-bar form > div { display: flex; gap: 7px; margin-top: 4px; }
.identity-bar input:not([type=range]) { margin-top: 0; padding: 8px 11px; font-size: 13px; min-width: 0; }
.identity-bar .button { white-space: nowrap; }
#organizer-toggle { margin-top: 17px; }
.competition-banner { --material-blur: 20px; display: flex; align-items: center; gap: 15px; padding: 18px 20px; margin-bottom: 10px; }
.competition-symbol { width: 42px; height: 42px; background: #edf2f9; border: 1px solid #e3eaf4; color: var(--muted); display: grid; place-items: center; border-radius: 13px; flex-shrink: 0; }
.competition-copy { flex: 1; min-width: 0; }
.competition-banner .eyebrow { display: inline-flex; color: var(--muted); font-size: 9px; letter-spacing: .6px; background: #edf2f9; border: 1px solid #dfe7f3; border-radius: 20px; padding: 3px 8px; margin-bottom: 2px; }
.competition-banner strong { font-size: 16px; font-weight: 650; display: block; margin: 2px 0 3px; }
.competition-banner p { color: var(--muted); font-size: 12px; max-width: 680px; line-height: 1.7; }
.competition-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 270px; justify-content: flex-end; }
.competition-actions .button { font-size: 11px; }
.competition-live { --material-bg: rgb(238 253 245 / .5); }
.competition-live .competition-symbol { color: var(--success); background: #e5f3eb; border-color: #d9ebdf; }
.competition-live .eyebrow { color: var(--success); background: var(--success-soft); border-color: #d5e7de; }
.competition-banner[data-phase=draining] { --material-bg: rgb(255 248 234 / .66); }
.competition-banner[data-phase=draining] .eyebrow { background: var(--warning-soft); border-color: #ecdfc7; }
.competition-banner[data-phase=draining] .eyebrow, .competition-banner[data-phase=draining] .competition-symbol { color: var(--warning); }
.workspace-game { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 17px; padding: 13px 3px; border: none; background: none; box-shadow: none; }
.workspace-game > div { flex: 1; min-width: 0; }
.workspace-game .eyebrow { font-size: 9px; letter-spacing: .7px; }
.workspace-game strong { display: block; color: var(--muted); font-size: 12px; font-weight: 500; margin-top: 2px; }
.workspace-game label { width: 215px; font-size: 10px; color: var(--subtle); }
.workspace-game select { margin-top: 4px; padding: 7px 10px; font-size: 12px; }
.workspace-game .button { min-height: 34px; font-size: 11px; padding: 7px 12px; }
.network-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-radius: 12px; background: var(--warning-soft); border: 1px solid #eedcba; color: #785320; font-size: 12px; margin-bottom: 14px; }
.network-notice button { white-space: nowrap; color: #785320; }

/* Quiet hero illustration uses original vector artwork and CSS, no external font/assets. */
.hero { display: flex; align-items: center; gap: 22px; position: relative; min-height: 290px; padding: 12px 0 35px; }
.hero-copy { flex: 1; min-width: 0; }
.hero .eyebrow { color: var(--muted); font-size: 9px; letter-spacing: 1.8px; display: flex; align-items: center; gap: 8px; }
.hero-dot { width: 6px; height: 6px; background: #83aef4; border-radius: 50%; }
.hero h1 { font-size: clamp(29px,2.8vw,43px); font-weight: 650; line-height: 1.25; letter-spacing: -1.8px; margin: 15px 0 17px; }
h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 13px; color: var(--muted); line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.hero-languages { display: flex; gap: 13px; flex-wrap: wrap; align-items: center; font-size: 10px; margin-top: 20px; color: var(--subtle); }
.hero-languages b { font-size: 10px; font-weight: 550; color: #60718e; }
.hero-art { flex: 0 0 310px; height: 285px; position: relative; perspective: 900px; }
.art-halo { position: absolute; width: 270px; height: 270px; border-radius: 50%; background: radial-gradient(circle at 25% 25%,#fcfeff,#e5edff 47%,#e3e1f5 85%); box-shadow: inset 0 2px 12px #ffffffb3, 0 24px 55px #7b98c11a; right: 9px; top: -5px; }
.art-ring { position: absolute; width: 292px; height: 292px; top: -16px; right: -2px; border: 1px solid #dae4f4b3; border-radius: 50%; }
.art-label { position: absolute; top: 3px; left: 33px; padding: 8px 13px; border-radius: 30px; font-size: 10px; font-weight: 550; color: #536b8f; z-index: 2; }
.strategy-tile { --material-bg: rgb(255 255 255 / .36); position: absolute; top: 66px; width: 125px; height: 147px; padding: 12px; border-radius: 26px; color: var(--player-a); box-shadow: 4px 24px 32px #4c6eab2b, inset 0 2px 2px #ffffffed, inset 0 -2px 6px #b5caf03b; }
.tile-a { left: 7px; transform: rotate(-11deg) translateZ(8px); }
.tile-b { top: 84px; right: 2px; transform: rotate(10deg); color: var(--player-b); --material-bg: rgb(255 250 244 / .4); }
.strategy-tile > span { font-size: 10px; font-weight: 650; position: absolute; left: 14px; top: 10px; opacity: .6; }
.strategy-tile svg { width: 73px; height: 86px; margin: 8px auto 2px; display: block; fill: #e0ebff; stroke: currentColor; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.tile-b svg { fill: #f7e6d6; }
.strategy-tile .robot-eyes { stroke-width: 5.5; }
.strategy-tile small { display: block; text-align: center; font-size: 8px; letter-spacing: 1.1px; font-weight: 600; opacity: .75; }
.art-center { position: absolute; top: 126px; left: 143px; z-index: 2; display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #fff; border-radius: 50%; background: #ffffffc7; box-shadow: 0 4px 14px #47668d12; color: #7c91ad; font-size: 12px; font-weight: 600; font-style: italic; }
.art-caption { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); white-space: nowrap; display: flex; align-items: center; gap: 9px; color: #647c9c; font-size: 10px; }
.art-caption .nav-icon { width: 17px; height: 17px; }
.stats-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin: 4px 0 34px; }
.stat-card { display: flex; align-items: center; gap: 13px; padding: 21px 18px; border-radius: var(--radius); position: relative; min-width: 0; }
.stat-symbol { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.stat-symbol.purple { color: #8c6839; background: #faf3e9; }
.stat-symbol.green { color: var(--success); background: #edf7f2; }
.stat-symbol svg { width: 21px; height: 21px; }
.stat-label { display: block; font-size: 11px; color: var(--muted); }
.stat-card strong { display: block; font-size: 29px; font-weight: 600; line-height: 1.25; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.stat-note { margin-left: auto; align-self: flex-end; color: var(--subtle); font-size: 9px; white-space: nowrap; }

/* Shared controls */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; padding: 11px 18px; min-height: 43px; font-size: 12px; font-weight: 600; border: 1px solid transparent; border-radius: var(--radius-sm); transition: background var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast); line-height: 1.5; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled), .icon-button:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.button.primary { background: var(--accent); border-color: #215cc4; color: #fff; box-shadow: inset 0 1px #ffffff1a, 0 3px 7px #2868d818; }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 5px 14px #2868d829; }
.button.ghost { background: linear-gradient(155deg,#ffffffc9,#f6f9ff75); border-color: #c4d2e699; color: #354d70; box-shadow: inset 0 1px #fff, 0 3px 6px #20365c08; }
.button.ghost:hover:not(:disabled) { background: #f5f8fd; border-color: #bccce5; }
.button.danger { color: #fff; background: var(--danger); border-color: #a13845; }
.button.danger:hover:not(:disabled) { background: #9a3340; }
.button.small { min-height: 35px; padding: 8px 12px; font-size: 11px; }
.button.full { width: 100%; }
.button-icon { width: 16px; height: 16px; }
.text-button { display: inline-flex; align-items: center; gap: 9px; color: var(--accent); background: none; border: 0; padding: 3px 0; font-size: 12px; font-weight: 550; cursor: pointer; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.icon-button { min-width: 35px; height: 35px; padding: 0 9px; background: #fff; border: 1px solid var(--border); border-radius: 9px; color: #536780; display: inline-grid; place-items: center; font-size: 15px; transition: background var(--motion-fast), transform var(--motion-fast); }
.icon-button:hover { background: var(--accent-soft); color: var(--accent); border-color: #cadbf5; }
.icon-button.selected { background: var(--accent-soft); color: var(--accent); border-color: #c6dafa; }
.is-loading { cursor: progress !important; }
.is-loading::before { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
label { display: block; color: #43516a; font-size: 13px; font-weight: 550; }
input:not([type=range]):not([type=file]):not([type=checkbox]), select, textarea { display: block; width: 100%; border: 1px solid #d7e0ec; background: #fbfcfe; color: var(--text); padding: 11px 13px; margin-top: 8px; border-radius: 10px; font-size: 13px; line-height: 1.5; transition: border-color var(--motion-fast), box-shadow var(--motion-fast); min-width: 0; }
input:not([type=file]):hover, select:hover, textarea:hover { border-color: #b6c7e0; }
input::placeholder, textarea::placeholder { color: #7b8799; }
input:disabled, select:disabled, textarea:disabled { color: #617087; background: #f1f4f8; border-color: #e5eaf1; opacity: 1; -webkit-text-fill-color: #617087; }
select { cursor: pointer; }
select option { background: #fff; color: var(--text); }
textarea { min-height: 100px; resize: vertical; font-family: var(--mono); }
input[type=range] { accent-color: var(--accent); width: 100%; min-width: 20px; cursor: pointer; margin: 0; height: 25px; }
input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; margin-top: 10px; }
.padded-form { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.form-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.form-note { font-size: 12px; line-height: 1.85; color: var(--muted); font-weight: 400; }
.feedback { color: var(--success); background: var(--success-soft); border: 1px solid #d1e9db; padding: 13px 15px; font-size: 12px; border-radius: 11px; overflow-wrap: anywhere; }
.feedback.error { color: var(--danger); background: var(--danger-soft); border-color: #f0d4d9; }
.feedback.pending { color: var(--accent); background: var(--accent-soft); border-color: #d4e3fb; }
.feedback:not(.error):not(.pending)::before { content: "✓ "; font-weight: 700; }
#readonly-notice { margin-bottom: 15px; }
.shared-hint { padding: 15px 23px; font-size: 12px; color: var(--muted); background: #fbfcfe; border-bottom: 1px solid var(--border-soft); }
.empty-state { padding: 36px 24px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.9; }
.empty-state::before { content: ""; display: block; width: 34px; height: 25px; margin: 0 auto 14px; border: 1.5px solid #bbc9dc; border-radius: 7px; background: linear-gradient(#edf2f9 0 35%,transparent 35%); }

/* Live Arena: solid surfaces, distinct blue/amber sides, no blur on cells. */
.arena-section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 0 1px 18px; }
.arena-section-title .eyebrow { font-size: 9px; }
.arena-section-title h2 { font-size: 25px; font-weight: 600; letter-spacing: -.8px; margin-top: 3px; }
.section-caption { font-size: 12px; color: var(--subtle); }
.arena-layout { display: grid; grid-template-columns: minmax(0,1fr) 250px; gap: 20px; align-items: start; }
.arena-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.arena-side .panel-heading { padding: 18px; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 500; white-space: nowrap; }
.live-tag i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #8e9cb1; }
.live-tag.running { color: var(--success); }
.live-tag.running i { background: var(--success); }
.arena-panel { padding: 8px; box-shadow: var(--glass-shadow), var(--glass-rim); }
.arena-panel > .panel-heading { background: transparent; }
.combatants { display: flex; align-items: center; gap: 14px; padding: 18px; background: #ffffff80; border-radius: 16px 16px 0 0; }
.fighter { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; padding: 12px; background: linear-gradient(120deg,#edf4ffb8,#ffffff80); border: 1px solid #ffffffd9; border-radius: 17px; box-shadow: inset 0 1px #fff, 0 5px 12px #314c800b; }
.fighter > div { min-width: 0; flex: 1; }
.fighter small { font-size: 9px; font-weight: 650; letter-spacing: 1.2px; color: var(--player-a); }
.fighter strong { display: block; font-size: 11px; font-weight: 600; line-height: 1.5; margin: 3px 0 8px; overflow-wrap: anywhere; }
.fighter-icon { display: grid; place-items: center; flex-shrink: 0; width: 37px; height: 39px; border-radius: 12px; color: var(--player-a); background: #ebf2ff; border: 1px solid #dce8fa; font-size: 19px; font-weight: 550; }
.fighter-b { text-align: right; justify-content: flex-end; background: linear-gradient(240deg,#fff3e5b8,#ffffff80); border-color: #ffffffd9; }
.fighter-b small { color: var(--player-b); }
.fighter-b .fighter-icon { color: var(--player-b); background: #fff3e7; border-color: #f3e2cf; }
.hp-track { height: 5px; background: #e9eef6; overflow: hidden; border-radius: 8px; }
.hp-track span { height: 100%; width: 100%; display: block; background: var(--player-a); border-radius: 8px; transition: width 280ms var(--ease); }
.fighter-b .hp-track { background: #f4ece3; }
.fighter-b .hp-track span { background: var(--player-b); margin-left: auto; }
.hp-text { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.vs { text-align: center; font-size: 21px; font-style: italic; font-weight: 550; color: #8b99b0; }
.vs span { font-size: 6px; font-style: normal; letter-spacing: .6px; margin-top: 3px; display: block; }
.canvas-wrap { position: relative; background: #f8fafd; border: 1px solid #e7edf5; border-radius: 16px; overflow: hidden; isolation: isolate; }
#arena { display: block; width: 100%; height: auto; aspect-ratio: 900/580; }
.canvas-hud, .canvas-bottom { position: absolute; left: 18px; right: 18px; display: flex; justify-content: space-between; gap: 10px; align-items: center; color: #5d708e; font-size: 11px; font-weight: 500; pointer-events: none; }
.canvas-hud { top: 13px; }
.canvas-bottom { bottom: 13px; }
.canvas-bottom strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.canvas-bottom .status-dot { width: 5px; height: 5px; }
.standby-overlay { position: absolute; inset: 0; z-index: 2; padding: 30px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px; background: linear-gradient(#f8fafdde,#f8fafdf5); }
.standby-icon { display: grid; place-items: center; background: #e9f1ff; border: 1px solid #d9e6fb; color: var(--accent); width: 57px; height: 57px; border-radius: 18px; margin-bottom: 7px; }
.standby-icon svg { width: 27px; height: 27px; }
.standby-overlay strong { font-size: 20px; font-weight: 600; letter-spacing: -.5px; }
.standby-overlay > span:not(.standby-icon) { color: var(--muted); font-size: 12px; max-width: 320px; }
.standby-overlay .button { margin-top: 9px; }
.victory-overlay { position: absolute; inset: 0; z-index: 3; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: radial-gradient(ellipse at 50% 30%,#e7effffc,#f8fafcfa 72%); animation: enter 300ms var(--ease); }
.victory-icon { width: 66px; height: 66px; border-radius: 22px; background: #fff; border: 1px solid #fff; box-shadow: 0 8px 23px #5276a81a; color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }
.victory-icon svg { width: 31px; height: 31px; }
.victory-overlay .eyebrow { font-size: 9px; color: #637fa5; margin-bottom: 5px; }
.victory-overlay h3 { font-size: clamp(24px,3vw,38px); color: var(--accent); font-weight: 650; letter-spacing: -1px; }
.victory-overlay > strong { font-size: 13px; font-weight: 600; margin: 9px 0; overflow-wrap: anywhere; max-width: 100%; }
.victory-overlay p { font-size: 12px; color: var(--muted); max-width: 450px; margin-bottom: 18px; overflow-wrap: anywhere; }
.playback-bar { --material-blur: 18px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 12px 0 0; border-radius: var(--radius-lg); position: relative; }
.playback-buttons { display: flex; gap: 5px; padding-right: 9px; border-right: 1px solid var(--border); }
#play-speed { width: 55px; padding: 6px 4px; margin: 0; border-color: transparent; background: none; font-size: 12px; flex-shrink: 0; }
.quick-form { padding: 20px; }
.quick-form label { font-size: 12px; }
.quick-vs { text-align: center; color: #8e9bb0; font-size: 11px; font-style: italic; padding: 9px 0; }
.quick-form .button { margin-top: 19px; font-size: 11px; }
.active-bot-panel .padded-form { gap: 12px; padding: 22px 19px; }
.active-bot-art, .dialog-icon { width: 43px; height: 43px; border-radius: 14px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.active-bot-panel strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.active-bot-panel .button { margin-top: 3px; font-size: 11px; }
.quick-hint { text-align: center; padding-top: 7px; }
.quick-hint .text-button { font-size: 11px; }
.combat-log { height: 200px; overflow: auto; padding: 6px 17px; font: 10px/1.8 var(--mono); scrollbar-width: thin; scrollbar-color: #ccd7e7 transparent; }
.log-line { padding: 9px 0; border-bottom: 1px solid var(--border-soft); color: #627490; overflow-wrap: anywhere; }
.log-line > span { color: #7f8da3; margin-right: 8px; }
.log-line.attack { color: var(--player-a); }
.log-line.fault { color: var(--danger); }
.log-line.result { color: var(--success); }
.log-footer { padding: 13px 17px; font-size: 10px; color: var(--subtle); border-top: 1px solid var(--border-soft); }
.has-match[data-view=home] .hero, .has-match[data-view=home] .stats-grid, .has-match[data-view=home] .workspace-game { display: none; }
.has-match .arena-section-title { margin-top: 22px; }

/* Submission, lists and history */
.page-intro { padding: 12px 0 31px; }
.page-intro h1 { font-size: clamp(30px,3.3vw,44px); font-weight: 600; line-height: 1.25; letter-spacing: -1.6px; margin: 13px 0 15px; }
.page-intro p { color: var(--muted); font-size: 13px; max-width: 680px; line-height: 1.85; }
.two-column { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 22px; align-items: start; }
.drop-zone { min-height: 208px; background: radial-gradient(ellipse at 35% 0,#ffffffa8,transparent 65%),#e9f2ff6e; border: 1.5px dashed #8caddba8; border-radius: 18px; box-shadow: inset 0 1px 1px #fff, inset 0 -2px 8px #7297ce0a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 25px; position: relative; cursor: pointer; text-align: center; transition: background var(--motion-fast), border-color var(--motion-fast); }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: radial-gradient(ellipse at 35% 0,#ffffffc9,transparent 65%),#dae9ffad; }
.drop-zone:focus-within { outline: 3px solid var(--accent); outline-offset: 4px; }
.drop-zone input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.drop-zone strong { font-size: 15px; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.drop-zone > span:not(.upload-glyph) { color: var(--muted); font-size: 12px; }
.drop-zone small { color: var(--subtle); font-size: 10px; font-weight: 400; }
.upload-glyph { width: 47px; height: 47px; display: grid; place-items: center; background: #fff; border-radius: 14px; box-shadow: 0 3px 10px #2c5b9510; color: var(--accent); margin-bottom: 7px; }
.drop-zone .file-language { background: #fff; border: 1px solid #d7e4fa; color: var(--accent) !important; font-size: 10px !important; padding: 2px 8px; border-radius: 6px; }
.compiler-log { margin: 0; background: #f3f6fb; border: 1px solid #dbe4f1; color: #4f3853; padding: 16px; font: 11px/1.9 var(--mono); max-height: 250px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 12px; }
.sample-list { padding: 4px 23px; }
.sample-card { display: flex; align-items: center; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--border-soft); }
.sample-card:last-child { border-bottom: none; }
.sample-card > div { flex: 1; min-width: 0; }
.sample-card strong { font-size: 13px; font-weight: 600; }
.sample-card p { margin-top: 5px; font-size: 11px; color: var(--muted); }
.language-icon { display: grid; place-items: center; flex-shrink: 0; width: 39px; height: 42px; background: #ebf3ff; color: #346cbd; border: 1px solid #d9e7fa; border-radius: 11px; font: 650 11px var(--font); }
.language-icon.cpp { color: #6a5b9b; background: #f2effb; border-color: #e4dff3; }
.language-icon.java { color: #9d6232; background: #fff4e9; border-color: #f2e2d2; font-size: 10px; }
.protocol-preview { padding: 22px 24px; background: #fbfcfe; border-top: 1px solid var(--border-soft); }
.protocol-preview pre { color: #496383; font-size: 11px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; }
.safety-note { padding: 18px 23px; font-size: 11px; color: #75613e; background: #fdf9f1; border-top: 1px solid #eee5d7; line-height: 1.7; }
.safety-note > strong { font-weight: 600; }
.safety-note span { display: block; font-size: 11px; color: #756d5d; margin-top: 5px; }
.library-panel, .history-panel { margin-top: 27px; }
.bot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 20px 23px; border-bottom: 1px solid var(--border-soft); }
.bot-row:last-child { border-bottom: 0; }
.bot-description { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bot-row strong { font-size: 14px; font-weight: 600; }
.bot-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.bot-description .tag { margin-top: 7px; font-size: 9px; }
.bot-description .bot-owner { font-size: 10px; color: var(--subtle); }
.bot-row details { width: 100%; font-size: 11px; color: var(--muted); }
.bot-row details pre { white-space: pre-wrap; max-height: 210px; overflow: auto; overflow-wrap: anywhere; background: #f5f7fb; border-radius: 9px; padding: 12px; font-size: 11px; }
summary { cursor: pointer; width: fit-content; }
.match-list { min-height: 85px; }
.match-row { display: grid; grid-template-columns: 40px minmax(0,1fr) 96px minmax(95px,150px) auto; gap: 16px; align-items: center; padding: 20px 23px; border-bottom: 1px solid var(--border-soft); transition: background var(--motion-fast); }
.match-row:hover { background: #fcfdff; }
.match-row:last-child { border-bottom: 0; }
.match-id { color: var(--subtle); font: 10px var(--mono); }
.match-names { font-size: 12px; font-weight: 550; line-height: 1.7; overflow-wrap: anywhere; }
.match-names > span { color: #8a98ae; padding: 0 8px; font-size: 10px; font-weight: 400; }
.match-date { display: block; color: var(--muted); font-size: 10px; font-weight: 400; margin-top: 4px; }
.match-correction-history { margin-top: 3px; }
.match-correction-history summary { color: var(--accent); }
.match-status { display: inline-flex; align-items: center; justify-content: center; width: max-content; gap: 5px; padding: 5px 9px; color: var(--success); background: var(--success-soft); border: 1px solid #d8eadf; border-radius: 7px; font-size: 11px; font-weight: 600; line-height: 1.5; }
.match-status::before { content: "✓"; font-weight: 700; }
.match-status.running, .match-status.queued, .match-status.status-online, .match-status.status-invited, .match-status.status-pending, .match-status.status-partially_accepted { color: var(--accent); background: var(--accent-soft); border-color: #d9e5f9; }
.match-status.running::before, .match-status.queued::before { content: "●"; font-size: 6px; }
.match-status.interrupted, .match-status.status-offline, .match-status.status-declined, .match-status.status-cancelled, .match-status.status-expired { color: var(--muted); background: #f2f4f8; border-color: #e2e7ee; }
.match-status.interrupted::before { content: "!"; }
.match-status.status-offline::before, .match-status.status-cancelled::before, .match-status.status-expired::before { content: "–"; }
.match-status.status-pending::before, .match-status.status-partially_accepted::before, .match-status.status-invited::before { content: "◷"; }
.match-status.status-declined::before { content: "×"; }
.match-status.status-online::before { content: "●"; font-size: 6px; }
.match-status.bot-error { color: var(--danger); background: var(--danger-soft); border-color: #f0d4da; }
.match-result { color: var(--muted); font-size: 11px; text-align: center; overflow-wrap: anywhere; }
.match-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.match-row .button { padding: 7px 10px; min-height: 34px; font-size: 10px; }

/* Organizer and lobby */
.player-row, .invitation-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border-soft); min-width: 0; }
.player-row { margin: 10px; background: #ffffff8f; border: 1px solid var(--glass-stroke); border-radius: 16px; box-shadow: var(--shadow-sm), inset 0 1px #fff; }
.invitation-row:last-child { border-bottom: 0; }
.player-row .bot-description strong, .invitation-row .bot-description strong { display: block; font-size: 14px; font-weight: 600; }
.player-row .bot-description small, .invitation-row .bot-description small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.create-form { margin-top: 24px; }
.fighter-selection { display: grid; grid-template-columns: minmax(0,1fr) 85px minmax(0,1fr); gap: 15px; align-items: center; }
.selection-card { padding: 26px; text-align: center; background: radial-gradient(ellipse at 50% 15%,#e1edff99,transparent 65%),#ffffff73; border-color: var(--glass-stroke); }
.selection-card .eyebrow { color: var(--player-a); font-size: 10px; }
.selection-avatar { width: 86px; height: 86px; border-radius: 28px; display: grid; place-items: center; margin: 24px auto 20px; color: var(--player-a); background: linear-gradient(140deg,#f8fbff,#e0ebff); border: 1px solid #d6e3f8; box-shadow: inset 0 1px #fff, 0 9px 20px #5880bf0d; font-size: 44px; font-weight: 550; }
.selection-card h2 { font-size: 19px; font-weight: 550; letter-spacing: -.5px; margin-bottom: 23px; }
.selection-card label { text-align: left; font-size: 12px; }
.purple-card { background: radial-gradient(ellipse at 50% 15%,#fff0db99,transparent 65%),#ffffff73; border-color: var(--glass-stroke); }
.purple-card .eyebrow { color: var(--player-b); }
.purple-card .selection-avatar { color: var(--player-b); background: linear-gradient(140deg,#fffcf8,#f9e8d4); border-color: #eedcc7; box-shadow: inset 0 1px #fff, 0 9px 20px #9e77480d; }
.selection-vs { text-align: center; font-size: 30px; font-weight: 550; font-style: italic; color: #90a0b8; }
.selection-vs span { display: block; font-size: 9px; font-weight: 500; font-style: normal; letter-spacing: 1px; margin-top: 8px; }
.launch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 0; }
.launch-row p { color: var(--muted); font-size: 12px; }
.launch-button { min-width: 210px; }
.waiting-panel .padded-form { align-items: flex-start; gap: 15px; }
.waiting-panel h2 { font-size: 23px; font-weight: 550; letter-spacing: -.6px; }
.rules-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; margin: 24px 0; }
.rules-summary > div { flex: 1; }
.rules-chips { display: flex; flex-wrap: wrap; gap: 12px 22px; margin: 12px 0; }
.rules-chips > span { color: var(--muted); font-size: 11px; }
.rules-chips strong { font-size: 18px; font-weight: 600; color: var(--text); margin-right: 5px; }
.game-library { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 18px; margin-bottom: 23px; }
.game-card { position: relative; display: flex; align-items: flex-start; gap: 17px; text-align: left; background: linear-gradient(145deg,#ffffffa3,#ffffff5c); border: 1px solid var(--glass-stroke); border-radius: var(--radius); padding: 28px 23px 23px; color: var(--text); box-shadow: var(--shadow), var(--glass-rim); transition: border-color var(--motion-fast), background var(--motion-fast), box-shadow var(--motion-fast); }
.game-card:hover { border-color: #b4caec; background: #fcfdff; }
.game-card.selected { border-color: #8cb2ef; background: linear-gradient(135deg,#ffffffb8,#deebff85); box-shadow: 0 0 0 2px #bcd4fa33, var(--glass-shadow), var(--glass-rim); }
.game-card.selected::after { content: "✓ Đang chọn"; position: absolute; right: 14px; top: 10px; font-size: 9px; font-weight: 600; color: var(--accent); }
.game-card:disabled { cursor: default; opacity: .85; }
.game-card.selected:disabled { opacity: 1; }
.game-card-icon { width: 49px; height: 53px; border-radius: 15px; flex-shrink: 0; display: grid; place-items: center; background: #edf3fd; border: 1px solid #dde7f7; color: var(--accent); font-size: 18px; font-weight: 600; letter-spacing: -.5px; }
.game-card:nth-child(even) .game-card-icon { color: #8a6433; background: #fbf3e8; border-color: #efe2d0; }
.game-card-copy { min-width: 0; }
.game-card h2 { font-size: 19px; font-weight: 600; letter-spacing: -.5px; margin: 0 0 9px; }
.game-card p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.game-card small { display: block; font-size: 9px; color: var(--subtle); margin-top: 14px; }
.game-information { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; padding: 25px; margin-bottom: 24px; }
.game-information > div:first-child { flex: 1; min-width: 180px; }
.game-information h2 { font-size: 23px; font-weight: 600; margin: 7px 0; letter-spacing: -.7px; }
.game-information p { font-size: 13px; color: var(--muted); line-height: 1.9; }
.fixed-rules { display: flex; flex-wrap: wrap; width: 100%; gap: 8px; }
.fixed-rule { font-size: 10px; background: #f6f8fc; border: 1px solid #e6ebf3; border-radius: 8px; padding: 7px 10px; color: #4a607e; overflow-wrap: anywhere; max-width: 100%; }
.fixed-rule small { color: var(--subtle); margin-right: 7px; font-size: 9px; }
.rules-fields { display: flex; flex-direction: column; gap: 21px; }
.input-hint { float: right; font-size: 11px; color: var(--subtle); font-weight: 400; }
.field-description { display: block; font-weight: 400; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.rule-explainer ol { padding: 6px 23px 16px; margin: 0; list-style: none; }
.rule-explainer li { display: flex; align-items: flex-start; gap: 15px; padding: 19px 0; border-bottom: 1px solid var(--border-soft); }
.rule-explainer li:last-child { border-bottom: none; }
.rule-explainer li > span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: #f0f4fb; color: #607ba2; font-size: 10px; flex-shrink: 0; }
.rule-explainer strong { font-size: 13px; font-weight: 600; }
.rule-explainer p { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.game-loading { padding: 25px; text-align: center; color: var(--muted); }

/* Elevated surfaces: opaque fallback first, glass only when supported. */
.organizer-dialog { width: min(480px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; color: var(--text); border-radius: var(--radius-lg); overflow: auto; }
.organizer-dialog[open] { animation: dialog-enter 200ms var(--ease); }
.organizer-dialog .padded-form { padding: 31px; gap: 18px; }
.organizer-dialog h2 { font-size: 27px; font-weight: 600; letter-spacing: -.9px; line-height: 1.3; }
.organizer-dialog::backdrop { background: #40537538; }
.account-dialog { width: min(560px,calc(100vw - 32px)); }
.account-dialog .padded-form { display: grid; gap: 17px; }
.account-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; border: 1px solid #d4deecb8; border-radius: var(--radius); background: #ffffff70; box-shadow: inset 0 1px #fff; }
.account-form label:first-child, .account-form .button { grid-column: 1 / -1; }
.account-form input, .account-form select { width: 100%; }
.activation-panel { border-top: 1px solid #d6dfec; padding-top: 13px; }
.activation-panel summary { cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 650; margin-bottom: 12px; }
.account-dialog #account-feedback { margin: 0; }
.invitation-dialog { width: min(600px,calc(100vw - 32px)); }
.invitation-fighters { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.invitation-fighter { padding: 19px; background: #f2f6ff; border: 1px solid #dbe6fb; border-radius: 16px; overflow-wrap: anywhere; }
.invitation-fighter:nth-child(2) { background: #fff7ee; border-color: #efdfcd; }
.invitation-fighter h3 { font-size: 22px; font-weight: 600; color: var(--player-a); letter-spacing: -.6px; }
.invitation-fighter:nth-child(2) h3 { color: var(--player-b); }
.invitation-fighter small { font-size: 10px; color: var(--muted); }
.invitation-fighter p { font-size: 13px; font-weight: 550; margin: 13px 0; }
.invitation-fighter .tag { background: #ffffffbf; }
.countdown { color: var(--accent); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.toast { position: fixed; bottom: 26px; left: calc(50% + 110px); transform: translateX(-50%); z-index: 50; padding: 15px 20px; color: #245c45; border: 1px solid #d4e9df; border-radius: 19px; width: max-content; max-width: min(620px,calc(100vw - 36px)); font-size: 13px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; animation: toast-enter 180ms var(--ease); }
.toast.error { color: var(--danger); border-color: #ebcbd3; }
.main-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 25px 0; margin-top: 33px; border-top: 1px solid #e2e9f3; color: var(--subtle); font-size: 10px; }
.main-footer strong { color: #5d708f; font-size: 12px; font-weight: 650; letter-spacing: -.3px; }
.footer-dot { margin: 0 7px; }
.protocol-document { max-width: 950px; margin: 35px auto; padding: 40px; background: #fff; border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); }
.protocol-document h1 { font-size: 34px; font-weight: 600; line-height: 1.3; letter-spacing: -1px; margin: 24px 0; }
.protocol-document h2 { font-size: 22px; font-weight: 600; letter-spacing: -.5px; margin: 32px 0 12px; }
.protocol-document p, .protocol-document li { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 12px 0; }
.protocol-document pre { padding: 20px; background: #f3f6fb; border: 1px solid #e0e8f4; border-radius: 13px; color: #3d577a; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.9; }
.protocol-document .network-status { padding: 20px; background: #f0f6ff; border: 1px solid #d8e5f9; border-radius: 14px; margin: 22px 0; overflow-wrap: anywhere; }
.protocol-document .network-status strong { color: var(--accent); }
.lan-guide a { color: var(--accent); }
.lan-guide .button.primary { color: #fff; }
.lan-guide .safety-note { border-radius: 13px; margin-top: 25px; }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :where(.panel) { background-color: var(--sheet-bg); }
  .glass-surface { background-color: var(--material-bg); -webkit-backdrop-filter: blur(var(--material-blur)) saturate(var(--glass-saturate)); backdrop-filter: blur(var(--material-blur)) saturate(var(--glass-saturate)); }
  .glass-subtle { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass-frame > .padded-form { background: #ffffff73; }
  .organizer-dialog::backdrop { -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
}
/* Unblurred reading layers keep long data readable without hiding the frame. */
.match-list, #bot-library, .sample-list, .combat-log, .rule-explainer ol { background: var(--content-bg); }
/* Make transparency optional for accessibility and low-power demonstrations. */
@media (prefers-reduced-transparency: reduce) { .glass-surface, .panel, .glass-frame > .padded-form, .game-card, .drop-zone, .fighter, .player-row { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } .organizer-dialog::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .game-card:hover:not(:disabled) { box-shadow: var(--glass-shadow), inset 0 1px #fff; } }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-enter { from { opacity: 0; transform: translate(-50%,5px); } to { opacity: 1; transform: translate(-50%,0); } }

/* Laptop first, then a compact navigation shelf on small screens. */
@media (min-width:1600px) { .hero { min-height: 325px; } .hero-art { flex-basis: 370px; margin-right: 20px; } .art-halo { right: 38px; } .art-ring { right: 27px; } .tile-a { left: 33px; } .tile-b { right: 25px; } .art-center { left: 168px; } .art-label { left: 62px; } .arena-layout { grid-template-columns: minmax(0,1fr) 280px; } }
@media (max-width:1350px) { .sidebar { width: 215px; } .shell { margin-left: 248px; } .brand { font-size: 20px; gap: 9px; padding: 0; } .brand-sub { font-size: 7px; letter-spacing: 1.4px; } .sidebar .brand-mark { width: 37px; height: 40px; } .nav-item { font-size: 12px; padding: 12px 10px; gap: 10px; } .nav-number { display: none; } main { padding-inline: 28px; } .topbar { padding-inline: 28px; } .stat-note { display: none; } .hero-art { flex-basis: 285px; } .hero h1 { letter-spacing: -1.3px; } .arena-layout { grid-template-columns: minmax(0,1fr) 225px; gap: 16px; } .sample-card { gap: 9px; } .sample-card .icon-button { min-width: 30px; padding: 0 6px; } .match-row { grid-template-columns: minmax(0,1fr) 85px minmax(0,auto); gap: 12px; } .match-id { display: none; } .match-result { grid-column: 1; grid-row: 2; text-align: left; } .match-actions { grid-column: 3; grid-row: 1 / span 2; flex-direction: column; } }
@media (max-width:1100px) { .identity-bar { flex-wrap: wrap; gap: 14px; } .identity-bar form { width: 210px; } #organizer-toggle { margin-top: 0; } .identity-copy { flex-basis: 45%; } .arena-layout { grid-template-columns: minmax(0,1fr); } .arena-side { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; } .hero-art { flex-basis: 230px; transform: scale(.8); transform-origin: right center; margin-left: -50px; } .hero .eyebrow { font-size: 8px; letter-spacing: 1px; } .hero h1 { font-size: 32px; } .hero-actions .button { padding-inline: 12px; gap: 8px; font-size: 11px; } .competition-actions { max-width: 220px; } .competition-actions .button { font-size: 10px; } .workspace-game { gap: 12px; } .workspace-game label { width: 180px; } .workspace-game .button { display: none; } .two-column { grid-template-columns: minmax(0,1fr); } .fighter-selection { grid-template-columns: minmax(0,1fr) 55px minmax(0,1fr); gap: 12px; } .selection-card { padding: 22px 18px; } .selection-card h2 { font-size: 17px; } .game-library { grid-template-columns: minmax(0,1fr); } }
@media (max-width:900px) {
  .sidebar { position: relative; inset: auto; width: auto; margin: 10px 10px 0; padding: 15px 12px 10px; border-radius: 21px; gap: 16px; }
  .brand { font-size: 20px; padding-left: 4px; }
  .brand-mark { width: 32px !important; height: 34px !important; border-radius: 11px; font-size: 31px; }
  .brand-mark span { font-size: 9px; right: 4px; }
  .brand-sub { font-size: 7px; margin-top: 4px; }
  .sidebar-caption, .sidebar-bottom { display: none; }
  .sidebar nav { flex-direction: row; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .nav-item { flex-shrink: 0; padding: 10px; border-radius: 11px; gap: 6px; font-size: 11px; }
  .nav-item .nav-icon { width: 16px; height: 16px; }
  .shell { margin-left: 0; }
  .topbar { height: 52px; margin: 12px 19px; padding: 0 12px; gap: 9px; border-radius: 17px; }
  .breadcrumb { font-size: 11px; }
  .breadcrumb span { margin-inline: 6px; }
  .topbar-right { gap: 10px; }
  .clock, .avatar { display: none; }
  .connection { font-size: 10px; }
  main { padding: 0 19px; }
  .identity-bar { padding: 16px 14px; gap: 12px; }
  .identity-copy { flex-basis: 100%; }
  .identity-bar strong { font-size: 17px; }
  .identity-bar small { font-size: 9px; }
  .identity-bar form { flex: 1; min-width: 160px; }
  #organizer-toggle { align-self: flex-end; margin-bottom: 0; font-size: 10px; min-height: 37px; }
  .competition-banner { gap: 12px; padding: 17px; align-items: flex-start; flex-wrap: wrap; }
  .competition-symbol { width: 34px; height: 34px; border-radius: 11px; }
  .competition-symbol svg { width: 18px; height: 18px; }
  .competition-copy { flex-basis: calc(100% - 50px); }
  .competition-banner .eyebrow { font-size: 9px; }
  .competition-banner strong { font-size: 15px; margin: 3px 0 5px; }
  .competition-banner p { font-size: 11px; }
  .competition-actions { max-width: none; width: 100%; justify-content: flex-start; padding-left: 46px; }
  .competition-actions:empty { display: none; }
  .competition-actions .button { font-size: 10px; }
  .workspace-game { padding: 11px 1px; gap: 12px; margin-bottom: 12px; }
  .workspace-game > div { min-width: 90px; }
  .workspace-game strong { font-size: 10px; }
  .workspace-game label { width: 155px; font-size: 9px; }
  .workspace-game select { font-size: 11px; }
  .hero { padding: 20px 1px 28px; min-height: 0; }
  .hero-art { display: none; }
  .hero .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .hero h1 { font-size: clamp(27px,6vw,37px); letter-spacing: -1.2px; margin-top: 14px; }
  .hero p { font-size: 12px; }
  .hero-actions { gap: 8px; margin-top: 21px; }
  .hero-languages { font-size: 9px; gap: 10px; margin-top: 17px; }
  .hero-languages b { font-size: 9px; }
  .stats-grid { gap: 9px; margin-bottom: 27px; }
  .stat-card { padding: 14px 10px; display: block; border-radius: 14px; }
  .stat-symbol { width: 30px; height: 30px; border-radius: 10px; margin-bottom: 10px; }
  .stat-symbol svg { width: 16px; height: 16px; }
  .stat-label { font-size: 9px; }
  .stat-card strong { font-size: 26px; margin-top: 3px; }
  .arena-section-title h2 { font-size: 23px; }
  .section-caption { display: none; }
  .panel-heading { min-height: 58px; padding: 16px 17px; gap: 8px; }
  .panel-heading h2 { font-size: 12px; gap: 7px; flex-wrap: wrap; }
  .panel-heading .tag { font-size: 8px; }
  .live-tag { font-size: 9px; }
  .arena-side { grid-template-columns: minmax(0,1fr); }
  .combatants { padding: 16px 13px; gap: 8px; }
  .fighter { gap: 7px; padding: 8px; border-radius: 13px; }
  .fighter small { font-size: 8px; letter-spacing: .8px; }
  .fighter strong { font-size: 9px; }
  .fighter-icon { width: 27px; height: 31px; border-radius: 9px; font-size: 15px; }
  .hp-text { font-size: 8px; }
  .vs { font-size: 16px; }
  .vs span { display: none; }
  .canvas-hud, .canvas-bottom { left: 11px; right: 11px; font-size: 7px; }
  .canvas-hud { top: 7px; }
  .canvas-bottom { bottom: 7px; }
  .canvas-hud span:last-child { max-width: 66%; text-align: right; }
  .standby-overlay { padding: 17px; gap: 7px; }
  .standby-icon { width: 37px; height: 37px; border-radius: 12px; margin-bottom: 0; }
  .standby-icon svg { width: 21px; height: 21px; }
  .standby-overlay strong { font-size: 15px; }
  .standby-overlay > span:not(.standby-icon) { font-size: 10px; max-width: 250px; }
  .standby-overlay .button { margin-top: 4px; min-height: 31px; padding: 5px 10px; font-size: 10px; }
  .victory-overlay { padding: 16px; }
  .victory-icon { width: 38px; height: 38px; border-radius: 13px; margin-bottom: 7px; }
  .victory-icon svg { width: 23px; height: 23px; }
  .victory-overlay .eyebrow { font-size: 7px; }
  .victory-overlay h3 { font-size: 25px; }
  .victory-overlay > strong { font-size: 10px; margin: 4px 0; }
  .victory-overlay p { font-size: 9px; line-height: 1.5; margin-bottom: 9px; }
  .victory-overlay .button { min-height: 29px; padding: 5px 11px; font-size: 10px; }
  .playback-bar { padding: 10px; margin: 9px 0 0; gap: 7px; flex-wrap: wrap; border-radius: 19px; }
  .playback-buttons { gap: 4px; }
  .playback-bar .icon-button { height: 31px; min-width: 28px; padding-inline: 6px; font-size: 12px; }
  #timeline { flex: 1; width: 50px; }
  #play-speed { width: 45px; font-size: 10px; }
  .padded-form { padding: 20px 18px; gap: 19px; }
  .page-intro { padding: 19px 1px 25px; }
  .page-intro .eyebrow { font-size: 8px; }
  .page-intro h1 { font-size: 32px; letter-spacing: -1.1px; }
  .page-intro p { font-size: 12px; }
  .two-column { gap: 19px; }
  .match-row { padding: 18px 17px; gap: 10px; grid-template-columns: minmax(0,1fr) auto; }
  .match-actions { grid-column: 2; grid-row: 1 / span 3; flex-direction: column; }
  .match-row .match-status { grid-column: 1; grid-row: 2; }
  .match-row .match-result { grid-column: 1; grid-row: 3; }
  .match-names { font-size: 11px; }
  .match-date { font-size: 9px; }
  .shared-hint { padding: 13px 17px; font-size: 11px; }
  .bot-row { padding: 18px; gap: 12px; }
  .bot-row .bot-description { flex-basis: calc(100% - 60px); }
  .bot-row .button { font-size: 10px; min-height: 34px; }
  .sample-list { padding-inline: 18px; }
  .sample-card { flex-wrap: wrap; }
  .sample-card strong { font-size: 12px; }
  .sample-card p { font-size: 10px; }
  .sample-card > div { flex-basis: calc(100% - 55px); }
  .protocol-preview { padding: 20px 18px; }
  .protocol-preview pre { font-size: 10px; }
  .drop-zone { min-height: 190px; }
  .fighter-selection { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .selection-card { padding: 23px; }
  .selection-avatar { width: 64px; height: 64px; border-radius: 21px; font-size: 34px; margin: 17px auto; }
  .selection-vs { font-size: 22px; }
  .selection-vs span { margin-top: 1px; font-size: 8px; }
  .selection-card h2 { margin-bottom: 17px; }
  .launch-row { flex-direction: column; align-items: stretch; }
  .launch-row .button { width: 100%; }
  .rules-summary { padding: 20px 18px; flex-wrap: wrap; }
  .rules-chips { gap: 9px 15px; }
  .rules-chips > span { font-size: 10px; }
  .rules-chips strong { font-size: 17px; }
  .game-card { padding: 27px 18px 21px; gap: 14px; }
  .game-card h2 { font-size: 18px; }
  .game-card p { font-size: 11px; }
  .game-information { padding: 20px 18px; }
  .game-information h2 { font-size: 21px; }
  .game-information p { font-size: 12px; }
  .fixed-rule { font-size: 9px; }
  .game-library { gap: 14px; }
  .player-row, .invitation-row { padding: 19px 18px; gap: 13px; }
  .player-row .bot-description, .invitation-row .bot-description { flex-basis: 100%; }
  .player-row .bot-description strong, .invitation-row .bot-description strong { font-size: 13px; }
  .player-row .bot-description small, .invitation-row .bot-description small { font-size: 10px; }
  .organizer-dialog .padded-form { padding: 26px 22px; }
  .organizer-dialog h2 { font-size: 25px; }
  .invitation-fighters { gap: 10px; }
  .invitation-fighter { padding: 15px 12px; }
  .invitation-fighter h3 { font-size: 19px; }
  .invitation-fighter p { font-size: 12px; }
  .invitation-dialog .form-buttons .button { flex: 1; }
  .toast { left: 50%; bottom: 16px; padding: 13px 17px; font-size: 12px; }
  .main-footer { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 26px; font-size: 9px; }
  .protocol-document { margin: 15px; padding: 24px 20px; border-radius: 19px; }
  .protocol-document h1 { font-size: 28px; }
  .protocol-document h2 { font-size: 21px; }
  .protocol-document p, .protocol-document li { font-size: 13px; }
  .protocol-document pre { font-size: 10px; padding: 15px; }
}
@media (max-width:370px) { main { padding-inline: 13px; } .topbar { padding-inline: 16px; } .identity-bar #organizer-toggle { margin-top: 0; align-self: flex-start; } .identity-bar form { flex-basis: 100%; } .hero-actions .button { width: 100%; } .workspace-game label { width: 143px; } }
@media (max-width:520px) { .account-form { grid-template-columns: 1fr; } .account-form label, .account-form label:first-child, .account-form .button { grid-column: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } html { scroll-behavior: auto; } }
@media (forced-colors: active) { .button, .icon-button, .panel, .nav-item, .tag, .match-status { border: 1px solid CanvasText; } .hp-track span { background: Highlight; } }

.standings-panel { margin-top: 25px; }
.standings-table-wrap { overflow-x: auto; }
.standings-table { width: 100%; min-width: 790px; border-collapse: collapse; }
.standings-table th, .standings-table td { padding: 13px 20px; border-bottom: 1px solid #242a3980; text-align: left; white-space: nowrap; }
.standings-table th { color: #79859a; font: 8px var(--mono); letter-spacing: 1px; text-transform: uppercase; }
.standings-table td { color: #a5b3ca; font: 10px var(--mono); }
.standings-table tbody tr:last-child td { border-bottom: none; }
.standings-table tbody tr:hover { background: #42e8ef08; }
.standings-table th:nth-child(n+3), .standings-table td:nth-child(n+3) { text-align: right; }
.standings-table .standing-wins { color: var(--cyan); font-weight: 700; }
.standings-table .standing-win-rate { color: #e6d08a; font-variant-numeric: tabular-nums; }
.standings-table .standing-form { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.form-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid #34415a; border-radius: 50%; font: 8px var(--mono); }
.form-mark.w { color: var(--green); border-color: #78edb455; background: #78edb40c; }
.form-mark.d { color: #e6d08a; border-color: #e6d08a55; background: #e6d08a0c; }
.form-mark.l { color: var(--pink); border-color: #f077c455; background: #f077c40c; }
.panel-heading .standings-game-filter { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; color: #8292aa; font: 8px var(--mono); letter-spacing: .8px; }
.panel-heading .standings-game-filter select { width: auto; min-width: 190px; margin-top: 0; padding: 8px 28px 8px 10px; font: 9px var(--mono); }

#tournaments-list { min-height: 0; padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.tournament-card { min-width: 0; padding: 18px; border: 1px solid #2b3548; border-radius: 3px; background: linear-gradient(135deg, #141b29, #0c111c); transition: border-color .2s, background .2s; }
.tournament-card:hover { border-color: #42e8ef66; background: linear-gradient(135deg, #172130, #0d1420); }
.tournament-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tournament-card-title { min-width: 0; }
.tournament-id { display: block; color: #7486a3; font: 8px var(--mono); letter-spacing: 1.2px; }
.tournament-card h3 { margin: 7px 0 0; color: #e3ebf8; font: 600 18px/1.35 var(--display); letter-spacing: .4px; overflow-wrap: anywhere; }
.tournament-status { flex: 0 0 auto; padding: 6px 9px; border: 1px solid #42e8ef33; background: #42e8ef0a; color: var(--cyan); font: 8px var(--mono); letter-spacing: .5px; text-align: center; }
.tournament-status.completed { color: var(--green); border-color: #78edb433; background: #78edb40a; }
.tournament-status.registration { color: #c3a5ff; border-color: #b58aff44; background: #b58aff0a; }
.tournament-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.tournament-meta-item { padding: 6px 9px; border: 1px solid #293449; background: #090e18; color: #9babc2; font: 9px var(--mono); }
.tournament-players { margin-top: 15px; padding-top: 12px; border-top: 1px solid #263043; }
.tournament-players-label { display: block; margin-bottom: 8px; color: #70829d; font: 8px var(--mono); letter-spacing: 1px; }
.tournament-player-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tournament-player-chip { max-width: 100%; padding: 6px 9px; border: 1px solid #42e8ef22; background: #42e8ef08; color: #b8c8dc; font-size: 10px; overflow-wrap: anywhere; }
.tournament-player-chip.muted { color: #7d8ba0; border-color: #293449; background: #090e18; }
.tournament-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tournament-delete { color: var(--pink); border-color: #f077c444; background: #f077c408; }
.tournament-delete:hover { border-color: #f077c488; background: #f077c414; box-shadow: 0 0 14px #f077c411; }
.tournament-details { margin-top: 18px; border-top: 1px solid #263043; }
.tournament-details > summary { display: flex; align-items: center; gap: 9px; min-height: 48px; color: #c8d5e8; cursor: pointer; list-style: none; font-size: 11px; font-weight: 700; letter-spacing: .35px; }
.tournament-details > summary::-webkit-details-marker { display: none; }
.tournament-details > summary::before { content: "+"; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #42e8ef44; color: var(--cyan); font: 13px var(--mono); }
.tournament-details[open] > summary::before { content: "−"; }
.tournament-bracket { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-color: #34435c #111824; scrollbar-width: thin; }
.tournament-bracket-lane { min-width: 0; padding: 15px; border: 1px solid #253249; background: #0a101b99; }
.tournament-bracket-lane > h4 { display: flex; align-items: center; gap: 9px; margin: 0 0 13px; color: #d8e4f5; font: 700 10px var(--mono); letter-spacing: 1px; }
.tournament-bracket-lane > h4::before { content: ""; width: 3px; height: 13px; background: var(--cyan); box-shadow: 0 0 10px #42e8ef55; }
.tournament-bracket-lane:nth-child(2) > h4::before { background: #f077c4; box-shadow: 0 0 10px #f077c455; }
.tournament-bracket-lane:nth-child(3) > h4::before { background: #c3a5ff; box-shadow: 0 0 10px #c3a5ff55; }
.tournament-bracket-board { display: flex; align-items: stretch; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-color: #34435c #111824; scrollbar-width: thin; }
.tournament-bracket-round { flex: 0 0 clamp(210px, 24vw, 270px); min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.tournament-bracket-round > h4 { margin: 0; padding: 0 2px 7px; border-bottom: 1px solid #27344a; color: #8394ad; font: 8px var(--mono); letter-spacing: .8px; text-transform: uppercase; }
.tournament-group { min-width: 0; margin-top: 12px; padding: 12px; border: 1px solid #263247; background: #0a101b99; }
.tournament-group > h4 { margin: 0; color: #d8e4f5; font: 700 10px var(--mono); letter-spacing: .5px; }
.tournament-bracket-match { min-width: 0; display: grid; gap: 6px; padding: 10px; border: 1px solid #29364b; background: linear-gradient(145deg, #151e2d, #101723); box-shadow: inset 2px 0 #42e8ef33; }
.tournament-bracket-match.completed { border-color: #78edb433; box-shadow: inset 2px 0 #78edb4; }
.tournament-bracket-match.needs_attention { border-color: #ffb26b77; box-shadow: inset 2px 0 #ffb26b; }
.tournament-bracket-match.skipped { opacity: .65; box-shadow: inset 2px 0 #71809a66; }
.tournament-bracket-player { display: block; min-width: 0; padding: 7px 8px; border: 1px solid #263247; background: #0b111c; color: #bdcbe0; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.tournament-bracket-player + .tournament-bracket-player { border-color: #342b43; }
.tournament-bracket-match > small { display: block; color: #8192aa; font: 8px/1.5 var(--mono); letter-spacing: .25px; overflow-wrap: anywhere; }
.tournament-bracket-match > .tournament-match-winner { color: var(--green); }
.tournament-bracket-match > .button { justify-self: start; margin-top: 3px; }
.tournament-standings { margin: 8px 0 0; overflow-x: auto; border: 1px solid #263247; scrollbar-color: #34435c #111824; scrollbar-width: thin; }
.tournament-standing-row { min-width: 760px; display: grid; grid-template-columns: 58px minmax(150px, 1.7fr) repeat(5, minmax(58px, .7fr)) minmax(104px, 1.1fr) minmax(70px, .8fr); align-items: center; color: #b8c8dc; font: 9px/1.4 var(--mono); }
.tournament-standing-row:not(.heading):hover { background: #42e8ef08; }
.tournament-standing-cell { min-width: 0; padding: 10px 9px; border-bottom: 1px solid #263247; white-space: nowrap; }
.tournament-standing-row:last-child .tournament-standing-cell { border-bottom: 0; }
.tournament-standing-cell.rank { color: #91a5c2; text-align: center; font-weight: 700; }
.tournament-standing-cell.player { overflow: hidden; color: #e0e9f6; text-overflow: ellipsis; font-family: var(--display); font-size: 10px; }
.tournament-standing-cell.played, .tournament-standing-cell.wins, .tournament-standing-cell.draws, .tournament-standing-cell.losses, .tournament-standing-cell.points, .tournament-standing-cell.head-to-head, .tournament-standing-cell.difference { text-align: right; font-variant-numeric: tabular-nums; }
.tournament-standing-cell.wins { color: var(--cyan); font-weight: 700; }
.tournament-standing-cell.points { color: #e6d08a; font-weight: 700; }
.tournament-standing-cell.head-to-head { color: #bda1ff; }
.tournament-standing-cell.difference.positive { color: var(--green); }
.tournament-standing-cell.difference.negative { color: var(--pink); }
.tournament-standing-row.heading { color: #8394ad; background: #0a101b; font-size: 8px; letter-spacing: .45px; }
.tournament-standing-row.heading .tournament-standing-cell { border-bottom: 1px solid #34415a; }
.tournament-standing-note { margin: 8px 2px 15px; color: #71839e; font-size: 9px; }
.tournament-schedule { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; padding-bottom: 4px; }
.tournament-schedule-round { min-width: 0; padding: 13px; border: 1px solid #263247; background: #0b111c; }
.tournament-round-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.tournament-round-heading h4 { margin: 0; color: #d4dfef; font-size: 11px; }
.tournament-round-state { padding: 4px 6px; border: 1px solid #34415a; color: #8fa0b8; font: 7px var(--mono); letter-spacing: .35px; }
.tournament-round-state.active { border-color: #42e8ef55; color: var(--cyan); }
.tournament-round-state.done { border-color: #78edb433; color: var(--green); }
.tournament-schedule-match { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; margin-top: 7px; padding: 9px; border: 1px solid #263247; background: #111a28; color: #becbe0; font-size: 9px; }
.tournament-schedule-match > span:first-child, .tournament-schedule-match > span:nth-child(3) { min-width: 0; overflow-wrap: anywhere; }
.tournament-schedule-match > span:nth-child(3) { text-align: right; }
.tournament-schedule-match .tournament-versus { color: #657791; font: 8px var(--mono); }
.tournament-schedule-match > small { grid-column: 1 / -1; color: #8092aa; font: 8px var(--mono); }
.tournament-match-winner { color: var(--green) !important; }
.tournament-bye-note { color: #8d9db4; font-size: 9px; }
.player-row .player-delete { flex: 0 0 auto; color: var(--pink); border-color: #f077c433; background: #f077c406; }
.player-row .player-delete:hover { border-color: #f077c477; background: #f077c411; }
@media (max-width:520px) {
  #tournaments-list { padding: 10px; grid-template-columns: minmax(0, 1fr); }
  .tournament-card { padding: 14px; }
  .tournament-card-heading { gap: 10px; }
  .tournament-card h3 { font-size: 15px; }
  .tournament-bracket-lane { padding: 11px; }
  .tournament-bracket-round { flex-basis: min(76vw, 250px); }
  .tournament-bracket-match { padding: 8px; }
  .tournament-standing-row { min-width: 760px; }
  .tournament-schedule-match { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .player-row { flex-wrap: wrap; }
  .player-row .player-delete { margin-left: auto; }
}

/* Signed-out Account-Only entry, isolated from the authenticated workspace. */
body.account-landing-active > .skip-link,
body.account-landing-active > .sidebar,
body.account-landing-active > .shell { display: none !important; }
.account-landing {
  min-height: 100svh;
  color: #edf6ff;
  background: radial-gradient(ellipse at 84% 30%, #284c925c, transparent 44%),
              radial-gradient(ellipse at 15% 85%, #0b756e3a, transparent 42%),
              linear-gradient(140deg, #08101f, #111a30 56%, #070e1a);
}
.landing-frame { max-width: 1240px; min-height: 100svh; margin: auto; padding: 28px clamp(22px, 5vw, 78px); display: flex; flex-direction: column; }
.landing-header, .landing-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.landing-brand { display: flex; align-items: center; gap: 13px; font-size: 19px; font-weight: 800; letter-spacing: -.55px; }
.landing-logo { width: 41px; height: 41px; display: grid; place-items: center; border: 1px solid #70dbfb66; border-radius: 13px; background: #153051; color: #67e4f8; box-shadow: 0 0 30px #25c9ed22; font-size: 25px; }
.landing-brand small { display: block; color: #91aac4; font-size: 10px; font-weight: 650; letter-spacing: 2px; }
.landing-header-note, .landing-eyebrow { color: #71e2e8; font: 700 11px/1.6 var(--mono); letter-spacing: 2px; }
.landing-header-note { border: 1px solid #71e2e838; padding: 9px 13px; border-radius: 99px; }
.landing-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: center; gap: clamp(35px, 6vw, 92px); padding-block: 72px; }
.landing-copy h1 { max-width: 700px; margin: 20px 0 24px; color: #f7fbff; font-size: clamp(39px, 5.3vw, 70px); font-weight: 750; line-height: 1.12; letter-spacing: -2.3px; }
.landing-copy h1 span { color: #76e6e8; }
.landing-lead { max-width: 510px; color: #b2c2d7; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.8; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.landing-action { min-height: 53px; padding: 12px 24px; border-radius: 14px; font-size: 15px; font-weight: 750; transition: transform .18s ease, background .18s ease; }
.landing-action:hover:not(:disabled) { transform: translateY(-2px); }
.landing-action.primary { border: 1px solid #8cf0ff; background: #79e8f1; color: #071526; box-shadow: 0 10px 28px #5edfe533; }
.landing-action.secondary { border: 1px solid #7891b76d; background: #23314c; color: #eef7ff; }
.landing-action:disabled { opacity: .48; }
.landing-status { min-height: 1.5em; margin-top: 18px; color: #b9cee3; font-size: 12px; }
.landing-register-note { margin-top: 6px; color: #8fa8c1; font-size: 12px; }
.landing-retry { margin-top: 10px; padding: 8px 0; border: 0; background: none; color: #84ebf2; font-weight: 700; text-decoration: underline; }
.landing-visual { position: relative; display: grid; place-items: center; min-height: 380px; isolation: isolate; }
.landing-visual::before { content: ""; position: absolute; width: min(100%, 410px); aspect-ratio: 1; border: 1px solid #64ddec25; border-radius: 50%; box-shadow: 0 0 0 36px #52cbd708, 0 0 0 82px #52cbd706; }
.landing-visual::after { content: ""; position: absolute; width: 70%; height: 70%; border: 1px dashed #a3d8ff2b; border-radius: 50%; transform: rotate(-18deg); }
.landing-match-card { z-index: 1; width: min(100%, 390px); padding: 26px; border: 1px solid #91b0ea52; border-radius: 24px; background: linear-gradient(145deg,#1c3052e8,#0c192bdc); box-shadow: 0 30px 90px #010510aa, inset 0 1px #ffffff20; }
.landing-match-card > small { color: #79e3f0; font: 700 10px var(--mono); letter-spacing: 2px; }
.landing-matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 24px 0; }
.landing-bot { min-width: 0; display: grid; justify-items: center; gap: 12px; padding: 22px 10px; border: 1px solid #78a4e947; border-radius: 16px; background: #172a48; color: #e9f8ff; font-weight: 750; }
.landing-bot span { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid #80dbe988; border-radius: 15px; background: #1f4563; color: #81eff0; font: 800 22px var(--mono); }
.landing-bot:last-child span { color: #e7b5ff; background: #44305f; border-color: #d2a1ff88; }
.landing-versus { color: #8faecf; font: 800 13px var(--mono); }
.landing-card-footer { border-top: 1px solid #87aada30; padding-top: 17px; color: #a6bfdc; font-size: 12px; text-align: center; }
.landing-footer { padding-top: 20px; border-top: 1px solid #aac5eb24; color: #859eb8; font-size: 12px; }
@media (max-width: 820px) {
  .landing-main { grid-template-columns: 1fr; padding-block: 55px; gap: 35px; }
  .landing-visual { min-height: 290px; }
  .landing-match-card { width: min(100%, 360px); }
  .landing-header-note { display: none; }
  .landing-copy h1 { letter-spacing: -1.6px; }
}
@media (max-width: 480px) {
  .landing-main { padding-block: 45px; }
  .landing-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .landing-action { padding: 12px 9px; font-size: 13px; }
  .landing-visual { min-height: 265px; }
  .landing-match-card { padding: 19px; }
  .landing-bot { padding: 16px 7px; }
  .landing-footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .landing-action { transition: none; } }
