/* style.css - Retro Arcade Cabinet Presentation & Responsive Layout */

:root {
  --bg-dark: #07090e;
  --panel-bg: #111622;
  --accent-gold: #ffd32a;
  --accent-green: #2ecc71;
  --accent-red: #ff4757;
  --accent-blue: #1e90ff;
  --text-main: #f1f2f6;
  --text-muted: #a4b0be;
  --border-neon: rgba(255, 211, 42, 0.4);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 20%, rgba(39, 174, 96, 0.12), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(192, 57, 43, 0.12), transparent 50%),
    linear-gradient(180deg, #07090e 0%, #0d131f 100%);
}

/* Header Arcade Marquee */
.arcade-header {
  width: 100%;
  max-width: 1320px;
  padding: 16px 20px 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(255, 211, 42, 0.2);
}

.marquee-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.marquee-badge {
  background: linear-gradient(135deg, #27ae60, #f39c12);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(39, 174, 96, 0.4);
}

.marquee-text {
  font-family: 'Impact', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #ffd32a 0%, #ff6b6b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 211, 42, 0.5));
}

.header-controls {
  display: flex;
  gap: 10px;
}

.arcade-btn {
  background: #1e2433;
  color: var(--accent-gold);
  border: 1px solid #334155;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.arcade-btn:hover {
  background: #2a3449;
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(255, 211, 42, 0.3);
  transform: translateY(-1px);
}

.arcade-btn:active {
  transform: translateY(1px);
}

/* Arcade Cabinet Bezel Wrapper */
.arcade-cabinet {
  width: 100%;
  max-width: 1300px;
  margin: 12px auto;
  position: relative;
  background: #141a29;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.8),
    0 0 0 2px #263249,
    0 0 30px rgba(255, 211, 42, 0.15);
}

/* CRT Screen Frame */
.screen-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* LittleJS Canvas Styling */
.screen-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* CRT Scanlines Overlay */
.scanlines-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  z-index: 10;
  opacity: 0.6;
}

.scanlines-overlay.disabled {
  display: none;
}

