:root {
  --bg-dark: #0b0e17;
  --bg-panel: #151b2b;
  --bg-card: #1e273c;
  --bg-card-hover: #27334f;
  --accent-yellow: #ffbe0b;
  --accent-gold: #ffd166;
  --accent-orange: #fb5607;
  --accent-red: #e63946;
  --accent-crimson: #b5171e;
  --accent-green: #06d6a0;
  --accent-blue: #3a86ff;
  --accent-cyan: #48cae4;
  --text-light: #f8f9fa;
  --text-muted: #adb5bd;
  --border-subtle: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background: radial-gradient(circle at 50% 0%, #231942 0%, #0b0e17 75%);
  color: var(--text-light);
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

button, input, select {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

/* ================= TOP NAVIGATION BAR & STF ARCADE BUTTON ================= */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(11, 14, 23, 0.96);
  border-bottom: 2px solid var(--accent-yellow);
  position: sticky;
  top: 0;
  z-index: 60;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stf-arcade-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #e63946, #d62828);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.84rem;
  padding: 8px 13px;
  border-radius: 8px;
  border: 2px solid #ffd166;
  box-shadow: 0 3px 0 #780000;
  transition: transform 0.12s ease, filter 0.12s ease;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.stf-arcade-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.brand-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-light);
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.92rem;
}

.brand-badge {
  background: linear-gradient(135deg, #ffbe0b, #fb5607);
  color: #111;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 900;
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.nav-btn {
  background: var(--bg-card);
  color: var(--text-light);
  border: 1px solid var(--border-subtle);
  padding: 7px 11px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
}

.nav-btn-gold {
  background: linear-gradient(135deg, #ffbe0b, #f77f00);
  color: #111;
  border-color: #fff;
  font-weight: 900;
}

/* ================= MAIN APP SHELL & SCREENS ================= */
.app-shell {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 10px 12px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ================= SCREEN 1: SELECT SCREEN ================= */
.tournament-marquee {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(135deg, rgba(43, 9, 56, 0.92), rgba(21, 27, 43, 0.96));
  border: 2px solid var(--accent-yellow);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.marquee-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  background: rgba(230, 57, 70, 0.25);
  border: 1px solid var(--accent-red);
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 4px;
}

.marquee-title {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 3px 0 #d62828, 0 5px 12px rgba(0, 0, 0, 0.6);
}

.num-iv {
  color: var(--accent-yellow);
}

.marquee-subtitle {
  font-size: 0.9rem;
  color: #e0e6ed;
  margin-top: 3px;
}

.player-profile-card {
  background: rgba(11, 14, 23, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.profile-input-row {
  display: flex;
  gap: 6px;
}

.profile-input-row input {
  flex: 1;
  background: #0b0e17;
  color: #fff;
  border: 1px solid var(--accent-yellow);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 0.92rem;
  font-weight: 700;
  user-select: text;
}

.btn-small {
  background: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 6px 11px;
  font-weight: 800;
  cursor: pointer;
}

.local-best-strip {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.local-best-strip strong {
  color: var(--accent-green);
}

.select-block {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
}

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

.block-title {
  font-size: 0.96rem;
  font-weight: 900;
  color: var(--accent-yellow);
  letter-spacing: 0.04em;
}

.block-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Modes Grid */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-light);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}

.mode-card:hover {
  background: var(--bg-card-hover);
}

.mode-card.active {
  border-color: var(--accent-yellow);
  background: linear-gradient(135deg, rgba(255, 190, 11, 0.18), rgba(251, 86, 7, 0.12));
  box-shadow: 0 0 14px rgba(255, 190, 11, 0.25);
}

.mode-icon {
  font-size: 1.55rem;
  line-height: 1;
}

.mode-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mode-info strong {
  font-size: 0.88rem;
  color: #fff;
}

.mode-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Roster & Preview Layout */
.roster-and-preview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.select-target-toggle {
  display: flex;
  gap: 6px;
}

.target-pill {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  padding: 4px 11px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.target-pill.active {
  background: var(--accent-yellow);
  color: #111;
  border-color: #fff;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 680px) {
  .roster-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fighter-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 8px;
  color: var(--text-light);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}

.fighter-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
}

.fighter-card.selected-p1 {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 2px rgba(255, 190, 11, 0.35);
}

.fighter-card.selected-p2 {
  border-color: var(--accent-cyan);
}

.fighter-card-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.sel-tag {
  font-size: 0.66rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
}

.sel-tag.p1 {
  background: var(--accent-yellow);
  color: #111;
}

.sel-tag.p2 {
  background: var(--accent-cyan);
  color: #111;
}

.fighter-card-svg {
  width: 74px;
  height: 74px;
  margin-bottom: 6px;
}

.fighter-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fighter-card-name {
  font-size: 0.9rem;
  font-weight: 900;
  color: #fff;
}

.fighter-card-quote {
  font-size: 0.72rem;
  color: var(--accent-gold);
  font-style: italic;
  margin-top: 2px;
}

/* Fighter Dossier Preview Panel */
.fighter-dossier-card {
  background: linear-gradient(160deg, #1b2338 0%, #111624 100%);
  border: 2px solid var(--accent-yellow);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dossier-matchup-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
}

.dossier-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dossier-side.right {
  flex-direction: row-reverse;
  text-align: right;
}

.dossier-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.dossier-vs-pill {
  background: var(--accent-red);
  color: #fff;
  font-weight: 900;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
}

.dossier-bio-text {
  font-size: 0.8rem;
  color: #dee2e6;
  line-height: 1.4;
}

.dossier-specials-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px;
}

.special-chip {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--accent-yellow);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.75rem;
}

.special-chip strong {
  display: block;
  color: var(--accent-gold);
}

.special-chip small {
  color: var(--text-muted);
}

.dossier-ult-banner {
  background: linear-gradient(135deg, rgba(214, 40, 40, 0.3), rgba(120, 0, 0, 0.45));
  border: 1px solid var(--accent-red);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.dossier-ult-banner strong {
  color: #ffccd5;
}

/* Arenas Grid */
.arenas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 8px;
}

.arena-card {
  text-align: left;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.arena-card.active {
  border-color: var(--accent-green);
  background: rgba(6, 214, 160, 0.13);
}

.arena-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.64rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 190, 11, 0.2);
  color: var(--accent-gold);
}

.arena-card strong {
  font-size: 0.86rem;
}

.arena-card span {
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* Giant Start CTA */
.start-cta-bar {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.btn-start-fight {
  width: 100%;
  max-width: 680px;
  background: linear-gradient(135deg, #e63946 0%, #fb5607 100%);
  color: #fff;
  border: 3px solid var(--accent-gold);
  border-radius: 14px;
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  box-shadow: 0 6px 0 #780000, 0 10px 24px rgba(230, 57, 70, 0.45);
  transition: transform 0.1s, filter 0.12s;
}

.btn-start-fight:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn-start-fight:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #780000;
}

.start-main {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.start-sub {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-gold);
}

/* ================= SCREEN 2: VS SCREEN ================= */
.vs-card {
  background: linear-gradient(145deg, #1a1433 0%, #0f172a 100%);
  border: 3px solid var(--accent-yellow);
  border-radius: 16px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.vs-stage-badge {
  background: var(--accent-red);
  color: #fff;
  font-weight: 900;
  font-size: 0.76rem;
  padding: 4px 12px;
  border-radius: 99px;
}

.vs-arena-title {
  font-size: 1.3rem;
  color: var(--accent-gold);
  margin-top: 6px;
}

.vs-combatants-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.vs-fighter-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.vs-portrait {
  width: 115px;
  height: 115px;
}

.vs-player-tag {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--accent-yellow);
}

.vs-quote {
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-style: italic;
}

.vs-burst {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffbe0b, #e63946);
  color: #111;
  font-size: 1.65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  box-shadow: 0 0 24px rgba(255, 190, 11, 0.6);
}

.vs-tip-box {
  width: 100%;
  max-width: 760px;
  background: rgba(11, 14, 23, 0.85);
  border: 2px dashed var(--accent-gold);
  border-radius: 12px;
  padding: 12px 16px;
}

.tip-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 900;
  color: var(--accent-yellow);
  margin-bottom: 4px;
}

.tip-text {
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(135deg, #06d6a0, #00b4d8);
  color: #081c15;
  font-weight: 900;
  font-size: 1rem;
  padding: 11px 22px;
  border-radius: 10px;
  border: 2px solid #fff;
  cursor: pointer;
}

/* ================= SCREEN 3: ACTIVE FIGHT ARENA & CONTROLS ================= */
.fight-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  background: rgba(15, 20, 32, 0.95);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 10px;
}

.hud-fighter {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.hud-mini-portrait {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.hud-name-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hud-name-group.right {
  align-items: flex-end;
  text-align: right;
}

.hud-name-group strong {
  font-size: 0.88rem;
}

.hud-round-dots {
  font-size: 0.78rem;
  color: var(--accent-yellow);
  min-height: 14px;
}

.hud-hp-num {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--accent-gold);
}

.hp-bar-outer {
  width: 100%;
  height: 16px;
  background: #2b0912;
  border: 2px solid #ffffff;
  border-radius: 99px;
  overflow: hidden;
}

.hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06d6a0, #ffbe0b);
  transition: width 0.08s linear;
}

.hp-bar-fill.low-hp {
  background: linear-gradient(90deg, #e63946, #ff9f1c);
}

.hud-meters-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hud-meters-row.right {
  justify-content: flex-end;
}

.meter-pill {
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
}

.meter-pill.red-pill {
  background: rgba(230, 57, 70, 0.25);
  color: #ffccd5;
  border: 1px solid var(--accent-red);
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
}

.hud-mode-pill {
  font-size: 0.64rem;
  font-weight: 900;
  color: var(--accent-gold);
  letter-spacing: 0.04em;
}

.hud-timer {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 2px 0 #e63946;
}

.hud-score-line {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-green);
}

.hud-quick-btns {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.btn-hud-mini {
  background: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

/* Training Mode Strip */
.training-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(6, 214, 160, 0.12);
  border: 1px solid var(--accent-green);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.training-strip select {
  background: #0b0e17;
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 3px 8px;
}

.training-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Canvas Box */
.canvas-stage-box {
  width: 100%;
  background: #000;
  border: 3px solid var(--accent-yellow);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
}

#fight-canvas {
  width: 100%;
  max-height: 58vh;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: contain;
}

/* ================= TOUCH & DESKTOP CONTROL DECK ================= */
.fight-controls-deck {
  display: grid;
  grid-template-columns: 1fr auto 1.25fr;
  align-items: center;
  gap: 12px;
  background: var(--bg-panel);
  border: 2px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px 14px;
}

.joystick-zone {
  display: flex;
  align-items: center;
  gap: 12px;
}

.virtual-joystick-base {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, #27334f 0%, #111624 100%);
  border: 3px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  flex-shrink: 0;
}

.joystick-dirs {
  position: absolute;
  inset: 6px;
  pointer-events: none;
  font-size: 0.62rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.55);
}

.j-dir {
  position: absolute;
}
.j-up { top: 2px; left: 50%; transform: translateX(-50%); }
.j-down { bottom: 2px; left: 50%; transform: translateX(-50%); }
.j-left { left: 4px; top: 50%; transform: translateY(-50%); }
.j-right { right: 4px; top: 50%; transform: translateY(-50%); }

.virtual-joystick-knob {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffbe0b, #fb5607);
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: transform 0.04s linear;
}

.dpad-fallback-btns {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dpad-vert {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dpad-btn {
  background: var(--bg-card);
  color: #fff;
  border: 2px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 900;
  font-size: 0.78rem;
  cursor: pointer;
  touch-action: manipulation;
}

.dpad-btn:active, .dpad-btn.pressed {
  background: var(--accent-yellow);
  color: #111;
}

.desktop-keys-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.74rem;
}

.key-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.key-col strong {
  color: var(--accent-gold);
}

.key-col code {
  background: #27334f;
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 800;
}

.action-buttons-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.standard-attack-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.atk-btn {
  border-radius: 10px;
  padding: 11px 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 2px solid #fff;
  touch-action: manipulation;
  transition: transform 0.08s;
}

.atk-btn:active {
  transform: translateY(2px);
}

.atk-normal {
  background: linear-gradient(135deg, #3a86ff, #1d3557);
  box-shadow: 0 4px 0 #0d1b2a;
}

.atk-crazy {
  background: linear-gradient(135deg, #8338ec, #3a0ca3);
  box-shadow: 0 4px 0 #240046;
}

.atk-title {
  font-size: 0.88rem;
  font-weight: 900;
}

.atk-sub {
  font-size: 0.72rem;
  color: #e0fbfc;
}

/* THE GIANT RED "DO NOT PRESS THIS BUTTON" */
.do-not-press-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: radial-gradient(circle at 50% 25%, #ff4d6d 0%, #d62828 55%, #780000 100%);
  color: #ffffff;
  border: 3px solid #ffd166;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 5px 0 #590d22, 0 0 22px rgba(230, 57, 70, 0.7);
  touch-action: manipulation;
  animation: pulseForbiddenButton 1.4s infinite alternate;
}

.do-not-press-btn.cooldown {
  filter: grayscale(0.65) opacity(0.75);
  animation: none;
}

@keyframes pulseForbiddenButton {
  0% {
    box-shadow: 0 5px 0 #590d22, 0 0 12px rgba(230, 57, 70, 0.5);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 5px 0 #590d22, 0 0 26px rgba(255, 190, 11, 0.9);
    transform: scale(1.015);
  }
}

.hazard-stripes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    45deg,
    #ffbe0b,
    #ffbe0b 10px,
    #111111 10px,
    #111111 20px
  );
}

.dnp-warning-icon {
  font-size: 0.66rem;
  font-weight: 900;
  color: #ffd166;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.dnp-main-text {
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.dnp-ult-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff3b0;
}

/* ================= SCREEN 4: VICTORY & LEADERBOARD SUBMISSION ================= */
.victory-card {
  background: linear-gradient(150deg, #1b2338 0%, #0f1420 100%);
  border: 3px solid var(--accent-yellow);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.victory-badge {
  background: var(--accent-yellow);
  color: #111;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 99px;
}

.victory-callout {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: 0 3px 0 #d62828;
  margin-top: 4px;
}

.victory-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  width: 100%;
  max-width: 780px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 16px;
}

.victory-portrait {
  width: 125px;
  height: 125px;
}

.victory-quote-box {
  flex: 1;
  min-width: 240px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.victory-quote-box blockquote {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-gold);
  font-style: italic;
}

.victory-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.v-stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 10px;
}

.v-stat-pill span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.v-stat-pill strong {
  font-size: 1rem;
  color: #fff;
}

.profile-pref-row {
  margin: 2px 0 4px;
}

.auto-save-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--accent-gold);
  cursor: pointer;
  user-select: none;
}

.auto-save-toggle input[type="checkbox"] {
  accent-color: var(--accent-green);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.victory-submit-box {
  width: 100%;
  max-width: 780px;
  background: linear-gradient(135deg, rgba(6, 214, 160, 0.12), rgba(255, 190, 11, 0.08));
  border: 2px solid var(--accent-green);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.submit-row input {
  background: #0b0e17;
  color: #fff;
  border: 1px solid var(--accent-yellow);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 800;
  user-select: text;
}

.victory-hof-confirmation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  animation: popInHof 0.28s ease-out;
}

@keyframes popInHof {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.hof-message {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 900;
  color: var(--accent-gold);
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.hof-rank {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--accent-green);
  background: rgba(6, 214, 160, 0.18);
  border: 1px solid var(--accent-green);
  border-radius: 99px;
  padding: 5px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 12px rgba(6, 214, 160, 0.25);
}

.lb-pref-strip {
  display: flex;
  justify-content: flex-end;
  padding: 2px 4px;
}

.victory-actions {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.victory-secondary-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ================= MODALS (LEADERBOARDS, BIOS, CONTROLS, PAUSE) ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-card {
  background: var(--bg-panel);
  border: 2px solid var(--accent-yellow);
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card.modal-wide {
  max-width: 980px;
}

.modal-card.modal-small {
  max-width: 420px;
  text-align: center;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.close-btn {
  background: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-weight: 900;
  cursor: pointer;
}

/* Leaderboards Modal */
.lb-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.lb-tab {
  background: var(--bg-card);
  color: var(--text-light);
  border: 2px solid transparent;
  border-radius: 9px;
  padding: 9px 12px;
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
}

.lb-tab.active {
  border-color: var(--accent-yellow);
  background: rgba(255, 190, 11, 0.18);
  color: var(--accent-gold);
}

.lb-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.lb-filter-bar select {
  background: #0b0e17;
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 700;
}

.lb-table-wrap {
  overflow-x: auto;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.lb-table th, .lb-table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.lb-table th {
  color: var(--accent-gold);
  font-weight: 900;
  background: rgba(0, 0, 0, 0.25);
}

.lb-empty {
  text-align: center !important;
  color: var(--text-muted);
  padding: 20px !important;
}

/* Bios Grid */
.bios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.bio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bio-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bio-avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.controls-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.guide-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
}

.guide-box h3 {
  color: var(--accent-gold);
  font-size: 0.94rem;
  margin-bottom: 8px;
}

.guide-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.83rem;
}

kbd {
  background: #0b0e17;
  border: 1px solid var(--accent-gold);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-yellow);
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ================= RESPONSIVE BREAKPOINTS (MOBILE & DESKTOP) ================= */
@media (min-width: 900px) {
  .tournament-marquee {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .player-profile-card {
    min-width: 310px;
  }

  .roster-and-preview-grid {
    grid-template-columns: 1.25fr 1fr;
  }
}

@media (max-width: 760px) {
  .hide-mobile, .hide-sm {
    display: none !important;
  }

  .fight-controls-deck {
    grid-template-columns: 1fr 1.15fr;
    padding: 8px;
  }

  .vs-combatants-row {
    grid-template-columns: 1fr;
  }

  .vs-emblem-center {
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .hide-xs {
    display: none !important;
  }

  .fight-controls-deck {
    grid-template-columns: 1fr;
  }

  .joystick-zone {
    justify-content: space-around;
  }
}
