/* RAI FOOTBALL v0.4 — Sovereign #336699 Hologram Stadium HUD, Tactics, Squad Editor & League/Cup UI
 * Compliant with UI-TEMA-KURALI.md (R1), CREATE GAME RULES (R19), and modern-web-guidance:
 * - Native <dialog> modals scoped with dialog[open], overscroll-behavior: contain on dialog:modal & ::backdrop
 * - Responsive @container sticky data tables for League Standings & 16-Player Squad Editor
 * - Brand-consistent native range sliders with separate WebKit & Firefox pseudo-element rules + progress() fallback
 */

@font-face {
  font-family: 'Orbitron';
  src: url('assets/orbitron.ttf') format('truetype');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --rai-blue: #336699;
  --rai-cyan: #79c5ff;
  --rai-mint: #4df0c0;
  --rai-gold: #ffd27d;
  --rai-crimson: #ef5368;
  --panel-bg: rgba(7, 19, 32, 0.84);
  --panel-deep: rgba(6, 15, 26, 0.94);
  --panel-border: rgba(121, 197, 255, 0.36);
  --text-main: #ecf6ff;
  --text-muted: #9ec0dd;
  --cursor-svg: url('assets/nexus-cursor.svg') 4 2, auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #061320;
  color: var(--text-main);
  font-family: 'Orbitron', system-ui, -apple-system, 'Segoe UI', sans-serif;
  cursor: var(--cursor-svg);
  -webkit-user-select: none;
  user-select: none;
}

input[type="text"],
input[type="number"] {
  -webkit-user-select: text;
  user-select: text;
}

button,
select,
input,
label,
summary {
  font-family: inherit;
  cursor: var(--cursor-svg);
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stadium-shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

#world-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  filter: brightness(var(--rai-brightness, 100%)) saturate(var(--rai-saturation, 105%));
}

.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(121, 197, 255, 0.025) 0px,
      rgba(121, 197, 255, 0.025) 1px,
      rgba(2, 8, 16, 0.06) 2px,
      rgba(2, 8, 16, 0.06) 4px
    );
  opacity: 0.42;
}

.crt-overlay.is-hidden {
  display: none;
}

/* ==================== TOP HUD ==================== */
.hud-top {
  position: absolute;
  inset-block-start: 10px;
  inset-inline: 12px;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.hud-left-stack,
.scoreboard-wrap,
.hud-right-stack {
  pointer-events: auto;
}

.hud-left-stack {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.radar-card,
.player-card,
.scoreboard,
.telemetry-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  backdrop-filter: blur(9px);
  box-shadow: 0 8px 24px rgba(2, 9, 18, 0.45);
}

.radar-card {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 11;
  padding: 7px 8px;
  width: 202px;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.radar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.radar-head strong {
  color: var(--rai-cyan);
  font-size: 9px;
}

#pitch-radar {
  display: block;
  width: 184px;
  height: 252px;
  border-radius: 7px;
  border: 1px solid rgba(121, 197, 255, 0.36);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.48);
}

.player-card {
  padding: 8px 10px;
  min-width: 168px;
}

.player-card-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
}

.pos-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  background: rgba(51, 102, 153, 0.65);
  border: 1px solid rgba(121, 197, 255, 0.55);
  color: #ffffff;
}

.mini-card-icon {
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 800;
  background: #ffe14d;
  color: #101620;
}

.meter-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
}

.mini-track {
  flex: 1;
  height: 5px;
  background: rgba(121, 197, 255, 0.14);
  border-radius: 99px;
  overflow: hidden;
}

.mini-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #336699, #79c5ff);
}

.mini-track.stamina i {
  background: linear-gradient(90deg, #27ae60, #4df0c0);
}

.mini-track.special i {
  background: linear-gradient(90deg, #d89b2b, #ffd27d);
}

.scoreboard-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.scoreboard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 13px;
}

.team-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kit-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #336699;
  border: 1.5px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 8px rgba(121, 197, 255, 0.45);
}

.team-meta-col {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.team-meta-col.is-right {
  align-items: flex-end;
}

.team-code {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.team-cards-mini {
  font-size: 9px;
  min-height: 10px;
  color: var(--rai-gold);
}

.score-num {
  font-size: 23px;
  font-weight: 900;
  min-width: 22px;
  text-align: center;
  color: #ffffff;
}

.clock-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-inline: 10px;
  border-inline: 1px solid rgba(121, 197, 255, 0.24);
}

.half-badge {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--rai-cyan);
}

.clock-num {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.camera-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.cam-chip,
.cam-pill,
.hud-mini-btn {
  appearance: none;
  background: rgba(12, 30, 48, 0.88);
  color: var(--text-main);
  border: 1px solid rgba(121, 197, 255, 0.34);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 140ms ease, border-color 140ms ease, transform 120ms ease;
}

.cam-chip:hover,
.cam-pill:hover,
.hud-mini-btn:hover {
  background: rgba(51, 102, 153, 0.56);
  border-color: var(--rai-cyan);
}

.cam-chip.is-active,
.cam-pill.is-active,
.hud-mini-btn.is-accent {
  background: linear-gradient(180deg, rgba(51, 102, 153, 0.92), rgba(28, 66, 104, 0.95));
  border-color: var(--rai-cyan);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(121, 197, 255, 0.32);
}

.hud-right-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.hud-actions-row {
  display: flex;
  gap: 5px;
}

.telemetry-card {
  padding: 7px 10px;
  width: 288px;
}

.power-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: var(--text-muted);
}

.power-label-row strong {
  color: var(--rai-mint);
  font-size: 9.5px;
  text-align: right;
}

.power-bar-track {
  height: 6px;
  margin-block: 5px;
  border-radius: 99px;
  background: rgba(121, 197, 255, 0.14);
  overflow: hidden;
}

.power-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #54b4ff, #4df0c0 65%, #ffd27d);
  transition: width 40ms linear;
}

.curve-badge {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--rai-cyan);
  text-align: center;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(20, 48, 76, 0.55);
}

.curve-badge.is-live {
  background: rgba(255, 210, 125, 0.24);
  color: #ffe89e;
  border: 1px solid rgba(255, 210, 125, 0.62);
}

/* ==================== BANNERS & POST-MATCH BAR ==================== */
.center-banner {
  position: absolute;
  inset-block-start: 20%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 12;
  padding: 10px 22px;
  border-radius: 12px;
  background: rgba(6, 18, 32, 0.92);
  border: 1.5px solid var(--rai-cyan);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.58), 0 0 22px rgba(121, 197, 255, 0.35);
  font-size: clamp(13px, 1.9vw, 22px);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
}

.center-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.post-match-bar {
  position: absolute;
  inset-block-end: 52px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--panel-deep);
  border: 1.5px solid var(--rai-gold);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
}

