﻿:root {
      --sidebar-width: 250px;
      --rightbar-width: 320px;
      --panel-bg: #141a28;
      --panel-accent: #2f9ff3;
      --text-main: #ecf3ff;
      --text-sub: #abc2e8;
      --bg-main: #0b0f18;
    }

    * { box-sizing: border-box; }

    html, body, button {
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      user-select: none;
      touch-action: manipulation;
    }
    html, body {
      margin: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: radial-gradient(circle at 20% 20%, #1b2740 0%, var(--bg-main) 62%);
      color: var(--text-main);
      font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
    }

    #app { display: flex; width: 100%; height: 100%; }

    #sidebar {
      width: var(--sidebar-width);
      flex: 0 0 var(--sidebar-width);
      background: linear-gradient(180deg, #202a41 0%, var(--panel-bg) 100%);
      border-right: 1px solid rgba(130, 178, 245, 0.22);
      padding: 10px;
      overflow-y: auto;
      z-index: 8;
    }

    #sidebar h1 {
      margin: 2px 4px 10px;
      font-size: 16px;
      letter-spacing: 0.04em;
      color: #f4f8ff;
    }

    #sidebar .help {
      margin: 0 4px 10px;
      font-size: 12px;
      line-height: 1.45;
      color: var(--text-sub);
    }

    #charList { display: grid; grid-template-columns: 1fr; gap: 8px; }

    .char-item {
      display: flex;
      align-items: center;
      gap: 8px;
      border: 1px solid rgba(125, 164, 220, 0.28);
      border-radius: 10px;
      padding: 6px;
      background: rgba(18, 24, 36, 0.7);
      color: var(--text-main);
      cursor: pointer;
      transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
      text-align: left;
    }

    .char-item:hover {
      transform: translateY(-1px);
      border-color: #7ec4ff;
      background: rgba(35, 52, 84, 0.9);
    }

    .char-item.active {
      border-color: var(--panel-accent);
      background: rgba(39, 82, 132, 0.95);
      box-shadow: 0 0 0 1px rgba(73, 176, 255, 0.35) inset;
    }

    .char-item img {
      width: 50px;
      height: 50px;
      object-fit: contain;
      border-radius: 6px;
      background: rgba(0, 0, 0, 0.18);
    }

    .char-item .name { font-size: 13px; line-height: 1.2; word-break: break-all; }

    #gameWrap { position: relative; flex: 1; min-width: 0; min-height: 0; }

    canvas { width: 100%; height: 100%; display: block; background: #000; touch-action: none; }
    #hud { display: none !important;
      position: absolute;
      left: 12px;
      top: 10px;
      padding: 8px 10px;
      border-radius: 10px;
      background: rgba(5, 11, 20, 0.64);
      border: 1px solid rgba(127, 175, 255, 0.34);
      font-size: 12px;
      line-height: 1.45;
      pointer-events: none;
      color: #e8f2ff;
      text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
      max-width: min(560px, 90vw);
      z-index: 4;
    }

    .stage-nav {
      position: absolute;
      bottom: 8px;
      width: 48px;
      height: 42px;
      border: 1px solid rgba(160, 206, 255, 0.5);
      border-radius: 10px;
      background: rgba(8, 16, 34, 0.72);
      color: #dff1ff;
      font-size: 24px;
      line-height: 1;
      cursor: pointer;
      display: none;
      z-index: 4;
      backdrop-filter: blur(6px);
    }

    .stage-nav.show { display: block; }
    #navLeft { left: 8px; }
    #navRight { right: 8px; }

    #entityPanel {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 100vw;
      width: 0;
      background: linear-gradient(180deg, #1b2437 0%, #121a2b 100%);
      border-left: 1px solid rgba(130, 178, 245, 0.22);
      padding: 10px;
      overflow-y: auto;
      font-size: 12px;
      z-index: 6;
      transition: transform 0.28s ease, opacity 0.28s ease;
    }

    .panel-title {
      color: #d8ebff;
      font-size: 13px;
      margin: 8px 0;
      letter-spacing: 0.04em;
    }

    #stageSelectSection {
      margin-bottom: 8px;
    }

    #stageSelector {
      width: 100%;
      border: 1px solid rgba(146, 196, 255, 0.48);
      border-radius: 8px;
      color: #e7f2ff;
      background: rgba(24, 52, 95, 0.8);
      padding: 7px 8px;
      font-size: 12px;
      outline: none;
    }

    #stageSelector:focus {
      border-color: #7ec4ff;
      box-shadow: 0 0 0 1px rgba(126, 196, 255, 0.35) inset;
    }

    #entityPanel .entity-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      border: 1px solid rgba(113, 149, 206, 0.36);
      border-radius: 8px;
      padding: 6px;
      margin-bottom: 6px;
      background: rgba(17, 30, 56, 0.58);
    }

    #entityPanel .entity-row.state-danger {
      border-color: rgba(255, 120, 120, 0.65);
      box-shadow: 0 0 0 1px rgba(255, 92, 92, 0.22) inset;
    }

    #entityPanel .entity-row.state-spectator {
      opacity: 0.76;
      border-color: rgba(168, 186, 220, 0.5);
    }

    #entityPanel .entity-name {
      flex: 1;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: #ecf4ff;
    }

    #entityPanel .badge {
      font-size: 11px;
      color: #9ec9ff;
      border: 1px solid rgba(130, 178, 245, 0.45);
      border-radius: 999px;
      padding: 1px 6px;
      margin-left: auto;
    }

    #entityPanel .hp-wrap {
      width: 100%;
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 8px;
    }

    #entityPanel .hp-bar {
      position: relative;
      height: 9px;
      border-radius: 999px;
      overflow: hidden;
      border: 1px solid rgba(171, 205, 248, 0.4);
      background: rgba(6, 12, 24, 0.7);
    }

    #entityPanel .hp-fill {
      width: 100%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #4de067, #9cf472);
      transition: width 0.35s ease, filter 0.25s ease;
    }

    #entityPanel .entity-row.state-danger .hp-fill {
      background: linear-gradient(90deg, #ff5252, #ff9a6a);
      animation: hpDangerPulse 0.9s ease-in-out infinite;
    }

    #entityPanel .entity-row.state-spectator .hp-fill {
      background: linear-gradient(90deg, #9db1ca, #c2d0e2);
    }

    #entityPanel .hp-text {
      min-width: 72px;
      text-align: right;
      font-size: 11px;
      color: #d5e6ff;
      font-variant-numeric: tabular-nums;
    }

    @keyframes hpDangerPulse {
      0% { filter: brightness(1); }
      50% { filter: brightness(1.28); }
      100% { filter: brightness(1); }
    }

    .action-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
      margin-bottom: 8px;
    }

    .action-btn {
      position: relative;
      overflow: visible;
      border: 1px solid rgba(146, 196, 255, 0.48);
      border-radius: 8px;
      color: #e7f2ff;
      background:
        linear-gradient(90deg,
          rgba(24, 52, 95, 0.86) 0% 49.4%,
          rgba(168, 210, 255, 0.45) 49.4% 50.6%,
          rgba(24, 52, 95, 0.86) 50.6% 100%);
      padding: 6px 22px;
      margin-bottom: 8px;
      cursor: pointer;
      font-size: 12px;
      text-align: center;
      -webkit-user-select: none;
      user-select: none;
      -webkit-touch-callout: none;
      touch-action: manipulation;
      --cd-long-pct: 0%;
    }

    /* 長押しCD専用の細ゲージ（ボタン下） */
    .action-btn::before {
      content: "";
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: -6px;
      height: 4px;
      border-radius: 999px;
      background:
        linear-gradient(90deg, rgba(255, 197, 116, 0.96) 0 var(--cd-long-pct), rgba(0, 0, 0, 0) var(--cd-long-pct) 100%),
        rgba(7, 14, 30, 0.86);
      border: 1px solid rgba(196, 158, 102, 0.48);
      opacity: 0;
      transition: opacity 0.14s ease;
      pointer-events: none;
    }

    .action-btn.long-cooldown::before {
      opacity: 1;
    }

    .action-btn.holding {
      box-shadow: 0 0 0 1px rgba(122, 214, 255, 0.6) inset;
      background:
        linear-gradient(90deg,
          rgba(120, 210, 255, 0.36) 0 var(--hold-progress, 0%),
          rgba(6, 16, 36, 0) var(--hold-progress, 0%) 100%),
        linear-gradient(90deg,
          rgba(24, 52, 95, 0.86) 0% 49.4%,
          rgba(168, 210, 255, 0.45) 49.4% 50.6%,
          rgba(24, 52, 95, 0.86) 50.6% 100%);
    }

    .action-btn.cooldown {
      filter: saturate(0.7) brightness(0.85);
      border-color: rgba(180, 210, 255, 0.62);
    }

    /* 通常CDは従来どおりボタン上オーバーレイ表示 */
    .action-btn.cooldown::after {
      content: attr(data-cd);
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(6, 12, 26, 0.52);
      color: #e8f2ff;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.04em;
      pointer-events: none;
    }

    #entityPanel .entity-actions {
      width: 100%;
      display: flex;
      gap: 6px;
      justify-content: flex-end;
    }

    #entityPanel .op {
      border: 1px solid rgba(146, 196, 255, 0.48);
      border-radius: 6px;
      color: #e7f2ff;
      background: rgba(24, 52, 95, 0.8);
      padding: 4px 6px;
      cursor: pointer;
      font-size: 11px;
    }

    #entityPanel .op.revive {
      border-color: rgba(132, 255, 190, 0.6);
      background: rgba(26, 89, 60, 0.72);
    }

    #entityPanel .op.del {
      border-color: rgba(255, 152, 152, 0.55);
      background: rgba(110, 22, 30, 0.72);
    }

    .speech-log {
      border: 1px solid rgba(113, 149, 206, 0.36);
      border-radius: 8px;
      background: rgba(9, 17, 33, 0.72);
      min-height: 110px;
      max-height: 34vh;
      overflow-y: auto;
      padding: 6px;
    }

    .speech-line {
      font-size: 12px;
      line-height: 1.35;
      color: #d8e7ff;
      padding: 4px 2px;
      border-bottom: 1px solid rgba(120, 150, 210, 0.2);
    }

    .speech-line:last-child { border-bottom: none; }

    #mobileToggles {
      display: none;
      position: absolute;
      top: 10px;
      right: 10px;
      z-index: 9;
      gap: 6px;
    }

    .mobile-toggle-btn {
      border: 1px solid rgba(146, 196, 255, 0.48);
      border-radius: 8px;
      color: #e7f2ff;
      background: rgba(12, 26, 50, 0.82);
      padding: 6px 9px;
      font-size: 12px;
      cursor: pointer;
    }

    #mobileActionOverlay {
      display: none;
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      z-index: 9;
      border: 1px solid rgba(130, 178, 245, 0.35);
      border-radius: 10px;
      background: rgba(8, 16, 32, 0.8);
      backdrop-filter: blur(6px);
      padding: 8px;
    }

    #mobileActionOverlay .speech-log {
      max-height: 18vh;
      min-height: 72px;
    }

    @media (max-width: 900px) {
      #mobileToggles { display: flex; }
      #sidebar { padding-bottom: 180px; }

      #sidebar,
      #entityPanel {
        top: 0;
        bottom: 0;
        width: min(82vw, 320px) !important;
      }

      #sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        opacity: 0.98;
        transition: transform 0.28s ease;
      }

      #entityPanel {
        right: 0;
        left: auto !important;
        transform: translateX(100%);
        opacity: 0.98;
        transition: transform 0.28s ease;
      }

      body.show-left-sidebar #sidebar { transform: translateX(0); }
      body.show-right-sidebar #entityPanel { transform: translateX(0); }
    }

    body.use-action-overlay #mobileActionOverlay { display: block; }

    @media (max-width: 900px) and (orientation: portrait) {
      #sidebar { padding-bottom: 250px; }
      #entityPanel .desktop-only { display: none; }
      #mobileActionOverlay { display: block; }
    }
    @media (max-width: 1200px) and (orientation: landscape) {
      #entityPanel .desktop-only { display: none; }
      #mobileActionOverlay {
        display: grid !important;
        grid-template-columns: 42% 58% !important;
        grid-template-areas:
          "op-title log-title"
          "op-grid  log-box";
        column-gap: 8px;
        row-gap: 2px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(99vw, 1200px);
        bottom: -10px;
        padding: 2px 6px 8px;
        border-radius: 8px 8px 0 0;
        background: rgba(8, 16, 32, 0.4);
        border-color: rgba(130, 178, 245, 0.26);
      }
      #mobileActionOverlay .panel-title {
        margin: 0;
        font-size: 10px;
        line-height: 1.1;
      }
      #mobileActionOverlay .panel-title:nth-of-type(1) { grid-area: op-title !important; }
      #mobileActionOverlay .panel-title:nth-of-type(2) { grid-area: log-title !important; }
      #mobileActionOverlay .action-grid {
        grid-area: op-grid !important;
        margin: 0;
        gap: 3px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
      #mobileActionOverlay .action-btn {
        padding: 2px 5px;
        font-size: 10px;
        line-height: 1.1;
      }
      #mobileActionOverlay .speech-log {
        grid-area: log-box !important;
        max-height: 9vh;
        min-height: 44px;
        padding: 4px;
      }
      #mobileActionOverlay .speech-line {
        font-size: 10px;
        padding: 2px 1px;
      }
    }
