:root {
    color-scheme: dark;
    --bg: #0e0e0e;
    --panel: #181818;
    --panel-hover: #222222;
    --line: #343434;
    --text: #f4f5fa;
    --muted: #b0b0b0;
    --accent: #ff9f43;
    --accent-hover: #ffb66e;
    --accent-blue: #53dff1;
    --mint: #10b981;
    --violet: #53dff1;
    --font-heading: 'Inter', 'Montserrat', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
}

#match-rules-help .shortcut-list > div { align-items: flex-start; }
#match-rules-help .shortcut-list dt { flex: 0 0 55px; }
#match-rules-help .shortcut-list dd { margin: 0; line-height: 1.7; }
[data-release="product"] { overflow-wrap: anywhere; }

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Mouse clicks may leave a button focused; reserve the visible ring for keyboard focus. */
button:focus:not(:focus-visible), a:focus:not(:focus-visible), input:focus:not(:focus-visible), select:focus:not(:focus-visible), summary:focus:not(:focus-visible) {
    outline: none;
}
[hidden] { display: none !important; }
html[data-startup="arena"] body.site-shell:not(.router-ready)>:not(#startup-shield):not(noscript) { visibility: hidden; }
::selection { background: rgba(255, 159, 67, 0.35); color: #fff; }
 .live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--mint);
    border-radius: 50%;
}
.mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: #1e1e1e;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: #dedede;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mode-toggle:hover {
    background: #292929;
    border-color: #555555;
    color: #fff;
}
.mode-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    transition: all 0.2s ease;
}
body.dev-mode .mode-dot {
    background: #f97316;
    box-shadow: 0 0 6px rgba(249, 115, 22, 0.5);
}
.state-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--muted);
    background: #1c1c1c;
}
.state-pill[data-state=running] {
    border-color: #10b98155;
    color: var(--mint);
}
.state-pill[data-state=paused] {
    border-color: #f08c3555;
    color: var(--accent);
}
.fps-badge {
    font: 11px Consolas, monospace;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* User Mode vs Dev Mode Visibility */
body.user-mode .dev-only {
    display: none !important;
}
body.dev-mode .user-only {
    display: none !important;
}
.local-dev-trigger { flex: none; min-height: 36px; padding: 5px 9px; }
.local-dev-dialog {
    width: min(480px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text, #eee);
    background: #181818;
}
.local-dev-dialog::backdrop { background: #000a; }
.local-dev-dialog header, .local-dev-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.local-dev-dialog header { justify-content: space-between; margin-bottom: 12px; }
.local-dev-dialog h2 { margin: 0; font-size: 18px; }
.local-dev-dialog h3 { margin: 14px 0 7px; font-size: 14px; }
.local-dev-dialog .button { min-height: 40px; }
.local-dev-dialog .local-dev-actions + .local-dev-actions { margin-top: 14px; }
.local-dev-dialog pre { max-height: 36dvh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.local-dev-dialog pre:empty { display: none; }
@media (max-width: 440px) {
    .play-header:has(.local-dev-trigger) .play-header-launch { display: none; }
    .play-header:has(.local-dev-trigger) [data-play-brand] { width: 52px; }
}
.page {
    animation: appear 0.2s ease;
}
@keyframes appear {
    from { opacity: 0.7; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

/* ========================================================
   TYPOGRAPHY & HERO
   ======================================================== */
.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin: 0 0 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.eyebrow > span {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}
h1, h2, h3, h4, p { margin-top: 0; }
h1 {
    font-family: var(--font-heading);
    font-size: clamp(32px, 3.8vw, 48px);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 16px;
}
h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.3;
}
h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
}
p {
    line-height: 1.8;
    color: var(--muted);
}
.muted { color: var(--muted); font-size: 12px; }
.subtle { color: #969696; font-size: 11px; }

.highlight-text {
    background: linear-gradient(90deg, #ff9f43, #ffd16b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.button {
    border: 1px solid transparent;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.button.primary {
    background: var(--accent);
    color: #141414;
}
.button.primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.button.secondary {
    background: #222222;
    border-color: #3e3e3e;
    color: #ececec;
}
.button.secondary:hover {
    background: #2c2c2c;
    color: #fff;
}
.button.ghost {
    background: transparent;
    color: #cccccc;
    border-color: var(--line);
}
.button.ghost:hover {
    background: #1f1f1f;
    color: #fff;
}
.button.danger-ghost {
    background: transparent;
    color: #ea8d8d;
    border-color: #542d35;
}
.button.danger-ghost:hover {
    background: #331920;
}
.button.small {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 11px;
}

/* ========================================================
   ROSTER SHOWCASE
   ======================================================== */
.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    margin: 36px 0 20px;
}
.section-heading .eyebrow { margin-bottom: 6px; }
.section-heading h2 { font-size: 20px; margin: 0; }

.roster-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.roster-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    transition: all 0.15s ease;
}
.roster-card:hover {
    border-color: #525252;
    background: #222222;
    transform: translateY(-2px);
}
.roster-img {
    width: 50px;
    height: 50px;
    border-radius: 7px;
    object-fit: cover;
    background: #121212;
    border: 1px solid #383838;
    flex-shrink: 0;
}
.roster-info h4 {
    margin: 0 0 3px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}
.roster-series {
    font-size: 11px;
    color: var(--muted);
}

/* ========================================================
   FEATURE GRID & SESSIONS
   ======================================================== */
.feature-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.feature-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    display: block;
}
.mint { background: #142a22; color: var(--mint); }
.orange { background: #2c2017; color: var(--accent); }
.violet { background: #18272b; color: var(--violet); }

/* ========================================================
   PLAY ARENA (KHUNG ĐẤU TRƯỜNG)
   ======================================================== */
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 10px 0 22px;
}
.page-heading h1 { font-size: 28px; margin: 0; }
.page-heading > p { font-size: 12.5px; margin: 0; max-width: 360px; }
.page-heading.compact { margin-bottom: 16px; }

.play-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 20px;
    align-items: start;
}
.game-column { min-width: 0; }
.game-surface {
    border: 1px solid #3d3d3d;
    border-radius: 10px;
    background: #0c0c0c;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.75);
    width: 100%;
    max-width: calc(clamp(260px, calc(100dvh - 270px), 760px) * 16 / 9 + 2px);
    margin-inline: auto;
}

.game-toolbar {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    background: #181818;
    border-bottom: 1px solid var(--line);
}
.game-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
}
.game-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fps-chip {
    font: 12px Consolas, monospace;
    font-weight: 600;
    color: var(--mint);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 8px;
    border-radius: 5px;
}
.fps-chip[data-level=low] {
    color: var(--accent);
    border-color: rgba(255, 159, 67, 0.4);
    background: rgba(255, 159, 67, 0.12);
}
.icon-button {
    height: 28px;
    min-width: 30px;
    border: 1px solid #444444;
    background: #242424;
    color: #dcdcdc;
    border-radius: 5px;
    font-size: 15px;
    display: inline-grid;
    place-items: center;
    transition: all 0.15s;
}
.icon-button:hover:not(:disabled) {
    background: #303030;
    color: #fff;
    border-color: var(--accent);
}

/* Khung Arena */
#arena {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    isolation: isolate;
    overflow: hidden;
}
ruffle-player {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0;
}

/* Crisp rendering cho canvas */
#arena canvas, ruffle-player canvas {
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
}

/* Arena Placeholder */
.arena-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(255, 159, 67, 0.1) 0%, #1a1a1a 35%, #0c0c0c 85%);
    text-align: center;
    padding: 24px;
    z-index: 2;
}
.arena-placeholder-inner {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.arena-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(255, 159, 67, 0.12);
    border: 1px solid rgba(255, 159, 67, 0.35);
    padding: 4px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
    letter-spacing: 0.8px;
}
.arena-placeholder h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #fff;
}
.arena-placeholder p {
    font-size: 13px;
    margin-bottom: 20px;
    color: var(--muted);
}
.btn-main-start {
    font-size: 14px;
    padding: 12px 28px;
    box-shadow: 0 4px 18px rgba(255, 159, 67, 0.35);
}
.btn-main-start:hover {
    box-shadow: 0 6px 24px rgba(255, 159, 67, 0.5);
}
#loading-detail {
    font-size: 11px;
    color: #9e9e9e;
    margin-top: 12px;
}
.quick-controls-hint {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #333333;
    font-size: 11.5px;
    color: #a0a0a0;
    line-height: 1.8;
}
.quick-controls-hint strong { color: #e8e8e8; }

/* Statusbar */
.game-statusbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    font: 11px Consolas, monospace;
    color: #a8a8a8;
    border-top: 1px solid var(--line);
    background: #121212;
}