/* Arcade Controls Panel */
.controls-dashboard {
  width: 100%;
  max-width: 1300px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.control-card {
  background: rgba(17, 22, 34, 0.85);
  border: 1px solid #232c40;
  border-radius: 10px;
  padding: 16px 20px;
  backdrop-filter: blur(8px);
}

.control-card.p1 { border-left: 4px solid #3498db; }
.control-card.p2 { border-left: 4px solid #e67e22; }
.control-card.xbox { border-left: 4px solid #2ecc71; }

.card-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title.p1 { color: #3498db; }
.card-title.p2 { color: #e67e22; }
.card-title.xbox { color: #2ecc71; }

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

.key-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.kbd-badge {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  border-bottom: 2px solid #334155;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: bold;
  font-size: 12px;
  min-width: 28px;
  text-align: center;
  box-shadow: 0 2px 0 rgba(0,0,0,0.4);
}

/* Xbox Controller Badges */
.xbox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 12px;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.xbox-badge.a { background: #2ecc71; color: #000; }
.xbox-badge.b { background: #e74c3c; }
.xbox-badge.x { background: #3498db; }
.xbox-badge.y { background: #f1c40f; color: #000; }

.xbox-badge.pill {
  width: auto;
  padding: 2px 8px;
  border-radius: 12px;
  background: #2c3e50;
  border: 1px solid #475569;
  font-size: 11px;
}

.marquee-badge.green {
  background: linear-gradient(135deg, #10ac84, #1dd1a1);
  box-shadow: 0 0 10px rgba(16, 172, 132, 0.6);
  animation: pulse-green 1.5s infinite alternate;
}

@keyframes pulse-green {
  from { opacity: 0.8; }
  to { opacity: 1; transform: scale(1.05); }
}

/* Touch / Virtual Quick Bar for testing or mobile */
.virtual-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.v-btn {
  background: #1e2438;
  color: #fff;
  border: 1px solid #3d4a68;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.v-btn:active {
  background: #34495e;
}

/* Modal Instructions */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(5px);
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #141a29;
  border: 2px solid var(--accent-gold);
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  color: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 22px;
  color: var(--accent-gold);
  font-weight: bold;
}

.close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
}

.modal-body h4 {
  color: #ffd32a;
  margin: 12px 0 6px 0;
}

/* Online Modal Specifics */
.online-box {
  max-width: 650px;
}

/* Settings Modal Specifics */
.settings-box {
  max-width: 680px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-label {
  font-weight: 800;
  font-size: 13px;
  color: #ffd32a;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.difficulty-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .difficulty-options-grid {
    grid-template-columns: 1fr;
  }
}

.diff-btn {
  background: #0f1624;
  border: 2px solid #27364f;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #e2e8f0;
}

.diff-btn:hover {
  background: #172238;
  border-color: #4a638b;
  transform: translateY(-2px);
}

.diff-btn.active {
  background: rgba(255, 211, 42, 0.12);
  border-color: #ffd32a;
  box-shadow: 0 0 16px rgba(255, 211, 42, 0.35);
  transform: scale(1.02);
}

.diff-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
  padding: 2px 6px;
  border-radius: 4px;
}

.diff-badge.green { color: #2ecc71; background: rgba(46, 204, 113, 0.15); }
.diff-badge.yellow { color: #f1c40f; background: rgba(241, 196, 15, 0.15); }
.diff-badge.red { color: #e74c3c; background: rgba(231, 76, 60, 0.15); }
.diff-badge.purple { color: #9b59b6; background: rgba(155, 89, 182, 0.15); }

.diff-title {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 4px;
}

.diff-desc {
  font-size: 12px;
  line-height: 1.4;
  color: #94a3b8;
}

.settings-btn-row {
  display: flex;
  gap: 10px;
}

.time-btn {
  flex: 1;
  background: #0f1624;
  border: 2px solid #27364f;
  color: #94a3b8;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.time-btn:hover {
  background: #172238;
  color: #fff;
  border-color: #4a638b;
}

.time-btn.active {
  background: rgba(52, 152, 219, 0.2);
  border-color: #3498db;
  color: #3498db;
  box-shadow: 0 0 12px rgba(52, 152, 219, 0.35);
}

.online-section {
  background: #0d131f;
  border: 1px solid #243048;
  border-radius: 8px;
  padding: 14px 16px;
}

.room-input {
  flex: 1;
  background: #162032;
  border: 2px solid #3b4d6b;
  color: #ffd32a;
  font-family: monospace;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 2px;
  padding: 8px 12px;
  border-radius: 6px;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s;
}

.room-input:focus {
  border-color: #ffd32a;
  box-shadow: 0 0 10px rgba(255, 211, 42, 0.3);
}

.room-code-tag {
  background: #1b263b;
  border: 1px solid #ffd32a;
  padding: 6px 12px;
  border-radius: 6px;
  color: #fff;
  font-family: monospace;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-code-tag strong {
  color: #ffd32a;
  font-size: 18px;
  letter-spacing: 1px;
}

.mini-copy-btn {
  background: #ffd32a;
  color: #000;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 11px;
  cursor: pointer;
}

.mini-copy-btn:hover {
  background: #ffeaa7;
}

.green-btn {
  background: #27ae60 !important;
  color: #fff !important;
  border-color: #2ecc71 !important;
}

.green-btn:hover {
  background: #2ecc71 !important;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.4) !important;
}

.blue-btn {
  background: #2980b9 !important;
  color: #fff !important;
  border-color: #3498db !important;
}

.blue-btn:hover {
  background: #3498db !important;
  box-shadow: 0 0 12px rgba(52, 152, 219, 0.4) !important;
}

.online-status-text {
  margin-top: 8px;
  font-size: 13px;
  font-weight: bold;
  color: #ffd32a;
  min-height: 18px;
}

/* Responsiveness */
@media (max-width: 900px) {
  .controls-dashboard {
    grid-template-columns: 1fr;
  }
  .marquee-text {
    font-size: 20px;
  }
}

/* ==========================================================================
   VIRTUAL TOUCH CONTROLS (Mobile Arcade Overlay)
   ========================================================================== */

.touch-controls-wrapper {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 16px 20px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.touch-controls-wrapper.hidden {
  display: none !important;
}

.touch-pause-controls {
  position: absolute;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 105;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.touch-pause-controls[hidden] {
  display: none !important;
}

.touch-pause-btn,
.touch-pause-menu-btn {
  min-width: 78px;
  height: 44px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 2px solid rgba(255, 211, 42, 0.7);
  border-radius: 22px;
  background: rgba(17, 24, 39, 0.88);
  color: #ffd32a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
  font-weight: 900;
  cursor: pointer;
}

.touch-pause-btn:active,
.touch-pause-btn.active,
.touch-pause-menu-btn:active,
.touch-pause-menu-btn.active {
  transform: scale(0.94);
  background: rgba(255, 211, 42, 0.35);
}

.touch-pause-menu-btn {
  border-color: rgba(231, 76, 60, 0.8);
  color: #ff8a80;
}

.touch-pause-menu-btn[hidden] {
  display: none !important;
}

.touch-pause-icon {
  font-size: 16px;
}

.touch-pause-label {
  font-size: 10px;
  letter-spacing: 0.5px;
}

/* Virtual D-Pad (Left Side) */
.touch-dpad-container {
  position: relative;
  width: 170px;
  height: 170px;
  pointer-events: auto;
  touch-action: none;
  margin-bottom: 8px;
}

.touch-dpad-center {
  position: absolute;
  top: 55px;
  left: 55px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.6));
  border: 2px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.touch-dpad-btn {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(20, 27, 43, 0.88);
  color: #ecf0f1;
  border: 2px solid rgba(255, 211, 42, 0.35);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.08s ease, border-color 0.08s ease;
}

.touch-dpad-btn.dpad-up {
  top: 0;
  left: 57px;
}

.touch-dpad-btn.dpad-down {
  bottom: 0;
  left: 57px;
}

.touch-dpad-btn.dpad-left {
  top: 57px;
  left: 0;
}

.touch-dpad-btn.dpad-right {
  top: 57px;
  right: 0;
}

.touch-dpad-btn:active,
.touch-dpad-btn.active {
  background: rgba(255, 211, 42, 0.4);
  border-color: #ffd32a;
  color: #ffd32a;
  transform: scale(0.92);
  box-shadow: 0 0 16px rgba(255, 211, 42, 0.7);
}

/* Action Buttons Cluster (Right Side) */
.touch-actions-container {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.touch-action-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.touch-action-btn {
  width: 62px;
  height: 62px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(20, 27, 43, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  border: 2px solid #555;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.08s ease;
}

.touch-action-btn .btn-lbl {
  font-family: 'Impact', sans-serif;
  font-size: 16px;
  letter-spacing: 0.5px;
  line-height: 1;
}

.touch-action-btn .btn-sub {
  max-width: calc(100% - 4px);
  font-size: clamp(6.5px, 0.6vw, 8px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0.9;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.touch-action-btn:active,
.touch-action-btn.active {
  transform: scale(0.9);
  filter: brightness(1.35);
}

/* Button Variants */
.touch-action-btn.btn-lp {
  border-color: #2ecc71;
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.2);
}
.touch-action-btn.btn-lp:active,
.touch-action-btn.btn-lp.active {
  box-shadow: 0 0 16px rgba(46, 204, 113, 0.8);
}

.touch-action-btn.btn-hp {
  border-color: #3498db;
  color: #3498db;
  background: rgba(52, 152, 219, 0.2);
}
.touch-action-btn.btn-hp:active,
.touch-action-btn.btn-hp.active {
  box-shadow: 0 0 16px rgba(52, 152, 219, 0.8);
}

.touch-action-btn.btn-sp {
  border-color: #f1c40f;
  color: #f1c40f;
  background: rgba(241, 196, 15, 0.2);
}
.touch-action-btn.btn-sp:active,
.touch-action-btn.btn-sp.active {
  box-shadow: 0 0 16px rgba(241, 196, 15, 0.8);
}

.touch-action-btn.btn-lk {
  border-color: #e67e22;
  color: #e67e22;
  background: rgba(230, 126, 34, 0.2);
}
.touch-action-btn.btn-lk:active,
.touch-action-btn.btn-lk.active {
  box-shadow: 0 0 16px rgba(230, 126, 34, 0.8);
}

.touch-action-btn.btn-block {
  border-color: #9b59b6;
  color: #d2a8ff;
  background: rgba(155, 89, 182, 0.24);
}
.touch-action-btn.btn-block:active,
.touch-action-btn.btn-block.active {
  box-shadow: 0 0 16px rgba(155, 89, 182, 0.85);
}

/* Super Special CPI Button */
.touch-action-btn.btn-super {
  width: 124px;
  height: 56px;
  border-radius: 28px;
  border-color: #ff4757;
  color: #ff4757;
  background: rgba(255, 71, 87, 0.25);
  box-shadow: 0 0 12px rgba(255, 71, 87, 0.4);
}
.touch-action-btn.btn-super:active,
.touch-action-btn.btn-super.active {
  background: rgba(255, 71, 87, 0.5);
  box-shadow: 0 0 24px rgba(255, 71, 87, 0.9);
}

/* ==========================================================================
   MOBILE & PWA LANDSCAPE OPTIMIZATION
   ========================================================================== */

@media (max-height: 580px), (orientation: landscape) and (max-width: 950px) {
  body {
    overflow: hidden;
    padding: 0;
    margin: 0;
  }

  .arcade-header {
    display: none; /* Hide header in landscape to maximize fighting arena */
  }

  .arcade-cabinet {
    margin: 0;
    padding: 0;
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    background: #000;
  }

  .screen-container {
    height: 100vh;
    width: 100vw;
    border-radius: 0;
  }

  .controls-dashboard {
    display: none; /* Hide keyboard cards on mobile */
  }

  .touch-controls-wrapper {
    padding: 10px 14px;
  }

  .touch-dpad-container {
    width: 145px;
    height: 145px;
  }

  .touch-dpad-btn {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

  .touch-dpad-btn.dpad-up { left: 48px; }
  .touch-dpad-btn.dpad-down { left: 48px; }
  .touch-dpad-btn.dpad-left { top: 48px; }
  .touch-dpad-btn.dpad-right { top: 48px; }
  .touch-dpad-center {
    top: 48px;
    left: 48px;
    width: 49px;
    height: 49px;
  }

  .touch-action-btn {
    width: 52px;
    height: 52px;
  }

  .touch-action-btn.btn-super {
    width: 106px;
    height: 50px;
  }
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #000;
  }

  .arcade-header,
  .controls-dashboard,
  .virtual-bar {
    display: none !important;
  }

  .arcade-cabinet,
  .screen-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }
}

html:fullscreen,
html:fullscreen body,
html:-webkit-full-screen,
html:-webkit-full-screen body,
html.fullscreen-active,
html.fullscreen-active body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background: #000;
}

html:fullscreen .arcade-header,
html:fullscreen .controls-dashboard,
html:fullscreen .virtual-bar,
html:-webkit-full-screen .arcade-header,
html:-webkit-full-screen .controls-dashboard,
html:-webkit-full-screen .virtual-bar,
html.fullscreen-active .arcade-header,
html.fullscreen-active .controls-dashboard,
html.fullscreen-active .virtual-bar {
  display: none !important;
}

html:fullscreen .arcade-cabinet,
html:fullscreen .screen-container,
html:-webkit-full-screen .arcade-cabinet,
html:-webkit-full-screen .screen-container,
html.fullscreen-active .arcade-cabinet,
html.fullscreen-active .screen-container {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}

html:fullscreen .modal-overlay,
html:-webkit-full-screen .modal-overlay,
html.fullscreen-active .modal-overlay {
  z-index: 1200;
}



/* ==========================================================================
   PWA UPDATE GATE
   ========================================================================== */

.pwa-update-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(7, 9, 14, 0.98);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  touch-action: none;
}

html.pwa-update-check .pwa-update-overlay {
  display: flex;
}

.pwa-update-box {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pwa-update-spinner {
  width: 54px;
  height: 54px;
  border: 5px solid rgba(255, 211, 42, 0.2);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: pwa-update-spin 0.8s linear infinite;
}

@keyframes pwa-update-spin {
  to { transform: rotate(360deg); }
}

.pwa-update-title {
  font-family: 'Impact', sans-serif;
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--accent-gold);
}

.pwa-update-status {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
}

.pwa-update-retry {
  justify-content: center;
  min-width: 190px;
}

.pwa-update-overlay [hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .pwa-update-spinner {
    animation: none;
  }
}

/* ==========================================================================
   MOBILE PORTRAIT ROTATION OVERLAY (landscape required + PWA install CTA)
   ========================================================================== */

.rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(7, 9, 14, 0.96);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  overflow-y: auto;
  touch-action: none;
}

@media (orientation: portrait) and (max-width: 900px) and (pointer: coarse) {
  .rotate-overlay {
    display: flex;
  }
}

.rotate-overlay-box {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rotate-icon {
  font-size: 56px;
  line-height: 1;
  animation: rotate-hint 2.4s ease-in-out infinite;
}

@keyframes rotate-hint {
  0%, 15% { transform: rotate(0deg); }
  50%, 70% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .rotate-icon {
    animation: none;
  }
}

.rotate-title {
  font-family: 'Impact', sans-serif;
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--accent-gold);
}

.rotate-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
}

.rotate-install {
  width: 100%;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 2px solid rgba(255, 211, 42, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.rotate-install-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rotate-install-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
}

.rotate-install-hint {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
}

.rotate-overlay [hidden] {
  display: none !important;
}