@media (max-width: 900px) {
      #mobileActionOverlay .panel-title {
        margin: 4px 0;
        font-size: 12px;
      }
      #mobileActionOverlay .action-grid {
        gap: 4px;
        margin-bottom: 4px;
      }
      #mobileActionOverlay .action-btn {
        padding: 4px 6px;
        font-size: 11px;
      }
      #mobileActionOverlay .speech-log {
        max-height: 9vh;
        min-height: 44px;
      }
    }






/* ===== Start Screen ===== */
#startScreen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
}

#startScreen.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.start-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 20%, rgba(74, 130, 207, 0.38), transparent 42%),
    radial-gradient(circle at 78% 80%, rgba(101, 163, 255, 0.22), transparent 44%),
    linear-gradient(180deg, #0f1b34 0%, #0a1122 62%, #0a1020 100%);
}

.start-card {
  position: relative;
  width: min(760px, 92vw);
  border: 1px solid rgba(144, 198, 255, 0.34);
  border-radius: 20px;
  padding: 24px 24px 22px;
  background: linear-gradient(180deg, rgba(18, 33, 62, 0.9), rgba(10, 18, 34, 0.92));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(100, 176, 255, 0.16) inset;
  backdrop-filter: blur(8px);
}

#startLogo {
  display: block;
  width: min(540px, 84vw);
  max-height: 180px;
  object-fit: contain;
  margin: 0 auto 8px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}