/* Pause Overlay */
.pause-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(12, 12, 12, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}
.pause-symbol {
    font-size: 48px;
    line-height: 1;
    color: var(--accent);
    margin-bottom: 16px;
}
.pause-overlay h2 { font-size: 24px; margin-bottom: 8px; }
.pause-overlay p:not(.eyebrow) { font-size: 13px; max-width: 360px; margin-bottom: 18px; }
.pause-overlay small { font-size: 11px; color: #a0a0a0; margin-top: 16px; }

/* ========================================================
   CONTROLS & GAME ACTION BUTTONS (VIBRANT & DISTINCT)
   ======================================================== */
.under-game {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin: 14px 0 16px;
}
.game-action-btn[hidden] { display: none; }
.game-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}
.game-action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.7);
    pointer-events: none;
}
.action-svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* Nút Nhận bàn phím — Xanh thiên thanh (Electric Sky Blue) */
.focus-btn {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.35);
    color: #38bdf8;
}
.focus-btn:hover:not(:disabled) {
    background: rgba(14, 165, 233, 0.22);
    border-color: #0ea5e9;
    color: #7dd3fc;
    box-shadow: 0 0 14px rgba(14, 165, 233, 0.3);
}

/* Nút Nạp lại — Vàng hổ phách (Warm Amber) */
.restart-btn {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}
.restart-btn:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.22);
    border-color: #f59e0b;
    color: #fde68a;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

