:root {
    color-scheme: dark;
    --panel: rgba(11, 17, 27, 0.82);
    --line: rgba(202, 216, 235, 0.18);
    --text: #eef5ff;
    --muted: #9fb1c9;
    --cyan: #46d7c4;
    --gold: #ffd166;
    --danger: #ff5f7a;
  }

  * { box-sizing: border-box; }

  html,
  body {
    width: 100%;
    height: 100%;
  }

  body {
    margin: 0;
    overflow: hidden;
    background: #061015;
    color: var(--text);
    font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    touch-action: none;
    user-select: none;
  }

  canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    background: transparent;
  }

  #gpuCanvas {
    display: block;
    z-index: 0;
    pointer-events: none;
    background: #061015;
  }

  #gameCanvas {
    z-index: 1;
    background: transparent;
  }

  .performance-mode .panel,
  .performance-mode .joystick-base {
    backdrop-filter: none;
  }

  button {
    font: inherit;
    color: inherit;
    border: 1px solid var(--line);
    background: rgba(24, 35, 51, 0.9);
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  }

  button:hover {
    background: rgba(38, 54, 76, 0.98);
    border-color: rgba(78, 220, 196, 0.65);
  }

  button:active { transform: scale(0.96); }

  button:focus-visible,
  a:focus-visible,
  select:focus-visible,
  input:focus-visible {
    outline: 3px solid rgba(103, 232, 249, 0.86);
    outline-offset: 3px;
  }

  .title-screen {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    padding: clamp(22px, 4vw, 62px);
    background:
      radial-gradient(circle at 77% 36%, rgba(40, 200, 174, 0.22), transparent 27%),
      radial-gradient(circle at 86% 76%, rgba(52, 107, 215, 0.22), transparent 32%),
      linear-gradient(125deg, rgba(2, 8, 14, 0.985) 0 42%, rgba(4, 19, 28, 0.96) 70%, rgba(4, 11, 21, 0.98));
    isolation: isolate;
  }

  .title-screen::before,
  .title-screen::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
  }

  .title-screen::before {
    inset: 0;
    opacity: 0.34;
    background-image:
      linear-gradient(rgba(103, 232, 249, 0.055) 1px, transparent 1px),
      linear-gradient(90deg, rgba(103, 232, 249, 0.055) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(90deg, transparent, #000 42%, #000);
  }

  .title-screen::after {
    width: min(62vw, 920px);
    aspect-ratio: 1;
    right: -13vw;
    top: -18vw;
    border: 1px solid rgba(103, 232, 249, 0.13);
    border-radius: 50%;
    box-shadow: inset 0 0 130px rgba(34, 211, 238, 0.05), 0 0 110px rgba(34, 211, 238, 0.08);
  }

  .title-shell {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: clamp(36px, 7vw, 112px);
    align-items: center;
  }

  .title-rail {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 4vh, 48px);
  }

  .title-brand h1 {
    margin: 8px 0 12px;
    font-size: clamp(52px, 6.3vw, 92px);
    line-height: 0.86;
    letter-spacing: -0.08em;
    text-shadow: 0 0 45px rgba(70, 215, 196, 0.2);
  }

  .title-kicker,
  .hero-label,
  .title-panel-head span {
    color: #58edc8;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.22em;
  }

  .title-brand p {
    margin: 0;
    color: #8299ad;
    font-size: 13px;
    letter-spacing: 0.16em;
  }

  .title-nav {
    display: grid;
    gap: 7px;
  }

  .title-action {
    min-height: 54px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 8px 14px 8px 18px;
    border-width: 0 0 0 2px;
    border-color: rgba(148, 163, 184, 0.22);
    border-radius: 0 7px 7px 0;
    text-align: left;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.055), transparent);
  }

  .title-action:hover {
    border-color: rgba(103, 232, 249, 0.78);
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.15), transparent);
    transform: translateX(5px);
  }

  .title-action span { font-weight: 850; }
  .title-action small { color: #7890a5; font-size: 10px; }
  .title-action.primary { border-color: #58edc8; }
  .title-action.online { border-color: #60a5fa; }
  .beta-inline { margin-left: 5px; padding: 2px 5px; border-radius: 999px; color: #071015; background: #ffd166; font-size: 8px; font-style: normal; vertical-align: 1px; }
  .desktop-only { display: none; }
  .desktop-env .desktop-only { display: grid; }

  .title-content {
    position: relative;
    min-height: min(610px, 74vh);
    display: grid;
    place-items: center;
  }

  .title-panel {
    width: min(760px, 100%);
    max-height: 72vh;
    overflow: auto;
    padding: clamp(26px, 4vw, 52px);
    border: 1px solid rgba(148, 210, 220, 0.16);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(12, 27, 38, 0.8), rgba(6, 15, 25, 0.72));
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px);
  }

  .title-panel[hidden] { display: none; }
  .title-panel[data-title-panel="home"] { background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; overflow: visible; }
  .title-panel h2 { margin: 12px 0 18px; font-size: clamp(34px, 5vw, 68px); line-height: 1.02; letter-spacing: -0.05em; }
  .title-panel > p { max-width: 650px; margin: 0; color: #a9bbc9; font-size: clamp(14px, 1.6vw, 18px); line-height: 1.8; }

  .hero-orbit {
    position: absolute;
    z-index: -1;
    width: min(35vw, 470px);
    aspect-ratio: 1;
    right: -4vw;
    top: 50%;
    border: 1px solid rgba(88, 237, 200, 0.2);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: inset 0 0 90px rgba(88, 237, 200, 0.07), 0 0 70px rgba(37, 99, 235, 0.12);
  }

  .hero-orbit::before,
  .hero-orbit::after {
    content: "";
    position: absolute;
    inset: 14%;
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 50%;
  }

  .hero-orbit::after { inset: 32%; background: radial-gradient(circle at 34% 28%, #d9fff8, #3cd9bf 5%, #0b5d66 32%, #030a11 72%); box-shadow: 0 0 70px rgba(88, 237, 200, 0.44); }
  .hero-orbit i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #f8fafc; box-shadow: 0 0 15px #67e8f9; }
  .hero-orbit i:nth-child(1) { left: 8%; top: 38%; }
  .hero-orbit i:nth-child(2) { right: 13%; top: 24%; background: #ffd166; }
  .hero-orbit i:nth-child(3) { right: 26%; bottom: 7%; background: #a78bfa; }

  .hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0; }
  .hero-chips span { padding: 7px 10px; border: 1px solid rgba(103, 232, 249, 0.2); border-radius: 999px; color: #c7d9e5; background: rgba(6, 18, 29, 0.66); font-size: 11px; font-weight: 750; }
  .hero-start { min-width: 230px; min-height: 50px; padding: 0 18px; border-color: #58edc8; border-radius: 7px; background: linear-gradient(110deg, #187c70, #246a94); font-weight: 850; text-align: left; }
  .hero-start b { float: right; font-size: 20px; }

  .title-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
  .title-panel-head h2 { margin: 5px 0 0; font-size: clamp(28px, 4vw, 44px); }
  .title-panel-head button { min-width: 74px; min-height: 38px; border-radius: 7px; }

  .settings-grid { display: grid; gap: 10px; }
  .settings-grid > label { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 14px; border: 1px solid rgba(148, 163, 184, 0.12); border-radius: 8px; background: rgba(255, 255, 255, 0.035); }
  .settings-grid label > span { font-size: 14px; font-weight: 800; }
  .settings-grid label small { display: block; margin-top: 4px; color: #8096aa; font-size: 10px; font-weight: 500; }
  .settings-grid select { min-width: 150px; min-height: 38px; padding: 0 10px; border: 1px solid rgba(103, 232, 249, 0.22); border-radius: 6px; color: #eef5ff; background: #0b1b28; }
  .toggle-row input { width: 42px; height: 22px; accent-color: #46d7c4; }
  .settings-note { padding: 10px 13px; border-left: 2px solid #60a5fa; color: #9eb2c4; background: rgba(37, 99, 235, 0.08); font-size: 11px; line-height: 1.6; }
  .settings-actions { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding: 12px 0; background: #08151f; border-top: 1px solid rgba(103,232,249,.16); }
  .settings-actions button { min-width: 108px; min-height: 42px; border-radius: 7px; }
  .settings-actions .save { border-color: #58edc8; background: #187c70; }

  .control-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .control-guide article { min-height: 92px; display: grid; grid-template-columns: 78px 1fr; gap: 14px; align-items: center; padding: 14px; border: 1px solid rgba(148, 163, 184, 0.13); border-radius: 8px; background: rgba(255, 255, 255, 0.035); }
  .control-guide kbd { display: grid; place-items: center; min-height: 42px; padding: 5px; border: 1px solid rgba(103, 232, 249, 0.32); border-bottom-width: 3px; border-radius: 6px; color: #d9fff8; background: #0a1822; font: 800 11px/1 "Segoe UI", sans-serif; }
  .control-guide strong { font-size: 14px; }
  .control-guide p { margin: 5px 0 0; color: #8197a9; font-size: 10px; line-height: 1.5; }

  .about-card > strong { display: block; margin-bottom: 12px; font-size: 23px; }
  .about-card > p { color: #9eb2c4; line-height: 1.8; }
  .about-links { display: grid; gap: 9px; margin: 25px 0; }
  .about-links a,
  .about-links button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 13px 15px; border: 1px solid rgba(103, 232, 249, 0.18); border-radius: 7px; color: #e6f5f5; text-align: left; text-decoration: none; background: rgba(34, 211, 238, 0.055); }
  .about-links a:hover,
  .about-links button:hover { border-color: rgba(103, 232, 249, 0.6); background: rgba(34, 211, 238, 0.11); }
  .about-card > small { color: #71869a; }

  .title-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 18px; color: #71869a; font-size: 10px; letter-spacing: 0.06em; }
  .title-footer button { min-width: 72px; min-height: 32px; border-radius: 6px; font-size: 11px; }

  .hide-performance #renderBadge { display: none; }
  .title-active .hud { visibility: hidden; }

  .hud {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
  }

  .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
  }

  .brand {
    position: fixed;
    top: 18px;
    left: 18px;
    width: min(430px, calc(100vw - 36px));
    padding: 14px;
  }

  .brand h1 {
    margin: 0 0 10px;
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1;
    letter-spacing: 0;
  }

  .brand-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }

  .brand-head h1 { margin-bottom: 0; }

  .render-badge {
    flex: 0 0 auto;
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid rgba(103, 232, 249, 0.3);
    border-radius: 999px;
    background: rgba(5, 15, 24, 0.72);
    color: #bff7ee;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .render-badge.fallback {
    border-color: rgba(255, 209, 102, 0.38);
    color: #ffe4a0;
  }

  .stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .stat {
    min-width: 0;
    padding: 9px;
    border: 1px solid rgba(202, 216, 235, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
  }

  .label {
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
  }

  .value {
    margin-top: 6px;
    font-size: 21px;
    font-weight: 850;
    line-height: 1;
  }

  .leaderboard {
    position: fixed;
    top: 18px;
    right: 18px;
    width: min(260px, calc(100vw - 36px));
    padding: 14px;
  }

  .leaderboard h2,
  .status h2 {
    margin: 0 0 10px;
    color: #dce9f8;
    font-size: 13px;
    letter-spacing: 0;
  }

  .rank-list {
    display: grid;
    gap: 7px;
  }

  .rank-row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    gap: 8px;
    align-items: center;
    color: #cfdcee;
    font-size: 13px;
  }

  .rank-row.player {
    color: #ffffff;
    font-weight: 850;
  }

  .dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    box-shadow: 0 0 12px currentColor;
  }

  .status {
    position: fixed;
    right: 18px;
    bottom: 118px;
    width: min(260px, calc(100vw - 36px));
    padding: 12px;
  }

  .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .tag {
    min-height: 27px;
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid rgba(202, 216, 235, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #d8e6f6;
    font-size: 12px;
  }

  .tag.danger {
    border-color: rgba(255, 95, 122, 0.45);
    color: #ffd3da;
  }

  .domination-meter {
    width: 100%;
    padding: 8px;
    border: 1px solid rgba(103, 232, 249, 0.22);
    border-radius: 8px;
    background: rgba(5, 12, 20, 0.52);
  }

  .meter-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #dce9f8;
    font-size: 12px;
    line-height: 1.1;
  }

  .meter-track {
    height: 8px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
  }

  .meter-fill {
    width: var(--p, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #46d7c4, #ffd166);
    transition: width 160ms ease;
  }

  .meter-fill.ready {
    background: linear-gradient(90deg, #ffd166, #ff5f7a);
  }

  .minimap {
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: 150px;
    height: 150px;
    padding: 8px;
  }

  .minimap canvas {
    position: static;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background: rgba(3, 8, 13, 0.68);
    border: 1px solid rgba(202, 216, 235, 0.13);
  }

  .controls {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: grid;
    grid-template-columns: repeat(6, 56px);
    gap: 10px;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
  }

  .icon-btn {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 900;
    touch-action: none;
    user-select: none;
  }

  .icon-btn.primary {
    background: #2b9e82;
    border-color: #58edc8;
  }

  .icon-btn.warn {
    background: #926d20;
    border-color: #ffd166;
  }

  .icon-btn.active {
    outline: 2px solid rgba(255, 209, 102, 0.85);
    outline-offset: 2px;
  }

  .joystick {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 5;
    width: 122px;
    height: 122px;
    display: none;
    pointer-events: auto;
    touch-action: none;
  }

  .joystick-base {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(202, 216, 235, 0.24);
    background: rgba(7, 12, 20, 0.42);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 50px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
  }

  .joystick-stick {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(88, 237, 200, 0.72);
    background: rgba(43, 158, 130, 0.72);
    box-shadow: 0 0 22px rgba(88, 237, 200, 0.22);
  }

  .overlay {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 10, 0.7);
    z-index: 8;
    overflow: auto;
  }

  .event-banner,
  .lobby-toast {
    position: fixed;
    left: 50%;
    z-index: 12;
    max-width: min(520px, calc(100vw - 32px));
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    color: #f8fbff;
    text-align: center;
    font-weight: 900;
    letter-spacing: 0;
    background: rgba(9, 14, 24, 0.88);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -18px) scale(0.96);
    transition: opacity 160ms ease, transform 160ms ease;
  }

  .event-banner {
    top: 18px;
  }

  .lobby-toast {
    top: 50%;
    color: #fff7d6;
  }

  .event-banner.show,
  .lobby-toast.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  .dialog {
    width: min(860px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 24px;
    text-align: center;
    background: rgba(13, 19, 29, 0.96);
    border: 1px solid rgba(202, 216, 235, 0.24);
    border-radius: 8px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.45);
  }

  .lobby-back {
    display: block;
    min-height: 34px;
    margin: 0 0 12px;
    padding: 0 12px;
    border-radius: 6px;
    color: #a9becf;
    background: rgba(255, 255, 255, 0.04);
  }

  .lobby-back:hover { color: #e6fffb; border-color: rgba(103, 232, 249, 0.55); }

  .dialog h2 {
    margin: 0 0 12px;
    font-size: 30px;
  }

  .final-mass {
    color: var(--gold);
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
  }

  .dialog p {
    margin: 10px 0 20px;
    color: var(--muted);
  }

  .meta-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
  }

  .meta-pill {
    min-height: 44px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: #f3f8ff;
    font-size: 13px;
    font-weight: 800;
  }

  .meta-pill span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }

  .lobby-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
  }

  .lobby-tab {
    min-height: 42px;
    border-radius: 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.055);
  }

  .lobby-tab.active {
    border-color: rgba(70, 215, 196, 0.85);
    color: #f3f8ff;
    background: rgba(43, 158, 130, 0.28);
  }

  .lobby-panel {
    display: none;
  }

  .lobby-panel.active {
    display: block;
  }

  .lobby-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
  }

  .lobby-tools button {
    min-height: 38px;
    border-radius: 8px;
    font-size: 12px;
  }

  .lobby-tools button.active {
    border-color: rgba(88, 237, 200, 0.7);
    background: rgba(43, 158, 130, 0.28);
  }

  .online-entry {
    grid-column: 1 / -1;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border: 1px solid rgba(88, 237, 200, 0.62);
    border-radius: 8px;
    color: #f3f8ff;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(43, 158, 130, 0.34), rgba(59, 130, 246, 0.2));
    box-shadow: inset 0 0 0 1px rgba(88, 237, 200, 0.12), 0 10px 26px rgba(0, 0, 0, 0.2);
  }

  .online-entry:hover {
    border-color: rgba(88, 237, 200, 0.9);
    background: linear-gradient(135deg, rgba(43, 158, 130, 0.46), rgba(59, 130, 246, 0.28));
  }

  .online-entry strong {
    font-size: 14px;
  }

  .online-entry span {
    color: rgba(222, 235, 246, 0.72);
    font-size: 11px;
  }

  .mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
    text-align: left;
  }

  .mode-card {
    width: 100%;
    min-height: 74px;
    padding: 12px;
    border-radius: 8px;
    text-align: left;
    background: rgba(255, 255, 255, 0.045);
  }

  .mode-card:hover {
    background: rgba(255, 255, 255, 0.07);
  }

  .mode-card strong {
    display: block;
    margin-bottom: 5px;
    color: #f3f8ff;
    font-size: 15px;
  }

  .mode-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
  }

  .mode-card.active {
    border-color: rgba(70, 215, 196, 0.85);
    background: rgba(43, 158, 130, 0.26);
    box-shadow: inset 0 0 0 1px rgba(70, 215, 196, 0.22);
  }

  .lobby-loadout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 16px;
    text-align: left;
  }

  .loadout-group {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
  }

  .forge-panel {
    --forge-theme: #ffd166;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid rgba(255, 209, 102, 0.18);
    border-radius: 8px;
    background:
      linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(79, 70, 229, 0.08)),
      rgba(255, 255, 255, 0.045);
    text-align: left;
    box-shadow: inset 0 0 0 1px var(--forge-theme);
  }

  .forge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    color: #f3f8ff;
    font-size: 13px;
  }

  .forge-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .forge-skin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f8fbff;
    background: rgba(255, 255, 255, 0.055);
  }

  .forge-skin span {
    color: var(--muted);
    font-size: 12px;
  }

  .forge-skin strong {
    color: var(--forge-theme);
    font-size: 13px;
  }

  .forge-stat,
  .pity-box {
    min-height: 48px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.16);
    color: #f3f8ff;
    font-size: 12px;
    font-weight: 800;
  }

  .forge-stat span,
  .pity-box span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }

  .forge-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 12px;
    margin-bottom: 12px;
  }

  .forge-core,
  .forge-prizes,
  .forge-log {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.16);
  }

  .forge-core {
    padding: 10px;
  }

  .forge-slots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .forge-slot {
    min-height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 209, 102, 0.22);
    border-radius: 8px;
    color: #f8e7b3;
    font-size: 12px;
    background: rgba(255, 209, 102, 0.08);
  }

  .forge-meter {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
  }

  .forge-meter i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffd166, #ff7a90, #67e8f9);
  }

  .forge-meter.level i {
    background: linear-gradient(90deg, #58edc8, #67e8f9);
  }

  .pity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .rarity-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
  }

  .rarity-chip {
    min-height: 30px;
    padding: 6px 4px;
    border-radius: 8px;
    color: #dce9f8;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.06);
  }

  .forge-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
  }

  .forge-prizes {
    padding: 10px;
  }

  .forge-prize-title {
    margin-bottom: 8px;
    color: #f3f8ff;
    font-size: 12px;
    font-weight: 800;
  }

  .forge-prize-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    max-height: 260px;
    overflow: auto;
  }

  .forge-prize {
    min-width: 0;
    padding: 6px 7px;
    border-radius: 8px;
    color: #dce9f8;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .forge-prize.common { border-left: 3px solid #94a3b8; }
  .forge-prize.rare { border-left: 3px solid #38bdf8; }
  .forge-prize.epic { border-left: 3px solid #c084fc; }
  .forge-prize.legendary { border-left: 3px solid #ffd166; }

  .forge-prize.unlocked {
    color: #f8fbff;
    background: rgba(43, 158, 130, 0.22);
    box-shadow: inset 0 0 0 1px rgba(88, 237, 200, 0.18);
  }

  .forge-prize-list.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    margin-top: 8px;
  }

  .forge-log {
    margin-top: 10px;
    padding: 8px 10px;
    color: #f8e7b3;
    font-size: 12px;
  }

  .shop-panel {
    margin: 0 0 16px;
    text-align: left;
  }

  .shop-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .shop-card {
    min-height: 96px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    text-align: left;
  }

  .shop-card strong {
    display: block;
    margin-bottom: 6px;
    color: #f3f8ff;
    font-size: 14px;
  }

  .shop-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
  }

  .shop-card button {
    width: 100%;
    min-height: 34px;
    margin-top: 10px;
    border-radius: 8px;
    font-size: 12px;
  }

  .redeem-box {
    padding: 12px;
    border: 1px solid rgba(70, 215, 196, 0.18);
    border-radius: 8px;
    background: rgba(70, 215, 196, 0.055);
  }

  .redeem-box + .redeem-box {
    margin-top: 10px;
  }

  .redeem-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 8px;
  }

  .redeem-row + .redeem-row {
    margin-top: 8px;
  }

  .code-input {
    min-width: 0;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    outline: none;
    color: #f3f8ff;
    background: rgba(0, 0, 0, 0.24);
  }

  .shop-message {
    min-height: 18px;
    margin-top: 8px;
    color: #f8e7b3;
    font-size: 12px;
  }

  .forge-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .forge-actions button {
    min-height: 40px;
    border-radius: 8px;
    font-size: 12px;
  }

  .progress-panel {
    margin: 0 0 16px;
    text-align: left;
  }

  .progress-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .progress-card {
    min-height: 82px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
  }

  .progress-card strong {
    display: block;
    color: #f3f8ff;
    font-size: 20px;
    line-height: 1;
  }

  .progress-card span {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
  }

  .progress-road {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .progress-node {
    min-height: 52px;
    padding: 8px;
    border: 1px solid rgba(255, 209, 102, 0.22);
    border-radius: 8px;
    color: #dce9f8;
    background: rgba(255, 209, 102, 0.055);
    font-size: 11px;
  }

  .progress-node.active {
    border-color: rgba(88, 237, 200, 0.64);
    color: #f8fbff;
    background: rgba(43, 158, 130, 0.2);
  }

  .loadout-group strong {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    color: #f3f8ff;
  }

  .cosmetic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .cosmetic-card {
    min-height: 58px;
    padding: 8px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
  }

  .cosmetic-card small {
    color: rgba(207, 220, 238, 0.68);
    font-size: 10px;
    line-height: 1.1;
  }

  .cosmetic-card.active {
    border-color: rgba(70, 215, 196, 0.86);
    color: #f3f8ff;
    background: rgba(43, 158, 130, 0.24);
  }

  .cosmetic-card.special {
    border-color: rgba(255, 209, 102, 0.3);
    background: rgba(255, 209, 102, 0.06);
  }

  .cosmetic-card.owned {
    border-color: rgba(88, 237, 200, 0.5);
    box-shadow: inset 0 0 0 1px rgba(88, 237, 200, 0.16);
  }

  .cosmetic-card:disabled {
    opacity: 0.62;
    cursor: not-allowed;
  }

  .swatch {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28), 0 0 16px currentColor;
  }

  .swatch.special {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.38), 0 0 18px currentColor;
  }

  .lobby-start-bar {
    position: sticky;
    bottom: -24px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 12px -24px -24px;
    padding: 14px 24px;
    border-top: 1px solid rgba(103, 232, 249, 0.2);
    background: #0d1822;
    text-align: left;
  }
  .lobby-start-bar span { color: #a9becf; font-size: 13px; }
  .lobby-start-bar #playAgainBtn { margin: 0; flex-shrink: 0; }
  .single-session-menu { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 20px; background: rgba(3, 10, 17, .74); }
  .single-session-menu[hidden] { display: none; }
  .single-session-card { width: min(430px, 100%); padding: 28px; border: 1px solid #285562; border-radius: 16px; background: #0d1822; box-shadow: 0 24px 90px #0008; }
  .single-session-card small { color: #5eead4; letter-spacing: .12em; }
  .single-session-card h2 { margin: 12px 0; font-size: 32px; }
  .single-session-card p { color: #a9becf; line-height: 1.7; }
  .single-session-card button { display: block; width: 100%; margin-top: 10px; min-height: 44px; background: #182b38; }
  .single-session-card button.primary { background: #187767; color: white; }
  .session-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; color: #b9ced8; font-size: 12px; }
  .session-controls span { padding: 6px 8px; border: 1px solid #284454; border-radius: 5px; }
  #playAgainBtn {
    min-width: 150px;
    min-height: 44px;
    border-radius: 8px;
    background: #2b9e82;
    border-color: #58edc8;
  }

  @media (max-width: 760px) {
    .title-screen { padding: 16px; overflow: auto; }
    .title-shell { grid-template-columns: 1fr; gap: 22px; align-items: start; }
    .title-rail { gap: 18px; }
    .title-brand h1 { font-size: 50px; }
    .title-brand br { display: none; }
    .title-brand p { display: none; }
    .title-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .title-action { min-height: 50px; grid-template-columns: 1fr; gap: 2px; }
    .title-content { min-height: 0; place-items: start stretch; }
    .title-panel { max-height: none; padding: 20px; }
    .title-panel h2 { font-size: 34px; }
    .hero-orbit { opacity: 0.42; width: 70vw; right: -28vw; }
    .settings-grid > label { align-items: flex-start; flex-direction: column; gap: 9px; }
    .settings-grid select { width: 100%; }
    .toggle-row { flex-direction: row !important; align-items: center !important; }
    .control-guide { grid-template-columns: 1fr; }
    .title-footer { padding-bottom: 10px; }

    .overlay { padding: 12px; }

    .dialog {
      width: min(340px, calc(100vw - 80px));
      max-width: calc(100vw - 80px);
      padding: 22px 14px;
    }

    .dialog h2 { font-size: 28px; }

    .mode-grid {
      grid-template-columns: 1fr;
    }

    .mode-card {
      min-height: 66px;
      padding: 10px;
    }

    .lobby-loadout {
      grid-template-columns: 1fr;
    }

    .forge-layout {
      grid-template-columns: 1fr;
    }

    .forge-actions {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .meta-strip,
    .forge-stats,
    .shop-grid,
    .progress-grid,
    .progress-road {
      grid-template-columns: 1fr;
    }

    .lobby-tabs {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brand {
      top: 10px;
      left: 10px;
      width: min(350px, calc(100vw - 38px));
      padding: 10px;
    }

    .brand h1 {
      margin-bottom: 8px;
      font-size: 25px;
    }

    .stats {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
    }

    .stat { padding: 7px; }
    .value { font-size: 18px; }
    .leaderboard { display: none; }
    .status { display: none; }

    .minimap {
      width: 112px;
      height: 112px;
      left: 10px;
      bottom: 142px;
    }

    .joystick {
      display: block;
      left: 12px;
      bottom: 12px;
      width: 112px;
      height: 112px;
    }

    .controls {
      left: 50%;
      right: auto;
      bottom: 10px;
      grid-template-columns: repeat(2, 48px);
      gap: 8px;
      transform: translateX(24px);
    }

    .icon-btn {
      width: 48px;
      height: 48px;
      font-size: 16px;
    }
  }

  @media (max-width: 460px) {
    .brand { width: min(340px, calc(100vw - 36px)); }
  }
