@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700;800&family=Nunito:wght@600;700;800;900&family=Outfit:wght@500;600;700;800;900&display=swap');

/* ==========================================================================
   ZEAXTH GAMES • MOBILE GAMING STUDIO THEME (SUPERCELL & POKÉMON GO CUTE POLISH)
   ========================================================================== */

:root {
  --bg-main: #070a12;
  --bg-card: rgba(15, 23, 42, 0.78);
  --bg-card-hover: rgba(30, 41, 59, 0.88);
  --border-card: rgba(255, 255, 255, 0.12);
  
  --accent-cyan: #00f0ff;
  --accent-blue: #38bdf8;
  --accent-green: #22c55e;
  --accent-purple: #c084fc;
  --accent-amber: #facc15;
  --accent-red: #ef4444;
  
  /* Mino Colors */
  --piece-i: #00f0ff;
  --piece-o: #facc15;
  --piece-t: #c084fc;
  --piece-s: #22c55e;
  --piece-z: #ef4444;
  --piece-j: #3b82f6;
  --piece-l: #f97316;
  
  --font-family: 'Fredoka', 'Outfit', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  color: #ffffff;
  font-family: var(--font-family);
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Subtle Ambient Background */
.game-ambient-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, rgba(2, 132, 199, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 50% 90%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* 100% Edge-to-Edge Container */
.tetris-app-container {
  position: relative;
  width: 100vw;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: transparent;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
  overscroll-behavior: none;
  touch-action: none;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.app-screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
  overscroll-behavior: none;
  touch-action: none;
}

.app-screen.active {
  display: flex;
}

.splash-screen {
  display: none !important;
  pointer-events: none !important;
}

.action-mode-card * {
  pointer-events: none;
}

.action-mode-card {
  pointer-events: auto;
}

.splash-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.studio-logo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.studio-logo-svg {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: logoPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.studio-brand-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffffff;
  margin-top: 6px;
}

.brand-accent {
  color: var(--accent-cyan);
}

.studio-brand-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: #64748b;
  text-transform: uppercase;
}

.splash-loading-wrap {
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.splash-progress-track {
  width: 100%;
  height: 5px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.splash-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #a855f7);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.splash-status-text {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #94a3b8;
}

.splash-studio-footer {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #475569;
}

@keyframes logoPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   SCREEN 1: LOBBY / HOME SCREEN (POKÉMON GO / SUPERCELL MINIMAL)
   ========================================================================== */
.lobby-screen {
  justify-content: space-between;
  padding: 16px 14px 12px;
}

/* Trainer Profile Card */
.trainer-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  width: 100%;
}

.trainer-avatar-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.trainer-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-svg {
  width: 28px;
  height: 28px;
}

.trainer-level-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 8.5px;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--accent-cyan);
  color: #000000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.trainer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.trainer-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trainer-name {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.tier-pill {
  font-size: 9.5px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.tier-bronze {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.trainer-stats-row {
  display: flex;
  gap: 12px;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
}

.icon-stat {
  width: 14px;
  height: 14px;
}

/* Game Modes List */
.game-modes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin: auto 0;
}