/* Nút Dừng trận — Đỏ hồng ngọc (Crimson Ruby) */
.stop-btn {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}
.stop-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
    color: #fca5a5;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.3);
}

/* ========================================================
   DẢI PHÍM ĐANG NHẤN (INPUT HUD) VỚI NÚT ẨN/HIỆN TẠI CHỖ
   ======================================================== */
.input-hud, .virtual-panel, .log-panel {
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #161616;
    margin: 12px 0;
    transition: all 0.2s ease;
}
.hud-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.hud-heading-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hud-title-svg {
    width: 16px;
    height: 16px;
    stroke: #a8a8a8;
}
.hud-heading h3 {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.8px;
    margin: 0;
    color: #dcdcdc;
}
.hud-heading-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hud-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #222222;
    border: 1px solid #404040;
    border-radius: 14px;
    color: #e5e5e5;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.hud-toggle-btn:hover {
    background: #2c2c2c;
    border-color: #5c5c5c;
    color: #fff;
}
.hud-toggle-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
    transition: all 0.15s ease;
}
.hud-toggle-btn.off .hud-toggle-dot {
    background: #737373;
    box-shadow: none;
}
.hud-toggle-btn.off {
    color: #a3a3a3;
    background: #191919;
    border-color: #333333;
}
.hud-config-link {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}
.hud-config-link:hover {
    color: #ffb66e;
    text-decoration: underline;
}
.hud-body {
    margin-top: 10px;
}
.input-hud.collapsed .hud-body {
    display: none;
}
.input-hud.collapsed {
    padding: 10px 18px;
    background: #121212;
    border-color: #2e2e2e;
}

.hud-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 6px 0;
}
.hud-player {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
    min-width: 26px;
}
.hud-player.p2 { color: var(--accent-blue); }
kbd, .hud-key {
    font: 11px Consolas, monospace;
    font-weight: 700;
    background: #242424;
    border: 1px solid #444444;
    border-bottom: 2px solid #303030;
    border-radius: 4px;
    padding: 4px 6px;
    white-space: nowrap;
}
.hud-key {
    min-width: 26px;
    text-align: center;
    padding: 5px 3px;
    transition: all 0.05s ease;
    color: var(--muted);
}
.hud-key.pressed {
    background: var(--accent);
    color: #141414;
    border-color: #ffb66e;
    transform: translateY(1px);
}
.hud-key.p2.pressed {
    background: var(--accent-blue);
    color: #141414;
    border-color: #a5f3fc;
    transform: translateY(1px);
}
.hud-key:nth-of-type(5) { margin-left: 8px; }

/* ========================================================
   CONTROLS CARD (THAO TÁC CƠ BẢN)
   ======================================================== */
