:root {
  --bg-dark: #0b1120;
  --panel-bg: rgba(15, 23, 42, 0.85);
  --panel-border: rgba(255, 255, 255, 0.14);
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.45);
  --primary: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #10b981;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

#game-canvas, #touch-controls {
  touch-action: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0f172a;
}

/* Force immediate Landscape orientation on smartphones even when device is held Portrait */
@media (max-width: 960px) and (orientation: portrait) {
  #app {
    position: fixed;
    top: 0;
    left: 100vw;
    width: 100dvh;
    height: 100vw;
    transform: rotate(90deg);
    transform-origin: top left;
  }
}

.hidden {
  display: none !important;
}

/* Top Utilities */
#top-utils {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 40;
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  color: var(--text-main);
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}

.icon-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* Match HUD */
#match-hud {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(94vw, 680px);
  justify-content: center;
}

.scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 6px 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  flex: 1;
}

.team-hud {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-badge {
  width: 10px;
  height: 34px;
  border-radius: 5px;
  background: #ef4444;
}

.team-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.team-hud.right .team-info {
  align-items: flex-end;
}

.team-name {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #e2e8f0;
  text-transform: uppercase;
}

.set-dots {
  display: flex;
  gap: 4px;
}

.set-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.set-dot.won {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.serve-indicator {
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.serve-indicator.active {
  opacity: 1;
  animation: pulseServe 1.2s infinite ease-in-out;
}

@keyframes pulseServe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.score-box {
  font-size: 1.75rem;
  font-weight: 900;
  min-width: 38px;
  text-align: center;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

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

.set-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.touch-status {
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.04em;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Mobile Touch Controls: PlayStation Gamepad Overlay */
#touch-controls {
  position: fixed;
  bottom: 10px;
  left: 0;
  right: 0;
  padding: 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 35;
}

.gp-left, .gp-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.gp-shoulders {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.gp-shoulder {
  min-width: 54px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.42);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.58;
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
  cursor: pointer;
  touch-action: none;
}

.gp-shoulder small {
  font-size: 0.46rem;
  color: #94a3b8;
  margin-top: 1px;
}

.gp-shoulder:active, .gp-shoulder.pressed {
  opacity: 0.95;
  background: rgba(245, 158, 11, 0.6);
  border-color: #fff;
}

.joystick-zone {
  pointer-events: auto;
  touch-action: none;
  opacity: 0.52;
  transition: opacity 0.15s;
}

.joystick-zone:active {
  opacity: 0.88;
}

.joystick-base {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.joystick-knob {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transform: translate(0px, 0px);
  transition: transform 0.04s linear;
}

/* PS Diamond Face Buttons */
.ps-diamond {
  position: relative;
  width: 126px;
  height: 126px;
  pointer-events: auto;
}

.ps-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.42);
  color: #fff;
  opacity: 0.6;
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  line-height: 1;
}

.ps-btn .ps-sym {
  font-size: 1rem;
  font-weight: 900;
}

.ps-btn small {
  font-size: 0.42rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 1px;
}

.ps-tri { top: 0; left: 41px; border-color: rgba(74, 222, 128, 0.55); }
.ps-tri .ps-sym { color: #4ade80; }

.ps-sq { top: 41px; left: 0; border-color: rgba(244, 114, 182, 0.55); }
.ps-sq .ps-sym { color: #f472b6; }

.ps-cir { top: 41px; right: 0; border-color: rgba(248, 113, 113, 0.55); }
.ps-cir .ps-sym { color: #f87171; }

.ps-x { bottom: 0; left: 41px; border-color: rgba(96, 165, 250, 0.55); }
.ps-x .ps-sym { color: #60a5fa; }

.ps-btn:active, .ps-btn.pressed {
  opacity: 0.96;
  background: rgba(245, 158, 11, 0.65);
  border-color: #fff;
  transform: scale(0.92);
}

/* Main Menu Overlay */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background:
    linear-gradient(180deg, rgba(11, 17, 32, 0.55) 0%, rgba(11, 17, 32, 0.78) 100%),
    url('assets/wallpaper.png') center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  overflow-y: auto;
}

.menu-container {
  width: min(1240px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-header {
  text-align: center;
}

.logo-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin-bottom: 2px;
}

.game-title {
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.game-title span {
  color: var(--accent);
}

.menu-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
}

.menu-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.menu-card h2 {
  font-size: 0.94rem;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s;
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.mode-btn.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: #60a5fa;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.25);
}

.mode-icon {
  font-size: 1.5rem;
}

.mode-btn strong {
  display: block;
  font-size: 0.95rem;
}

.mode-btn small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.options-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.options-row label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pill-group {
  display: flex;
  gap: 6px;
}

.pill {
  flex: 1;
  padding: 5px 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.pill.active {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
}

/* Arena Selector */
.arena-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.arena-card {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.18s;
}

.arena-card.active {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.14);
}

.arena-card span {
  font-size: 0.74rem;
  font-weight: 700;
}

.arena-preview {
  width: 100%;
  height: 46px;
  border-radius: 8px;
}

.champ-prev {
  background: linear-gradient(90deg, #0284c7 0%, #0369a1 50%, #0284c7 100%);
  border: 3px solid #ea580c;
}

.parquet-prev {
  background: linear-gradient(90deg, #d97706 0%, #b45309 50%, #d97706 100%);
  border: 3px solid #fef3c7;
}

.neon-prev {
  background: linear-gradient(90deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  border: 3px solid #38bdf8;
  box-shadow: inset 0 0 10px #ec4899;
}

/* Jersey Customizer */
.jersey-customizer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.jersey-pick label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.color-swatches {
  display: flex;
  gap: 7px;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}

.swatch.active {
  border-color: #fff;
  transform: scale(1.18);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.controls-hint {
  margin-top: auto;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Menu Footer */
.menu-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.primary-cta {
  padding: 14px 36px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.primary-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.6);
}

.primary-cta:active {
  transform: translateY(1px);
}

.credit-text {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Modals */
.modal {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: min(420px, 100%);
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 26px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

.modal-box h2 {
  font-size: 1.45rem;
  font-weight: 900;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.secondary-btn {
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.secondary-btn.danger {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.trophy-icon {
  font-size: 3rem;
  margin-bottom: 6px;
}

.summary-sub {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
}

.stat-val {
  display: block;
  font-size: 1.4rem;
  font-weight: 900;
  color: #38bdf8;
}

.stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.toast {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--success);
  font-weight: 700;
}

.controls-box {
  width: min(620px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  text-align: left;
}

.controls-box h2 {
  text-align: center;
  font-size: 1.2rem;
}

.preset-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.keybind-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.keybind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.78rem;
  gap: 8px;
}

.keybind-row span {
  color: #e2e8f0;
  font-weight: 600;
}

.keybind-btn {
  min-width: 72px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.85);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.keybind-btn:hover {
  border-color: var(--accent);
}

.keybind-btn.listening {
  background: var(--accent);
  color: #0f172a;
  border-color: #fff;
  animation: pulseServe 0.8s infinite;
}

.keybind-tip {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.team-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.team-select-box label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.team-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.roster-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
}

.roster-chip {
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  font-weight: 600;
}

.roster-chip b {
  color: var(--accent);
}

.roster-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.roster-team-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 8px;
  padding: 6px;
}

.roster-team-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #f8fafc;
}

.roster-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.sub-col h3 {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sub-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.sub-card:hover {
  background: rgba(255, 255, 255, 0.11);
}

.sub-card.selected {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.22);
}

.sub-card small {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.guide-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.guide-item strong {
  display: block;
  color: var(--accent);
  margin-bottom: 2px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 700;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.cutin-banner {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cutin-inner {
  width: 100%;
  padding: 10px 24px;
  background: linear-gradient(90deg, transparent 0%, rgba(249, 115, 22, 0.92) 15%, rgba(234, 88, 12, 0.95) 85%, transparent 100%);
  border-top: 3px solid #fef08a;
  border-bottom: 3px solid #fef08a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transform: skewY(-2deg);
  box-shadow: 0 0 40px rgba(249, 115, 22, 0.7);
  animation: cutinSlide 0.9s ease-out forwards;
}

.cutin-portrait-wrap {
  width: clamp(82px, 13vw, 128px);
  height: clamp(82px, 13vw, 128px);
  border-radius: 14px;
  border: 3px solid #fef08a;
  overflow: hidden;
  transform: skewX(-8deg);
  box-shadow: 0 0 26px rgba(250, 204, 21, 0.8);
  background: #0f172a;
  flex-shrink: 0;
}

.cutin-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform: skewX(8deg) scale(1.12);
}

.cutin-text-wrap {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cutin-tag {
  display: block;
  font-size: clamp(0.65rem, 1.4vw, 0.82rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #fef08a;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.cutin-title {
  display: block;
  font-size: clamp(1.5rem, 4.2vw, 2.7rem);
  font-weight: 900;
  font-style: italic;
  color: #ffffff;
  -webkit-text-stroke: 1.5px #0f172a;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.75);
  letter-spacing: 0.05em;
  line-height: 1.05;
}

.cutin-sub {
  display: block;
  font-size: clamp(0.72rem, 1.5vw, 0.95rem);
  font-weight: 800;
  font-style: italic;
  color: #fde047;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
}

@keyframes cutinSlide {
  0% { opacity: 0; transform: skewY(-2deg) scaleX(0.3); }
  20% { opacity: 1; transform: skewY(-2deg) scaleX(1.03); }
  80% { opacity: 1; transform: skewY(-2deg) scaleX(1); }
  100% { opacity: 0; transform: skewY(-2deg) scaleX(1.08); }
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.history-row .h-score {
  font-weight: 900;
  color: var(--accent);
}

@media (max-width: 980px), (max-height: 540px) {
  #top-utils {
    top: 4px;
    right: 6px;
    gap: 4px;
  }
  .icon-btn {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: 0.78rem;
  }
  .icon-btn svg {
    width: 13px;
    height: 13px;
  }
  #match-hud {
    top: 4px;
    left: 6px;
    right: 128px;
    transform: none;
    width: auto;
    gap: 4px;
    justify-content: flex-start;
  }
  .scoreboard {
    padding: 2px 8px;
    border-radius: 8px;
    max-width: 420px;
    min-height: 26px;
  }
  .team-hud {
    gap: 4px;
  }
  .team-badge {
    width: 4px;
    height: 16px;
  }
  .team-info {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  .team-name {
    font-size: 0.56rem;
    letter-spacing: 0.02em;
  }
  .set-dot {
    width: 5px;
    height: 5px;
  }
  .score-box {
    font-size: 0.95rem;
    min-width: 16px;
  }
  .hud-center {
    flex-direction: row;
    padding: 0 5px;
    gap: 5px;
  }
  .set-label {
    font-size: 0.54rem;
  }
  .touch-status {
    font-size: 0.52rem;
    padding: 1px 5px;
  }
  .serve-indicator {
    font-size: 0.65rem;
  }
  .overlay {
    align-items: flex-start;
    padding: 8px 10px;
  }
  .menu-container {
    gap: 8px;
  }
  .logo-badge {
    font-size: 0.58rem;
    padding: 2px 8px;
  }
  .game-title {
    font-size: 1.55rem;
  }
  .menu-grid {
    gap: 10px;
  }
  .menu-card {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 14px;
  }
  .menu-card h2 {
    font-size: 0.85rem;
    padding-bottom: 5px;
  }
  .mode-btn {
    padding: 6px 10px;
  }
  .mode-btn strong {
    font-size: 0.82rem;
  }
  .mode-btn small {
    font-size: 0.65rem;
  }
  .pill {
    padding: 5px 6px;
    font-size: 0.7rem;
  }
  .primary-cta {
    padding: 10px 24px;
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }
  .roster-preview {
    grid-template-columns: 1fr;
  }
}