.post-match-bar[hidden] {
  display: none;
}

.post-match-actions {
  display: flex;
  gap: 8px;
}

/* ==================== BOTTOM PURE SENSIBLE STRIP ==================== */
.controls-bar {
  position: absolute;
  left: 226px;
  right: 14px;
  bottom: 12px;
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(6, 16, 28, 0.82);
  border: 1px solid rgba(121, 197, 255, 0.25);
  font-size: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(51, 102, 153, 0.48);
  border: 1px solid rgba(121, 197, 255, 0.52);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
}

/* ==================== DIRECTIONAL VIEW TRANSITIONS (modern-web-guidance) ==================== */
@keyframes swos-slide-from-right {
  from { opacity: 0.35; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes swos-slide-to-left {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0.25; transform: translateX(-28px); }
}
@keyframes swos-slide-from-left {
  from { opacity: 0.35; transform: translateX(-28px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes swos-slide-to-right {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0.25; transform: translateX(28px); }
}

html:active-view-transition-type(forward)::view-transition-old(root) {
  animation: 190ms cubic-bezier(0.22, 1, 0.36, 1) both swos-slide-to-left;
}
html:active-view-transition-type(forward)::view-transition-new(root) {
  animation: 210ms cubic-bezier(0.22, 1, 0.36, 1) both swos-slide-from-right;
}
html:active-view-transition-type(backward)::view-transition-old(root) {
  animation: 190ms cubic-bezier(0.22, 1, 0.36, 1) both swos-slide-to-right;
}
html:active-view-transition-type(backward)::view-transition-new(root) {
  animation: 210ms cubic-bezier(0.22, 1, 0.36, 1) both swos-slide-from-left;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(root),
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

/* Hide live match HUD cleanly while Intro or SWOS Menu is open */
.stadium-shell:is(.is-menu-open, .is-intro-open) :is(.hud-top, .radar-card, .controls-bar) {
  opacity: 0;
  pointer-events: none;
}

/* ==================== OPENING INTRO: RAI NEXUS PRESENTS ==================== */
@keyframes intro-hero-kenburns {
  from { transform: scale(1.045); }
  to { transform: scale(1.0); }
}

@keyframes intro-badge-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes intro-title-reveal {
  0%, 24% { opacity: 0; transform: translateY(18px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 36;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.4vw, 18px);
  background:
    radial-gradient(circle at 50% 42%, rgba(16, 46, 108, 0.78) 0%, rgba(2, 6, 22, 0.97) 74%),
    #020618;
  transition: opacity 340ms ease, transform 340ms ease;
}

.intro-overlay.is-closing {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.intro-overlay.is-hidden {
  display: none;
}

.intro-stage {
  width: min(1480px, 95vw);
  max-height: 95dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intro-art-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(95dvh - 58px);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(121, 197, 255, 0.72);
  box-shadow:
    0 26px 72px rgba(0, 0, 0, 0.90),
    0 0 42px rgba(51, 102, 153, 0.65),
    inset 0 0 0 1px rgba(255, 210, 125, 0.25);
  background: #030920;
}

.intro-hero-img,
.intro-hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-floodlight-beams {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 38% 48% at 50% 52%, rgba(4, 15, 42, 0.56) 0%, rgba(4, 15, 42, 0.0) 76%),
    conic-gradient(from 135deg at 10% 10%, rgba(121, 197, 255, 0.14) 0deg, transparent 34deg),
    conic-gradient(from 200deg at 90% 10%, rgba(255, 210, 125, 0.14) 0deg, transparent 34deg);
}

.intro-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0px,
    rgba(255, 255, 255, 0.018) 1px,
    rgba(2, 6, 20, 0.20) 2px,
    rgba(2, 6, 20, 0.20) 4px
  );
}

.intro-copy-overlay {
  position: absolute;
  inset: 0;
  padding: clamp(14px, 2.2vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.intro-presents-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(12, 34, 78, 0.94), rgba(5, 16, 40, 0.94));
  border: 1.5px solid rgba(255, 210, 125, 0.78);
  box-shadow: 0 0 22px rgba(77, 184, 255, 0.45), 0 4px 12px rgba(0, 0, 0, 0.7);
  font-size: clamp(9.5px, 1.0vw, 12.5px);
  font-weight: 900;
  letter-spacing: 0.22em;
  color: #fff3d1;
  animation: intro-badge-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-crest-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(77, 184, 255, 0.8));
}

.intro-title-stack {
  margin-top: clamp(8px, 1.2vw, 16px);
  width: min(560px, 46%);
  padding: clamp(10px, 1.5vw, 20px) clamp(14px, 2vw, 26px);
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 45%, rgba(6, 20, 52, 0.82) 0%, rgba(3, 10, 28, 0.68) 100%);
  border: 1px solid rgba(121, 197, 255, 0.36);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.68), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(4px);
  animation: intro-title-reveal 980ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-kicker-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.intro-wing-line {
  width: clamp(18px, 3vw, 44px);
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffd27d);
}