.start-card h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: 0.06em;
  color: #edf6ff;
}

.start-lead {
  margin: 8px 0 16px;
  text-align: center;
  color: #b4ccf0;
  font-size: 14px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.mode-tab {
  border: 1px solid rgba(146, 196, 255, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  color: #e8f3ff;
  background: rgba(20, 41, 76, 0.8);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.mode-tab:hover {
  transform: translateY(-1px);
  border-color: #7ec4ff;
}

.mode-tab.active {
  border-color: #6fd0ff;
  background: linear-gradient(180deg, rgba(42, 92, 160, 0.95), rgba(28, 63, 112, 0.95));
  box-shadow: 0 0 0 1px rgba(120, 196, 255, 0.32) inset;
}

.stadium-setup {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.stadium-setup label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #b5c8e8;
}

.stadium-setup select {
  width: 100%;
  border: 1px solid rgba(146, 196, 255, 0.48);
  border-radius: 8px;
  color: #e7f2ff;
  background: rgba(24, 52, 95, 0.88);
  padding: 7px 8px;
  font-size: 12px;
  outline: none;
}

.start-game-btn {
  width: 100%;
  border: 1px solid rgba(161, 219, 255, 0.7);
  border-radius: 12px;
  background: linear-gradient(180deg, #2e86d9, #225fa0);
  color: #f3f9ff;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 14px;
  cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 20px rgba(20, 62, 104, 0.4);
}

.start-game-btn:hover {
  filter: brightness(1.08);
}

@media (max-width: 860px) {
  .stadium-setup {
    grid-template-columns: 1fr;
  }
}

/* Start screen slot cards */
.start-lead { display: none; }

.stadium-setup {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.slot-card {
  border: 1px solid rgba(129, 184, 245, 0.36);
  border-radius: 12px;
  padding: 10px;
  background: rgba(14, 28, 53, 0.72);
  display: grid;
  gap: 8px;
}

.slot-title {
  font-size: 13px;
  font-weight: 700;
  color: #eaf4ff;
  letter-spacing: 0.05em;
}

.slot-preview {
  width: 100%;
  height: 86px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(120, 176, 240, 0.32);
  background: linear-gradient(180deg, rgba(9, 16, 30, 0.9), rgba(10, 22, 45, 0.9));
}

.icon-help-btn {
  position: sticky;
  top: 8px;
  margin-left: auto;
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(158, 205, 255, 0.62);
  background: rgba(22, 46, 84, 0.9);
  color: #e7f2ff;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
}

.combat-help-box {
  border: 1px solid rgba(130, 178, 245, 0.35);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 10px;
  background: rgba(10, 18, 35, 0.88);
}

.help-lines {
  display: grid;
  gap: 4px;
  color: #d9ebff;
  font-size: 12px;
  line-height: 1.45;
}

.help-close-btn {
  margin-top: 8px;
  width: 100%;
  border: 1px solid rgba(146, 196, 255, 0.48);
  border-radius: 8px;
  color: #e7f2ff;
  background: rgba(24, 52, 95, 0.8);
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

/* ===== Start Screen: Fighting Style Override ===== */
.start-fg-card {
  width: min(1180px, 96vw);
  max-height: calc(100vh - 24px);
  padding: 16px 16px 18px;
  border-radius: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
}

.fg-header {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.start-fg-card #startLogo {
  width: min(520px, 78vw);
  max-height: 130px;
  margin: 0;
}

.fg-versus-board {
  display: grid !important;
  grid-template-columns: minmax(280px, 1fr) 180px minmax(280px, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
}

.slot-card {
  border: 1px solid rgba(129, 184, 245, 0.38);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(16, 30, 56, 0.92), rgba(10, 20, 38, 0.94));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3) inset;
}

.slot-title {
  font-size: 15px;
  text-shadow: 0 0 12px rgba(91, 182, 255, 0.45);
}

.slot-preview {
  height: 120px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 35%, rgba(74, 130, 207, 0.25), transparent 68%),
    linear-gradient(180deg, rgba(6, 14, 28, 0.96), rgba(8, 18, 34, 0.95));
}

.versus-center {
  display: grid;
  gap: 12px;
  justify-items: center;
  align-content: center;
  padding-top: 30px;
}

.vs-emblem {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  border: 2px solid rgba(164, 219, 255, 0.75);
  display: grid;
  place-items: center;
  color: #f3f9ff;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background:
    radial-gradient(circle at 35% 30%, rgba(86, 165, 245, 0.7), rgba(30, 73, 131, 0.92));
  box-shadow:
    0 0 0 3px rgba(106, 180, 255, 0.28) inset,
    0 10px 22px rgba(6, 20, 40, 0.65);
}

.start-game-btn {
  min-height: 50px;
  font-size: 15px;
}

.start-mobile-start-wrap {
  display: none;
  margin-top: 10px;
}

.start-roster {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 2px;
  padding-bottom: 8px;
}

.start-roster-btn {
  border: 1px solid rgba(126, 176, 236, 0.45);
  border-radius: 8px;
  padding: 4px 2px;
  background: rgba(9, 18, 34, 0.78);
  color: #d9ebff;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease, background-color 0.15s ease;
}

.start-roster-btn:hover {
  transform: translateY(-1px);
  border-color: #7ec4ff;
}

.start-roster-btn.active {
  border-color: #68ccff;
  background: rgba(31, 72, 128, 0.9);
  box-shadow: 0 0 0 1px rgba(113, 202, 255, 0.35) inset;
}

.start-roster-btn img {
  width: 100%;
  height: 36px;
  object-fit: contain;
  display: block;
}

.start-roster-btn .n {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#startScreen.play-mode .stadium-only {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.35);
}

#startScreen.play-mode .vs-emblem {
  opacity: 0.65;
}

@media (max-width: 1000px) {
  .fg-versus-board {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .versus-center {
    order: 3;
    grid-template-columns: 90px 1fr;
    grid-template-areas: "vs start";
    align-items: center;
    justify-items: stretch;
    padding-top: 0;
  }

  .vs-emblem {
    grid-area: vs;
    width: 90px;
    height: 90px;
    font-size: 30px;
    justify-self: center;
  }

  .versus-center .start-game-btn {
    grid-area: start;
  }

  .start-roster {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .start-fg-card {
    width: 100%;
    max-height: calc(100vh - 12px);
    border-radius: 12px;
    padding: 10px 10px 14px;
    overflow-y: auto;
  }

  .start-fg-card #startLogo {
    width: min(88vw, 460px);
    max-height: 96px;
  }

  .mode-tabs {
    gap: 6px;
    margin-bottom: 8px;
  }

  .mode-tab {
    padding: 9px 8px;
    font-size: 13px;
  }

  .slot-preview {
    height: 90px;
  }

  .start-roster {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .start-roster-btn img {
    height: 30px;
  }

  .start-mobile-start-wrap {
    display: block;
  }

  .versus-center .start-game-btn {
    display: none;
  }

  #startScreen.play-mode .stadium-only {
    display: none;
  }
}

#startScreen {
  padding: 12px;
}

.start-fg-card::-webkit-scrollbar {
  width: 10px;
}

.start-fg-card::-webkit-scrollbar-track {
  background: rgba(10, 22, 44, 0.55);
  border-radius: 999px;
}

.start-fg-card::-webkit-scrollbar-thumb {
  background: rgba(98, 169, 245, 0.65);
  border-radius: 999px;
  border: 2px solid rgba(9, 22, 45, 0.8);
}









/* Online setup */
.online-setup {
  margin-top: 14px;
  border: 1px solid rgba(122, 183, 255, 0.28);
  border-radius: 14px;
  padding: 12px;
  background: rgba(9, 19, 43, 0.75);
}
.online-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.online-head label,
.online-form label {
  display: grid;
  gap: 5px;
  color: #cddfff;
  font-size: 13px;
}
.online-head input,
.online-form input,
.online-roomlist-wrap select {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(122, 183, 255, 0.35);
  background: rgba(19, 44, 87, 0.72);
  color: #eaf2ff;
  padding: 0 10px;
}
.online-btn {
  height: 38px;
  min-width: 120px;
  border-radius: 10px;
  border: 1px solid rgba(122, 183, 255, 0.45);
  background: linear-gradient(180deg, rgba(66, 135, 219, 0.9), rgba(42, 90, 168, 0.9));
  color: #fff;
  cursor: pointer;
}
.online-role-tabs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.online-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.online-roomlist-wrap {
  display: grid;
  gap: 6px;
}
.online-room-info {
  margin-top: 10px;
  min-height: 20px;
  font-size: 13px;
  color: #cbe2ff;
}
#startScreen.online-mode .stadium-only {
  display: none !important;
}

.host-tools {
  margin-top: 10px;
  border: 1px solid rgba(122, 183, 255, 0.28);
  border-radius: 12px;
  padding: 10px;
  background: rgba(9, 19, 43, 0.68);
}
.host-tool-toggle {
  display: block;
  margin: 4px 0;
  font-size: 12px;
  color: #d5e7ff;
}
.host-coords {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(120, 184, 255, 0.35);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #d6e7ff;
  background: rgba(7, 18, 39, 0.72);
}
.host-command-guide {
  margin-top: 8px;
  font-size: 12px;
  color: #c9defa;
}
.host-command-guide summary {
  cursor: pointer;
  margin-bottom: 6px;
}
.host-command-box {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.host-command-box input {
  min-width: 0;
  height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(122, 183, 255, 0.35);
  background: rgba(19, 44, 87, 0.72);
  color: #eaf2ff;
  padding: 0 10px;
}
.host-ready-list {
  margin-top: 6px;
  border: 1px solid rgba(122, 183, 255, 0.35);
  border-radius: 8px;
  background: rgba(7, 18, 39, 0.62);
  padding: 6px;
  max-height: 120px;
  overflow: auto;
}
.host-ready-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #dbeaff;
  padding: 4px 2px;
  border-bottom: 1px solid rgba(122, 183, 255, 0.2);
}
.host-ready-item:last-child {
  border-bottom: none;
}
.host-ready-tag {
  font-size: 11px;
  border: 1px solid rgba(122, 183, 255, 0.45);
  border-radius: 999px;
  padding: 1px 6px;
  color: #d9ecff;
  background: rgba(24, 58, 106, 0.75);
}
.host-ready-tag.ready {
  border-color: rgba(96, 226, 138, 0.65);
  color: #dcffe7;
  background: rgba(24, 98, 55, 0.7);
}
.host-ready-tag.offline {
  border-color: rgba(172, 181, 198, 0.45);
  color: #d9deea;
  background: rgba(66, 74, 92, 0.6);
}
