﻿  :root {
    --red:      #e7252b;
    --red-2:    #ff5a3d;
    --red-3:    #8a0d10;
    --blue:     #1f5fd6;
    --blue-2:   #3a8eff;
    --blue-3:   #0c2a72;
    --gold:     #ffd14a;
    --gold-2:   #ffa31a;
    --ink:      #0c0d10;
    --ink-2:    #1a1c22;
    --display:  'Bangers', 'Impact', 'Arial Black', sans-serif;
    --display-2: 'Anton', 'Impact', sans-serif;
    --body:     'Inter', system-ui, -apple-system, sans-serif;
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; background: #000; overflow: hidden; font-family: 'Segoe UI', system-ui, sans-serif; }

  /* -- Video layer -- */
  #player {
    position: fixed; inset: 0;
    width: 100vw; height: 100vh;
    object-fit: contain;
    background: #000;
    z-index: 0;
    transition: opacity 0.25s ease;
  }

  /* -- Title / Game-Over overlay -- */
  #overlay {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,.92);
    z-index: 50;
  }
  #overlay.poster-bg { background: rgba(0,0,0,.45); justify-content: flex-end; padding-bottom: 3%; }
  #menu-spiral {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    pointer-events: none;
    z-index: 49;
  }
  #overlay.menu-bg {
    justify-content: center;
    align-items: center;
    padding: max(44px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
    background: transparent;
    overflow: hidden;
  }
  #overlay.menu-bg::before {
    display: none;
  }
  #overlay.menu-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 50% 50%,
        rgba(0,0,0,.55) 0%,
        rgba(0,0,0,.15) 22%,
        rgba(0,0,0,0) 45%,
        rgba(0,0,0,.55) 90%,
        rgba(0,0,0,.85) 100%);
    pointer-events: none;
  }
  /* -- Design F: Glass panel (hidden outside menu-bg) -- */
  .menu-glass-panel {
    display: none;
    order: 2;
    position: relative;
    z-index: 1;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 2.5vh, 28px);
    padding: clamp(24px, 4vh, 44px) clamp(32px, 5vw, 64px) clamp(20px, 3.5vh, 40px);
    width: min(960px, calc(100vw - 24px));
    background: rgba(8,4,0,.72);
    border: 1px solid rgba(255,209,74,.22);
    border-radius: 20px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 0 60px rgba(0,0,0,.5);
  }
  #overlay.menu-bg .menu-glass-panel { display: flex; }
  #overlay.menu-bg .menu-logo { height: clamp(200px, 36vh, 448px); width: auto; max-width: none; margin-bottom: 0; order: unset; animation: logo-float 3.6s ease-in-out infinite; }
  @keyframes logo-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-18px); }
  }


  /* -- Design F: Primary button (rounds-btn in menu) -- */
  #overlay.menu-bg #rounds-btn {
    font-family: var(--display);
    font-size: clamp(26px, 4vw, 48px);
    letter-spacing: .1em;
    color: var(--gold);
    background: var(--red);
    border: none;
    border-radius: 12px;
    padding: clamp(14px, 2.2vh, 28px) 0;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 0 #3a0000, 0 16px 40px rgba(0,0,0,.5);
    text-shadow: 2px 2px 0 rgba(0,0,0,.35);
    transition: transform .12s ease, box-shadow .12s ease;
  }
  #overlay.menu-bg #rounds-btn:hover {
    background: var(--red);
    color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 13px 0 #3a0000, 0 20px 48px rgba(0,0,0,.55);
  }
  #overlay.menu-bg #rounds-btn:active {
    transform: translateY(4px);
    box-shadow: 0 6px 0 #3a0000, 0 8px 20px rgba(0,0,0,.4);
  }

  /* -- Design F: Nav buttons -- */
  #overlay.menu-bg #mp-title-menu {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 0;
    width: 100%;
  }
  #overlay.menu-bg #mp-title-menu button {
    font-family: var(--body);
    font-size: clamp(13px, 1.7vw, 22px);
    letter-spacing: .13em;
    color: rgba(255,209,74,.85);
    border-color: rgba(255,209,74,.28);
    background: rgba(0,0,0,.4);
    padding: clamp(10px, 1.8vh, 18px) clamp(12px, 1.5vw, 20px);
    min-height: clamp(44px, 7vh, 76px);
  }
  #overlay.menu-bg #mp-title-menu button:hover {
    background: rgba(255,209,74,.08);
    border-color: rgba(255,209,74,.6);
    color: var(--gold);
  }

  /* -- Design F: mp-title-user inside panel -- */
  #overlay.menu-bg #mp-title-user {
    margin-top: 0;
    font-family: var(--body);
    font-size: 11px;
    color: rgba(255,255,255,.45);
  }

  /* -- Design F: Challenge inbox gold tint -- */
  #overlay #challenge-inbox-btn {
    border-color: rgba(255,209,74,.35);
    box-shadow: 0 0 16px rgba(255,209,74,.15);
  }
  #overlay #challenge-inbox-btn:hover {
    border-color: rgba(255,209,74,.75);
    box-shadow: 0 0 24px rgba(255,209,74,.3);
    background: rgba(14,18,23,.82);
  }

  /* -- Design F: Audio + fullscreen gold hover -- */
  #audio-toggle:hover { border-color: rgba(255,209,74,.7) !important; }
  #fullscreen-btn:hover { border-color: rgba(255,209,74,.7); }

  @keyframes menu-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
  #audio-toggle {
    position: fixed; bottom: 40px; right: 40px;
    background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.5);
    color: #fff; width: 44px; height: 44px;
    border-radius: 50%; cursor: pointer; z-index: 96;
    display: none; align-items: center; justify-content: center;
    transition: border-color .2s, background .2s;
  }
  #audio-toggle:hover { border-color: #fff; background: rgba(0,0,0,.42); }
  #audio-toggle::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 13px;
    width: 19px;
    height: 18px;
    background: #fff;
    clip-path: polygon(0 34%, 34% 34%, 76% 0, 76% 100%, 34% 66%, 0 66%);
  }
  #audio-toggle::after {
    content: "";
    position: absolute;
    left: 25px;
    top: 12px;
    width: 9px;
    height: 20px;
    border-right: 2px solid #fff;
    border-radius: 50%;
  }
  #audio-toggle.is-muted::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 20px;
    width: 26px;
    height: 3px;
    background: #ff4e4e;
    border: 0;
    border-radius: 2px;
    transform: rotate(-45deg);
    box-shadow: 0 0 8px rgba(255,78,78,.7);
  }
  #fullscreen-btn {
    position: fixed;
    right: 40px;
    bottom: 94px;
    z-index: 95;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 0;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 50%;
    cursor: pointer;
    transition: border-color .2s;
  }
  #fullscreen-btn:hover { border-color: #fff; }
  #home-btn {
    position: fixed;
    bottom: 40px;
    left: 40px;
    z-index: 96;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 0;
    padding: 0;
    color: #fff;
    background: rgba(0,0,0,.28);
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 50%;
    cursor: pointer;
    transition: border-color .2s, background .2s;
  }
  #home-btn:hover { border-color: #fff; background: rgba(0,0,0,.42); }
  #home-btn::before {
    content: "";
    width: 22px;
    height: 20px;
    background: #fff;
    clip-path: polygon(50% 0, 100% 42%, 86% 42%, 86% 100%, 60% 100%, 60% 66%, 40% 66%, 40% 100%, 14% 100%, 14% 42%, 0 42%);
  }
  .fs-icon {
    position: relative;
    width: 20px;
    height: 20px;
    display: block;
  }
  .fs-icon::before,
  .fs-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(#fff, #fff) left top / 7px 2px no-repeat,
      linear-gradient(#fff, #fff) left top / 2px 7px no-repeat,
      linear-gradient(#fff, #fff) right top / 7px 2px no-repeat,
      linear-gradient(#fff, #fff) right top / 2px 7px no-repeat,
      linear-gradient(#fff, #fff) left bottom / 7px 2px no-repeat,
      linear-gradient(#fff, #fff) left bottom / 2px 7px no-repeat,
      linear-gradient(#fff, #fff) right bottom / 7px 2px no-repeat,
      linear-gradient(#fff, #fff) right bottom / 2px 7px no-repeat;
  }
  #fullscreen-btn.is-fullscreen .fs-icon {
    width: 18px;
    height: 18px;
  }
  #fullscreen-btn.is-fullscreen .fs-icon::before {
    transform: rotate(45deg);
  }
  #fullscreen-btn.is-fullscreen .fs-icon::after {
    transform: rotate(-45deg);
  }
  #overlay.hidden { display: none; }
  .menu-logo {
    position: relative;
    z-index: 1;
    order: 1;
    max-width: 546px;
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 12px;
  }
  #overlay .subtitle {
    position: relative;
    z-index: 1;
    order: 2;
    font-size: 18px; color: #aaa; margin-bottom: 40px;
    letter-spacing: .08em; text-transform: uppercase;
  }
  #overlay button {
    position: relative;
    z-index: 1;
    font: 700 22px/1 system-ui, sans-serif;
    color: #fff; background: transparent;
    border: 2px solid #fff;
    padding: 16px 48px; border-radius: 6px;
    cursor: pointer; letter-spacing: .1em;
    text-transform: uppercase; transition: .2s;
  }
  #overlay button:hover { background: #fff; color: #000; }

  #overlay #challenge-inbox-btn {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 56;
    width: 44px;
    height: 44px;
    min-height: 0;
    padding: 0;
    border: 1px solid rgba(255,255,255,.44);
    border-radius: 50%;
    background: rgba(8,12,16,.72);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow:
      0 0 24px rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    overflow: visible;
    letter-spacing: 0;
    text-transform: none;
  }
  #overlay #challenge-inbox-btn::before {
    display: none;
  }
  #overlay #challenge-inbox-btn::after {
    display: none;
  }
  #overlay #challenge-inbox-btn .bell-icon {
    width: 29px;
    height: 29px;
    display: block;
    color: #fff;
    filter: drop-shadow(0 0 8px rgba(255,255,255,.22));
  }
  #overlay #challenge-inbox-btn img {
    display: none;
  }
  #overlay #challenge-inbox-btn:hover {
    background: rgba(14,18,23,.82);
    color: #fff;
    border-color: rgba(255,255,255,.78);
    box-shadow:
      inset 0 0 0 8px rgba(255,255,255,.06),
      inset 0 0 0 16px rgba(0,0,0,.24),
      0 0 28px rgba(255,255,255,.18);
  }
  #overlay #challenge-inbox-btn.hidden { display: none; }
  #overlay #challenge-inbox-count {
    position: absolute;
    right: -4px;
    top: 3px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #ff3348;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 0 14px rgba(255,51,72,.66);
    font: 900 10px/1 system-ui, sans-serif;
    letter-spacing: 0;
  }
  #overlay #challenge-inbox-count.hidden { display: none; }

  #mp-title-menu {
    position: relative;
    z-index: 1;
    order: 4;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
    width: min(360px, calc(100vw - 32px));
  }
  #overlay #mp-title-menu button {
    min-height: 46px;
    padding: 12px 18px;
    font-size: 13px;
    letter-spacing: .12em;
    border-color: rgba(255,255,255,.72);
    background: rgba(0,0,0,.26);
  }
  #mp-title-user {
    position: relative;
    z-index: 1;
    order: 6;
    margin-top: 12px;
    min-height: 18px;
    color: rgba(255,255,255,.72);
    font: 700 12px/1.35 system-ui, sans-serif;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
  #mp-title-menu .hidden { display: none; }
  #overlay #local-dev-play-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 55;
    min-height: 28px;
    padding: 6px 9px;
    font-size: 9px;
    letter-spacing: .06em;
    border-width: 1px;
    border-color: rgba(255,255,255,.28);
    background: rgba(0,0,0,.18);
    color: rgba(255,255,255,.64);
    text-transform: uppercase;
  }
  #overlay.menu-bg #local-dev-play-btn {
    position: relative;
    top: auto;
    left: auto;
    order: 5;
    width: min(360px, calc(100vw - 32px));
    min-height: 46px;
    margin-top: 10px;
    padding: 12px 18px;
    font-size: 13px;
    letter-spacing: .12em;
    border-width: 2px;
    border-color: rgba(255,255,255,.72);
    background: rgba(0,0,0,.26);
    color: #fff;
  }
  #overlay #rounds-btn { order: 3; }
  #overlay.poster-bg #rounds-btn { display: none; }
  #overlay.poster-bg .subtitle {
    margin-bottom: clamp(90px, 16vh, 170px);
  }
  #overlay #local-dev-play-btn.hidden { display: none; }
  #game-over-menu {
    display: none;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 12px;
    width: min(520px, calc(100vw - 32px));
  }
  #overlay #game-over-menu button {
    min-height: 46px;
    padding: 12px 18px;
    font-size: 13px;
    letter-spacing: .12em;
    border-color: rgba(255,255,255,.72);
    background: rgba(0,0,0,.26);
  }
  #game-over-menu.visible { display: grid; }
  @media (max-width: 520px) {
    #mp-title-menu, #game-over-menu { grid-template-columns: 1fr; }
  }

  #rotate-gate {
    position: fixed; inset: 0;
    z-index: 220;
    display: none;
    align-items: center; justify-content: center;
    padding: 24px;
    background: #000;
    color: #fff;
    text-align: center;
  }
  #rotate-gate .rotate-card {
    width: min(420px, 100%);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    padding: 24px;
    background: rgba(255,255,255,.04);
  }
  #rotate-gate h2 {
    font: 900 24px/1.05 system-ui, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 12px;
  }
  #rotate-gate p {
    color: rgba(255,255,255,.72);
    font: 700 13px/1.45 system-ui, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 18px;
  }
  #rotate-fullscreen-btn {
    min-height: 44px;
    padding: 12px 18px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font: 800 12px/1 system-ui, sans-serif;
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  /* -- Multiplayer auth overlays -- */
  .mp-auth {
    position: fixed; inset: 0;
    z-index: 90;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background:
      radial-gradient(circle at center, rgba(120,0,0,.24), rgba(0,0,0,.94) 62%),
      rgba(0,0,0,.92);
  }
  .mp-auth.hidden { display: none; }
  .mp-card {
    width: min(460px, 100%);
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 8px;
    padding: 28px;
    background: rgba(0,0,0,.74);
    box-shadow: 0 0 60px rgba(255,50,50,.18);
    color: #fff;
  }
  .mp-card h2 {
    font-size: 28px; font-weight: 900;
    letter-spacing: .14em; text-transform: uppercase;
    margin-bottom: 12px;
  }
  .mp-card p {
    color: #bbb;
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 18px;
  }
  .mp-card input {
    width: 100%;
    height: 48px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.38);
    background: rgba(255,255,255,.08);
    color: #fff;
    padding: 0 14px;
    font: 600 16px/1 system-ui, sans-serif;
    margin-bottom: 12px;
  }
  .mp-card button {
    width: 100%;
    min-height: 48px;
    border-radius: 6px;
    border: 2px solid #fff;
    background: transparent;
    color: #fff;
    font: 800 15px/1 system-ui, sans-serif;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .mp-card button:hover { background: #fff; color: #000; }
  .mp-status {
    margin-top: 14px;
    min-height: 20px;
    color: #ddd;
    font-size: 14px;
    overflow-wrap: anywhere;
  }
  .mp-status a { color: #fff; text-decoration: underline; }
  .mp-panel {
    position: fixed; inset: 0;
    z-index: 80;
    display: flex; align-items: stretch; justify-content: center;
    padding: max(68px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 50% 34%, rgba(255,215,44,.12), transparent 34%),
      rgba(0,0,0,.92);
  }
  .mp-panel.hidden { display: none; }
  .mp-panel-box {
    width: min(720px, 100%);
    max-height: 100%;
    overflow: auto;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 8px;
    background: rgba(0,0,0,.86);
    box-shadow: 0 0 70px rgba(255,50,50,.16);
    color: #fff;
  }
  .mp-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.16);
  }
  .mp-panel-head h2 {
    font: 900 22px/1 system-ui, sans-serif;
    letter-spacing: .14em;
    text-transform: uppercase;
  }
  .mp-panel-close {
    border: 1px solid rgba(255,255,255,.52);
    border-radius: 50%;
    width: 38px; height: 38px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font: 900 18px/1 system-ui, sans-serif;
  }
  .mp-panel-body { padding: 18px 20px 22px; }
  .mp-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .mp-row:last-child { border-bottom: 0; }
  .mp-row-main { min-width: 0; }
  .mp-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .mp-row-title {
    font: 800 15px/1.25 system-ui, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .mp-row-meta {
    margin-top: 4px;
    color: rgba(255,255,255,.62);
    font: 600 12px/1.35 system-ui, sans-serif;
  }
  .mp-row button, .mp-form button {
    min-height: 38px;
    border-radius: 6px;
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
    padding: 0 14px;
    font: 800 12px/1 system-ui, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
  }
  .mp-row button:hover, .mp-form button:hover, .mp-panel-close:hover {
    background: #fff; color: #000;
  }
  .mp-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
  }
  .mp-form input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.34);
    background: rgba(255,255,255,.08);
    color: #fff;
    padding: 0 12px;
    font: 600 15px/1 system-ui, sans-serif;
  }
  .mp-empty {
    color: rgba(255,255,255,.64);
    font: 600 14px/1.45 system-ui, sans-serif;
  }
  @media (max-width: 620px) {
    .mp-row, .mp-form { flex-direction: column; align-items: stretch; }
    .mp-row button, .mp-form button { width: 100%; }
    .mp-row-actions { width: 100%; }
  }

  #vs-screen {
    position: fixed;
    inset: 0;
    z-index: 75;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: url('../assets/images/vs_bg2.png') center / cover no-repeat;
    color: #fff;
  }
  #vs-screen.hidden { display: none; }
  .top-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 20px;
    background: rgba(0,0,0,.55);
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
  }
  .tb-item {
    font: 700 20px/1 'Inter', system-ui;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
  }
  .arena {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    min-height: 0;
  }
  .half {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px 18px 14px;
  }
  .half-red  { align-items: flex-start; }
  .half-blue { align-items: flex-end; text-align: right; }
  .half > div { position: relative; z-index: 2; }
  .player-img {
    position: absolute;
    bottom: 0;
    height: 105%;
    width: auto;
    max-width: 75%;
    object-fit: contain;
    object-position: bottom center;
    z-index: 1;
  }
  .player-img-red {
    right: -4px;
    animation: slide-from-left 0.55s cubic-bezier(0.22,1,0.36,1) 0.15s both;
  }
  .player-img-blue {
    left: -4px;
    animation: slide-from-right 0.55s cubic-bezier(0.22,1,0.36,1) 0.15s both;
  }
  @keyframes slide-from-left {
    from { transform: translateX(-110%); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
  }
  @keyframes slide-from-right {
    from { transform: scaleX(-1) translateX(-110%); opacity: 0; }
    to   { transform: scaleX(-1) translateX(0);     opacity: 1; }
  }
  .corner-tag {
    font: 700 8px/1 'Inter', system-ui;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    margin-bottom: 4px;
  }
  .fighter-name {
    font: 400 clamp(28px, 6vw, 52px)/1 'Bangers', system-ui;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .half-red  .fighter-name { color: #ff5a3d; text-shadow: 0 0 30px rgba(231,37,43,.55), 0 2px 0 rgba(0,0,0,.5); }
  .half-blue .fighter-name { color: #3a8eff; text-shadow: 0 0 30px rgba(31,95,214,.55), 0 2px 0 rgba(0,0,0,.5); }
  .score-pips {
    display: flex;
    gap: 5px;
    margin-top: 6px;
  }
  .half-blue .score-pips { justify-content: flex-end; }
  .score-pip {
    display: block;
    width: 5px;
    height: 29px;
    border-radius: 2px;
    background: #ffd14a;
    box-shadow: 0 0 6px rgba(255,209,74,.9), 0 0 16px rgba(255,209,74,.6), 0 0 32px rgba(255,209,74,.3);
  }
  .bolt-col {
    width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    overflow: hidden;
  }
  .vs-mark { font-size: 0; }
  #vs-banner {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    text-align: center;
    font: 400 clamp(42px, 9vw, 96px)/1 'Bangers', system-ui;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,209,74,.8), 0 0 60px rgba(255,209,74,.4), 3px 3px 0 rgba(0,0,0,.6);
    white-space: nowrap;
  }
  #vs-banner.active {
    animation: vs-banner-pop 2.8s ease-out forwards;
  }
  @keyframes vs-banner-pop {
    0%   { transform: translate(-50%,-50%) scale(0.2) rotate(-5deg); opacity: 0; }
    18%  { transform: translate(-50%,-50%) scale(1.18) rotate(2deg);  opacity: 1; }
    30%  { transform: translate(-50%,-50%) scale(0.94) rotate(-1deg); opacity: 1; }
    42%  { transform: translate(-50%,-50%) scale(1)    rotate(0deg);  opacity: 1; }
    72%  { transform: translate(-50%,-50%) scale(1)    rotate(0deg);  opacity: 1; }
    100% { transform: translate(-50%,-50%) scale(1.08) rotate(0deg);  opacity: 0; }
  }
  .bottom-strip {
    background: rgba(8,4,0,.78);
    border: 1px solid rgba(255,209,74,.18);
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    margin: 0 7.5%;
    padding: 10px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
  }
  .result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .result-text {
    font: 400 clamp(16px, 3.5vw, 28px)/1 'Bangers', system-ui;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #ffd14a;
    text-shadow: 0 0 16px rgba(255,209,74,.45);
  }
  .vs-info {
    display: grid;
    gap: 10px;
    max-height: min(30vh, 240px);
    overflow-y: auto;
    scrollbar-width: none;
  }
  .vs-info::-webkit-scrollbar { display: none; }
  .vs-result-line {
    font: 400 clamp(14px, 3vw, 22px)/1 'Bangers', system-ui;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #ffd14a;
    text-shadow: 0 0 16px rgba(255,209,74,.45);
  }
  .vs-moves {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .vs-move-card {
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 6px;
    padding: 10px;
    background: rgba(0,0,0,.32);
    text-align: left;
  }
  .vs-round-block {
    display: grid;
    gap: 8px;
  }
  .vs-round-title {
    font: 900 12px/1.1 system-ui, sans-serif;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255,255,255,.82);
    text-align: left;
    margin-top: 4px;
  }
  .vs-move-name {
    font: 900 11px/1.1 system-ui, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 7px;
  }
  .vs-move-name.red { color: #ff4e4e; }
  .vs-move-name.blue { color: #4ea8ff; }
  .vs-move-line {
    font: 800 11px/1.45 system-ui, sans-serif;
    color: rgba(255,255,255,.78);
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .actions {
    display: flex;
    gap: 8px;
  }
  .actions button.hidden { display: none; }
  .btn {
    flex: 1;
    min-height: 36px;
    border-radius: 8px;
    border: none;
    font: 400 18px/1 'Bangers', system-ui;
    letter-spacing: .08em;
    cursor: pointer;
  }
  .btn-primary {
    background: #e7252b;
    color: #ffd14a;
    box-shadow: 0 5px 0 #3a0000, 0 8px 20px rgba(0,0,0,.4);
    text-shadow: 1px 1px 0 rgba(0,0,0,.35);
  }
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #3a0000, 0 12px 28px rgba(0,0,0,.45); }
  .btn-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #3a0000, 0 4px 12px rgba(0,0,0,.35); }
  .btn-secondary {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.72);
    border: 1px solid rgba(255,255,255,.2);
  }
  .btn-secondary:hover { background: rgba(255,255,255,.12); color: #fff; }

  /* -- HUD (top bar) -- */
  #hud {
    position: fixed; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px;
    background: linear-gradient(180deg, rgba(0,0,0,.7) 0%, transparent 100%);
    z-index: 20;
    pointer-events: none;
  }
  #hud.hidden { display: none; }
  .score-side {
    display: flex; align-items: center; gap: 14px;
    font: 700 16px/1 system-ui, sans-serif;
    text-transform: uppercase; letter-spacing: .08em;
  }
  .score-side.blue { color: #4ea8ff; flex-direction: row-reverse; }
  .score-side.red  { color: #ff4e4e; }
  .score-val {
    font-size: 28px; font-weight: 900;
    min-width: 30px; text-align: center;
  }
  #round-label {
    font: 700 18px/1 system-ui, sans-serif;
    color: #fff; letter-spacing: .12em;
    text-transform: uppercase;
  }

  /* -- Center announcement -- */
  #announcement {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font: 900 64px/1 system-ui, sans-serif;
    color: #fff;
    text-shadow: 0 0 30px rgba(0,0,0,.9), 0 4px 20px rgba(0,0,0,.7);
    text-transform: uppercase; letter-spacing: .1em;
    white-space: pre-line; text-align: center;
    z-index: 30;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s;
  }
  #announcement.visible { opacity: 1; }
  #announcement.hit  { color: #ff3333; text-shadow: 0 0 40px rgba(255,50,50,.8); }
  #announcement.blocked { color: #33aaff; text-shadow: 0 0 40px rgba(50,150,255,.8); }

  /* -- Handover overlay -- */
  #handover {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,.92);
    z-index: 40;
  }
  #handover.hidden { display: none; }
  #handover h2 {
    font: 900 42px/1 system-ui, sans-serif;
    color: #fff;
    text-transform: uppercase; letter-spacing: .12em;
    margin-bottom: 36px;
    text-align: center;
  }
  #handover.red h2 { color: #ff4e4e; text-shadow: 0 0 30px rgba(255,50,50,.5); }
  #handover.blue h2 { color: #4ea8ff; text-shadow: 0 0 30px rgba(50,130,255,.5); }
  #handover button {
    font: 700 20px/1 system-ui, sans-serif;
    color: #fff; background: transparent;
    border: 2px solid #fff;
    padding: 14px 44px; border-radius: 6px;
    cursor: pointer; letter-spacing: .1em;
    text-transform: uppercase; transition: .2s;
  }
  #handover button:hover { background: #fff; color: #000; }

  /* -- Loading / generating state -- */
  #handover .progress-wrap {
    width: 280px; height: 6px;
    background: rgba(255,255,255,.15);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 28px;
    display: none;
  }
  #handover.generating .progress-wrap { display: block; }
  #handover.generating button { display: none; }
  #handover .progress-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #ff4e4e, #ff9933, #4ea8ff);
    border-radius: 3px;
    animation: progress-fill 90s ease-out forwards;
  }
  @keyframes progress-fill {
    0%   { width: 0%; }
    30%  { width: 40%; }
    60%  { width: 65%; }
    80%  { width: 80%; }
    100% { width: 95%; }
  }
  #handover.generating h2 {
    animation: pulse-text 2s ease-in-out infinite;
  }
  @keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }
  #handover .error-msg {
    color: #ff4e4e; font-size: 14px;
    margin-bottom: 16px; display: none;
    text-align: center; max-width: 400px;
  }
  #handover.error .error-msg { display: block; }
  #handover.error .progress-wrap { display: none; }
  #handover.error button { display: inline-block; }
  .handover-buttons { display: flex; gap: 16px; }
  #replay-btn.hidden { display: none; }
  #replay-match-btn.hidden { display: none; }
  #rounds-btn.hidden { display: none; }

  /* -- Character picker -- */
  #character-select {
    position: fixed; inset: 0; z-index: 30;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 28px;
    background: rgba(0, 0, 0, 0.92);
    color: #fff;
    padding: 32px 40px;
    transition: background 0.3s;
  }
  #character-select.hidden { display: none; }
  #character-select.left  { background: radial-gradient(ellipse at center, rgba(80,0,0,0.55), rgba(0,0,0,0.96)); }
  #character-select.right { background: radial-gradient(ellipse at center, rgba(0,0,80,0.55), rgba(0,0,0,0.96)); }
  #character-select.external-picker {
    padding: 0; gap: 0; display: block; overflow: hidden; background: var(--ink);
  }
  #cs-header {
    font: 700 28px/1 system-ui, sans-serif;
    text-transform: uppercase; letter-spacing: .1em;
    text-align: center;
  }
  #cs-header .slot { font-size: 14px; opacity: .65; margin-top: 10px; display: block; letter-spacing: .16em; }
  #character-select.left  #cs-header .slot { color: #ff6666; }
  #character-select.right #cs-header .slot { color: #4ea8ff; }
  #cs-carousel {
    display: flex; align-items: center; justify-content: center;
    gap: 16px;
    width: 100%;
  }
  #cs-viewport {
    overflow: hidden;
    width: calc(5 * 252px + 4 * 40px + 80px);
    max-width: calc(100vw - 200px);
    padding: 40px 0;
    touch-action: pan-y;
  }
  #character-grid {
    display: flex; flex-wrap: nowrap; gap: 40px;
    transition: transform .38s cubic-bezier(.2,.8,.2,1);
    will-change: transform;
  }
  #character-grid.is-dragging { transition: none; }
  .cs-arrow {
    width: 56px; height: 56px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.12);
    color: #fff;
    font: 700 32px/1 system-ui, sans-serif;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, opacity .2s;
    flex-shrink: 0;
    padding: 0;
  }
  .cs-arrow:hover:not(:disabled) { background: rgba(255,255,255,.22); }
  .cs-arrow:disabled { opacity: .25; cursor: default; }
  .character-card {
    width: 252px;
    background: rgba(0,0,0,.6);
    border-radius: 12px;
    overflow: visible;
    cursor: pointer;
    transition: transform .35s ease, box-shadow .35s ease, opacity .35s ease;
    position: relative;
    flex-shrink: 0;
    opacity: .55;
    z-index: 1;
    box-shadow:
      0 0 0 4px rgba(255,255,255,.9),
      0 0 0 8px rgba(0,0,0,.7),
      0 0 0 10px rgba(255,255,255,.2),
      0 0 24px rgba(255,255,255,.3),
      0 8px 32px rgba(0,0,0,.8);
  }
  .character-card.is-center {
    opacity: 1;
    z-index: 2;
    animation: cs-pulse 1.6s ease-in-out infinite;
  }
  .character-card:hover { z-index: 3; }
  @keyframes cs-pulse {
    0%, 100% { transform: scale(1.05); }
    50%      { transform: scale(1.14); }
  }
  #character-select.left .character-card.is-center {
    box-shadow:
      0 0 0 4px #ff4e4e,
      0 0 0 8px rgba(0,0,0,.7),
      0 0 0 10px rgba(255,78,78,.5),
      0 0 50px rgba(255,78,78,.7),
      0 0 80px rgba(255,78,78,.3),
      0 14px 44px rgba(0,0,0,.9);
  }
  #character-select.right .character-card.is-center {
    box-shadow:
      0 0 0 4px #4ea8ff,
      0 0 0 8px rgba(0,0,0,.7),
      0 0 0 10px rgba(78,168,255,.5),
      0 0 50px rgba(78,168,255,.7),
      0 0 80px rgba(78,168,255,.3),
      0 14px 44px rgba(0,0,0,.9);
  }
  .character-card .poster {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 12px;
  }
  .character-card .name {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 48px 10px 12px;
    background: linear-gradient(to top, rgba(0,0,0,.95) 0%, transparent 100%);
    font: 700 11px/1.2 system-ui, sans-serif;
    text-transform: uppercase; letter-spacing: .1em;
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,.9);
    border-radius: 0 0 12px 12px;
  }
  .character-card.taken {
    opacity: .2; cursor: not-allowed;
  }
  .character-card.taken.is-center {
    opacity: .35; transform: scale(1.08);
  }

  /* -- Action panel (bottom) -- */
  #action-panel {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; flex-direction: column;
    align-items: center; gap: 16px;
    padding: 24px 24px 36px;
    background: linear-gradient(0deg, rgba(0,0,0,.8) 0%, transparent 100%);
    z-index: 20;
  }
  #action-panel.hidden { display: none; }
  #action-label {
    font: 700 16px/1 system-ui, sans-serif;
    letter-spacing: .12em; text-transform: uppercase;
  }
  #action-label.blue { color: #4ea8ff; }
  #action-label.red  { color: #ff4e4e; }
  #action-buttons {
    display: flex; gap: 16px;
  }
  #action-buttons button {
    font: 700 18px/1 system-ui, sans-serif;
    padding: 16px 32px;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .08em;
    transition: .15s;
    border: 2px solid;
    min-width: 100px;
  }
  #action-buttons button:disabled {
    opacity: .3; cursor: default;
  }
  /* Blue-tinted buttons */
  #action-panel.blue-turn button {
    color: #4ea8ff; background: rgba(30,80,140,.3);
    border-color: #4ea8ff;
  }
  #action-panel.blue-turn button:hover:not(:disabled) {
    background: #4ea8ff; color: #000;
  }
  /* Red-tinted buttons */
  #action-panel.red-turn button {
    color: #ff4e4e; background: rgba(140,30,30,.3);
    border-color: #ff4e4e;
  }
  #action-panel.red-turn button:hover:not(:disabled) {
    background: #ff4e4e; color: #000;
  }

  /* -----------------------------------------
     Fight Builder UI
     ----------------------------------------- */
  #fight-builder {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    background: #000;
    z-index: 70;
    isolation: isolate;  /* scope canvas z-index:-1 to this element */
  }
  #fight-builder.hidden { display: none; }
  #fb-bg-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: -1;  /* behind siblings, above #fight-builder's bg */
    pointer-events: none;
    display: block;
  }

  /* -- Round history table -- */
  /* Sizes are vw-based but capped with min() so the HUD stops growing
     past ~1400px viewport - avoids the "giant HUD" look on wide monitors. */
  #fb-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: min(1.2vw, 21px) min(3.4vw, 60px);
    align-content: end;  /* push content to bottom of frame */
    align-items: center;
    flex-shrink: 0;
    padding: 0 min(9vw, 158px) min(0.4vw, 7px);
    width: min(40%, 975px);
    height: min(6.9vw, 120px);  /* matches uhd_bottom2 aspect */
    margin: auto auto 0;  /* bottom-align within #fight-builder flex column */
    background: url('../assets/moves/uhd_bottom2.png') center / 100% 100% no-repeat;
  }
  .fbt-corner { display: none; }
  .fbt-rh {
    text-align: center;
    font: 700 min(0.7vw, 12px)/min(0.87vw, 15px) system-ui, sans-serif;
    color: rgba(255,255,255,.28);
    letter-spacing: .16em;
    text-transform: uppercase;
    transition: color .2s;
  }
  .fbt-rh.cur { color: #fff; }
  .fbt-pl {
    display: none;
    font: 800 min(0.87vw, 15px)/1 system-ui, sans-serif;
    letter-spacing: .16em;
    text-transform: uppercase;
    align-items: center;
  }
  .fbt-pl.blue { color: #4ea8ff; }
  .fbt-pl.red  { color: #ff4e4e; }
  .fbt-pd {
    display: flex; gap: 12px;
    justify-content: center; align-items: center;
    transition: background .2s;
  }
  .fbt-pd.cur { background: transparent; }

  /* -- Pick icon slots -- */
  .fb-slot {
    width: min(3vw, 52px); height: min(3vw, 52px);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
  }

  /* -- Only show the current picker's row - opponent stays hidden -- */
  #fight-builder.blue-turn #fb-table .fbt-pl.red,
  #fight-builder.blue-turn #fb-red-1,
  #fight-builder.blue-turn #fb-red-2,
  #fight-builder.blue-turn #fb-red-3 { display: none; }
  #fight-builder.red-turn #fb-table .fbt-pl.blue,
  #fight-builder.red-turn #fb-blue-1,
  #fight-builder.red-turn #fb-blue-2,
  #fight-builder.red-turn #fb-blue-3 { display: none; }
  .fb-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
  /* Attack: full color, solid ring */
  .fb-slot-atk {
    border: 1.5px solid rgba(255,255,255,.42);
    background: rgba(255,255,255,.05);
  }
  /* Defense: desaturated, dashed ring */
  .fb-slot-def {
    border: 1.5px dashed rgba(255,255,255,.22);
    background: rgba(255,255,255,.03);
  }
  .fb-slot-def img { filter: saturate(.3) brightness(.7); }
  /* Empty slot */
  .fb-slot-empty {
    border: 1.5px solid rgba(255,255,255,.1);
    background: transparent;
  }
  /* Locked / hidden opponent pick */
  .fb-slot-locked {
    border: 1.5px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.02);
    font: 700 11px/1 system-ui;
    color: rgba(255,255,255,.14);
  }

  /* -- Title bar -- */
  #fb-title {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 0;
  }
  #fb-title {
    filter:
      drop-shadow(0 0 5px rgba(78,168,255,1))
      drop-shadow(0 0 16px rgba(78,168,255,.65))
      drop-shadow(0 0 40px rgba(78,168,255,.3));
  }
  #fb-title-shape {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 88px 15px;
    width: min(660px, 88vw);
    clip-path: polygon(42px 0%, calc(100% - 42px) 0%, 100% 100%, 0% 100%);
    background: url('../assets/moves/hud.png') center center / auto 100% no-repeat;
    overflow: hidden;
  }
  /* Bright angled-edge lines at top */
  #fb-title-shape::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1.5px;
    background: linear-gradient(to right,
      transparent 0%,
      rgba(78,168,255,.95) 7%,
      rgba(78,168,255,.5) 28%,
      rgba(78,168,255,.12) 50%,
      rgba(78,168,255,.5) 72%,
      rgba(78,168,255,.95) 93%,
      transparent 100%
    );
  }
  /* Subtle inner top glow for depth */
  #fb-title-shape::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 55%;
    background: linear-gradient(to bottom, rgba(78,168,255,.08) 0%, transparent 100%);
    pointer-events: none;
  }
  #fight-builder.red-turn #fb-title-shape::before {
    background: linear-gradient(to right,
      transparent 0%,
      rgba(255,78,78,.95) 7%,
      rgba(255,78,78,.5) 28%,
      rgba(255,78,78,.12) 50%,
      rgba(255,78,78,.5) 72%,
      rgba(255,78,78,.95) 93%,
      transparent 100%
    );
  }
  #fight-builder.red-turn #fb-title-shape::after {
    background: linear-gradient(to bottom, rgba(255,78,78,.08) 0%, transparent 100%);
  }
  #fb-player-name {
    font: 900 17px/1 system-ui, sans-serif;
    text-transform: uppercase; letter-spacing: .2em;
    position: relative; z-index: 1;
    text-shadow: 0 0 18px currentColor;
  }
  #fight-builder.blue-turn #fb-player-name { color: #4ea8ff; }
  #fight-builder.red-turn  #fb-player-name { color: #ff4e4e; }
  .fb-sep { color: rgba(255,255,255,.3); font: 400 15px/1 system-ui; position: relative; z-index: 1; }
  #fb-action-type {
    font: 800 17px/1 system-ui, sans-serif;
    text-transform: uppercase; letter-spacing: .2em;
    color: #fff;
    position: relative; z-index: 1;
  }

  /* -- Main area -- */
  #fb-main {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: 0;
    overflow: visible;
  }

  /* -- Fighter frame -- */
  /* NOTE: no `transform` here - it would create a stacking context that
     traps #fb-move-vid's mix-blend-mode: screen, preventing the black
     pixels from blending against the wave canvas backdrop. */
  #fb-fighter-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
  }
  #fb-char {
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center bottom;
    display: block;
  }
  #fb-move-vid {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    height: min(100%, 62vh);
    width: auto;
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity .18s;
    pointer-events: none;
    z-index: 15;
  }
  #fight-builder.is-previewing #fb-move-vid {
    opacity: 1 !important;
  }

  /* -- Horizontal zone row at bottom -- */
  #fb-zones-row {
    position: relative;
    z-index: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(24px, 5vw, 72px);
    padding: 20px 40px 28px;
    width: 35%;
    flex-shrink: 0;
    margin: 20px auto 24px;
  }
  .fb-zone {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none; -webkit-user-select: none;
    transition: transform .15s ease;
  }
  .fb-zone:hover,
  .fb-zone.is-preview { transform: scale(1.07); }
  .fb-zone.is-pressed { transform: scale(1.01); }
  .fb-circle {
    width: min(151px, 20vmin);
    height: min(151px, 20vmin);
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.3);
    transition: box-shadow .18s, border-color .18s;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.05);
  }
  .fb-circle img {
    width: 84%; height: 84%;
    object-fit: contain;
  }
  /* Hover: player-color glow */
  #fight-builder.blue-turn .fb-zone:hover .fb-circle,
  #fight-builder.blue-turn .fb-zone.is-preview .fb-circle {
    border-color: #4ea8ff;
    box-shadow: 0 0 30px rgba(78,168,255,.72), 0 0 65px rgba(78,168,255,.32),
                inset 0 0 28px rgba(78,168,255,.15);
  }
  #fight-builder.red-turn .fb-zone:hover .fb-circle,
  #fight-builder.red-turn .fb-zone.is-preview .fb-circle {
    border-color: #ff4e4e;
    box-shadow: 0 0 30px rgba(255,78,78,.72), 0 0 65px rgba(255,78,78,.32),
                inset 0 0 28px rgba(255,78,78,.15);
  }
  .fb-zone-name {
    font: 800 16px/1 system-ui, sans-serif;
    text-transform: uppercase; letter-spacing: .14em;
    color: #fff;
  }
  @media (max-width: 900px) {
    #fullscreen-btn {
      display: flex;
      right: 12px;
      bottom: 60px;
      width: 38px;
      height: 38px;
    }
    .fs-icon {
      width: 18px;
      height: 18px;
    }
    body.mp-panel-open #fullscreen-btn,
    body.mp-auth-open #fullscreen-btn { display: none; }
    #audio-toggle {
      right: 12px;
      bottom: 12px;
      width: 38px;
      height: 38px;
      font-size: 17px;
    }
    #home-btn {
      bottom: 12px;
      left: 12px;
      width: 38px;
      height: 38px;
    }
  }

  @media (max-width: 900px) and (orientation: portrait) {
    #rotate-gate { display: none; }
    #overlay.poster-bg,
    #overlay.menu-bg {
      justify-content: flex-start;
      padding: max(68px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
    }
    .menu-logo {
      max-width: 429px;
      margin: 18px 0 10px;
    }
    #overlay .subtitle {
      width: min(360px, 100%);
      font-size: 13px;
      line-height: 1.35;
      text-align: center;
      margin-bottom: 22px;
    }
    #overlay #rounds-btn,
    #mp-title-menu {
      width: min(360px, calc(100vw - 32px));
    }
    #overlay button {
      width: 100%;
      min-height: 50px;
      padding: 13px 16px;
      font-size: 14px;
    }
    #mp-title-menu {
      grid-template-columns: 1fr;
    }
    #player {
      object-fit: contain;
    }
    #fight-builder {
      padding: max(58px, env(safe-area-inset-top)) 0 max(10px, env(safe-area-inset-bottom));
    }
    #fb-title-shape {
      width: min(420px, 92vw);
      padding: 13px 34px 14px;
    }
    #fb-player-name,
    #fb-action-type {
      font-size: 12px;
      letter-spacing: .13em;
    }
    #fb-move-vid {
      height: min(58vh, 520px);
    }
    #fb-zones-row {
      width: 100%;
      gap: clamp(14px, 6vw, 36px);
      padding: 12px 16px 18px;
      margin: 8px auto 14px;
    }
    .fb-circle {
      width: clamp(78px, 25vw, 118px);
      height: clamp(78px, 25vw, 118px);
    }
    .fb-zone-name {
      font-size: 12px;
      letter-spacing: .12em;
    }
    #fb-table {
      width: min(430px, 96vw);
      height: 84px;
      grid-template-rows: 18px 48px;
      padding: 0 70px 7px;
    }
    .fb-slot {
      width: 34px;
      height: 34px;
    }
    .fbt-rh {
      font-size: 10px;
      line-height: 12px;
    }
    .vs-moves {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 900px) and (orientation: landscape) {
    #overlay.poster-bg {
      justify-content: flex-end;
      align-items: center;
      padding: 0 18px 18px;
    }
    .menu-logo {
      max-width: 312px;
      margin-bottom: 6px;
    }
    #overlay .subtitle {
      font-size: clamp(10px, 2.2vw, 13px);
      margin-bottom: 12px;
    }
    #overlay button {
      padding: 10px 20px;
      min-height: 42px;
      font-size: clamp(12px, 2.2vw, 16px);
    }
    #overlay #rounds-btn {
      width: min(420px, calc(100vw - 220px));
    }
    #mp-title-menu,
    #game-over-menu {
      width: min(560px, calc(100vw - 220px));
      grid-template-columns: repeat(2, minmax(120px, 1fr));
      gap: 8px;
      margin-top: 8px;
    }
    #overlay #mp-title-menu button,
    #overlay #game-over-menu button {
      min-height: 38px;
      padding: 8px 12px;
      font-size: 11px;
    }
    #mp-title-user {
      margin-top: 7px;
      min-height: 14px;
      font-size: 10px;
    }
    .mp-auth,
    .mp-panel {
      align-items: stretch;
      justify-content: center;
      padding: 12px max(14px, env(safe-area-inset-left)) 12px max(14px, env(safe-area-inset-right));
    }
    .mp-card,
    .mp-panel-card {
      width: min(760px, 100%);
      max-height: calc(100vh - 24px);
      padding: 18px;
      overflow: auto;
    }
    .mp-card h2,
    .mp-panel h2 {
      font-size: clamp(18px, 3vw, 24px);
      margin-bottom: 10px;
    }
    .mp-card p {
      font-size: 12px;
      margin-bottom: 12px;
    }
    .mp-card input,
    .mp-form input {
      min-height: 40px;
    }
    .mp-card button,
    .mp-form button,
    .mp-row button {
      min-height: 40px;
      padding: 10px 14px;
      font-size: 11px;
    }
    .mp-form {
      flex-direction: row;
      gap: 8px;
      margin-bottom: 10px;
    }
    .mp-row {
      padding: 10px;
      gap: 10px;
    }
    .mp-row-title { font-size: 13px; }
    .mp-row-meta { font-size: 11px; }
    #character-select {
      gap: 12px;
      padding: 12px 18px;
    }
    #cs-header {
      font-size: clamp(18px, 3vw, 24px);
    }
    #cs-header .slot {
      margin-top: 6px;
      font-size: 10px;
    }
    #cs-carousel {
      gap: 10px;
    }
    #cs-viewport {
      width: min(530px, calc(100vw - 148px));
      max-width: calc(100vw - 148px);
      padding: 18px 0;
    }
    #character-grid {
      gap: 24px;
    }
    .character-card {
      width: min(188px, 28vw);
      pointer-events: none;
    }
    .character-card.is-center {
      animation: none;
      transform: scale(1.06);
      pointer-events: auto;
    }
    .cs-arrow {
      width: 48px;
      height: 48px;
      font-size: 28px;
    }
    #hud {
      padding: 8px 14px;
    }
    .score-side span:first-child {
      font-size: 12px;
      max-width: 132px;
    }
    .score-side span:last-child {
      font-size: 22px;
    }
    #round-label {
      font-size: 12px;
    }
    #fight-builder {
      padding-top: 0;
    }
    #fb-title-shape {
      min-width: min(390px, calc(100vw - 120px));
      height: 50px;
    }
    #fb-player-name,
    #fb-action-type {
      font-size: 13px;
    }
    #fb-zones-row {
      width: min(70vw, 620px);
      gap: clamp(18px, 4vw, 46px);
      padding: 10px 28px 12px;
      margin: 8px auto 10px;
    }
    #fb-table {
      width: min(86vw, 760px);
      height: clamp(70px, 18vh, 88px);
      grid-template-columns: clamp(46px, 8vw, 70px) repeat(3, 1fr);
      grid-template-rows: 20px 48px;
      padding: 0 clamp(58px, 10vw, 96px) 8px;
      transform: translateY(0);
    }
    .fbt-rh {
      font-size: 10px;
      line-height: 1;
    }
    .fbt-pl {
      font-size: 11px;
      line-height: 1;
    }
    .fbt-pd {
      gap: 8px;
    }
    .fb-slot {
      width: 38px;
      height: 38px;
    }
    .fb-zone {
      min-width: 112px;
      min-height: 122px;
    }
    .fb-circle {
      width: clamp(82px, 18vh, 118px);
      height: clamp(82px, 18vh, 118px);
    }
    #fb-move-vid {
      height: 175%;
    }
    .fb-zone-name {
      font-size: 14px;
    }
  }

  /* ====== Fighter Select Module ====== */
  #character-select[data-side="red"] { --tint: var(--red); --tint-2: var(--red-2); --tint-3: var(--red-3); --tint-rgb: 231, 37, 43; }
  #character-select[data-side="blue"] { --tint: var(--blue); --tint-2: var(--blue-2); --tint-3: var(--blue-3); --tint-rgb: 31, 95, 214; }

  @keyframes sun-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

  #character-select .fs-stage { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--tint-3); }
  #character-select .fs-stage-sun {
    position: absolute; top: 50%; left: 50%; width: 220vmax; height: 220vmax;
    transform: translate(-50%, -50%); transform-origin: 50% 50%;
    background: repeating-conic-gradient(from 0deg at 50% 50%, var(--tint-3) 0deg 9deg, var(--tint) 9deg 18deg, var(--tint-2) 18deg 27deg, var(--tint) 27deg 36deg);
    animation: sun-spin 90s linear infinite; will-change: transform;
  }
  #character-select .fs-stage-vignette {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 22%, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 90%, rgba(0,0,0,.85) 100%);
    pointer-events: none;
  }
  #character-select .fs-app {
    position: relative; z-index: 1; display: grid; grid-template-rows: auto 1fr auto;
    height: 100%; padding-top: env(safe-area-inset-top);
  }
  #character-select .fs-topbar { padding: 8px 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
  #character-select .fs-topbar > * { pointer-events: auto; }
  #character-select .fs-title-wrap { text-align: center; position: relative; padding: 4px 0 2px; }
  #character-select .fs-title-wrap::before, #character-select .fs-title-wrap::after {
    content: ""; position: absolute; top: 50%; width: 28%; height: 2px;
    background: repeating-linear-gradient(90deg, #fff 0 14px, transparent 14px 22px); opacity: .55; transform: translateY(-50%);
  }
  #character-select .fs-title-wrap::before { left: 3%; }
  #character-select .fs-title-wrap::after  { right: 3%; transform: translateY(-50%) scaleX(-1); }
  #character-select .fs-title {
    font-family: var(--display); font-size: clamp(25px, 8.05vw, 55px); font-weight: 400;
    letter-spacing: .06em; text-transform: uppercase; color: #fff; transform: rotate(-2deg); line-height: 1;
    text-shadow: 2px 2px 0 var(--ink), 4px 4px 0 var(--tint-3), 6px 6px 0 var(--ink), 0 0 26px rgba(var(--tint-rgb), .5);
    display: inline-block;
  }
  #character-select .fs-title em { font-style: normal; color: var(--gold); text-shadow: 2px 2px 0 var(--ink), 4px 4px 0 #4a2400, 6px 6px 0 var(--ink); }
  #character-select .fs-subtitle {
    font-family: var(--body); font-weight: 700; font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
    color: #fff; margin-top: 2px; padding: 4px 10px; background: rgba(0,0,0,.45); border-radius: 999px;
    backdrop-filter: blur(6px); text-shadow: 1px 1px 0 rgba(0,0,0,.6);
  }
  #character-select .fs-subtitle .vs { color: var(--gold); margin: 0 6px; }
  #character-select .fs-corner {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
    background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.4)); border: 2px solid var(--tint);
    box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 0 22px rgba(var(--tint-rgb), .65), inset 0 0 22px rgba(0,0,0,.25);
    font-weight: 800; font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
    backdrop-filter: blur(8px); animation: corner-pulse 2.2s ease-in-out infinite; color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.6);
  }
  #character-select .fs-corner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tint); box-shadow: 0 0 10px var(--tint); }

  #character-select .fs-roster {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 4px 10px 6px;
    overflow-y: auto; overflow-x: hidden; scrollbar-width: none; align-content: start;
  }
  #character-select .fs-roster::-webkit-scrollbar { display: none; }

  #character-select .fs-card {
    position: relative; aspect-ratio: 4 / 5; border: 0; background: transparent; cursor: pointer; padding: 0;
    transition: transform .25s cubic-bezier(.2,.9,.3,1.4); animation: card-in .55s cubic-bezier(.2,.8,.3,1.2) backwards;
    isolation: isolate; will-change: transform; color: inherit;
  }
  #character-select .fs-card:nth-child(1){ animation-delay:.05s } #character-select .fs-card:nth-child(2){ animation-delay:.10s }
  #character-select .fs-card:nth-child(3){ animation-delay:.15s } #character-select .fs-card:nth-child(4){ animation-delay:.20s }
  #character-select .fs-card:nth-child(5){ animation-delay:.25s } #character-select .fs-card:nth-child(6){ animation-delay:.30s }
  #character-select .fs-card:nth-child(7){ animation-delay:.35s } #character-select .fs-card:nth-child(8){ animation-delay:.40s }
  #character-select .fs-card:hover { transform: translateY(-4px); }
  #character-select .fs-card:active { transform: translateY(-2px) scale(.97); }

  #character-select .fs-panel {
    position: absolute; inset: 0; overflow: hidden;
    background: radial-gradient(ellipse at 50% 18%, #2a2c34 0%, #0e0f13 60%), var(--ink);
    border-radius: 6px; box-shadow: 0 8px 0 rgba(0,0,0,.55), 0 14px 28px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.04);
    transition: box-shadow .25s ease;
  }
  #character-select .fs-rays { display: none; }
  #character-select .fs-panel::before {
    content: ""; position: absolute; inset: 0; z-index: 2;
    background: radial-gradient(circle at 50% 25%, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 45%), radial-gradient(circle at 50% 60%, transparent 30%, rgba(0,0,0,.55) 100%);
    pointer-events: none;
  }
  #character-select .fs-frame { position: absolute; inset: 0; z-index: 5; pointer-events: none; border: 2px solid #fff; border-radius: 6px; }
  #character-select .fs-portrait {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%;
    transform: scale(1.15); transform-origin: 50% 18%; z-index: 4;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,.6)) drop-shadow(0 2px 0 rgba(0,0,0,.45));
    transition: transform .35s cubic-bezier(.2,.8,.3,1.2);
  }
  #character-select .fs-card:hover .fs-portrait { transform: scale(1.2) translateY(-2px); }
  #character-select .fs-nameplate {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%) rotate(-3deg); z-index: 6;
    background: var(--ink); color: #fff; padding: 3px 12px 4px; font-family: var(--display); font-weight: 400;
    font-size: clamp(13px, 4vw, 19px); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
    border: 2px solid #fff; box-shadow: 2px 2px 0 var(--tint), 4px 4px 0 rgba(0,0,0,.55); line-height: 1.05;
  }
  #character-select .fs-pickbadge {
    position: absolute; top: 8px; right: 8px; z-index: 7; width: 32px; height: 32px; border-radius: 50%;
    background: var(--tint); color: #fff; font-weight: 900; font-size: 14px;
    display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--ink), 2px 2px 0 rgba(0,0,0,.45), 0 0 14px var(--tint);
    opacity: 0; transform: scale(0) rotate(-30deg); transition: all .3s cubic-bezier(.2,.8,.3,1.5); font-family: var(--display-2);
  }
  #character-select .fs-card.selected .fs-pickbadge { opacity: 1; transform: scale(1) rotate(-8deg); }
  #character-select .fs-card.selected .fs-panel { box-shadow: 0 0 0 3px var(--tint), 0 0 36px var(--tint), 0 8px 0 rgba(0,0,0,.55), 0 14px 28px rgba(0,0,0,.55); }
  #character-select .fs-card.locking .fs-panel { box-shadow: 0 0 0 4px var(--gold), 0 0 60px var(--gold), 0 8px 0 rgba(0,0,0,.55), 0 14px 28px rgba(0,0,0,.55); }
  #character-select .fs-card.locking { animation: lock-pump .45s cubic-bezier(.2,.9,.3,1.4) forwards; }

  #character-select .fs-card.wild .fs-portrait { display: none; }
  #character-select .fs-card.wild .fs-panel { background: radial-gradient(ellipse at 50% 28%, #2c2e36 0%, #0b0c10 60%, #07080b 100%); }
  #character-select .fs-card.wild .fs-panel::before { background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 35%), radial-gradient(circle at 50% 60%, transparent 30%, rgba(0,0,0,.7) 100%); }
  #character-select .fs-card.wild .fs-frame { border-color: rgba(255,255,255,.85); box-shadow: inset 0 0 0 4px rgba(0,0,0,.5), inset 0 0 26px rgba(var(--tint-rgb), .35), 0 0 22px rgba(var(--tint-rgb), .35); }
  #character-select .fs-card.wild .fs-nameplate { background: var(--ink); box-shadow: 2px 2px 0 rgba(var(--tint-rgb), 1), 4px 4px 0 rgba(0,0,0,.55); }
  #character-select .fs-wild-mark {
    position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center;
    font-family: var(--display); font-size: clamp(76px, 24vw, 140px);
    background: linear-gradient(180deg, #ffffff 0%, #d8dbe2 35%, #6f7280 55%, #b3b6bd 70%, #f4f5f8 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
    transform: rotate(-4deg); letter-spacing: -.02em; line-height: 1;
    filter: drop-shadow(0 4px 0 rgba(0,0,0,.55)) drop-shadow(0 10px 18px rgba(0,0,0,.7)) drop-shadow(0 0 14px rgba(var(--tint-rgb), .35));
  }
  #character-select .fs-card.wild .fs-panel::after {
    content: ""; position: absolute; inset: 0; z-index: 3;
    background: radial-gradient(circle at 50% 45%, rgba(var(--tint-rgb), .45) 0%, rgba(var(--tint-rgb), 0) 45%);
    mix-blend-mode: screen; animation: wild-pulse 3s ease-in-out infinite; pointer-events: none;
  }
  @keyframes wild-pulse { 0%,100% { opacity: .55; } 50% { opacity: .9; } }

  #character-select .fs-dock {
    padding: 10px 10px max(12px, env(safe-area-inset-bottom)) 10px; margin: 0 10px 10px;
    background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.78); border-radius: 8px;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px;
  }
  #character-select .fs-pick-card {
    position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 52px;
    background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.5); border-radius: 6px;
    transition: border-color .25s ease, box-shadow .25s ease; overflow: hidden;
  }
  #character-select .fs-pick-card.filled { border-color: rgba(255,255,255,.82); box-shadow: 0 0 12px rgba(255,255,255,.14); }
  #character-select .fs-pick-rays { display: none; }
  #character-select .fs-pick-thumb {
    position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 8px;
    background: var(--ink-2); object-fit: cover; object-position: 50% 16%; flex-shrink: 0; border: 1px solid rgba(255,255,255,.2);
  }
  #character-select .fs-pick-card.filled .fs-pick-thumb { border-color: rgba(255,255,255,.55); }
  #character-select .fs-pick-thumb-empty {
    position: relative; z-index: 1; width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px;
    background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.35); font-family: var(--display); font-size: 18px;
  }
  #character-select .fs-pick-text { position: relative; z-index: 1; min-width: 0; flex: 1; }
  #character-select .fs-pick-name { font-family: var(--display); font-size: clamp(15px, 4.5vw, 21px); letter-spacing: .04em; line-height: 1.1; color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #character-select .fs-pick-hint { display: block; font-family: var(--body); font-size: 9.5px; font-weight: 700; color: rgba(255,255,255,.55); letter-spacing: .14em; text-transform: uppercase; margin-top: 3px; }
  #character-select .fs-pick-card.filled .fs-pick-hint { color: rgba(255,255,255,.85); }
  #character-select .fs-confirm-btn {
    padding: 14px 22px; font-family: var(--display); font-size: clamp(20px, 6.4vw, 26px); letter-spacing: .14em;
    text-transform: uppercase; color: #fff; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.5);
    border-radius: 6px; cursor: pointer; text-shadow: 1px 1px 0 rgba(0,0,0,.7);
    transition: transform .12s ease, box-shadow .12s ease, border-color .25s ease; position: relative; line-height: 1; white-space: nowrap;
  }
  #character-select .fs-confirm-btn:not(:disabled) { border-color: rgba(255,255,255,.88); box-shadow: 0 0 12px rgba(255,255,255,.18); text-shadow: 1px 1px 0 rgba(0,0,0,.7), 0 0 12px rgba(var(--tint-rgb), .8); }
  #character-select .fs-confirm-btn:not(:disabled):hover { transform: translateY(-2px); }
  #character-select .fs-confirm-btn:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
  #character-select .fs-confirm-btn:disabled { color: rgba(255,255,255,.32); cursor: not-allowed; text-shadow: none; border-color: rgba(255,255,255,.28); box-shadow: none; }
  #character-select .fs-back-btn {
    position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; z-index: 10;
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.45); border: 1.5px solid rgba(255,255,255,.25); border-radius: 50%;
    color: #fff; cursor: pointer; backdrop-filter: blur(6px); transition: border-color .2s ease, transform .2s ease;
  }
  #character-select .fs-back-btn:hover { border-color: #fff; transform: translateX(-2px); }
  #character-select .fs-back-btn svg { width: 16px; height: 16px; }
  #character-select .fs-splash {
    position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
    background: rgba(8,9,12,.85); pointer-events: none; opacity: 0; transition: opacity .25s ease;
  }
  #character-select .fs-splash.show { opacity: 1; pointer-events: auto; }
  #character-select .fs-splash.no-bg { background: transparent; }
  #character-select .fs-splash.no-bg::before { display: none; }
  #character-select .fs-splash-text {
    font-family: var(--display); font-size: clamp(40px, 14vw, 140px); letter-spacing: .04em; color: var(--gold);
    text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 var(--tint-3), 9px 9px 0 var(--ink), 0 0 60px rgba(255,209,74,.6);
    transform: rotate(-6deg) scale(.4); transition: transform .5s cubic-bezier(.2,.8,.3,1.4); text-align: center; line-height: 1;
  }
  #character-select .fs-splash.show .fs-splash-text { transform: rotate(-3deg) scale(1.05); }
  #character-select .fs-splash::before {
    content: ""; position: absolute; inset: -10%;
    background: repeating-conic-gradient(from 0deg at 50% 50%, var(--gold) 0deg 6deg, var(--tint) 6deg 12deg);
    opacity: .25; animation: spin-fast 4s linear infinite;
  }

  @media (min-width: 720px) {
    #character-select .fs-topbar { padding: 18px 24px 10px; gap: 8px; }
    #character-select .fs-roster { grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 10px 24px; }
    #character-select .fs-dock { grid-template-columns: 1fr auto; align-items: stretch; padding: 14px 24px max(20px, env(safe-area-inset-bottom)); column-gap: 14px; }
    #character-select .fs-pick-card { min-height: 72px; padding: 10px 14px; }
    #character-select .fs-pick-thumb, #character-select .fs-pick-thumb-empty { width: 56px; height: 56px; }
    #character-select .fs-confirm-btn { min-width: 220px; }
  }
  @media (max-width: 900px) and (orientation: landscape) {
    #character-select .fs-app { grid-template-rows: auto minmax(0, 1fr) auto; }
    #character-select .fs-topbar { padding: 4px 52px 2px; gap: 1px; }
    #character-select .fs-title-wrap { padding: 0; }
    #character-select .fs-title-wrap::before, #character-select .fs-title-wrap::after { display: none; }
    #character-select .fs-corner { padding: 3px 10px; border-width: 1px; font-size: 10px; letter-spacing: .14em; animation: none; }
    #character-select .fs-corner .dot { width: 7px; height: 7px; }
    #character-select .fs-title { font-size: clamp(36px, 9.5vh, 50px); text-shadow: 1px 1px 0 var(--ink), 3px 3px 0 var(--tint-3), 0 0 18px rgba(var(--tint-rgb), .45); }
    #character-select .fs-subtitle { margin-top: 0; padding: 2px 8px; font-size: 9px; letter-spacing: .14em; }
    #character-select .fs-roster { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: clamp(112px, 25vw, 150px); gap: 10px; padding: 4px 10px 8px; align-content: center; align-items: center; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-behavior: smooth; scroll-snap-type: x proximity; }
    #character-select .fs-card { aspect-ratio: 4 / 5; min-height: 0; scroll-snap-align: center; }
    #character-select .fs-portrait { object-position: 50% 14%; }
    #character-select .fs-nameplate { bottom: 4px; padding: 2px 7px 3px; max-width: calc(100% - 8px); font-size: clamp(10px, 2.7vh, 13px); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; }
    #character-select .fs-pickbadge { top: 4px; right: 4px; width: 24px; height: 24px; font-size: 11px; }
    #character-select .fs-wild-mark { font-size: clamp(48px, 18vh, 72px); }
    #character-select .fs-dock { grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 8px; margin: 0 8px 6px; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); }
    #character-select .fs-pick-card { min-height: 42px; padding: 5px 8px; gap: 8px; }
    #character-select .fs-pick-thumb, #character-select .fs-pick-thumb-empty { width: 32px; height: 32px; border-radius: 6px; }
    #character-select .fs-pick-name { font-size: clamp(14px, 4vh, 18px); }
    #character-select .fs-pick-hint { font-size: 8px; letter-spacing: .1em; margin-top: 1px; }
    #character-select .fs-confirm-btn { min-width: 148px; padding: 8px 12px; font-size: clamp(15px, 4.1vh, 18px); letter-spacing: .08em; }
    #character-select .fs-back-btn { top: max(6px, env(safe-area-inset-top)); left: 8px; width: 32px; height: 32px; }
  }
  @media (min-width: 1100px) {
    #character-select .fs-roster { grid-template-columns: repeat(4, 1fr); width: 100%; max-width: 1280px; margin-inline: auto; }
    #character-select .fs-topbar { width: 100%; max-width: 1280px; margin-inline: auto; }
    #character-select .fs-dock { width: 100%; max-width: 1280px; margin-inline: auto; }
    #character-select .fs-title { font-size: 64px; }
  }
  @media (prefers-reduced-motion: reduce) {
    #character-select .fs-card, #character-select .fs-card::before, #character-select .fs-card::after { animation: none !important; transition-duration: .01ms !important; }
  }