.intro-wing-line.is-right {
  background: linear-gradient(90deg, #ffd27d, transparent);
}

.intro-kicker-line {
  font-size: clamp(8.5px, 0.88vw, 11px);
  font-weight: 900;
  letter-spacing: 0.20em;
  color: #ffd875;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

.intro-main-logo {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.96;
}

.intro-nexus-super {
  font-size: clamp(28px, 4.4vw, 62px);
  font-weight: 900;
  letter-spacing: 0.14em;
  padding-left: 0.14em;
  background: linear-gradient(180deg, #fff8dc 0%, #ffd466 28%, #ffffff 50%, #63c2ff 74%, #2557b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(18, 48, 108, 0.85);
  filter:
    drop-shadow(0 2px 0 #0a1f4d)
    drop-shadow(0 4px 0 #050e26)
    drop-shadow(0 8px 20px rgba(51, 132, 255, 0.55));
}

.intro-world-row {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.intro-chevron-wing {
  width: clamp(22px, 3.2vw, 46px);
  height: 4px;
  border-top: 1.5px solid #79c5ff;
  border-bottom: 1.5px solid #ffd27d;
  transform: skewX(-28deg);
  opacity: 0.9;
}

.intro-chevron-wing.is-right {
  transform: skewX(28deg);
}

.intro-world-of {
  font-size: clamp(13px, 1.75vw, 24px);
  font-weight: 900;
  letter-spacing: 0.34em;
  padding-left: 0.34em;
  color: #f4f9ff;
  text-shadow: 0 2px 0 #061333, 0 4px 12px rgba(0, 0, 0, 0.95);
}

.intro-football-row {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.intro-football-word {
  white-space: nowrap;
  font-size: clamp(26px, 4.1vw, 58px);
  font-weight: 900;
  letter-spacing: 0.05em;
  background: repeating-linear-gradient(
    to bottom,
    #ffffff 0px,
    #ffffff 3px,
    #9ec8ff 3px,
    #9ec8ff 6px
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2.5px #d41932;
  filter:
    drop-shadow(0 3px 0 #6b0716)
    drop-shadow(0 5px 0 #2e030a)
    drop-shadow(0 10px 24px rgba(0, 0, 0, 0.92));
}

.intro-v5-chip {
  font-style: normal;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 9px 4px;
  border-radius: 7px;
  background: linear-gradient(180deg, #d11d36 0%, #780816 100%);
  border: 2px solid #ffd27d;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #ffffff;
  line-height: 1;
}

.intro-v5-top {
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #ffe29e;
}

.intro-v5-num {
  font-size: clamp(13px, 1.6vw, 21px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.intro-feature-pills {
  margin-top: clamp(8px, 1.2vw, 14px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.intro-feat-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(11, 34, 78, 0.85);
  border: 1px solid rgba(121, 197, 255, 0.42);
  font-size: clamp(8px, 0.78vw, 10.5px);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #dceeff;
}

.intro-footer-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.intro-progress-track {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(121, 197, 255, 0.18);
  overflow: hidden;
}

.intro-progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #336699, #79c5ff 55%, #ffd27d);
  transform-origin: center center;
  transform: scaleX(1);
}

.intro-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.intro-audio-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.intro-chant-btn {
  appearance: none;
  padding: 7px 13px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(16, 48, 104, 0.94), rgba(7, 22, 54, 0.94));
  border: 1.5px solid rgba(121, 197, 255, 0.68);
  color: #eaf5ff;
  font: inherit;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.intro-chant-btn:hover,
.intro-chant-btn:focus-visible {
  border-color: #ffd27d;
  box-shadow: inset 0 0 0 1px #ffd27d;
  outline: none;
}

.intro-chant-btn.is-muted {
  opacity: 0.74;
  border-color: rgba(160, 185, 220, 0.42);
}

.intro-enter-btn {
  min-width: 270px;
}

.intro-hint-text {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* ==================== SENSIBLE WORLD OF SOCCER v5 MENU OVERLAY ==================== */
.menu-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  overflow-y: auto;
  isolation: isolate;
}

.menu-overlay.is-hidden {
  display: none;
}

.swos-menu-bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #02061c;
  background-image: url('assets/menu-bg-swos.png?v=050');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}

.swos-menu-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-overlay.swos-backdrop-live3d .swos-menu-bg-video {
  display: none;
}

/* Optional Backdrop Modes from SWOS OPTIONS */
.menu-overlay.swos-backdrop-amiga .swos-menu-bg-layer {
  background-image:
    radial-gradient(circle at 50% 48%, rgba(22, 64, 158, 0.42) 0%, rgba(3, 8, 32, 0.96) 62%),
    url('assets/menu-bg-swos.png?v=050');
  background-blend-mode: multiply;
}

.menu-overlay.swos-backdrop-live3d .swos-menu-bg-layer {
  background-image: radial-gradient(circle at 50% 50%, rgba(3, 10, 30, 0.62) 0%, rgba(2, 6, 20, 0.84) 100%);
  background-color: transparent;
}

.swos-menu-scanlines {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(120, 175, 255, 0.018) 0px,
      rgba(120, 175, 255, 0.018) 1px,
      rgba(1, 4, 16, 0.22) 2px,
      rgba(1, 4, 16, 0.22) 4px
    );
}

.swos-shell {
  width: min(920px, 100%);
  max-height: calc(100dvh - 20px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.swos-top-utility {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.swos-top-left,
.swos-top-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.swos-util-pill {
  appearance: none;
  padding: 5px 10px;
  border-radius: 5px;
  background: rgba(5, 16, 46, 0.86);
  border: 1px solid rgba(110, 176, 255, 0.44);
  color: #e4f2ff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.swos-util-pill:hover,
.swos-util-pill:focus-visible {
  background: rgba(24, 62, 128, 0.92);
  border-color: #ffffff;
  box-shadow: inset 0 0 0 1px #ffffff;
  outline: none;
}

.swos-util-pill.is-gold {
  background: linear-gradient(180deg, #a61b2e, #6f0d1b);
  border-color: #ffd27d;
  color: #ffffff;
}

.swos-status-pill {
  padding: 4px 9px;
  border-radius: 4px;
  background: rgba(4, 12, 36, 0.78);
  border: 1px solid rgba(82, 146, 232, 0.34);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9dc8ff;
}

.swos-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.swos-screen[hidden] {
  display: none !important;
}

/* ==================== 3-LINE SCULPTED CHAMPIONSHIP CREST HEADER ==================== */
.swos-logo-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-block: 0 10px;
  padding: 8px 26px 10px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(16, 48, 108, 0.72) 0%, rgba(4, 13, 36, 0.84) 76%);
  border: 1.5px solid rgba(121, 197, 255, 0.46);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.72),
    0 0 28px rgba(51, 102, 153, 0.38),
    inset 0 1px 0 rgba(255, 224, 150, 0.28);
  backdrop-filter: blur(5px);
  user-select: none;
}

.swos-brand-script {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 1px 16px 6px;
}

.swos-brand-script::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent 0%, #4db8ff 22%, #ffd86b 50%, #4db8ff 78%, transparent 100%);
  box-shadow: 0 0 10px rgba(77, 184, 255, 0.65);
}

.swos-horizon-jewel {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 9px;
  height: 9px;
  transform: translateX(-50%) rotate(45deg);
  background: #4db8ff;
  border: 1.5px solid #ffd86b;
  box-shadow: 0 0 10px #4db8ff;
  z-index: 2;
}

.swos-crown-wing {
  width: clamp(22px, 3vw, 42px);
  height: 5px;
  border-top: 2px solid #ffd86b;
  border-bottom: 1.5px solid #59b9ff;
  transform: skewX(-30deg);
  opacity: 0.92;
}

.swos-crown-wing.is-right {
  transform: skewX(30deg);
}

.swos-crest-star {
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255, 216, 107, 0.75));
}

.swos-script-rai {
  font-size: clamp(22px, 3.2vw, 36px);
  font-weight: 900;
  letter-spacing: 0.14em;
  padding-left: 0.14em;
  background: linear-gradient(
    180deg,
    #fff7d6 0%,
    #ffd45e 26%,
    #ffffff 50%,
    #6bc4ff 76%,
    #1f54b8 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(10, 28, 72, 0.75);
  filter:
    drop-shadow(0 2px 0 #07173d)
    drop-shadow(0 4px 12px rgba(51, 132, 255, 0.55));
}

.swos-world-of-plaque {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(12, 34, 80, 0.0), rgba(14, 42, 98, 0.85) 20%, rgba(14, 42, 98, 0.85) 80%, rgba(12, 34, 80, 0.0));
  border-block: 1px solid rgba(130, 198, 255, 0.38);
}

.swos-plaque-chevron {
  width: 18px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffd27d);
}

.swos-plaque-chevron.is-right {
  background: linear-gradient(90deg, #ffd27d, transparent);
}

.swos-world-of {
  font-size: clamp(12px, 1.65vw, 19px);
  font-weight: 900;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  background: linear-gradient(180deg, #ffffff 0%, #d9ecff 60%, #96c5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #050d28) drop-shadow(0 3px 8px rgba(0, 0, 0, 0.9));
}

.swos-soccer-wordmark {
  margin: 3px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 0.94;
}

.swos-word-football {
  font-size: clamp(34px, 5.4vw, 64px);
  font-weight: 900;
  letter-spacing: 0.06em;
  background: repeating-linear-gradient(
    to bottom,
    #ffffff 0px,
    #ffffff 3px,
    #dff0ff 3px,
    #82b7ff 6px
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2.8px #d41830;
  filter:
    drop-shadow(0 2px 0 #8a0b1d)
    drop-shadow(0 4px 0 #4d040f)
    drop-shadow(0 8px 20px rgba(0, 0, 0, 0.92));
}

.swos-v5-emblem {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 10px 4px;
  border-radius: 7px;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.09) 0 2px, rgba(0,0,0,0.20) 2px 4px),
    linear-gradient(180deg, #d61f38 0%, #7d0818 100%);
  border: 2px solid #ffd86b;
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.38);
  line-height: 1;
}

.swos-v5-sub {
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #ffe299;
}

.swos-v5-emblem strong {
  font-size: clamp(13px, 1.6vw, 19px);
  font-weight: 900;
  letter-spacing: 0.05em;
}

/* ==================== AUTHENTIC AMIGA RIBBED MENU BARS ==================== */
/* Strictly fixed dimensions on hover/focus per CREATE GAME RULES #3! */
.swos-main-nav {
  width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.swos-two-columns {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.swos-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.swos-bottom-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.swos-bar {
  appearance: none;
  position: relative;
  width: 100%;
  min-height: 44px;
  padding: 7px 14px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #f6fbff;
  border-top: 2px solid rgba(255, 255, 255, 0.38);
  border-left: 2px solid rgba(255, 255, 255, 0.28);
  border-right: 2px solid rgba(0, 0, 0, 0.72);
  border-bottom: 2px solid rgba(0, 0, 0, 0.82);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.62);
  transition: filter 100ms ease, box-shadow 100ms ease;
}

.swos-bar-blue {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(120, 175, 255, 0.10) 0px,
      rgba(120, 175, 255, 0.10) 2px,
      rgba(0, 4, 28, 0.48) 2px,
      rgba(0, 4, 28, 0.48) 4px
    ),
    linear-gradient(180deg, #0b1c84 0%, #050d58 100%);
}

.swos-bar-crimson {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 160, 175, 0.10) 0px,
      rgba(255, 160, 175, 0.10) 2px,
      rgba(28, 0, 6, 0.48) 2px,
      rgba(28, 0, 6, 0.48) 4px
    ),
    linear-gradient(180deg, #9e0b22 0%, #6e0414 100%);
}

.swos-bar-burnt {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 195, 140, 0.10) 0px,
      rgba(255, 195, 140, 0.10) 2px,
      rgba(28, 6, 0, 0.46) 2px,
      rgba(28, 6, 0, 0.46) 4px
    ),
    linear-gradient(180deg, #98280c 0%, #6c1805 100%);
}

.swos-bar-amber {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 228, 165, 0.12) 0px,
      rgba(255, 228, 165, 0.12) 2px,
      rgba(36, 14, 0, 0.44) 2px,
      rgba(36, 14, 0, 0.44) 4px
    ),
    linear-gradient(180deg, #c65a10 0%, #8f3c06 100%);
}

.swos-bar-rust {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 185, 145, 0.10) 0px,
      rgba(255, 185, 145, 0.10) 2px,
      rgba(30, 6, 0, 0.48) 2px,
      rgba(30, 6, 0, 0.48) 4px
    ),
    linear-gradient(180deg, #9c200d 0%, #6b1205 100%);
}

.swos-bar-steel {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(230, 240, 255, 0.10) 0px,
      rgba(230, 240, 255, 0.10) 2px,
      rgba(12, 16, 28, 0.46) 2px,
      rgba(12, 16, 28, 0.46) 4px
    ),
    linear-gradient(180deg, #4b5268 0%, #34394b 100%);
}

/* Authentic SWOS White Highlight Frame on Hover / Keyboard Focus (0px size shift!) */
.swos-bar:hover,
.swos-bar:focus-visible,
.swos-bar.is-focused {
  filter: brightness(1.14);
  box-shadow:
    inset 0 0 0 2px #ffffff,
    0 6px 18px rgba(0, 0, 0, 0.75),
    0 0 16px rgba(121, 197, 255, 0.35);
  outline: none;
}

.swos-bar-label {
  font-size: clamp(12px, 1.45vw, 15.5px);
  font-weight: 900;
  letter-spacing: 0.09em;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.85);
}

.swos-bar-sub {
  margin-top: 2px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: rgba(226, 242, 255, 0.82);
}

.swos-bar-career {
  width: min(372px, 100%);
}

.swos-bar-load {
  width: min(560px, 100%);
  min-height: 38px;
}

.swos-bar-compact {
  width: auto;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.swos-main-footer {
  margin-top: 10px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(185, 218, 255, 0.82);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  text-align: center;
}

/* ==================== SUB-SCREENS: STEEL HEADER + FRIENDLY 3-COL GRID ==================== */
.swos-header-bar {
  width: 100%;
  min-height: 40px;
  padding: 8px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(12px, 1.5vw, 15px);
  font-weight: 900;
  letter-spacing: 0.11em;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.8);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.11) 0px,
      rgba(255, 255, 255, 0.11) 2px,
      rgba(12, 16, 28, 0.42) 2px,
      rgba(12, 16, 28, 0.42) 4px
    ),
    linear-gradient(180deg, #5c637a 0%, #3f4558 100%);
  border-top: 2px solid rgba(255, 255, 255, 0.5);
  border-left: 2px solid rgba(255, 255, 255, 0.35);
  border-right: 2px solid rgba(0, 0, 0, 0.75);
  border-bottom: 2px solid rgba(0, 0, 0, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
}

.swos-region-strip {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.swos-region-pill {
  appearance: none;
  padding: 5px 10px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: #dbeaff;
  background: rgba(8, 22, 62, 0.86);
  border: 1px solid rgba(110, 175, 255, 0.4);
  border-radius: 3px;
}

.swos-region-pill:hover,
.swos-region-pill.is-active {
  background: linear-gradient(180deg, #163ca6, #0b2272);
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: inset 0 0 0 1px #ffffff;
}

/* Authentic SWOS Role Swatch Row (COMPUTER / PLAYER / MANAGER / 2P) */
.swos-role-legend-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.swos-role-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(5, 14, 42, 0.84);
  border: 1px solid rgba(125, 182, 255, 0.34);
  border-radius: 3px;
  color: #f0f7ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.swos-role-chip:hover,
.swos-role-chip.is-active {
  border-color: #ffffff;
  box-shadow: inset 0 0 0 1.5px #ffffff;
  background: rgba(18, 44, 102, 0.92);
}

.swos-swatch {
  display: inline-block;
  width: 28px;
  height: 15px;
  border-top: 1.5px solid rgba(255, 255, 255, 0.65);
  border-left: 1.5px solid rgba(255, 255, 255, 0.5);
  border-right: 1.5px solid rgba(0, 0, 0, 0.8);
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.85);
}

.swos-swatch-red {
  background: repeating-linear-gradient(to bottom, #e61626 0 2px, #a80814 2px 4px);
}
.swos-swatch-blue {
  background: repeating-linear-gradient(to bottom, #1638f0 0 2px, #0a1fa8 2px 4px);
}
.swos-swatch-manager {
  background: repeating-linear-gradient(to bottom, #84a8ff 0 2px, #4d70cc 2px 4px);
}
.swos-swatch-green {
  background: repeating-linear-gradient(to bottom, #1cc97f 0 2px, #0d8a54 2px 4px);
}

/* 3-Column Metallic Ribbed Team Bars (Screenshot 2 Tribute!) */
.swos-teams-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px 8px;
  max-height: min(295px, 42vh);
  overflow-y: auto;
  padding: 4px;
}

.swos-team-bar {
  appearance: none;
  min-height: 31px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f4f8ff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.09) 0px,
      rgba(255, 255, 255, 0.09) 2px,
      rgba(10, 14, 24, 0.45) 2px,
      rgba(10, 14, 24, 0.45) 4px
    ),
    linear-gradient(180deg, #52586c 0%, #3b4052 100%);
  border-top: 1.5px solid rgba(255, 255, 255, 0.42);
  border-left: 1.5px solid rgba(255, 255, 255, 0.30);
  border-right: 1.5px solid rgba(0, 0, 0, 0.8);
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.86);
}

.swos-team-bar:hover,
.swos-team-bar:focus-visible {
  box-shadow: inset 0 0 0 2px #ffffff;
  filter: brightness(1.12);
  outline: none;
}

.swos-team-bar.is-role-player {
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.12) 0 2px, rgba(0,8,45,0.42) 2px 4px),
    linear-gradient(180deg, #163ce0, #0a2096);
  box-shadow: inset 0 0 0 2px #ffffff;
}

.swos-team-bar.is-role-computer {
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.12) 0 2px, rgba(45,0,8,0.42) 2px 4px),
    linear-gradient(180deg, #d41628, #8f0816);
  box-shadow: inset 0 0 0 2px #ffffff;
}

.swos-team-bar.is-role-manager {
  background:
    repeating-linear-gradient(to bottom, #7ca4ff 0 2px, #476bc7 2px 4px);
  color: #ffffff;
  box-shadow: inset 0 0 0 2px #ffffff;
}

.swos-team-bar.is-role-player2 {
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.12) 0 2px, rgba(0,35,20,0.42) 2px 4px),
    linear-gradient(180deg, #17a86b, #0c6e44);
  box-shadow: inset 0 0 0 2px #ffffff;
}

.swos-team-ovr {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.42);
  color: #ffd27d;
}

.swos-matchup-strip {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(4, 12, 38, 0.88);
  border: 1px solid rgba(110, 175, 255, 0.42);
  border-radius: 4px;
}

.swos-slot-box {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.slot-kicker {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #9ec4f2;
  display: block;
}

.slot-role-badge {
  appearance: none;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 900;
  border-radius: 3px;
  border: 1px solid #ffffff;
  color: #ffffff;
}
.slot-role-badge.is-blue { background: #1436d4; }
.slot-role-badge.is-red { background: #c41426; }
.slot-role-badge.is-manager { background: #557ce0; }
.slot-role-badge.is-green { background: #14965f; }

.swos-vs-badge {
  font-size: 13px;
  font-weight: 900;
  color: var(--rai-gold);
}

.swos-slot-tactic {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 170px;
}

.swos-select,
.swos-text-input {
  background: rgba(4, 12, 34, 0.96);
  color: #ffffff;
  border: 1px solid rgba(121, 197, 255, 0.52);
  border-radius: 3px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 700;
}

.swos-bottom-action-row {
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.swos-bottom-action-row.is-tight {
  margin-top: 6px;
}

.swos-exit-btn {
  width: 158px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.swos-kickoff-btn {
  width: auto;
  min-width: 240px;
  min-height: 38px;
  padding-inline: 20px;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.swos-prompt-text {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

/* ==================== EDIT TACTICS 2D PITCH WORKSPACE ==================== */
.swos-tactics-workspace {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}

.swos-pitch-board-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: rgba(4, 12, 38, 0.9);
  border: 1px solid rgba(121, 197, 255, 0.44);
  border-radius: 6px;
}

#tactics-board-canvas {
  display: block;
  width: min(330px, 82vw);
  height: auto;
  border: 2px solid #e6f4ff;
  border-radius: 3px;
  touch-action: none;
}

.swos-board-hint {
  margin: 0;
  max-width: 320px;
  font-size: 9px;
  color: #abd0ff;
  text-align: center;
}

.swos-tactics-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.swos-panel-box {
  padding: 10px 12px;
  background: rgba(4, 12, 38, 0.88);
  border: 1px solid rgba(110, 175, 255, 0.4);
  border-radius: 5px;
}

.swos-box-title {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--rai-gold);
  margin-bottom: 7px;
}

.swos-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 6px;
}

.swos-slot-btn {
  appearance: none;
  padding: 6px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f2f8ff;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.08) 0 2px, rgba(0,0,0,0.38) 2px 4px),
    linear-gradient(180deg, #122980, #081552);
  border: 1px solid rgba(135, 192, 255, 0.45);
}

.swos-slot-btn:hover,
.swos-slot-btn.is-active {
  box-shadow: inset 0 0 0 2px #ffffff;
  background: linear-gradient(180deg, #b84e0e, #7c3006);
}

.swos-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 10.5px;
}

.swos-form-row .swos-select,
.swos-form-row .swos-text-input {
  flex: 1;
  max-width: 260px;
}

.swos-inline-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.swos-feedback-line {
  min-height: 15px;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--rai-mint);
}

/* ==================== OPTIONS & DIY RIBBED BARS ==================== */
.swos-options-list {
  width: min(680px, 100%);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.swos-option-row,
.swos-option-input-row {
  appearance: none;
  width: 100%;
  min-height: 38px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #ffffff;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.09) 0px,
      rgba(255, 255, 255, 0.09) 2px,
      rgba(4, 8, 32, 0.48) 2px,
      rgba(4, 8, 32, 0.48) 4px
    ),
    linear-gradient(180deg, #0c2188 0%, #061258 100%);
  border-top: 1.5px solid rgba(255, 255, 255, 0.42);
  border-left: 1.5px solid rgba(255, 255, 255, 0.3);
  border-right: 1.5px solid rgba(0, 0, 0, 0.78);
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.85);
}

.swos-option-row:hover,
.swos-option-row:focus-visible {
  box-shadow: inset 0 0 0 2px #ffffff;
  filter: brightness(1.14);
  outline: none;
}

.opt-key {
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.09em;
  color: #dcecff;
}

.opt-val {
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--rai-gold);
}

/* ==================== PRESET, CAREER & SAVE DISK FILING ==================== */
.swos-preset-list {
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.swos-preset-card {
  appearance: none;
  width: 100%;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  color: #ffffff;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.09) 0 2px, rgba(20,4,0,0.45) 2px 4px),
    linear-gradient(180deg, #8e240c, #5e1404);
  border: 1.5px solid rgba(255, 210, 125, 0.45);
}

.swos-preset-card:hover,
.swos-preset-card.is-selected {
  box-shadow: inset 0 0 0 2px #ffffff;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.12) 0 2px, rgba(30,10,0,0.42) 2px 4px),
    linear-gradient(180deg, #c65a10, #8a3806);
}

.swos-career-setup,
.swos-career-dashboard {
  width: 100%;
}

.swos-career-club-preview {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(12, 34, 78, 0.65);
  border: 1px solid rgba(121, 197, 255, 0.35);
  font-size: 11px;
  color: #e4f2ff;
}

.swos-career-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.swos-kpi-card {
  padding: 7px 10px;
  background: rgba(5, 15, 44, 0.9);
  border: 1px solid rgba(121, 197, 255, 0.38);
  border-radius: 4px;
}

.swos-kpi-card span {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: #9dc5f2;
}

.swos-kpi-card strong {
  font-size: 13px;
  color: var(--rai-gold);
}

.swos-career-columns {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 10px;
}

.swos-career-fixture {
  padding: 7px 9px;
  margin-bottom: 6px;
  background: rgba(16, 42, 92, 0.58);
  border: 1px solid rgba(121, 197, 255, 0.3);
  font-size: 11px;
}

.swos-mini-standings {
  margin-top: 8px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 10px;
  color: #d6e9ff;
}

.swos-filing-grid {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.swos-filing-card {
  padding: 10px 12px;
  background: rgba(4, 13, 40, 0.9);
  border: 1px solid rgba(121, 197, 255, 0.42);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.swos-filing-card h3 {
  margin: 0;
  font-size: 11.5px;
  color: var(--rai-gold);
}

.swos-filing-card p {
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
  color: #cde2fa;
}

.matchup-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 11px;
  background: rgba(12, 31, 52, 0.72);
  border: 1px solid rgba(121, 197, 255, 0.28);
}

.selector-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 148px;
}

.selector-field.is-narrow { flex: 0 1 88px; }
.selector-field.is-color { flex: 0 0 76px; }

.selector-field label {
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

select,
input[type="text"],
input[type="number"] {
  background: rgba(6, 17, 29, 0.94);
  color: var(--text-main);
  border: 1px solid rgba(121, 197, 255, 0.38);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 11px;
}

select:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--rai-cyan);
  outline-offset: 2px;
}

input[type="color"] {
  width: 100%;
  height: 30px;
  padding: 2px;
  border-radius: 6px;
  background: rgba(6, 17, 29, 0.94);
  border: 1px solid rgba(121, 197, 255, 0.38);
}

@media (max-width: 820px) {
  .swos-two-columns,
  .swos-tactics-workspace,
  .swos-career-columns {
    grid-template-columns: 1fr;
  }
  .swos-teams-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .intro-copy-overlay {
    max-width: 90%;
  }
}

@media (max-width: 520px) {
  .swos-teams-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== NATIVE <dialog> MODALS (modern-web-guidance) ==================== */
/* MANDATORY: Never set display on dialog unconditionally; scope strictly with dialog[open]. */
dialog.rai-dialog {
  padding: 0;
  border: 1px solid rgba(121, 197, 255, 0.48);
  border-radius: 15px;
  background: var(--panel-deep);
  color: var(--text-main);
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100dvh - 28px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78);
}

dialog.rai-dialog.is-wide {
  width: min(880px, calc(100vw - 24px));
}

dialog.rai-dialog.is-xl {
  width: min(1080px, calc(100vw - 20px));
}

dialog.rai-dialog[open] {
  display: flex;
  flex-direction: column;
}

/* MANDATORY scroll containment per prevent-page-scroll-under-modal-dialog */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(3, 10, 19, 0.76);
  backdrop-filter: blur(5px);
}

.dialog-inner {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(121, 197, 255, 0.22);
  padding-bottom: 10px;
}

.dialog-head h2 {
  margin: 3px 0 0;
  font-size: 17px;
}

.dialog-head-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dialog-status-note {
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(51, 102, 153, 0.22);
  border: 1px solid rgba(121, 197, 255, 0.24);
  font-size: 10.5px;
  color: var(--text-muted);
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(121, 197, 255, 0.2);
}

/* ==================== TACTICS & SUBSTITUTIONS ==================== */
.tactics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.subs-counter-pill {
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(16, 40, 64, 0.85);
  border: 1px solid rgba(121, 197, 255, 0.34);
  font-size: 11px;
}

.subs-counter-pill strong {
  color: var(--rai-mint);
  margin-left: 5px;
}

.tactics-columns {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 12px;
}

.tactics-pane h3 {
  margin: 0 0 7px;
  font-size: 12px;
  color: var(--rai-cyan);
}

.roster-cards-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 360px;
  overflow-y: auto;
}

.roster-slot-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(11, 28, 46, 0.86);
  border: 1px solid rgba(121, 197, 255, 0.25);
  color: var(--text-main);
  font-size: 10.5px;
  text-align: left;
}

.roster-slot-btn:hover:not(:disabled) {
  border-color: var(--rai-cyan);
  background: rgba(51, 102, 153, 0.42);
}

.roster-slot-btn.is-selected {
  border-color: var(--rai-gold);
  background: rgba(255, 210, 125, 0.18);
}

.roster-slot-btn:disabled {
  opacity: 0.48;
}

.fit-tag {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(77, 240, 192, 0.18);
  color: var(--rai-mint);
}

.fit-tag.is-warn {
  background: rgba(255, 210, 125, 0.2);
  color: var(--rai-gold);
}

/* ==================== RESPONSIVE STICKY TABLES (modern-web-guidance) ==================== */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(440px, 60vh);
  container-type: inline-size;
  border-radius: 10px;
  border: 1px solid rgba(121, 197, 255, 0.28);
  background: rgba(7, 19, 32, 0.92);
}

.rai-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
}

.rai-data-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.rai-data-table thead th {
  background: #0d2742;
  color: var(--rai-cyan);
  padding: 8px 7px;
  text-align: left;
  font-size: 10px;
  border-bottom: 1px solid rgba(121, 197, 255, 0.35);
}

.rai-data-table tbody th,
.rai-data-table tbody td {
  padding: 6px 7px;
  border-bottom: 1px solid rgba(121, 197, 255, 0.12);
}

.rai-data-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: #091c30;
  text-align: left;
  font-weight: 700;
}

.rai-data-table tr.is-user-row th,
.rai-data-table tr.is-user-row td {
  background: rgba(51, 102, 153, 0.38);
}

.editor-stat-input {
  width: 52px;
  text-align: center;
}

@container (width < 600px) {
  .rai-data-table,
  .rai-data-table thead,
  .rai-data-table tbody,
  .rai-data-table tr,
  .rai-data-table th,
  .rai-data-table td {
    display: block;
  }

  .rai-data-table thead {
    display: none;
  }

  .rai-data-table tr {
    margin-block-end: 10px;
    border: 1px solid rgba(121, 197, 255, 0.28);
    border-radius: 8px;
  }

  .rai-data-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: #102b47;
  }

  .league-standings-table {
    --label-2: "O";
    --label-3: "G";
    --label-4: "B";
    --label-5: "M";
    --label-6: "AG";
    --label-7: "YG";
    --label-8: "AV";
    --label-9: "Puan";
  }

  .league-standings-table td:nth-child(2)::before { content: var(--label-2) ": "; color: var(--text-muted); }
  .league-standings-table td:nth-child(3)::before { content: var(--label-3) ": "; color: var(--text-muted); }
  .league-standings-table td:nth-child(4)::before { content: var(--label-4) ": "; color: var(--text-muted); }
  .league-standings-table td:nth-child(5)::before { content: var(--label-5) ": "; color: var(--text-muted); }
  .league-standings-table td:nth-child(6)::before { content: var(--label-6) ": "; color: var(--text-muted); }
  .league-standings-table td:nth-child(7)::before { content: var(--label-7) ": "; color: var(--text-muted); }
  .league-standings-table td:nth-child(8)::before { content: var(--label-8) ": "; color: var(--text-muted); }
  .league-standings-table td:nth-child(9)::before { content: var(--label-9) ": "; color: var(--text-muted); }

  .editor-roster-table {
    --ed-label-2: "Forma No";
    --ed-label-3: "Futbolcu";
    --ed-label-4: "Mevki";
    --ed-label-5: "Hız";
    --ed-label-6: "Şut";
    --ed-label-7: "Pas";
    --ed-label-8: "Kontrol";
    --ed-label-9: "Müdahale";
    --ed-label-10: "Kafa";
    --ed-label-11: "Kadro İşlemi";
  }

  .editor-roster-table td:nth-child(2)::before { content: var(--ed-label-2) ": "; color: var(--text-muted); }
  .editor-roster-table td:nth-child(3)::before { content: var(--ed-label-3) ": "; color: var(--text-muted); }
  .editor-roster-table td:nth-child(4)::before { content: var(--ed-label-4) ": "; color: var(--text-muted); }
  .editor-roster-table td:nth-child(5)::before { content: var(--ed-label-5) ": "; color: var(--text-muted); }
  .editor-roster-table td:nth-child(6)::before { content: var(--ed-label-6) ": "; color: var(--text-muted); }
  .editor-roster-table td:nth-child(7)::before { content: var(--ed-label-7) ": "; color: var(--text-muted); }
  .editor-roster-table td:nth-child(8)::before { content: var(--ed-label-8) ": "; color: var(--text-muted); }
  .editor-roster-table td:nth-child(9)::before { content: var(--ed-label-9) ": "; color: var(--text-muted); }
  .editor-roster-table td:nth-child(10)::before { content: var(--ed-label-10) ": "; color: var(--text-muted); }
  .editor-roster-table td:nth-child(11)::before { content: var(--ed-label-11) ": "; color: var(--text-muted); }
}

/* ==================== EDITOR & LEAGUE / CUP VIEWS ==================== */
.editor-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.comp-action-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(51, 102, 153, 0.28);
  border: 1px solid rgba(121, 197, 255, 0.36);
}

.muted-inline {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.comp-two-col {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.comp-side-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(9, 24, 40, 0.85);
  border: 1px solid rgba(121, 197, 255, 0.25);
}

.side-box h3 {
  margin: 0 0 7px;
  font-size: 11.5px;
  color: var(--rai-cyan);
}

.fixture-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 10.5px;
}

.fixture-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(16, 38, 62, 0.6);
}

.fixture-row.is-user {
  border: 1px solid var(--rai-gold);
}

.cup-bracket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.cup-stage-col {
  padding: 10px;
  border-radius: 10px;
  background: rgba(9, 24, 40, 0.86);
  border: 1px solid rgba(121, 197, 255, 0.26);
}

.cup-stage-col h3 {
  margin: 0 0 8px;
  font-size: 11.5px;
  color: var(--rai-gold);
}

.cup-tie-card {
  padding: 7px 9px;
  border-radius: 7px;
  background: rgba(16, 38, 62, 0.72);
  border: 1px solid rgba(121, 197, 255, 0.2);
  margin-bottom: 7px;
  font-size: 10.5px;
}

.cup-tie-card.is-user {
  border-color: var(--rai-gold);
}

/* ==================== RANGE SLIDERS (modern-web-guidance 'slider') ==================== */
input[type="range"] {
  --slider-track-size: 0.42rem;
  --slider-thumb-size: 1.05rem;
  --slider-track-radius: 999px;
  --slider-thumb-radius: 50%;
  --slider-track-color: rgba(121, 197, 255, 0.22);
  --slider-fill-color: #54b4ff;
  --slider-thumb-color: #dff2ff;
  --slider-direction: to right;

  --attr-min: attr(min type(<number>), 0);
  --attr-max: attr(max type(<number>), 100);
  --control-value: attr(value type(<number>), 50);
  --slider-progress: calc(
    progress(var(--control-value), var(--attr-min), var(--attr-max)) * 100%
  );

  appearance: none;
  inline-size: 100%;
  block-size: 1.9rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

@supports not (opacity: progress(1, 0, 100)) {
  input[type="range"] {
    --slider-progress: calc(
      (var(--control-value) - var(--attr-min)) /
      (var(--attr-max) - var(--attr-min)) * 100%
    );
  }
}

input[type="range"]::-webkit-slider-runnable-track {
  block-size: var(--slider-track-size);
  border: 0;
  border-radius: var(--slider-track-radius);
  background: linear-gradient(
    var(--slider-direction),
    var(--slider-fill-color) var(--slider-progress),
    var(--slider-track-color) var(--slider-progress)
  );
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  inline-size: var(--slider-thumb-size);
  block-size: var(--slider-thumb-size);
  margin-block-start: calc((var(--slider-track-size) - var(--slider-thumb-size)) / 2);
  border: 2px solid #336699;
  border-radius: var(--slider-thumb-radius);
  background: var(--slider-thumb-color);
}

input[type="range"]::-moz-range-track {
  block-size: var(--slider-track-size);
  border: 0;
  border-radius: var(--slider-track-radius);
  background: var(--slider-track-color);
}

input[type="range"]::-moz-range-progress {
  block-size: var(--slider-track-size);
  border-radius: var(--slider-track-radius);
  background: var(--slider-fill-color);
}

input[type="range"]::-moz-range-thumb {
  inline-size: var(--slider-thumb-size);
  block-size: var(--slider-thumb-size);
  border: 2px solid #336699;
  border-radius: var(--slider-thumb-radius);
  background: var(--slider-thumb-color);
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--slider-fill-color);
  outline-offset: 4px;
}

/* ==================== SETTINGS, HALL OF FAME & TUNING DRAWER ==================== */
.pause-quick-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.setting-row {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(11, 28, 46, 0.78);
  border: 1px solid rgba(121, 197, 255, 0.2);
  font-size: 11px;
}

.setting-row.is-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tuning-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
}

.hall-of-fame-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(11, 28, 46, 0.8);
  border: 1px solid rgba(255, 210, 125, 0.34);
}

.hall-of-fame-box h3 {
  margin: 0 0 6px;
  font-size: 11.5px;
  color: var(--rai-gold);
}

.hall-list {
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tuning-drawer {
  position: absolute;
  inset-block: 74px 48px;
  inset-inline-end: 12px;
  width: 310px;
  z-index: 16;
  padding: 12px;
  border-radius: 13px;
  background: var(--panel-deep);
  border: 1px solid var(--panel-border);
  overflow-y: auto;
  transform: translateX(115%);
  transition: transform 180ms ease;
}

.tuning-drawer.is-open {
  transform: translateX(0);
}

.tuning-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.tuning-kicker {
  font-size: 9px;
  color: var(--rai-cyan);
}

.tuning-header h3 {
  margin: 2px 0 0;
  font-size: 13px;
}

.tuning-header-actions {
  display: flex;
  gap: 4px;
}

.tuning-section h4 {
  margin: 10px 0 6px;
  font-size: 10.5px;
  color: var(--rai-gold);
}

/* ==================== MOBILE / TABLET TOUCH OVERLAY ==================== */
.touch-layer {
  display: none;
  position: absolute;
  inset-inline: 14px;
  inset-block-end: 16px;
  z-index: 14;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.touch-stick-zone {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: rgba(10, 28, 48, 0.56);
  border: 2px solid rgba(121, 197, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
}

.touch-stick-nub {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #8cd0ff, #336699);
  border: 2px solid #ffffff;
}

.touch-buttons-cluster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.touch-btn {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(12, 32, 54, 0.84);
  border: 1.5px solid rgba(121, 197, 255, 0.5);
  color: #ffffff;
  touch-action: none;
}

.touch-btn.is-primary {
  background: linear-gradient(135deg, #336699, #1f4b78);
  border-color: var(--rai-cyan);
}

.touch-btn.is-aerial-ready {
  background: linear-gradient(135deg, #d89b2b, #a85d14);
  border-color: #ffe89e;
  box-shadow: 0 0 16px rgba(255, 225, 77, 0.65);
}

@media (max-width: 900px), (pointer: coarse) {
  .controls-bar {
    display: none;
  }
  .touch-layer {
    display: flex;
  }
  .radar-card,
  .telemetry-card {
    display: none;
  }
  .tactics-columns,
  .comp-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hud-top {
    inset-block-start: 6px;
    inset-inline: 8px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .scoreboard-wrap {
    order: 1;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
  }
  .scoreboard {
    padding: 4px 9px;
    gap: 6px;
  }
  .camera-strip {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 4px;
    padding-bottom: 2px;
  }
  .cam-btn,
  .cam-pill {
    font-size: 8.5px;
    padding: 3px 6px;
    white-space: nowrap;
  }
  .center-banner {
    inset-block-start: 30%;
    font-size: 13px;
    padding: 8px 14px;
  }
  .hud-left-stack {
    order: 2;
    flex: 1 1 auto;
  }
  .player-card {
    min-width: 0;
    padding: 5px 8px;
  }
  .player-card-row {
    font-size: 10px;
    margin-bottom: 3px;
  }
  .hud-right-stack {
    order: 3;
  }
  .hud-action-row {
    gap: 4px;
  }
  .hud-mini-btn {
    font-size: 8.5px;
    padding: 5px 6px;
  }
}

/* RAI visual controls apply to static art as well as the live pitch. */
.swos-menu-bg-layer, .intro-hero-img { filter: brightness(var(--rai-brightness,100%)) saturate(var(--rai-saturation,105%)); }
.rai-kick-guide { position:fixed; left:50%; bottom:82px; transform:translateX(-50%); z-index:35; max-width:calc(100vw - 32px); padding:10px 16px; border:1px solid #5389b8; border-radius:6px; background:#071827e8; color:#d5eaff; font:12px Orbitron,sans-serif; pointer-events:none; text-align:center; }
.rai-kick-guide[hidden] { display:none; }
.rai-kick-meter { display:block; height:10px; width:260px; max-width:70vw; background:#162b3d; margin:7px auto; border:1px solid #56708a; }
.rai-kick-meter i { display:block; height:100%; background:linear-gradient(90deg,#336699,#45c987 65%,#e9c561 85%,#d3504e); }
@media(max-width:700px){.rai-kick-guide{bottom:132px;font-size:10px;}}

.rai-team-filters{display:flex;gap:14px;align-items:end;flex-wrap:wrap;margin:14px 0;color:#bcd8f1;font:12px Orbitron,sans-serif}.rai-team-filters label{display:grid;gap:6px;min-width:190px;flex:1}.rai-team-filters #friendly-count{padding:10px;color:#e0bc74}.swos-team-bar>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.swos-teams-grid{max-height:45vh;overflow-y:auto;overscroll-behavior:contain}.swos-team-bar{min-height:46px}