.controls-card {
    background: #161616;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}
.controls-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.card-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0;
}
.keybind-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.keybind-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    background: #202020;
    border-radius: 6px;
    font-size: 12.5px;
}
.keybind-action {
    color: #dcdcdc;
    font-weight: 500;
    font-size: 12px;
}
.key-caps {
    display: flex;
    gap: 4px;
}
.key-caps kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #282828;
    border: 1px solid #484848;
    border-bottom: 2px solid #1a1a1a;
    border-radius: 4px;
    color: #f4f5fa;
    font-size: 11px;
    font-family: inherit;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.key-caps.ulti kbd {
    background: #49351f;
    border-color: #88623c;
    border-bottom-color: #2c1e10;
    color: #ffe0a1;
}
.controls-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11.5px;
}
.p2-note {
    font-size: 11.5px;
    color: #a0a0a0;
    white-space: nowrap;
}
.edit-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    font-size: 11.5px;
    white-space: nowrap;
    transition: color 0.15s;
}
.edit-link:hover {
    color: #ffb66e;
    text-decoration: underline;
}

/* ========================================================
   PLAY SESSION CARD (TRẠNG THÁI PHIÊN KHÔNG BỊ TRÀN CHỮ)
   ======================================================== */
.play-session-card {
    background: #161616;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    width: 100%;
    box-sizing: border-box;
}
.play-session-card .session-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 16px !important;
    font-size: 12px;
}
.play-session-card .session-label {
    color: #9a9a9a;
    font-weight: 500;
    white-space: nowrap;
}
.play-session-card .session-val {
    color: #dedede;
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
}
.play-session-card .session-val[data-state="running"] {
    color: #10b981;
}
.play-session-card .session-val[data-state="paused"] {
    color: #f97316;
}
.play-session-card .session-val[data-state="loading"] {
    color: #53dff1;
}

/* ========================================================
   ROADMAP STEPS (TRANG ĐẤU ONLINE)
   ======================================================== */
.roadmap-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 24px;
}
.roadmap-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #1e1e1e;
    border: 1px solid var(--line);
    color: var(--muted);
}
.roadmap-step.done {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.roadmap-step.active {
    background: rgba(255, 159, 67, 0.12);
    border-color: rgba(255, 159, 67, 0.35);
    color: #ffb66e;
}
.step-check {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}
.step-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff9f43;
    box-shadow: 0 0 6px rgba(255, 159, 67, 0.6);
}

/* TOOLBAR SVG ICONS */
.toolbar-svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    display: block;
}
.heading-controls-hint {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    color: #9e9e9e;
}
.heading-controls-hint span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pause-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 159, 67, 0.15);
    border: 1px solid rgba(255, 159, 67, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--accent);
}
.pause-icon-wrap svg {
    width: 24px;
    height: 24px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    padding: 24px;
    margin-bottom: 20px;
}
.panel h2 { font-size: 20px; margin-bottom: 12px; }
.panel p, .panel li { font-size: 13.5px; line-height: 1.8; }
.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}
.bindings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}
.binding-player h3 {
    font-size: 13px;
    color: var(--accent);
    margin: 8px 0 14px;
}
.binding-player:nth-child(2) h3 { color: var(--accent-blue); }
.binding-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid #2e2e2e;
    font-size: 12.5px;
    color: #cccccc;
}
.binding-button {
    min-width: 76px;
    min-height: 30px;
    background: #232323;
    border: 1px solid #444444;
    border-radius: 4px;
    color: #e4e4e4;
    font: 11px Consolas, monospace;
}
.binding-button.capturing {
    border-color: var(--accent);
    color: var(--accent);
    background: #302216;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.shortcut-list > div {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 14px 0;
    font-size: 12.5px;
}
.shortcut-list dt { width: 55px; }
.shortcut-list dd { margin: 0; color: var(--muted); }