.action-mode-card {
  position: relative;
  width: 100%;
  background: rgba(13, 20, 36, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  color: #ffffff;
  font-family: inherit;
  transition: transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.action-mode-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.action-mode-card:active {
  transform: translateY(1px) scale(0.99);
}

.card-icon-pill {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-pill-blue { background: rgba(0, 229, 255, 0.12); color: #00e5ff; }
.icon-pill-green { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.icon-pill-purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.icon-pill-amber { background: rgba(250, 204, 21, 0.12); color: #facc15; }

.mode-svg {
  width: 24px;
  height: 24px;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.card-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.card-subtitle {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 600;
}

/* Tactile Pill Action Buttons (Pokémon GO Style) */
.card-action-btn {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 7px 12px;
  border-radius: 999px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-pill-blue {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 2px 0 #075985;
}

.btn-pill-green {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  box-shadow: 0 2px 0 #166534;
}

.btn-pill-purple {
  background: linear-gradient(180deg, #9333ea 0%, #7e22ce 100%);
  color: #ffffff;
  box-shadow: 0 2px 0 #6b21a8;
}

.btn-pill-amber {
  background: linear-gradient(180deg, #eab308 0%, #ca8a04 100%);
  color: #000000;
  box-shadow: 0 2px 0 #a16207;
}

.btn-pill-cancel {
  background: #334155;
  color: #ffffff;
  box-shadow: 0 2px 0 #1e293b;
}

.app-studio-footer {
  text-align: center;
  font-size: 9.5px;
  font-weight: 800;
  color: #475569;
  letter-spacing: 1px;
}

/* ==========================================================================
   SCREEN 2: GAMEPLAY ARENA
   ========================================================================== */
.game-screen {
  padding: 6px 8px 8px;
}

/* Top Header Bar */
.tetris-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
  width: 100%;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-back {
  background: #1e293b;
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8 !important;
  font-weight: 900;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  white-space: nowrap !important;
  flex-shrink: 0;
}

.mode-tag {
  color: #38bdf8;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  white-space: nowrap !important;
}

.score-pill {
  font-size: 11px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: 0.5px;
}

.sprint-pill {
  border-color: rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.08);
  color: #fef08a;
  font-size: 11px;
  font-weight: 900;
}

.icon-sprint-timer {
  width: 14px;
  height: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-btn {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 2px solid rgba(0, 0, 0, 0.4);
  color: #e2e8f0;
  padding: 5px 9px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.08s ease, filter 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.header-btn *, .action-mode-card *, .academy-tier-card *, .bot-tier-card * {
  pointer-events: none;
}

.btn-modal-cancel *, .btn-action-block *, .btn-join-room * {
  pointer-events: none;
}

.header-btn:hover {
  filter: brightness(1.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.header-btn:active {
  transform: translateY(1px) scale(0.96);
  border-bottom-width: 1px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.btn-back {
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.45) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-bottom: 2px solid rgba(14, 116, 144, 0.8);
  color: #38bdf8 !important;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.btn-back svg {
  stroke: #38bdf8;
}

.btn-retry {
  background: linear-gradient(180deg, rgba(180, 83, 9, 0.35) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-bottom: 2px solid rgba(180, 83, 9, 0.8);
  color: #fbbf24 !important;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.btn-retry svg {
  stroke: #fbbf24;
}

.btn-tuning {
  padding: 5px 7px;
  color: #94a3b8;
}

.btn-tuning:hover {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.btn-exit {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  border: 1px solid #ef4444;
  border-bottom: 2px solid #7f1d1d;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-exit svg {
  stroke: #ffffff;
}

.btn-exit:hover {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.icon-nav {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Practice Toolbar */
.practice-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  margin-bottom: 4px;
}

.practice-toolbar::-webkit-scrollbar {
  display: none;
}

.practice-btn {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease, filter 0.15s ease;
}

.practice-btn:active {
  transform: translateY(1px) scale(0.96);
}

.practice-btn.auto-btn {
  border-color: rgba(34, 197, 94, 0.5);
  color: #22c55e;
}

.practice-btn.auto-btn.active {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #000000;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.icon-mini {
  width: 12px;
  height: 12px;
}

.practice-guide-card {
  width: 100%;
  padding: 4px 8px;
  background: rgba(34, 197, 94, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.2);
  text-align: center;
  font-size: 9px;
  color: #a7f3d0;
  line-height: 1.2;
  margin-bottom: 4px;
}

.practice-guide-card b {
  color: #34d399;
}

/* ==========================================================================
   2. MAIN DUEL ARENA (2-COLUMN: LEFT PLAYER BOARD | RIGHT DOCK + BIG ENEMY)
   ========================================================================== */
.duel-arena {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  width: 100%;
  flex: 1;
  min-height: 0;
  gap: 6px;
  padding: 0;
  overflow: hidden;
}

.primary-matrix-column {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  max-height: 100%;
  flex: 1.15;
  min-width: 0;
  overflow: hidden;
}

.btn-retry {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  color: #fbbf24 !important;
}

.btn-retry:active {
  transform: scale(0.95);
  background: #f59e0b !important;
  color: #030712 !important;
}

.garbage-meter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  flex-shrink: 0;
}

.garbage-count-badge {
  font-size: 8px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: pulseBadge 0.8s infinite alternate ease-in-out;
}

@keyframes pulseBadge {
  0% { transform: scale(0.95); }
  100% { transform: scale(1.1); }
}

.b2b-streak-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(245, 158, 11, 0.25);
  border: 1.5px solid #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  pointer-events: none;
  z-index: 105;
  animation: pulseB2B 0.7s infinite alternate ease-in-out;
}

@keyframes pulseB2B {
  0% { transform: scale(0.96); box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
  100% { transform: scale(1.06); box-shadow: 0 0 16px rgba(245, 158, 11, 0.8); }
}

.combo-floater {
  position: absolute;
  top: 40%;
  right: 12px;
  font-size: 14px;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.9);
  pointer-events: none;
  opacity: 0;
  transform: translateY(0) scale(0.85);
  transition: all 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 110;
}

.combo-floater.active {
  opacity: 1;
  transform: translateY(-20px) scale(1.1);
}

@keyframes screenShake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, 1px); }
  80% { transform: translate(2px, -1px); }
  100% { transform: translate(0, 0); }
}

.matrix-frame.shake-impact,
.matrix-frame.matrix-shake {
  animation: screenShake 0.22s ease-in-out !important;
}

.card-sandbox {
  border-left: 4px solid #00f0ff !important;
}

.sandbox-toolbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  background: rgba(11, 17, 30, 0.92);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  margin-top: 4px;
  width: 100%;
}

.sandbox-palette-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  overflow-x: auto;
}

.sandbox-tile-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #1e293b;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  font-weight: 900;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sandbox-tile-btn.active {
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  background: rgba(0, 240, 255, 0.15);
}

.sandbox-tool-btn {
  padding: 5px 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease, filter 0.15s ease;
}

.sandbox-tool-btn:active {
  transform: translateY(1px) scale(0.96);
}

.sandbox-tool-btn.btn-danger {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.3) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.sandbox-action-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-sandbox-play {
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #000000;
  font-family: inherit;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.4);
  transition: transform 0.08s ease, filter 0.15s ease;
}

.btn-sandbox-play:active {
  transform: translateY(1px) scale(0.96);
}

.btn-sandbox-play.mode-playing {
  background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
  box-shadow: 0 2px 10px rgba(250, 204, 21, 0.4);
}

.sandbox-hint {
  font-size: 9.5px;
  color: #94a3b8;
  font-weight: 600;
}

.garbage-cancel-floater {
  position: absolute;
  top: 30%;
  left: 10px;
  font-size: 13px;
  font-weight: 900;
  color: #00f0ff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
  pointer-events: none;
  opacity: 0;
  transform: translateY(0);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 110;
}

.garbage-cancel-floater.active {
  opacity: 1;
  transform: translateY(-24px);
}

.tuning-select-dropdown {
  background: #1e293b;
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}

.garbage-meter-bar {
  width: 6px;
  height: 100%;
  max-height: 100%;
  background: #1e293b;
  border-radius: 3px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.garbage-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, #ef4444, #f97316);
  border-radius: 3px;
  transition: height 0.15s ease-out;
}

.matrix-frame {
  position: relative;
  height: auto;
  max-height: 100%;
  aspect-ratio: 10 / 20;
  width: auto;
  max-width: 100%;
  background: #060911;
  border: 1.5px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  margin: auto;
}

/* Critical Danger State (Last 3 Lines Remaining) - Pulsing Crimson Neon Perimeter Aura */
.matrix-frame.critical-danger {
  border-color: #ff0055 !important;
  box-shadow: 0 0 28px rgba(255, 0, 85, 0.75), inset 0 0 18px rgba(255, 0, 85, 0.3) !important;
  animation: dangerAuraPulse 0.4s infinite alternate ease-in-out;
}

@keyframes dangerAuraPulse {
  0% {
    box-shadow: 0 0 14px rgba(255, 0, 85, 0.45), inset 0 0 8px rgba(255, 0, 85, 0.2);
    border-color: rgba(255, 0, 85, 0.7);
  }
  100% {
    box-shadow: 0 0 32px rgba(255, 0, 85, 0.9), inset 0 0 24px rgba(255, 0, 85, 0.45);
    border-color: #ff0055;
  }
}

/* All Clear (PC) Golden Supernova Frame Bloom */
.matrix-frame.all-clear-bloom {
  animation: allClearGoldBloom 0.8s ease-out !important;
}

@keyframes allClearGoldBloom {
  0% {
    border-color: #ffffff;
    box-shadow: 0 0 45px rgba(251, 191, 36, 1), inset 0 0 30px rgba(251, 191, 36, 0.8);
  }
  40% {
    border-color: #fbbf24;
    box-shadow: 0 0 60px rgba(251, 191, 36, 0.9), inset 0 0 40px rgba(251, 191, 36, 0.6);
  }
  100% {
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
  }
}

.main-matrix-canvas {
  height: 100%;
  aspect-ratio: 10 / 20;
  width: auto;
  display: block;
  object-fit: contain;
}

.action-ticker-banner {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 25, 0.94);
  border: 1.5px solid var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
  padding: 6px 14px;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-ticker-banner.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.ticker-title {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.ticker-sub {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-cyan);
}

/* Right Side Dock (Holds Enlarged Next + Short Hold + Opponent Board) */
.side-dock.right-dock {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 138px;
  min-width: 120px;
  max-width: 155px;
  flex-shrink: 0;
  height: 100%;
  max-height: 100%;
  gap: 4px;
}

.dock-card {
  background: rgba(11, 18, 33, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 8px;
  padding: 3px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

/* 1. Enlarged NEXT Piece Window */
.next-card-enlarged {
  flex: 1;
  min-height: 0;
  max-height: 490px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  box-sizing: border-box;
}

.next-queue-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
}

.mini-preview-wrap {
  width: 96px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.next-primary-wrap {
  width: 110px !important;
  height: 74px !important;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.16);
  padding-bottom: 4px;
  margin-bottom: 3px;
}

.mini-preview-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 2. Short HOLD Window (Under NEXT) */
.hold-card-short {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  gap: 2px;
  flex-shrink: 0;
  height: 68px;
}

.hold-canvas-wrap {
  width: 96px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hold-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.dock-label {
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #94a3b8;
  text-transform: uppercase;
}

.label-enemy {
  color: #ff3366 !important;
}

/* 3. Opponent Window (Compact, Sitting Snugly on Bottom without Gap) */
.opponent-mini-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 4px 6px 4px;
  width: 100%;
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
  margin: 0;
}

.opp-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px;
}

.opp-badge {
  font-size: 7.5px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 0, 85, 0.2);
  color: #ff3366;
  border: 1px solid rgba(255, 0, 85, 0.4);
}

.opp-matrix-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: auto;
}

.opp-garbage-meter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  max-height: 265px;
  flex-shrink: 0;
}

.opp-garbage-count-badge {
  font-size: 7px;
  font-weight: 900;
  padding: 1px 3px;
  border-radius: 3px;
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
  animation: pulseBadge 0.8s infinite alternate ease-in-out;
}

.opp-garbage-meter-bar {
  width: 4px;
  height: 100%;
  background: #1e293b;
  border-radius: 2px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border: 1px solid rgba(255, 0, 85, 0.3);
  flex-shrink: 0;
}

.opp-garbage-fill {
  width: 100%;
  height: 0%;
  background: #ef4444;
  transition: height 0.15s ease-out, background 0.2s ease;
  border-radius: 2px;
}

.opp-matrix-frame {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 265px !important;
  aspect-ratio: 10 / 20 !important;
  background: rgba(6, 9, 17, 0.75);
  border: 1.5px solid rgba(255, 0, 85, 0.7);
  box-shadow: 0 0 14px rgba(255, 0, 85, 0.3);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.opp-matrix-canvas {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 10 / 20 !important;
  display: block;
  object-fit: contain;
}

.stats-badge-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 6px;
  padding: 3px 5px;
}

.stat-item {
  font-size: 8px;
  font-weight: 800;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 1px;
}

.stat-val {
  color: var(--accent-cyan);
  font-weight: 900;
}

/* ==========================================================================
   3. ERGONOMIC 4-4 TACTILE MOBILE TOUCH DOCK
   ========================================================================== */
.touch-controls-dock {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 132px;
  min-height: 132px;
  max-height: 132px;
  gap: 10px;
  padding: 4px 2px;
  background: rgba(11, 15, 25, 0.95);
  border-top: 1px solid var(--border-card);
  flex-shrink: 0;
}

.touch-cluster-left-4grid,
.touch-cluster-right-4grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  height: 100%;
  justify-content: center;
}

.touch-row-2 {
  display: flex;
  gap: 4px;
  flex: 1;
}

.gamepad-key {
  flex: 1;
  height: 100%;
  background: #182238;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 3px solid rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.05s, border-bottom-width 0.05s, background-color 0.05s;
}

.gamepad-key:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  background: #253354;
}

.key-svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
  margin-bottom: 2px;
}

.key-text {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* Key Accents */
.key-hold {
  border-color: rgba(250, 204, 21, 0.35);
  color: #facc15;
}

.key-harddrop {
  border-color: rgba(0, 229, 255, 0.4);
  color: #00e5ff;
}

.key-180 {
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.key-softdrop {
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

/* ==========================================================================
   MODALS (CLEAN MOBILE GAMING CARDS)
   ========================================================================== */
.game-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.game-modal-card {
  width: 100%;
  max-width: 320px;
  background: #141c2e;
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: modalPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 4px;
}

.modal-back-btn {
  padding: 4px 10px !important;
  font-size: 11px !important;
  height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.modal-header-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.modal-desc {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 600;
  text-align: center;
  margin-top: 2px;
}

.diff-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin: 16px 0 8px;
}

.diff-tier-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #1b253b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 3px solid rgba(0, 0, 0, 0.3);
  cursor: pointer;
  text-align: left;
  color: #ffffff;
  font-family: inherit;
  transition: transform 0.08s;
}

.diff-tier-card:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

.diff-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.diff-name {
  font-size: 13.5px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-green { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.dot-amber { background: #facc15; box-shadow: 0 0 6px #facc15; }
.dot-red { background: #ef4444; box-shadow: 0 0 6px #ef4444; }

.diff-speed-tag {
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.diff-detail {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

.btn-modal-cancel {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 6px;
}

.btn-modal-cancel:active {
  transform: scale(0.97);
}

/* ==========================================================================
   PREMIUM ESPORTS VICTORY & GAME OVER MODAL CARD
   ========================================================================== */
.victory-esports-card {
  max-width: 340px !important;
  background: linear-gradient(180deg, rgba(20, 28, 46, 0.96) 0%, rgba(10, 15, 29, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-top: 1.5px solid rgba(0, 240, 255, 0.5) !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 240, 255, 0.15) !important;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 22px 18px !important;
}

.victory-trophy-container {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.trophy-ambient-aura {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.4) 0%, rgba(250, 204, 21, 0) 70%);
  animation: trophyAuraPulse 2s infinite alternate ease-in-out;
}

@keyframes trophyAuraPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1.0; }
}

.victory-trophy-badge {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.25) 0%, rgba(217, 119, 6, 0.2) 100%);
  border: 1.5px solid rgba(250, 204, 21, 0.6);
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #facc15;
}

.trophy-svg {
  width: 30px;
  height: 30px;
  stroke: #facc15;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.6));
}

.victory-esports-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.8px;
  background: linear-gradient(135deg, #ffffff 0%, #facc15 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(250, 204, 21, 0.3);
  margin-bottom: 2px;
}

.esports-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin: 12px 0 16px 0;
}

.esports-stat-card {
  background: rgba(14, 20, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform 0.15s ease;
}

.esports-stat-card:active {
  transform: scale(0.98);
}

.stat-card-label {
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #64748b;
  text-transform: uppercase;
}

.stat-card-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.stat-card-num {
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.text-amber { color: #facc15; }
.text-purple { color: #c084fc; }
.text-cyan { color: #00f0ff; }
.text-green { color: #22c55e; }

.stat-card-chip {
  font-size: 8px;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 4px;
}

.chip-gold {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.4);
}

.btn-esports-rematch {
  background: linear-gradient(135deg, #00f0ff 0%, #0077ff 100%) !important;
  color: #030712 !important;
  font-weight: 900 !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.4) !important;
  border-radius: 14px !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.btn-esports-rematch:active {
  transform: scale(0.96) !important;
}

.btn-esports-lobby {
  background: rgba(30, 41, 59, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
}

.btn-esports-lobby:active {
  transform: scale(0.96) !important;
}

/* Modal Reason Badges */
.modal-reason-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #22c55e;
  text-align: center;
  margin: 4px 0 6px 0;
  width: 100%;
  letter-spacing: 0.3px;
}

.modal-reason-badge.defeat {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.modal-rematch-hint {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  margin-top: 10px;
  text-align: center;
}

/* TETR.IO Lethal Spike Warning Alert */
.matrix-frame.matrix-lethal-strobe {
  border-color: #ef4444 !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.9), inset 0 0 15px rgba(239, 68, 68, 0.4) !important;
  animation: lethalSpikeStrobe 0.4s infinite alternate ease-in-out !important;
}

@keyframes lethalSpikeStrobe {
  from { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
  to { border-color: #ff0055; box-shadow: 0 0 35px rgba(255, 0, 85, 1.0), inset 0 0 20px rgba(255, 0, 85, 0.6); }
}

/* TETR.IO B2B Charging Meter Pill */
.hud-b2b-pill {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 10;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: b2bPopIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

@keyframes b2bPopIn {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.hud-b2b-pill.b2b-tier-1 {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.6);
  color: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.hud-b2b-pill.b2b-tier-2 {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
}

.hud-b2b-pill.b2b-tier-3 {
  background: rgba(239, 68, 68, 0.25);
  border: 1.5px solid #ef4444;
  color: #ff4d4d;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.7);
}

.hud-b2b-pill.b2b-tier-4 {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.3) 0%, rgba(192, 132, 252, 0.3) 100%);
  border: 1.5px solid #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.8), 0 0 10px rgba(192, 132, 252, 0.6);
  animation: b2bMaxSurgePulse 0.6s infinite alternate ease-in-out;
}

@keyframes b2bMaxSurgePulse {
  0% { transform: scale(1); box-shadow: 0 0 14px rgba(0, 240, 255, 0.6); }
  100% { transform: scale(1.08); box-shadow: 0 0 28px rgba(0, 240, 255, 1.0), 0 0 15px rgba(192, 132, 252, 0.9); }
}

.opponent-mini-dock.danger-pulsing {
  border-color: #ef4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6) !important;
  animation: dangerPulse 0.8s infinite alternate ease-in-out;
}

@keyframes dangerPulse {
  from { box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); border-color: rgba(239, 68, 68, 0.6); }
  to { box-shadow: 0 0 20px rgba(239, 68, 68, 0.9); border-color: #ef4444; }
}

.opponent-mini-dock.knockout-crumble {
  animation: koCrumble 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes koCrumble {
  10%, 90% { transform: translate3d(-2px, 0, 0); filter: brightness(1.6) contrast(1.4); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Satisfying Hard Drop Matrix Elastic Bounce */
.matrix-frame.hard-drop-bounce {
  animation: matrixBounce 0.16s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes matrixBounce {
  0% { transform: translateY(0); }
  45% { transform: translateY(3.5px); }
  100% { transform: translateY(0); }
}

/* Quad & T-Spin Matrix Micro-Shake (Juice & Punch) */
.matrix-frame.matrix-shake-heavy {
  animation: matrixShakePunch 0.22s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;
}

@keyframes matrixShakePunch {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px) scale(1.008); }
  40% { transform: translate(2.5px, -2px); }
  60% { transform: translate(-1.5px, 1px); }
  80% { transform: translate(1px, -0.5px); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Upward Settling Elastic Rebound on Line Clears */
.matrix-frame.clear-rebound {
  animation: matrixClearRebound 0.18s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

@keyframes matrixClearRebound {
  0% { transform: translateY(0); }
  40% { transform: translateY(-3px) scaleY(0.995); }
  75% { transform: translateY(1px); }
  100% { transform: translateY(0) scaleY(1); }
}

/* Exact Numerical Incoming Line Counter Badge */
.garbage-counter-badge {
  position: absolute;
  top: -24px;
  left: 0;
  min-width: 26px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: #ef4444;
  color: #ffffff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.9), inset 0 0 4px rgba(255, 255, 255, 0.5);
  border: 1.5px solid #ffffff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  z-index: 100;
}

.garbage-counter-badge.visible {
  opacity: 1;
  transform: scale(1);
}

.garbage-counter-badge.lethal {
  background: #ff0055;
  box-shadow: 0 0 16px rgba(255, 0, 85, 1), inset 0 0 6px #ffffff;
  animation: badgePulsing 0.35s infinite alternate ease-in-out;
}

@keyframes badgePulsing {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* Sprint 40-Lines Personal Best Pacer */
.sprint-pacer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  font-family: 'Inter', system-ui, sans-serif;
  margin-left: 8px;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.sprint-pacer-badge.ahead {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.sprint-pacer-badge.behind {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.sprint-pacer-badge.neutral {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.modal-stats-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  background: #101726;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
}

.modal-stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
}

.stat-highlight {
  font-weight: 900;
  color: #facc15;
}

.modal-buttons-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.btn-modal-action {
  flex: 1;
  padding: 11px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

/* Custom Room */
.custom-room-container {
  width: 100%;
  margin-top: 14px;
}

.divider-text {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  margin: 10px 0;
}

.room-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-room-code {
  flex: 1;
  text-align: center;
  text-transform: uppercase;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 4px;
  background: #0f172a;
  border: 1.5px solid rgba(0, 229, 255, 0.4);
  border-radius: 12px;
  color: #00e5ff;
  height: 44px;
}

.btn-join-room {
  padding: 0 16px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.btn-action-block {
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.room-code-display {
  font-size: 32px;
  font-weight: 900;
  color: #00e5ff;
  letter-spacing: 6px;
  padding: 12px;
  background: rgba(0, 229, 255, 0.08);
  border: 1.5px dashed #00e5ff;
  border-radius: 12px;
  margin: 10px 0 12px;
}

.modal-hint {
  font-size: 11px;
  color: #94a3b8;
}

.waiting-indicator {
  font-size: 11px;
  color: #facc15;
  margin-bottom: 12px;
}

/* ==========================================================================
   MODAL 4: TUNING & CONTROLS STYLES
   ========================================================================== */
.tuning-modal-card {
  max-width: 360px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 16px 14px;
}

.tuning-settings-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

.tuning-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #101726;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-label-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-title {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
}

.setting-hint {
  font-size: 9px;
  color: #64748b;
  font-weight: 600;
}

.tuning-slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #101726;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.slider-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-val-tag {
  font-size: 10.5px;
  font-weight: 900;
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
}

.tuning-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 4px;
  outline: none;
}

.tuning-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-cyan);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

/* Switch Toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 24px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--accent-cyan);
}

input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* Keybinds Guide Card */
.keybinds-guide-card {
  background: #0b0f19;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keybinds-header {
  font-size: 10px;
  font-weight: 900;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}

.keybinds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
}

.key-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.key-pill {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 900;
  font-size: 9px;
}

@keyframes modalPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   THEMES & GLOW SKINS MODAL STYLES
   ========================================================================== */
.app-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.themes-modal-card {
  max-width: 390px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  background: #090e1a;
  border: 1.5px solid rgba(0, 229, 255, 0.3);
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 229, 255, 0.15);
  padding: 18px 16px;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.themes-grid-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.theme-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.theme-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 229, 255, 0.35);
}

.theme-card.active {
  background: rgba(0, 229, 255, 0.08);
  border-color: #00e5ff;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.2);
}

.theme-preview-palette {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.palette-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.dot-cyan { background: #00f0ff; box-shadow: 0 0 6px #00f0ff; }
.dot-yellow { background: #facc15; box-shadow: 0 0 6px #facc15; }
.dot-purple { background: #c084fc; box-shadow: 0 0 6px #c084fc; }
.dot-green { background: #22c55e; box-shadow: 0 0 6px #22c55e; }

.dot-orange { background: #f97316; box-shadow: 0 0 6px #f97316; }
.dot-pink { background: #f43f5e; box-shadow: 0 0 6px #f43f5e; }
.dot-violet { background: #8b5cf6; box-shadow: 0 0 6px #8b5cf6; }
.dot-amber { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }

.dot-phosphor { background: #34d399; box-shadow: 0 0 6px #34d399; }
.dot-emerald { background: #10b981; box-shadow: 0 0 6px #10b981; }
.dot-mint { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.dot-lime { background: #a3e635; box-shadow: 0 0 6px #a3e635; }

.dot-pure-cyan { background: #00f0ff; }
.dot-pure-yellow { background: #ffe600; }
.dot-pure-red { background: #f00000; }
.dot-pure-blue { background: #0000f0; }

.theme-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.theme-name {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.theme-desc {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
}

.btn-theme-equip,
.btn-stage-equip {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.btn-theme-equip.active,
.btn-stage-equip.active {
  background: #00e5ff;
  color: #030712;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

/* ==========================================================================
   50-LINES SPRINT SPEEDRUN COCKPIT & VICTORY MODAL STYLES
   ========================================================================== */
.sprint-pill {
  background: rgba(250, 204, 21, 0.12) !important;
  border-color: rgba(250, 204, 21, 0.5) !important;
  color: #facc15 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  padding: 3px 12px !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.25) !important;
}

.sprint-sub {
  font-size: 8.5px;
  font-weight: 900;
  color: #fef08a;
  letter-spacing: 0.5px;
}

/* Dedicated Sprint Speedrun Cockpit Dashboard Card */
.sprint-cockpit-dock {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid rgba(250, 204, 21, 0.4);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(250, 204, 21, 0.06);
  animation: cockpitGlowPulse 4s infinite alternate;
}

@keyframes cockpitGlowPulse {
  0% { border-color: rgba(250, 204, 21, 0.35); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 14px rgba(250, 204, 21, 0.04); }
  100% { border-color: rgba(250, 204, 21, 0.65); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(250, 204, 21, 0.25), inset 0 0 22px rgba(250, 204, 21, 0.08); }
}

.cockpit-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cockpit-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cockpit-bolt-svg {
  width: 17px;
  height: 17px;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.8));
}

.cockpit-title {
  font-size: 12px;
  font-weight: 900;
  color: #facc15;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.cockpit-pb-chip {
  font-size: 10px;
  font-weight: 800;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #fef08a;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.cockpit-chrono-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 8px;
  margin-bottom: 12px;
}

.cockpit-timer-text {
  font-size: 30px;
  font-weight: 900;
  font-family: 'Outfit', monospace;
  color: #00f0ff;
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
  letter-spacing: 1.5px;
  line-height: 1;
}

.cockpit-pacer-badge {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.cockpit-pacer-badge.ahead {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.6);
  color: #4ade80;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.cockpit-pacer-badge.behind {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.cockpit-pacer-badge.neutral {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.cockpit-progress-section {
  margin-bottom: 12px;
}

.cockpit-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.8px;
  margin-bottom: 5px;
}

.label-progress-count {
  color: #facc15;
  font-weight: 900;
}

.cockpit-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.cockpit-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00f0ff 0%, #facc15 100%);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.7);
  transition: width 0.15s ease-out;
  border-radius: 6px;
}

.cockpit-telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
}

.cockpit-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
}

.cockpit-stat-box .stat-k {
  font-size: 8px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.6px;
}

.cockpit-stat-box .stat-v-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 1px;
}

.cockpit-stat-box .stat-v {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
}

.cockpit-stat-box .stat-u {
  font-size: 8.5px;
  font-weight: 800;
  color: #64748b;
}

.text-cyan { color: #00f0ff; text-shadow: 0 0 10px rgba(0, 240, 255, 0.5); }
.text-amber { color: #facc15; text-shadow: 0 0 10px rgba(250, 204, 21, 0.5); }
.text-green { color: #4ade80; text-shadow: 0 0 10px rgba(74, 222, 128, 0.5); }
.text-purple { color: #c084fc; text-shadow: 0 0 10px rgba(192, 132, 252, 0.5); }
.text-gold { color: #fbbf24; text-shadow: 0 0 14px rgba(251, 191, 36, 0.6); }

.btn-cockpit-restart {
  width: 100%;
  padding: 8px 0;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.22), rgba(245, 158, 11, 0.3));
  border: 1.5px solid #facc15;
  border-radius: 10px;
  color: #fef08a;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(250, 204, 21, 0.1);
}

.btn-cockpit-restart:hover,
.btn-cockpit-restart:active {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #020617;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.6);
  transform: translateY(-1px);
}

/* ==========================================================================
   SPRINT VICTORY SPEEDRUN MODAL
   ========================================================================== */
.sprint-victory-card {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 24, 38, 0.96) 0%, rgba(10, 14, 26, 0.98) 100%) !important;
  border: 1.5px solid rgba(250, 204, 21, 0.6) !important;
  box-shadow: 0 0 45px rgba(250, 204, 21, 0.25), 0 20px 50px rgba(0, 0, 0, 0.8) !important;
  text-align: center;
  padding: 24px 20px 20px 20px !important;
  max-width: 360px !important;
  width: 90% !important;
}

.sprint-modal-crown {
  position: relative;
  width: 58px;
  height: 58px;
  margin: -42px auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trophy-glow-halo {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.5) 0%, transparent 70%);
  border-radius: 50%;
  animation: haloPulse 2s infinite alternate;
}

@keyframes haloPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1.0; }
}

.sprint-trophy-svg {
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.9));
}

.pill-sprint-gold {
  background: rgba(250, 204, 21, 0.15) !important;
  border: 1px solid rgba(250, 204, 21, 0.5) !important;
  color: #fde047 !important;
  font-weight: 900 !important;
  letter-spacing: 1px !important;
}

.hero-time-label {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hero-time-chrono {
  font-size: 38px;
  font-weight: 900;
  font-family: 'Outfit', monospace;
  color: #facc15;
  text-shadow: 0 0 25px rgba(250, 204, 21, 0.6);
  letter-spacing: 2px;
  line-height: 1.1;
  margin: 2px 0 4px 0;
}

.pb-badge-sparkle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.7);
  letter-spacing: 0.5px;
  animation: pulse 1s infinite alternate;
}

.pb-badge-sparkle .sparkle-svg {
  width: 13px;
  height: 13px;
}

.sprint-stats-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 6px 0;
  text-align: left;
}

.sprint-stat-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
}

.sprint-stat-tile.full-width {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tile-k {
  display: block;
  font-size: 8.5px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.8px;
}

.tile-v {
  font-size: 16px;
  font-weight: 900;
}

.btn-sprint-retry {
  background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%) !important;
  color: #020617 !important;
  font-weight: 900 !important;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.5) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-sprint-retry:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.8) !important;
}

.btn-sprint-lobby {
  background: rgba(30, 41, 59, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #f1f5f9 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Theme Variant Matrix Frame Adjustments */
.app-container.theme-synthwave .matrix-frame {
  border-color: rgba(244, 63, 94, 0.6);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.2);
}

.app-container.theme-matrix .matrix-frame {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.app-container.theme-minimalist .matrix-frame {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: none;
}

/* ==========================================================================
   SUPERCELL / POKÉMON GO CUTE POLISH & HERO MODE CARD STYLES
   ========================================================================== */
.card-pvp {
  border-left: 3.5px solid #00f0ff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 0 14px rgba(0, 240, 255, 0.05) !important;
}
.card-pvp:active {
  border-color: #00f0ff !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3) !important;
}

.card-custom-duel {
  border-left: 3.5px solid #facc15 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 0 14px rgba(250, 204, 21, 0.05) !important;
}
.card-custom-duel:active {
  border-color: #facc15 !important;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.3) !important;
}

.card-bot {
  border-left: 3.5px solid #22c55e !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 0 14px rgba(34, 197, 94, 0.05) !important;
}
.card-bot:active {
  border-color: #22c55e !important;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3) !important;
}

.card-sprint {
  border-left: 3.5px solid #fb923c !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 0 14px rgba(251, 146, 60, 0.05) !important;
}
.card-sprint:active {
  border-color: #fb923c !important;
  box-shadow: 0 0 20px rgba(251, 146, 60, 0.3) !important;
}

.card-sandbox {
  border-left: 3.5px solid #38bdf8 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 0 14px rgba(56, 189, 248, 0.05) !important;
}
.card-sandbox:active {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3) !important;
}

.btn-pill-cyan, .btn-pill-green, .btn-pill-amber, .btn-pill-purple, .btn-pill-blue {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 10.5px !important;
  letter-spacing: 0.5px !important;
  transition: all 0.15s ease !important;
}

.btn-pill-cyan:hover {
  border-color: #00f0ff !important;
  color: #00f0ff !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3) !important;
}
.btn-pill-green:hover {
  border-color: #22c55e !important;
  color: #22c55e !important;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.3) !important;
}
.btn-pill-amber:hover {
  border-color: #facc15 !important;
  color: #facc15 !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.3) !important;
}

/* Scalable Vector Rank Badges */
.rank-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.25));
}

.icon-pill-cyan {
  background: rgba(0, 240, 255, 0.12) !important;
  border: 1.5px solid rgba(0, 240, 255, 0.4) !important;
  border-radius: 14px !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.icon-pill-green {
  background: rgba(34, 197, 94, 0.12) !important;
  border: 1.5px solid rgba(34, 197, 94, 0.4) !important;
  border-radius: 14px !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.icon-pill-purple {
  background: rgba(192, 132, 252, 0.12) !important;
  border: 1.5px solid rgba(192, 132, 252, 0.4) !important;
  border-radius: 14px !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Bottom Nav */
.lobby-bottom-nav {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.nav-btn-tab {
  flex: 1;
  height: 44px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 800;
  font-size: 11.5px;
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn-tab:active {
  transform: scale(0.96);
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
}

.status-online-pill {
  font-size: 10px;
  font-weight: 800;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

/* Spin Academy Modal */
.academy-modal-card {
  max-width: 360px !important;
  padding: 22px 18px !important;
}

.academy-presets-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
  width: 100%;
}

.academy-tier-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #ffffff;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.academy-tier-card:active {
  transform: translateY(2px);
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(192, 132, 252, 0.3);
}

.preset-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preset-name {
  font-size: 13px;
  font-weight: 800;
}

.preset-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.tag-cyan { background: rgba(0, 240, 255, 0.2); color: #00f0ff; }
.tag-purple { background: rgba(192, 132, 252, 0.2); color: #c084fc; }
.tag-amber { background: rgba(250, 204, 21, 0.2); color: #facc15; }
.tag-green { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

.preset-detail {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.3;
}

.btn-demo {
  background: rgba(34, 197, 94, 0.2) !important;
  border: 1.5px solid #22c55e !important;
  color: #22c55e !important;
  font-weight: 800 !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  cursor: pointer;
}

.btn-demo.active {
  background: #22c55e !important;
  color: #000000 !important;
  box-shadow: 0 0 12px #22c55e !important;
}
/* ==========================================================================
   TETRISGO BRAND HEADER & GLOWING TITLE
   ========================================================================== */
.studio-main-header {
  text-align: center;
  padding: 24px 0 12px 0;
  width: 100%;
}

.game-brand-title {
  font-size: 3.4rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 0 25px rgba(0, 240, 255, 0.7), 0 0 50px rgba(0, 240, 255, 0.35);
  display: inline-block;
  line-height: 1;
}

.brand-title-accent {
  color: #00f0ff;
  text-shadow: 0 0 25px rgba(0, 240, 255, 0.9), 0 0 50px rgba(0, 240, 255, 0.5);
}

.lobby-screen {
  background: transparent !important;
}

.tetris-app-container {
  background: transparent !important;
}
/* Ensure translucent cosmic background behind matrix board during active gameplay */
.game-screen {
  background: transparent !important;
}

.lobby-screen {
  background: transparent !important;
}
/* ==========================================================================
   SUPERCELL / ARCADE BEAUTIFUL 3D TACTILE BUTTONS & PERFECT GROUND MATRIX
   ========================================================================== */
.primary-matrix-column {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  height: 100% !important;
  max-height: 100% !important;
  flex: 1.15 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.matrix-frame {
  position: relative !important;
  height: auto !important;
  max-height: 100% !important;
  aspect-ratio: 10 / 20 !important;
  width: auto !important;
  max-width: 100% !important;
  background: rgba(4, 7, 16, 0.72) !important;
  border: 2px solid rgba(0, 240, 255, 0.6) !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: auto !important;
}

.main-matrix-canvas {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 10 / 20 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
  object-fit: contain !important;
  vertical-align: bottom !important;
  margin: auto !important;
}

/* 3. ERGONOMIC 4-4 TACTILE MOBILE TOUCH DOCK */
.touch-controls-dock {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  height: 136px !important;
  min-height: 136px !important;
  max-height: 136px !important;
  gap: 10px !important;
  padding: 6px 8px !important;
  background: rgba(10, 15, 29, 0.96) !important;
  border-top: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  flex-shrink: 0 !important;
}

.touch-cluster-left-4grid,
.touch-cluster-right-4grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  flex: 1 !important;
  height: 100% !important;
  justify-content: center !important;
}

.touch-row-2 {
  display: flex !important;
  gap: 6px !important;
  flex: 1 !important;
}

.gamepad-key {
  flex: 1 !important;
  height: 100% !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: inherit !important;
  cursor: pointer !important;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  transition: all 0.08s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
}

.gamepad-key:active {
  transform: translateY(3px) scale(0.97) !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6) !important;
}

.key-svg {
  width: 22px !important;
  height: 22px !important;
  pointer-events: none !important;
  margin-bottom: 2px !important;
}

.key-text {
  font-size: 9.5px !important;
  font-weight: 900 !important;
  letter-spacing: 0.5px !important;
  pointer-events: none !important;
}

/* Modern eSports Frosted Glass & Laser Outline Touch Controls */
.gamepad-key {
  position: relative !important;
  background: rgba(13, 19, 33, 0.82) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-radius: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 4px 2px !important;
  cursor: pointer !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: none !important;
  transition: transform 0.08s ease, background 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease !important;
}

.gamepad-key:active {
  transform: scale(0.93) translateY(1px) !important;
}

/* 1. HOLD KEY: Sleek Amber Gold Laser Outline */
.key-hold {
  border: 1.5px solid rgba(245, 158, 11, 0.75) !important;
  color: #fde68a !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), inset 0 0 10px rgba(245, 158, 11, 0.1) !important;
}
.key-hold .key-svg { stroke: #fbbf24 !important; }
.key-hold .key-text { color: #fde68a !important; }
.key-hold:active {
  background: rgba(245, 158, 11, 0.22) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5) !important;
}

/* 2. HARD DROP KEY: Electric Cyan Laser Outline */
.key-harddrop {
  border: 1.5px solid rgba(0, 240, 255, 0.85) !important;
  color: #a5f3fc !important;
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.15), inset 0 0 12px rgba(0, 240, 255, 0.12) !important;
}
.key-harddrop .key-svg { stroke: #00f0ff !important; fill: rgba(0, 240, 255, 0.18) !important; }
.key-harddrop .key-text { color: #00f0ff !important; font-weight: 900 !important; }
.key-harddrop:active {
  background: rgba(0, 240, 255, 0.25) !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6) !important;
}

/* 3. NAVIGATION KEYS (LEFT / RIGHT): Ice-Slate Precision Outline */
.key-nav {
  border: 1.5px solid rgba(148, 163, 184, 0.55) !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 0 8px rgba(255, 255, 255, 0.04) !important;
}
.key-nav .key-svg { stroke: #e2e8f0 !important; }
.key-nav .key-text { color: #e2e8f0 !important; }
.key-nav:active {
  background: rgba(148, 163, 184, 0.22) !important;
  border-color: rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.3) !important;
}

/* 4. ROTATION KEYS (CCW / CW): Sky Blue Laser Outline */
.key-rot {
  border: 1.5px solid rgba(56, 189, 248, 0.75) !important;
  color: #bae6fd !important;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15), inset 0 0 10px rgba(56, 189, 248, 0.1) !important;
}
.key-rot .key-svg { stroke: #38bdf8 !important; }
.key-rot .key-text { color: #bae6fd !important; }
.key-rot:active {
  background: rgba(56, 189, 248, 0.22) !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5) !important;
}

/* 5. 180° KEY: Cyber Amethyst Laser Outline */
.key-180 {
  border: 1.5px solid rgba(192, 132, 252, 0.75) !important;
  color: #f3e8ff !important;
  box-shadow: 0 4px 12px rgba(192, 132, 252, 0.15), inset 0 0 10px rgba(192, 132, 252, 0.1) !important;
}
.key-180 .key-svg { stroke: #c084fc !important; }
.key-180 .key-text { color: #f3e8ff !important; }
.key-180:active {
  background: rgba(192, 132, 252, 0.22) !important;
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.5) !important;
}

/* 6. SOFT DROP KEY: Royal Cobalt Blue Laser Outline */
.key-softdrop {
  border: 1.5px solid rgba(96, 165, 250, 0.75) !important;
  color: #bfdbfe !important;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.15), inset 0 0 10px rgba(96, 165, 250, 0.1) !important;
}
.key-softdrop .key-svg { stroke: #60a5fa !important; }
.key-softdrop .key-text { color: #bfdbfe !important; }
.key-softdrop:active {
  background: rgba(96, 165, 250, 0.22) !important;
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.5) !important;
}
/* ==========================================================================
   SKILL CALIBRATION & TETROMINO SINGULARITY MATCHMAKING
   ========================================================================== */
.calibration-modal-card {
  max-width: 440px !important;
  width: 92% !important;
  background: rgba(10, 14, 26, 0.94) !important;
  border: 1.5px solid rgba(0, 240, 255, 0.4) !important;
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.25), inset 0 0 15px rgba(0, 240, 255, 0.1) !important;
}

.calibration-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.calibration-tier-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(18, 24, 43, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.calibration-tier-card:hover, .calibration-tier-card:active {
  transform: translateY(-2px) scale(1.01);
  border-color: #00f0ff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
  background: rgba(26, 35, 64, 0.95);
}

.calibration-tier-card.tier-rookie:hover { border-color: #22c55e; box-shadow: 0 0 16px rgba(34, 197, 94, 0.35); }
.calibration-tier-card.tier-adept:hover { border-color: #facc15; box-shadow: 0 0 16px rgba(250, 204, 21, 0.35); }
.calibration-tier-card.tier-expert:hover { border-color: #c084fc; box-shadow: 0 0 16px rgba(192, 132, 252, 0.35); }
.calibration-tier-card.tier-veteran:hover { border-color: #00f0ff; box-shadow: 0 0 16px rgba(0, 240, 255, 0.45); }

.tier-badge-icon {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.tier-info {
  flex: 1;
}

.tier-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-tr-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.tier-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.3;
}

.tier-arrow {
  color: #64748b;
  font-weight: 900;
  font-size: 14px;
  transition: transform 0.2s ease;
}

.calibration-tier-card:hover .tier-arrow {
  transform: translateX(3px);
  color: #00f0ff;
}

/* Tetromino Singularity Search Card */
.matchmaking-singularity-card {
  max-width: 380px !important;
  width: 90% !important;
  padding: 24px 20px !important;
  background: rgba(8, 12, 22, 0.96) !important;
  border: 1.5px solid rgba(0, 240, 255, 0.5) !important;
  box-shadow: 0 0 45px rgba(0, 240, 255, 0.3), inset 0 0 20px rgba(0, 240, 255, 0.15) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.singularity-stage {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.singularity-core-pulse {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.8) 0%, rgba(192, 132, 252, 0.4) 60%, transparent 100%);
  animation: corePulsing 1.8s infinite alternate ease-in-out;
  filter: blur(4px);
}

@keyframes corePulsing {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; }
}

.singularity-rings-wrap {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.singularity-ring {
  position: absolute;
  border-radius: 50%;
  border-style: dashed;
}

.ring-outer {
  width: 130px;
  height: 130px;
  border: 1.5px dashed rgba(0, 240, 255, 0.4);
  animation: rotateCW 12s linear infinite;
}

.ring-mid {
  width: 100px;
  height: 100px;
  border: 1.5px dashed rgba(192, 132, 252, 0.5);
  animation: rotateCCW 7s linear infinite;
}

.ring-inner {
  width: 70px;
  height: 70px;
  border: 1.5px dotted rgba(250, 204, 21, 0.6);
  animation: rotateCW 4s linear infinite;
}

@keyframes rotateCW { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rotateCCW { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }

.singularity-orbital-shards {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: rotateCW 5s linear infinite;
}

.tetro-shard {
  position: absolute;
  border-radius: 3px;
  box-shadow: 0 0 10px currentColor;
}

.shard-i { top: 6px; left: 62px; width: 16px; height: 5px; background: #00f0ff; color: #00f0ff; }
.shard-t { bottom: 8px; left: 60px; width: 14px; height: 10px; background: #c084fc; color: #c084fc; clip-path: polygon(33% 0%, 66% 0%, 66% 50%, 100% 50%, 100% 100%, 0% 100%, 0% 50%, 33% 50%); }
.shard-l { left: 8px; top: 60px; width: 10px; height: 14px; background: #f97316; color: #f97316; clip-path: polygon(0% 0%, 50% 0%, 50% 66%, 100% 66%, 100% 100%, 0% 100%); }
.shard-z { right: 8px; top: 62px; width: 14px; height: 10px; background: #ef4444; color: #ef4444; }

.singularity-center-gem {
  position: relative;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(4, 7, 16, 0.85);
  border: 1.5px solid #00f0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.7);
}

.singularity-icon {
  width: 24px;
  height: 24px;
}

.singularity-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.singularity-pool-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 12px;
  padding: 3px 10px;
  margin: 8px 0 6px 0;
  letter-spacing: 0.5px;
}

.singularity-telemetry {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px;
  color: #00f0ff;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  animation: telemetryFlicker 2s infinite ease-in-out;
}

@keyframes telemetryFlicker {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.5; }
}

.btn-cancel-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 220px;
  padding: 10px 18px;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.15);
  border: 1.5px solid rgba(239, 68, 68, 0.6);
  color: #f87171;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-search:hover, .btn-cancel-search:active {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   LOBBY PLAYER PROFILE BAR & RANK BADGE
   ========================================================================== */
.lobby-profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 10px;
  padding: 6px 10px;
  background: rgba(13, 20, 36, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.profile-pill-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.avatar-ring-frame {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  background: #091424;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.avatar-ring-frame:hover {
  transform: scale(1.08);
  box-shadow: 0 0 14px #00f0ff;
}

.avatar-svg, .avatar-tile-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.profile-text-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.player-name-text {
  font-size: 13.5px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: 0.5px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-tr-badge {
  font-size: 10px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

.btn-trophy-ladder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #facc15;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-trophy-ladder:hover, .btn-trophy-ladder:active {
  background: rgba(250, 204, 21, 0.25);
  border-color: #facc15;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.4);
}

.trophy-icon {
  width: 14px;
  height: 14px;
}

/* Card 2: Custom Room Duel */
.card-custom-duel {
  border-left: 3px solid #facc15 !important;
}

.card-custom-duel:hover {
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.2) !important;
}

.btn-pill-amber {
  background: rgba(250, 204, 21, 0.15) !important;
  color: #facc15 !important;
  border: 1px solid rgba(250, 204, 21, 0.4) !important;
}

.btn-copy-code {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  display: block;
}

/* ==========================================================================
   PRE-GAME 3-SECOND COUNTDOWN WINDOW (3... 2... 1... GO!)
   ========================================================================== */
.game-countdown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 18, 0.78);
  backdrop-filter: blur(8px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: countdownFadeIn 0.2s ease-out;
}

@keyframes countdownFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.countdown-pulse-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 240, 255, 0.5);
  animation: countdownRingSpin 2s linear infinite;
}

@keyframes countdownRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.countdown-number {
  font-size: 72px;
  font-weight: 900;
  color: #00f0ff;
  text-shadow: 0 0 30px rgba(0, 240, 255, 0.8), 0 0 60px rgba(0, 240, 255, 0.4);
  letter-spacing: 2px;
  transform: scale(1);
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.countdown-number.pulse {
  animation: countdownNumberPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes countdownNumberPop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.countdown-number.go-state {
  color: #22c55e !important;
  text-shadow: 0 0 35px rgba(34, 197, 94, 0.9), 0 0 70px rgba(34, 197, 94, 0.5) !important;
}

.countdown-subtext {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

/* ==========================================================================
   USER PROFILE & AVATAR MODAL
   ========================================================================== */
.profile-modal-card {
  max-width: 360px !important;
  width: 90% !important;
}

.profile-input-wrap {
  width: 100%;
  margin: 12px 0 16px;
  text-align: left;
}

.profile-input-label {
  display: block;
  font-size: 9.5px;
  font-weight: 900;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.input-gamer-tag {
  width: 100%;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(0, 240, 255, 0.3);
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  outline: none;
  box-sizing: border-box;
}

.input-gamer-tag:focus {
  border-color: #00f0ff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.3);
}

.avatar-selection-label {
  font-size: 9.5px;
  font-weight: 900;
  color: #94a3b8;
  letter-spacing: 1px;
  text-align: left;
  width: 100%;
  margin-bottom: 8px;
}

.avatar-selection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.avatar-select-tile {
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-select-tile:hover {
  border-color: rgba(0, 240, 255, 0.5);
  transform: translateY(-2px);
}

.avatar-select-tile.active {
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
  transform: scale(1.04);
}

.avatar-tile-svg {
  width: 44px;
  height: 44px;
}

.avatar-name-label {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #cbd5e1;
}

.btn-tier-recalibrate {
  background: none;
  border: 1px dashed rgba(250, 204, 21, 0.5);
  color: #facc15;
  font-size: 10px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.5px;
  width: 100%;
}

.btn-tier-recalibrate:hover {
  background: rgba(250, 204, 21, 0.1);
  border-style: solid;
}

/* ==========================================================================
   RANKED ESPORTS LEADERBOARD MODAL
   ========================================================================== */
.leaderboard-modal-card {
  max-width: 400px !important;
  width: 92% !important;
  padding: 16px 14px 20px !important;
}

.leaderboard-table-container {
  width: 100%;
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 14, 28, 0.7);
  overflow: hidden;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.header-row {
  background: rgba(15, 23, 42, 0.9);
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1px;
}

.col-rank { width: 38px; text-align: left; }
.col-player { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-tier { width: 110px; font-size: 9.5px; }
.col-tr { width: 48px; text-align: right; font-weight: 900; }

.leaderboard-scroll-area {
  max-height: 240px;
  overflow-y: auto;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
}

.rank-1 { background: rgba(250, 204, 21, 0.1); }
.rank-2 { background: rgba(192, 132, 252, 0.08); }
.rank-3 { background: rgba(192, 132, 252, 0.05); }

.user-sticky-row {
  background: rgba(0, 240, 255, 0.15) !important;
  border-top: 1.5px solid #00f0ff !important;
  border-bottom: none !important;
  color: #ffffff;
}

.text-yellow { color: #fde047; }
.text-gold { color: #facc15; }
.text-silver { color: #cbd5e1; }
.text-bronze { color: #d97706; }
/* ==========================================================================
   ZEN / TACTICAL SANDBOX & AMOLED BLACK & DYNAMIC LEADERBOARD STYLES
   ========================================================================== */

/* Zen / Tactical Sandbox Floating Action Bar */
.sandbox-tactical-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  margin: 4px auto 8px auto;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  width: fit-content;
  max-width: 92%;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.tactical-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.tactical-btn:active {
  transform: scale(0.95);
  background: rgba(51, 65, 85, 0.95);
}

.tactical-btn-accent {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.tactical-btn-accent:active {
  background: rgba(239, 68, 68, 0.45);
}

.tactical-btn.active {
  background: rgba(0, 240, 255, 0.25);
  border-color: #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* AMOLED Pure Black Matrix */
.matrix-amoled .matrix-frame,
.matrix-amoled .matrix-canvas,
.matrix-amoled .player-matrix-container,
.matrix-amoled .hold-frame,
.matrix-amoled .next-frame,
.matrix-amoled .hold-canvas,
.matrix-amoled .next-canvas,
.matrix-amoled.game-arena {
  background: #000000 !important;
  background-color: #000000 !important;
}

/* Leaderboard Tabs */
.leaderboard-tabs-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.lb-tab {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.lb-tab.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

/* ==========================================================================
   CYBER VAULT STORE & COSMETIC STYLES
   ========================================================================== */

/* Now Playing Floating Toast */
.now-playing-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(10, 15, 30, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.6);
  border-radius: 30px;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 240, 255, 0.3), inset 0 0 12px rgba(0, 240, 255, 0.15);
  backdrop-filter: blur(12px);
  z-index: 99990;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.now-playing-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.np-icon {
  font-size: 18px;
}

.np-info {
  display: flex;
  flex-direction: column;
}

.np-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #00f0ff;
  text-transform: uppercase;
}

.np-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

/* Lobby Shards Currency Badge */
.lobby-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lobby-shards-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.15);
  border: 1.5px solid rgba(168, 85, 247, 0.5);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
  transition: all 0.2s ease;
}

.lobby-shards-badge:active {
  transform: scale(0.95);
  background: rgba(168, 85, 247, 0.3);
}

.shard-icon {
  font-size: 14px;
}

.shard-val {
  font-size: 13px;
  font-weight: 800;
  color: #d8b4fe;
}

/* Store Modal Styles */
.store-modal-card {
  max-width: 480px !important;
  width: 95% !important;
  max-height: 85vh !important;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, rgba(30, 20, 50, 0.95), rgba(8, 10, 20, 0.98)) !important;
  border: 1.5px solid rgba(192, 132, 252, 0.5) !important;
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.35) !important;
}

.store-balance-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.store-balance-info {
  display: flex;
  flex-direction: column;
}

.store-balance-label {
  font-size: 9px;
  letter-spacing: 1px;
  color: #94a3b8;
  font-weight: 700;
}

.store-balance-amount {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 900;
  color: #e9d5ff;
}

.btn-daily-claim {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
  transition: all 0.2s ease;
}

.btn-daily-claim:active {
  transform: scale(0.95);
}

.btn-daily-claim.claimed {
  background: rgba(255, 255, 255, 0.1);
  color: #64748b;
  box-shadow: none;
  cursor: default;
}

/* Store Tabs */
.store-tabs-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.store-tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.store-tab.active {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

/* Store Items Grid */
.store-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  overflow-y: auto;
  max-height: 48vh;
  padding-right: 4px;
}

.store-card {
  background: rgba(20, 25, 45, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s;
}

.store-card.equipped {
  border-color: #22c55e !important;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3) !important;
}

.store-card-preview {
  height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
  font-size: 24px;
}

.store-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.store-card-title {
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
}

.store-card-desc {
  font-size: 9px;
  color: #94a3b8;
  line-height: 1.2;
}

.store-card-btn {
  width: 100%;
  border-radius: 8px;
  padding: 6px;
  font-size: 11px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.store-card-btn.btn-buy {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.store-card-btn.btn-equip {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.store-card-btn.btn-equipped {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid #22c55e;
  cursor: default;
}

/* Custom Equipped Matrix Frames */
.matrix-frame.frame-neon-plasma {
  border: 2px solid #ec4899 !important;
  box-shadow: 0 0 25px rgba(236, 72, 153, 0.6), 0 0 50px rgba(168, 85, 247, 0.3), inset 0 0 15px rgba(236, 72, 153, 0.2) !important;
  animation: plasmaGlowPulse 2.5s infinite alternate ease-in-out !important;
}

@keyframes plasmaGlowPulse {
  0% {
    border-color: #ec4899;
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.5), inset 0 0 10px rgba(236, 72, 153, 0.2);
  }
  100% {
    border-color: #a855f7;
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.8), inset 0 0 20px rgba(168, 85, 247, 0.4);
  }
}

.matrix-frame.frame-cyber-rainbow {
  border: 2px solid #00f0ff !important;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.7), inset 0 0 15px rgba(0, 240, 255, 0.25) !important;
  animation: rainbowBorderCycle 4s infinite linear !important;
}

@keyframes rainbowBorderCycle {
  0% { border-color: #ff0055; box-shadow: 0 0 28px rgba(255, 0, 85, 0.7), inset 0 0 12px rgba(255, 0, 85, 0.25); }
  25% { border-color: #facc15; box-shadow: 0 0 28px rgba(250, 204, 21, 0.7), inset 0 0 12px rgba(250, 204, 21, 0.25); }
  50% { border-color: #22c55e; box-shadow: 0 0 28px rgba(34, 197, 94, 0.7), inset 0 0 12px rgba(34, 197, 94, 0.25); }
  75% { border-color: #00f0ff; box-shadow: 0 0 28px rgba(0, 240, 255, 0.7), inset 0 0 12px rgba(0, 240, 255, 0.25); }
  100% { border-color: #ff0055; box-shadow: 0 0 28px rgba(255, 0, 85, 0.7), inset 0 0 12px rgba(255, 0, 85, 0.25); }
}

.matrix-frame.frame-obsidian-void {
  border: 2px solid #eab308 !important;
  background: #020307 !important;
  box-shadow: 0 0 28px rgba(234, 179, 8, 0.55), inset 0 0 25px rgba(0, 0, 0, 0.9) !important;
}

/* ==========================================================================
   GEMINI AI COACH & THEME FORGE (v3.0.0)
   ========================================================================== */
.ai-coach-section {
  background: linear-gradient(135deg, rgba(14, 23, 42, 0.85) 0%, rgba(30, 27, 75, 0.85) 100%);
  border: 1.5px solid rgba(168, 85, 247, 0.45);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
  margin-bottom: 8px;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.18);
  text-align: left;
}

.ai-coach-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.ai-coach-pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #d8b4fe;
  display: flex;
  align-items: center;
  gap: 5px;
}

.gemini-sparkle {
  font-size: 0.85rem;
  animation: pulseSparkle 1.6s infinite ease-in-out;
}

@keyframes pulseSparkle {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px #c084fc); }
  50% { transform: scale(1.25); filter: drop-shadow(0 0 10px #f472b6); }
}

.ai-coach-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.btn-ai-coach {
  width: 100%;
  padding: 7px 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
  border: 1px solid rgba(168, 85, 247, 0.6);
  border-radius: 8px;
  color: #f3e8ff;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-ai-coach:hover, .btn-ai-coach:active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.45) 0%, rgba(99, 102, 241, 0.45) 100%);
  border-color: #c084fc;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
}

.ai-coach-content {
  font-size: 0.74rem;
  line-height: 1.45;
  color: #e2e8f0;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-coach-content ul, .ai-coach-content p {
  margin: 0;
  padding-left: 14px;
}

.ai-coach-content li {
  margin-bottom: 5px;
}

/* Gemini Theme Forge */
.gemini-forge-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 27, 75, 0.95) 100%) !important;
  border: 1.5px solid rgba(0, 240, 255, 0.4) !important;
  grid-column: 1 / -1;
  padding: 12px 14px !important;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.15);
}

.forge-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forge-pill {
  font-size: 0.8rem;
  font-weight: 800;
  color: #00f0ff;
  letter-spacing: 0.6px;
}

.forge-sub {
  font-size: 0.65rem;
  color: #94a3b8;
}

.forge-hint {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin: 0;
}

.forge-input-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.forge-input {
  flex: 1;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 0.78rem;
  outline: none;
}

.forge-input:focus {
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.btn-forge-generate {
  padding: 8px 16px;
  background: linear-gradient(135deg, #00f0ff 0%, #3b82f6 100%);
  border: none;
  border-radius: 8px;
  color: #020617;
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-forge-generate:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

.forge-status-msg {
  font-size: 0.7rem;
  color: #38bdf8;
  margin-top: 2px;
}

/* ==========================================================================
   ESPORTS BROADCAST CASTER TICKER & AUDIO DUCKING VISUALS
   ========================================================================== */
.caster-ticker {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.15) 0%, rgba(250, 204, 21, 0.3) 50%, rgba(234, 179, 8, 0.15) 100%);
  border: 1px solid rgba(250, 204, 21, 0.6);
  border-radius: 9999px;
  color: #fef08a;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 14px;
  margin: 0 auto 6px auto;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.3);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 50;
}

.caster-ticker.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.caster-ticker.caster-flash {
  animation: casterPulse 0.4s ease-out;
}

@keyframes casterPulse {
  0% { transform: scale(0.92); box-shadow: 0 0 25px rgba(250, 204, 21, 0.8); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1.0); }
}

/* Red Alert Danger Pulse (Stack Height >= 14 Rows) */
.matrix-danger-pulse {
  border-color: #ef4444 !important;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.8), inset 0 0 16px rgba(239, 68, 68, 0.3) !important;
  animation: dangerPulseRing 0.8s infinite alternate !important;
}

@keyframes dangerPulseRing {
  0% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
  100% { box-shadow: 0 0 28px rgba(239, 68, 68, 0.9), inset 0 0 20px rgba(239, 68, 68, 0.35); }
}

/* ==========================================================================
   QUICK EMOTE REACTIONS BAR & FLOATING STICKERS
   ========================================================================== */
.quick-emotes-bar {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.btn-quick-emote {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 1.15rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  touch-action: manipulation;
}

.btn-quick-emote:hover,
.btn-quick-emote:active {
  transform: scale(1.25);
  background: rgba(0, 240, 255, 0.2);
  border-color: #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

/* 1-Tap Rematch Clickable Banner */
.clickable-banner {
  cursor: pointer;
  border-radius: 12px;
  padding: 8px 12px;
  transition: all 0.2s ease;
}

.clickable-banner:hover {
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
}

.clickable-banner:active {
  transform: scale(0.98);
}

/* Lobby APK Download Button */
.btn-lobby-apk-download {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #22c55e;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.25);
}

.btn-lobby-apk-download:hover {
  background: rgba(34, 197, 94, 0.35);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
}

/* Desktop controls legend & player header hidden on mobile by default */
.desktop-controls-legend,
.player-header-row {
  display: none !important;
}

.player-matrix-row {
  display: contents !important;
}

/* ==========================================================================
   DESKTOP WIDESCREEN ESPORTS COCKPIT LAYOUT (>= 1024px)
   100% Isolated: Mobile & Android (< 1024px) remain strictly identical & untouched.
   ========================================================================== */
@media (min-width: 1024px) {
  /* 1. Expand app container to widescreen */
  .app-container {
    max-width: 1320px !important;
    width: 95vw !important;
    height: 94vh !important;
    margin: 3vh auto !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 240, 255, 0.25) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* 2. Hide touch virtual buttons on desktop */
  .touch-controls-dock,
  .touch-cluster-left-4grid,
  .touch-cluster-right-4grid {
    display: none !important;
  }

  /* 3. Widescreen Duel Arena: 4-Column Balanced Esports Arena */
  .duel-arena {
    display: grid !important;
    grid-template-columns: 130px minmax(280px, 320px) minmax(280px, 320px) 130px !important;
    grid-template-rows: auto 1fr auto !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px 24px !important;
    flex: 1 !important;
    height: auto !important;
    max-height: 800px !important;
    padding: 6px 16px !important;
    overflow: visible !important;
  }

  /* Dissolve side-dock container so children map directly to the arena grid */
  .side-dock.right-dock {
    display: contents !important;
  }

  /* --- COLUMN 1 (LEFT FLANK): HOLD + STATS --- */
  .dock-card.hold-card-short {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 124px !important;
    height: 95px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(11, 18, 33, 0.9) !important;
    border: 1.5px solid rgba(0, 240, 255, 0.3) !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5) !important;
    margin: 0 auto !important;
    padding: 6px !important;
  }

  .hold-card-short .dock-label {
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    color: #00f0ff !important;
    margin-bottom: 4px !important;
  }

  .hold-card-short .hold-canvas-wrap {
    width: 96px !important;
    height: 50px !important;
  }

  .dock-card.stats-badge-wrap {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 124px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 12px 10px !important;
    background: rgba(11, 18, 33, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5) !important;
    margin: 0 auto !important;
  }

  .stats-badge-wrap .stat-item {
    font-size: 10px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    color: #94a3b8 !important;
    font-weight: 700 !important;
  }

  .stats-badge-wrap .stat-val {
    font-size: 13px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    font-family: 'JetBrains Mono', monospace !important;
  }

  /* --- COLUMN 2 (CENTER-LEFT): PLAYER MATRIX (EQUAL SIZE) --- */
  .player-header-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: auto !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
  }

  .label-player {
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    color: #00f0ff !important;
  }

  .player-badge {
    font-size: 9px !important;
    font-weight: 900 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    background: rgba(0, 240, 255, 0.25) !important;
    color: #00f0ff !important;
    border: 1px solid rgba(0, 240, 255, 0.5) !important;
  }

  .primary-matrix-column {
    grid-column: 2 !important;
    grid-row: 1 / span 3 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    max-height: 620px !important;
    width: 100% !important;
  }

  .player-matrix-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: calc(min(66vh, 580px)) !important;
    width: auto !important;
  }

  .primary-matrix-column .matrix-frame {
    height: calc(min(66vh, 580px)) !important;
    max-height: calc(min(66vh, 580px)) !important;
    aspect-ratio: 10 / 20 !important;
    width: auto !important;
    border: 2px solid rgba(0, 240, 255, 0.7) !important;
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.35) !important;
    border-radius: 10px !important;
    background: #060911 !important;
  }

  .primary-matrix-column .main-matrix-canvas {
    height: 100% !important;
    width: auto !important;
    aspect-ratio: 10 / 20 !important;
    object-fit: contain !important;
  }

  .primary-matrix-column .garbage-meter-wrap {
    height: calc(min(66vh, 580px)) !important;
    max-height: calc(min(66vh, 580px)) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 3px !important;
  }

  .primary-matrix-column .garbage-meter-bar {
    width: 6px !important;
    height: 100% !important;
  }

  /* --- COLUMN 3 (CENTER-RIGHT): ENEMY MATRIX (EXACT SAME SIZE AS PLAYER) --- */
  .dock-card.opponent-mini-dock {
    grid-column: 3 !important;
    grid-row: 1 / span 3 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 620px !important;
  }

  .opponent-mini-dock .opp-header-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: auto !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
  }

  .opponent-mini-dock .opp-header-row .label-enemy {
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    color: #ff0055 !important;
  }

  .opponent-mini-dock .opp-header-row .opp-badge {
    font-size: 9px !important;
    font-weight: 900 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    background: rgba(255, 0, 85, 0.25) !important;
    color: #ff3366 !important;
    border: 1px solid rgba(255, 0, 85, 0.5) !important;
  }

  .opponent-mini-dock .opp-matrix-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: calc(min(66vh, 580px)) !important;
    width: auto !important;
  }

  .opponent-mini-dock .opp-garbage-meter-wrap {
    height: calc(min(66vh, 580px)) !important;
    max-height: calc(min(66vh, 580px)) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
  }

  .opponent-mini-dock .opp-garbage-meter-bar {
    width: 6px !important;
    height: 100% !important;
    background: #1e293b !important;
    border-radius: 3px !important;
    border: 1px solid rgba(255, 0, 85, 0.4) !important;
  }

  .opponent-mini-dock .opp-matrix-frame {
    height: calc(min(66vh, 580px)) !important;
    max-height: calc(min(66vh, 580px)) !important;
    aspect-ratio: 10 / 20 !important;
    width: auto !important;
    background: #060911 !important;
    border: 2px solid rgba(255, 0, 85, 0.7) !important;
    box-shadow: 0 0 35px rgba(255, 0, 85, 0.35) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
  }

  .opponent-mini-dock .opp-matrix-canvas {
    height: 100% !important;
    width: auto !important;
    aspect-ratio: 10 / 20 !important;
    display: block !important;
    object-fit: contain !important;
  }

  /* --- COLUMN 4 (RIGHT FLANK): NEXT QUEUE --- */
  .dock-card.next-card-enlarged {
    grid-column: 4 !important;
    grid-row: 1 / span 3 !important;
    width: 124px !important;
    height: auto !important;
    max-height: 520px !important;
    padding: 10px 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    background: rgba(11, 18, 33, 0.9) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5) !important;
    margin: 0 auto !important;
  }

  .next-card-enlarged .dock-label {
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    color: #facc15 !important;
    margin-bottom: 6px !important;
  }

  .next-card-enlarged .next-queue-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .next-card-enlarged .mini-preview-wrap {
    width: 80px !important;
    height: 46px !important;
  }

  .next-card-enlarged .next-primary-wrap {
    width: 95px !important;
    height: 60px !important;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.2) !important;
    padding-bottom: 4px !important;
    margin-bottom: 2px !important;
  }

  .quick-emotes-bar {
    display: none !important;
  }

  /* Desktop Controls Guidance Bar beneath arena */
  .desktop-controls-legend {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.76rem !important;
    color: #64748b !important;
    padding: 8px 16px !important;
    background: rgba(11, 18, 33, 0.6) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin-top: auto !important;
  }

  .desktop-controls-legend span b {
    color: #00f0ff !important;
    font-weight: 700 !important;
  }
}