/* Settings Layout */
.settings-layout { max-width: 900px; }
.setting-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}
.setting-row:first-of-type { border-top: none; }
.setting-row select, .runtime-quality-card select { max-width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #444; border-radius: 4px; background: #121212; color: #f2f2f2; }
.runtime-quality-card { display: grid; gap: 10px; }
.runtime-quality-card p { margin: 0; font-size: 12px; color: var(--muted); }
.setting-row label { font-size: 13.5px; font-weight: 600; color: #fff; }
.setting-row p { font-size: 11.5px; margin: 3px 0 0; }
.setting-row input[type=checkbox] {
    appearance: none;
    min-width: 38px;
    height: 20px;
    border-radius: 20px;
    background: #2a2a2a;
    position: relative;
    cursor: pointer;
    border: 1px solid #555555;
}
.setting-row input[type=checkbox]::before {
    content: "";
    width: 12px;
    height: 12px;
    position: absolute;
    border-radius: 50%;
    background: #d4d4d4;
    top: 3px;
    left: 3px;
    transition: transform 0.15s;
}
.setting-row input[type=checkbox]:checked {
    background: #604723;
    border-color: var(--accent);
}
.setting-row input[type=checkbox]:checked::before {
    transform: translateX(18px);
    background: var(--accent);
}
.range-control {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 200px;
    flex-shrink: 0;
}
.range-control input { width: 100%; accent-color: var(--accent); }
.range-control output { font: 11px Consolas, monospace; min-width: 32px; color: var(--accent); }

/* Virtual controls */
.virtual-panel summary, .log-panel summary { font-size: 12px; color: #c8c8c8; cursor: pointer; }
.virtual-role { display: flex; gap: 8px; margin: 12px 0 10px; }
.virtual-role button {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 11.5px;
}
.virtual-role button[aria-pressed=true] {
    color: var(--accent);
    border-color: var(--accent);
    background: #261d15;
}
.virtual-controls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.virtual-key {
    border: 1px solid #444444;
    background: #232323;
    border-radius: 5px;
    color: #dcdcdc;
    min-height: 44px;
    font-size: 11px;
    touch-action: none;
    user-select: none;
}
.virtual-key strong { display: block; font-size: 15px; margin-bottom: 2px; }
.virtual-key.pressed { background: #4d331b; color: var(--accent); }

/* Minimalist Sticky Footer */
.site-footer {
    position: sticky;
    bottom: 0;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 32px;
    font-size: 11.5px;
    color: #8f8f8f;
    border-top: 1px solid var(--line);
    background: rgba(16, 16, 16, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-brand {
    font-weight: 700;
    color: #cccccc;
}
.footer-ver {
    font-size: 10px;
    font-weight: 700;
    color: #ffcc86;
    background: rgba(255, 159, 67, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 159, 67, 0.3);
}
.footer-center {
    font-size: 11px;
    color: #808080;
}
.footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.footer-link {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 11px;
    transition: color 0.15s;
}
.footer-link:hover {
    color: var(--accent);
}
.footer-status {
    font-size: 10.5px;
    color: #808080;
}
.badge-status.current {
    font-size: 10px;
    font-weight: 800;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #202020;
    border: 1px solid #555555;
    border-radius: 7px;
    padding: 10px 20px;
    z-index: 100;
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
    max-width: 90vw;
    color: #fff;
}
.skip-link {
    position: fixed;
    left: 10px;
    top: -80px;
    z-index: 100;
    background: var(--accent);
    color: #111;
    padding: 10px;
}
.skip-link:focus { top: 10px; }

/* Fullscreen mode */
#game-surface:fullscreen {
    position: relative;
    overflow: hidden;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: #000;
    width: 100%;
    height: 100dvh;
}
#game-surface:fullscreen #arena {
    width: 100%;
    height: 100%;
    flex: 1;
    aspect-ratio: auto;
}
#game-surface:fullscreen .game-toolbar {
    position: absolute;
    inset: 0 0 auto;
    z-index: 10;
    background: rgba(18, 18, 18, 0.92);
    opacity: 0;
    transition: opacity 0.2s ease;
}
#game-surface:fullscreen .game-statusbar { display: none; }
#game-surface:fullscreen:hover .game-toolbar,
#game-surface:fullscreen:focus-within .game-toolbar,
#game-surface:fullscreen[data-state=paused] .game-toolbar {
    opacity: 1;
}

/* ========================================================
   RESPONSIVE DESIGN
   ======================================================== */
@media (max-width: 1200px) {
    .roster-grid { grid-template-columns: repeat(2, 1fr); }
    .play-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .roster-grid { grid-template-columns: 1fr; }
    .bindings-grid, .two-columns { grid-template-columns: 1fr; }
}

.series-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.series-preview-card { display: flex; align-items: center; min-width: 0; gap: 18px; padding: 20px; background: #1a1a1a; border: 1px solid #3a3a3a; border-left: 3px solid #ff9f43; border-radius: 4px; text-decoration: none; color: #f4f5fa; transition: border-color .15s, background .15s; }
.series-preview-card:hover { background: #242424; border-color: #ffd16b; }
.series-preview-portrait { width: 72px; height: 72px; object-fit: contain; image-rendering: pixelated; background: #121212; border: 1px solid #484848; }
.series-preview-copy { min-width: 0; }
.series-preview-copy h3 { font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.series-preview-copy span { font-size: 11px; color: #b5b5b5; }
.roster-heading { align-items: center; }
.roster-heading h1 { margin-bottom: 12px; }
.roster-tools { display: flex; align-items: end; flex-wrap: wrap; gap: 18px; margin-bottom: 24px; }
.roster-tools label { display: block; color: #cccccc; font-size: 12px; margin-bottom: 8px; }
.roster-tools input[type=search], .roster-tools select { display: block; width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #444444; border-radius: 3px; background: #121212; color: #f4f5fa; font: inherit; }
.roster-search-field { flex: 1 1 250px; }
.roster-tools .roster-availability { display: flex; align-items: center; gap: 8px; min-height: 42px; margin-bottom: 0; font-size: 11px; }
.directory-layout { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 24px; align-items: start; }
.directory-sidebar { position: sticky; top: 90px; padding: 16px 10px; background: #161616; border: 1px solid #363636; border-radius: 4px; }
.directory-sidebar h2 { font-size: 13px; margin: 0 8px 14px; text-transform: uppercase; letter-spacing: 1px; color: #b5b5b5; }
.series-filters { display: grid; max-height: 560px; overflow-y: auto; gap: 4px; scrollbar-width: thin; }
.series-filter { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 10px; background: transparent; border: 1px solid transparent; border-radius: 2px; color: #c4c4c4; text-align: left; font: inherit; font-size: 11px; cursor: pointer; }
.series-filter[aria-pressed=true] { background: #2c241d; border-color: #88623c; color: #ffd16b; }
.series-filter:hover { background: #262626; color: #f4f5fa; }
.series-count { flex-shrink: 0; font: 10px Consolas, monospace; opacity: .8; }
.directory-main { min-width: 0; }
.directory-result-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; font-size: 11px; }
.directory-result-heading p { color: #d0d0d0; margin: 0; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.directory-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: #1a1a1a; border: 1px solid #3a3a3a; border-radius: 3px; }
.directory-portrait { display: block; width: 100%; height: 112px; object-fit: contain; padding: 18px; image-rendering: pixelated; background: linear-gradient(135deg, #262626 0%, #141414 70%); border-bottom: 1px solid #3a3a3a; }
.directory-card-copy { padding: 13px; min-width: 0; }
.directory-series { display: block; color: #ffcc86; font-size: 9px; line-height: 1.5; margin-bottom: 7px; }
.directory-card h3 { font-size: 12px; line-height: 1.5; margin: 0 0 7px; overflow-wrap: anywhere; }
.directory-form { display: block; font: 10px Consolas, monospace; line-height: 1.5; color: #b5b5b5; overflow-wrap: anywhere; }
.directory-note { display: block; margin-top: 9px; color: #ffd98b; font-size: 9px; line-height: 1.6; }
.directory-card.is-unavailable { opacity: .65; border-style: dashed; }
.directory-empty { grid-column: 1 / -1; padding: 36px 0; color: #b5b5b5; }
.directory-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 32px; font-size: 11px; color: #c4c4c4; }
.roster-guide { margin-top: 24px; font-size: 12px; line-height: 1.8; color: #c4c4c4; }
.roster-guide summary { color: #ffcc86; cursor: pointer; font-weight: 600; }
.roster-guide p { margin: 16px 0 0; }
@media (max-width: 1100px) { .series-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .directory-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 16px; } .series-preview-card { padding: 14px; gap: 12px; } }
@media (max-width: 700px) { .directory-layout { grid-template-columns: 1fr; } .directory-sidebar { position: static; } .series-filters { display: flex; max-height: none; overflow-x: auto; padding-bottom: 6px; } .series-filter { flex: 0 0 auto; white-space: nowrap; } .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .series-preview-grid { grid-template-columns: 1fr; } .roster-heading { align-items: flex-start; } }
