/* SUPER CYPHER Arcade CSS */
@font-face {
  font-family: 'Pixel';
  src: url('pixel.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Readout';
  src: url('mono.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #05070a;
  color: #ffffff;
  font-family: 'Readout', 'Consolas', 'Monaco', monospace;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

header.arcade-header {
  background: #0d1218;
  border-bottom: 2px solid #00ff88;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 20;
}

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

.arcade-back-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.75rem;
  border: 1px solid #334155;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
}

.arcade-back-link:hover {
  color: #00ff88;
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
}

.arcade-title {
  font-family: 'Pixel', monospace;
  font-weight: 400;
  color: #ffffff;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.arcade-btn-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.arcade-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid #1f2735;
  color: #8899ac;
  padding: 5px 9px;
  border-radius: 4px;
  font-family: 'Readout', 'Consolas', 'Monaco', monospace;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.arcade-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.arcade-btn.on {
  border-color: #00ff88;
  color: #00ff88;
  background: rgba(0, 255, 136, 0.12);
}

.arcade-btn.btn-s1 { color: #00ff88; border-color: rgba(0, 255, 136, 0.4); }
.arcade-btn.btn-s2 { color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); }
.arcade-btn.btn-s3 { color: #e879f9; border-color: rgba(232, 121, 249, 0.4); }
.arcade-btn.special-amber {
  border-color: #ffa502;
  color: #ffa502;
  background: rgba(255, 165, 2, 0.12);
}
.arcade-btn.special-pink {
  color: #ec4899;
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.12);
}
.arcade-btn.special-gold {
  color: #facc15;
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.12);
}
.arcade-btn.special-cyan {
  color: #38bdf8;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}
.arcade-btn.special-pause {
  color: #38bdf8;
  border-color: #38bdf8;
  font-weight: 800;
}
.arcade-btn.special-restart {
  color: #00ff88;
  border-color: #00ff88;
}

.hud-bar {
  background: #070a0e;
  border-bottom: 1px solid #1f2735;
  padding: 6px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  z-index: 15;
}

.hud-left {
  display: flex;
  gap: 16px;
  align-items: center;
}

.hud-right {
  display: flex;
  gap: 16px;
  align-items: center;
}

.hud-player-tag {
  color: #38bdf8;
  font-weight: 800;
  margin-right: 4px;
}

.hud-lives-val {
  color: #ff4757;
  font-weight: 800;
}

.hud-score-val {
  color: #00ff88;
  font-weight: 800;
}

.hud-weapon-val {
  color: #ffa502;
  font-weight: 800;
}

.hud-boss-wrap {
  display: none;
  align-items: center;
  gap: 8px;
}

.hud-boss-label {
  color: #ff4757;
  font-weight: 700;
  font-size: 0.75rem;
}

.hud-boss-meter {
  width: 100px;
  height: 8px;
  background: #222222;
  border: 1px solid #555555;
  border-radius: 2px;
  overflow: hidden;
}

.hud-boss-fill {
  width: 100%;
  height: 100%;
  background: #ff4757;
  transition: width 0.1s linear;
}

.hud-stage-name {
  color: #8899ac;
  font-size: 0.75rem;
}

#super-cypher-viewport {
  flex: 1;
  position: relative;
  background: #000000;
  overflow: hidden;
}

#super-cypher-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.touch-controls {
  position: absolute;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 100;
}

.dpad-container {
  pointer-events: auto;
  touch-action: none;
}

.dpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 4px;
}

.touch-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(14, 18, 24, 0.75);
  border: 2px solid #00ff88;
  color: #00ff88;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  backdrop-filter: blur(4px);
  touch-action: none;
  cursor: pointer;
}

.touch-btn:active, .touch-btn.active {
  background: #00ff88;
  color: #000000;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.8);
}

.touch-btn-up { grid-column: 2; grid-row: 1; }
.touch-btn-left { grid-column: 1; grid-row: 2; }
.touch-btn-center {
  grid-column: 2;
  grid-row: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.touch-btn-right { grid-column: 3; grid-row: 2; }
.touch-btn-down { grid-column: 2; grid-row: 3; }

.touch-btn-diag {
  width: 44px;
  height: 44px;
  background: transparent;
  touch-action: none;
  cursor: pointer;
}
.touch-btn-ul { grid-column: 1; grid-row: 1; }
.touch-btn-ur { grid-column: 3; grid-row: 1; }
.touch-btn-dl { grid-column: 1; grid-row: 3; }
.touch-btn-dr { grid-column: 3; grid-row: 3; }

.action-container {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.action-sub-row {
  display: flex;
  gap: 8px;
}

.action-main-cluster {
  display: flex;
  gap: 12px;
  align-items: center;
}

.touch-btn-pause {
  width: 42px;
  height: 42px;
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  font-size: 0.65rem;
  color: #38bdf8;
  font-weight: 800;
}

.touch-btn-wpn {
  width: 42px;
  height: 42px;
  background: rgba(255, 165, 2, 0.25);
  border-color: #ffa502;
  font-size: 0.7rem;
  color: #ffa502;
  font-weight: 800;
}

.touch-btn-fire {
  width: 56px;
  height: 56px;
  background: rgba(255, 71, 87, 0.25);
  border-color: #ff4757;
  color: #ff4757;
  font-weight: 800;
}

.touch-btn-jump {
  width: 56px;
  height: 56px;
  background: rgba(0, 255, 136, 0.25);
  border-color: #00ff88;
  color: #00ff88;
  font-weight: 800;
}

/* Modals and Overlays */
.sc-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 9, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 16px 40px 16px;
  text-align: center;
  z-index: 500;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sc-overlay-card {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Title Screen Marquee Hero */
.sc-title-hero-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1376 / 768;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #00ff88;
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.4);
  margin-bottom: 8px;
  background: #000000;
}

.sc-title-hero-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.sc-title-fx-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.sc-title-hero-badge-left,
.sc-title-hero-badge-right {
  position: absolute;
  bottom: 6px;
  padding: 2px 7px;
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
  backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 3;
}

.sc-title-hero-badge-left {
  left: 8px;
  background: rgba(4, 6, 9, 0.85);
  border: 1px solid #00ff88;
  color: #00ff88;
}

.sc-title-hero-badge-right {
  right: 8px;
  background: rgba(4, 6, 9, 0.85);
  border: 1px solid #facc15;
  color: #facc15;
}

.sc-modal-title {
  font-family: 'Pixel', monospace;
  font-size: 1.4rem;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 2px;
  margin-bottom: 6px;
  text-shadow: 0 0 16px rgba(0, 255, 136, 0.6);
}

.sc-modal-sub {
  color: #00ff88;
  font-size: 0.76rem;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.sc-mode-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.sc-mode-tab {
  font-size: 0.8rem;
  padding: 8px 16px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.sc-mode-tab.tab-free-active {
  background: #00ff88;
  color: #05070a;
  border: 2px solid #00ff88;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

.sc-mode-tab.tab-free-inactive {
  background: transparent;
  color: #00ff88;
  border: 2px solid #00ff88;
  box-shadow: none;
}

.sc-mode-tab.tab-ranked-active {
  background: #facc15;
  color: #05070a;
  border: 2px solid #facc15;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.4);
}

.sc-mode-tab.tab-ranked-inactive {
  background: transparent;
  color: #facc15;
  border: 2px solid #facc15;
  box-shadow: none;
}

.sc-launch-btn {
  font-size: 0.95rem;
  padding: 12px 28px;
  background: #00ff88;
  color: #000000;
  border: none;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 0 18px rgba(0, 255, 136, 0.5);
  transition: transform 0.1s, box-shadow 0.2s;
}

.sc-launch-btn:hover {
  transform: translateY(-1px);
}

.sc-mode-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 12px;
  max-width: 540px;
  line-height: 1.45;
}

.sc-instructions {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 12px;
  line-height: 1.4;
}

.sc-fixed-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sc-dialog-box {
  background: #090d16;
  border: 2px solid #facc15;
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.25);
  border-radius: 8px;
  max-width: 620px;
  width: 100%;
  padding: 20px;
  color: #ffffff;
}

.sc-dialog-box.box-cyan {
  border-color: #38bdf8;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.25);
}

.sc-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.sc-dialog-title {
  color: #facc15;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.sc-dialog-title.title-cyan {
  color: #38bdf8;
}

.sc-dialog-subtitle {
  color: #94a3b8;
  font-size: 0.72rem;
  margin-top: 2px;
}

.sc-dialog-close {
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
}

.sc-dialog-close:hover {
  color: #ffffff;
  border-color: #cbd5e1;
}

.sc-rules-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.sc-rules-title {
  color: #facc15;
  font-weight: 800;
  margin-bottom: 4px;
}

.sc-rules-highlight {
  color: #00ff88;
  margin-top: 4px;
}

.sc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin-bottom: 16px;
}

.sc-table th {
  border-bottom: 1px solid #334155;
  color: #94a3b8;
  text-align: left;
  padding: 6px 8px;
}

.sc-table td {
  border-bottom: 1px solid #1e293b;
  padding: 7px 8px;
}

.sc-rank-gold { color: #facc15; font-weight: 800; }
.sc-rank-silver { color: #e2e8f0; font-weight: 800; }
.sc-rank-bronze { color: #cd7f32; font-weight: 800; }
.sc-score-cell { color: #00ff88; font-weight: 800; }
.sc-haul-cell { color: #38bdf8; }

.sc-badge-verified {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.68rem;
  border: 1px solid #00ff88;
}

.sc-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sc-wallet-status {
  font-size: 0.72rem;
  color: #94a3b8;
}

.sc-tourney-btn {
  background: #facc15;
  color: #000000;
  border: none;
  padding: 8px 14px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  border-radius: 4px;
}

.sc-proof-content {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #e2e8f0;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 14px;
  word-break: break-all;
}

.sc-proof-row {
  margin-bottom: 6px;
}

.sc-proof-k {
  color: #94a3b8;
}

.sc-proof-v {
  color: #38bdf8;
  font-weight: 700;
}

.sc-proof-v.valid {
  color: #00ff88;
}

.sc-proof-hash {
  font-size: 0.7rem;
  color: #facc15;
  font-family: monospace;
}

#toast {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: #00ff88;
  color: #000000;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.8rem;
  display: none;
  z-index: 5000;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
}

#sc-haul-panel {
  display: none !important;
}

/* ==========================================================================
   Mission Controls and Keycap Styling
   ========================================================================== */
.keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: #1e293b;
  color: #f1f5f9;
  font-family: 'Readout', 'Consolas', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid #475569;
  border-bottom: 2px solid #0f172a;
  box-shadow: 0 2px 0 #0f172a, 0 0 6px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  margin: 0 2px;
  vertical-align: middle;
  user-select: none;
}

.keycap-sm {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.62rem;
  border-radius: 3px;
  margin: 0 1px;
}

.keycap-accent {
  background: #0369a1;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 2px 0 #082f49, 0 0 6px rgba(56, 189, 248, 0.4);
}

.keycap-red {
  background: #991b1b;
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 2px 0 #450a0a, 0 0 6px rgba(239, 68, 68, 0.4);
}

.keycap-gold {
  background: #854d0e;
  border-color: #facc15;
  color: #fef08a;
  box-shadow: 0 2px 0 #422006, 0 0 6px rgba(250, 204, 21, 0.4);
}

/* Controls Card in Start Overlay */
.sc-controls-card {
  width: 100%;
  max-width: 620px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 12px 14px;
  margin: 10px 0;
  text-align: left;
}

.sc-controls-title {
  font-family: 'Pixel', monospace;
  font-size: 0.72rem;
  color: #00ff88;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 255, 136, 0.2);
  padding-bottom: 4px;
}

.sc-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 14px;
}

.sc-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.73rem;
  padding: 3px 0;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.08);
}

.sc-ctrl-action {
  color: #94a3b8;
  font-weight: 500;
}

.sc-ctrl-keys {
  display: flex;
  align-items: center;
  gap: 2px;
}

.sc-konami-hint {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #1e293b;
  font-size: 0.7rem;
  color: #facc15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

/* Persistent HUD Helper Bar */
.hud-helper-bar {
  background: #090d13;
  border-top: 1px solid #1f2735;
  padding: 6px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #94a3b8;
  z-index: 10;
  flex-wrap: wrap;
  gap: 6px;
}

.hud-helper-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hud-helper-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.hud-helper-btn {
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid #facc15;
  color: #facc15;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.hud-helper-btn:hover {
  background: #facc15;
  color: #000000;
}

/* Dedicated Controls Modal */
.sc-modal-controls {
  max-width: 680px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
}

.sc-keymap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
  margin: 10px 0 14px 0;
}

.sc-keymap-table th {
  background: #111827;
  color: #00ff88;
  font-family: 'Pixel', monospace;
  font-size: 0.68rem;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #1f2937;
}

.sc-keymap-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #1e293b;
  color: #e2e8f0;
}

.sc-keymap-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.sc-tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.sc-tip-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.72rem;
  line-height: 1.4;
}

.sc-tip-title {
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 768px) {
  .arcade-btn-group .btn-secondary-arcade {
    display: none !important;
  }
  .mobile-only-btn {
    display: inline-flex !important;
  }
}

@media (max-width: 720px) {
  .sc-controls-grid {
    grid-template-columns: 1fr;
  }
  .sc-tips-grid {
    grid-template-columns: 1fr;
  }
  .hud-helper-bar {
    display: none;
  }
}

@media (max-width: 640px) {
  header.arcade-header {
    padding: 6px 10px;
  }
  .arcade-title {
    font-size: 0.75rem;
  }
  .arcade-btn {
    padding: 4px 7px;
    font-size: 0.68rem;
  }
  .hud-bar {
    font-size: 0.72rem;
    padding: 4px 10px;
  }
  .sc-modal-title {
    font-size: 1.15rem;
  }
}

/* Options Drawer Modal */
.sc-modal-options {
  max-width: 580px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
}

.sc-options-section {
  margin-bottom: 12px;
  text-align: left;
}

.sc-options-label {
  font-family: 'Pixel', monospace;
  font-size: 0.68rem;
  color: #00ff88;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(0, 255, 136, 0.2);
  padding-bottom: 2px;
}

.sc-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
}

.mobile-only-btn {
  display: none;
}

/* Mobile Rotation Notice */
.mobile-rotate-notice {
  display: none;
}

@media (max-width: 600px) and (orientation: portrait) {
  .mobile-rotate-notice {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 10, 0.96);
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    backdrop-filter: blur(8px);
  }
  .rotate-icon {
    font-size: 3.2rem;
    color: #00ff88;
    margin-bottom: 14px;
    animation: rotatePulse 2.2s infinite ease-in-out;
  }
  .rotate-text {
    font-family: 'Pixel', monospace;
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 6px;
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.5);
  }
  .rotate-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 20px;
    max-width: 260px;
    line-height: 1.4;
  }
  .rotate-dismiss {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 6px 16px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.72rem;
    cursor: pointer;
  }
}

@keyframes rotatePulse {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(90deg) scale(1.1); color: #38bdf8; }
  100% { transform: rotate(0deg) scale(1); }
}


/* HUD Intel button */
.sc-hud-btn {
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid #0284c7;
  color: #38bdf8;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 8px;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  pointer-events: auto;
}

.sc-hud-btn:hover {
  background: rgba(14, 165, 233, 0.4);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* Mode Selector Cards */
.sc-mode-selector-wrap {
  width: 100%;
  max-width: 520px;
  margin-bottom: 10px;
}

.sc-mode-selector-label {
  font-size: 0.65rem;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-align: left;
}

.sc-mode-cards {
  display: flex;
  gap: 10px;
  width: 100%;
}

.sc-mode-card {
  flex: 1;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  user-select: none;
}

.sc-mode-card.mode-card-active#btn-mode-free {
  background: rgba(0, 255, 136, 0.12);
  border: 2px solid #00ff88;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.35);
}

.sc-mode-card.mode-card-inactive#btn-mode-free {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #334155;
  opacity: 0.75;
}

.sc-mode-card.mode-card-active#btn-mode-ranked {
  background: rgba(250, 204, 21, 0.12);
  border: 2px solid #facc15;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.35);
}

.sc-mode-card.mode-card-inactive#btn-mode-ranked {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #334155;
  opacity: 0.75;
}

.sc-mode-card:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.sc-mode-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sc-mode-radio {
  font-size: 0.9rem;
  font-weight: 900;
}

.mode-card-active#btn-mode-free .sc-mode-radio,
.mode-card-active#btn-mode-free .sc-mode-card-title {
  color: #00ff88;
}

.mode-card-active#btn-mode-ranked .sc-mode-radio,
.mode-card-active#btn-mode-ranked .sc-mode-card-title {
  color: #facc15;
}

.mode-card-inactive .sc-mode-radio,
.mode-card-inactive .sc-mode-card-title {
  color: #94a3b8;
}

.sc-mode-card-title {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.sc-mode-card-sub {
  font-size: 0.65rem;
  color: #94a3b8;
  line-height: 1.35;
}

/* Operative Selector Cards */
.sc-char-selector-wrap {
  width: 100%;
  max-width: 520px;
  margin-bottom: 12px;
}

.sc-char-selector-label {
  font-size: 0.65rem;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-align: left;
}

.sc-char-cards {
  display: flex;
  gap: 8px;
  width: 100%;
}

.sc-char-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  user-select: none;
}

.sc-char-card.char-card-active {
  background: rgba(56, 189, 248, 0.16);
  border: 2px solid #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

.sc-char-card.char-card-inactive {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #334155;
  opacity: 0.75;
}

.sc-char-card:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.sc-char-visual {
  width: 38px;
  height: 38px;
  background: #020617;
  border: 1px solid #334155;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sc-char-card.char-card-active .sc-char-visual {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.sc-char-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sc-char-name {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sc-char-card.char-card-active .sc-char-name {
  color: #38bdf8;
}

.sc-char-role {
  font-size: 0.58rem;
  color: #94a3b8;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-options-grid-3 {
  grid-template-columns: repeat(3, 1fr) !important;
}

.char-opt-btn.active {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5) !important;
}

/* Secondary Action Hub on Start Overlay */
.sc-start-actions-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 520px;
  margin: 10px 0 6px 0;
}

.sc-start-action-btn {
  flex: 1;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sc-start-action-btn.action-intel {
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid #0ea5e9;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.sc-start-action-btn.action-intel:hover {
  background: rgba(14, 165, 233, 0.32);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.sc-start-action-btn.action-lb {
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid #facc15;
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.sc-start-action-btn.action-lb:hover {
  background: rgba(250, 204, 21, 0.28);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.5);
  transform: translateY(-1px);
}

.sc-start-action-btn.action-ctrl {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid #64748b;
  color: #e2e8f0;
}

.sc-start-action-btn.action-ctrl:hover {
  background: rgba(148, 163, 184, 0.28);
  border-color: #94a3b8;
  box-shadow: 0 0 14px rgba(226, 232, 240, 0.3);
  transform: translateY(-1px);
}

.sc-start-action-btn.action-share {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.sc-start-action-btn.action-share:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #7dd3fc;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

/* Compact Quick-Keys Ribbon on Start Overlay */
.sc-quick-keys-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 10px;
  width: 100%;
  max-width: 520px;
}

.sc-quick-key-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: #94a3b8;
}

/* Demo Notice Banner in Leaderboard */
.sc-demo-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid #facc15;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.72rem;
  color: #fef08a;
  text-align: left;
  line-height: 1.4;
}

.sc-demo-pill {
  background: #facc15;
  color: #0f172a;
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.sc-badge-demo {
  background: rgba(250, 204, 21, 0.2);
  border: 1px solid #facc15;
  color: #facc15;
  font-size: 0.62rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
}

.special-title {
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  background: rgba(14, 165, 233, 0.15) !important;
}

.special-title:hover {
  background: rgba(14, 165, 233, 0.35) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5) !important;
}


.sc-btn-secondary {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid #475569;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sc-btn-secondary:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #ffffff;
  border-color: #64748b;
}

.sc-dialog-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #1e293b;
}

/* Tactical Field Dossier Modal Styles */
.sc-dialog-box.sc-intel-dialog {
  max-width: 820px;
  max-height: 88vh;
  border-color: #0ea5e9;
  box-shadow: 0 0 35px rgba(14, 165, 233, 0.3);
  display: flex;
  flex-direction: column;
}

.sc-intel-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 8px;
}

.sc-intel-tab {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.sc-intel-tab.intel-tab-active {
  background: #0ea5e9;
  border-color: #38bdf8;
  color: #04101e;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
}

.sc-intel-view {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(88vh - 160px);
  padding-right: 4px;
}

.sc-intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
}

.sc-intel-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #334155;
  border-radius: 6px;
  align-items: center;
  transition: border-color 0.2s ease;
}

.sc-intel-card:hover {
  border-color: #0ea5e9;
}

.sc-intel-card.boss-card {
  background: rgba(30, 10, 20, 0.65);
  border-color: rgba(239, 68, 68, 0.4);
}

.sc-intel-card.boss-card:hover {
  border-color: #ef4444;
}

.sc-intel-visual {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid #1e293b;
  border-radius: 5px;
}

.sc-pixel-preview {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.sc-intel-body {
  flex: 1;
  min-width: 0;
}

.sc-intel-name {
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  color: #f8fafc;
  margin-bottom: 2px;
  letter-spacing: 0.04em;
}

.sc-intel-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
}

.badge-weapon {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.badge-powerup {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-swole {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.badge-cargo {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-threat-low {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-threat-med {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.badge-threat-high {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-boss {
  background: rgba(220, 38, 38, 0.28);
  color: #fca5a5;
  border: 1px solid #ef4444;
}

.sc-intel-desc {
  font-size: 0.68rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin-bottom: 3px;
}

.sc-intel-meta {
  font-size: 0.62rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.sc-intel-meta span {
  color: #e2e8f0;
  font-weight: 700;
}

/* ==========================================================================
   Mobile Landscape Mode Optimization (Tuned for Phones)
   ========================================================================== */
@media (max-height: 540px), (orientation: landscape) and (max-width: 950px) {
  /* Complete elimination of keyboard helper bar in landscape mode */
  .hud-helper-bar {
    display: none !important;
  }

  #toast {
    top: 36px;
    padding: 3px 10px;
    font-size: 0.68rem;
  }

  /* Ultra-compact single-row header */
  header.arcade-header {
    position: relative;
    z-index: 50;
    padding: 3px 10px;
    height: 32px;
    min-height: 32px;
    background: rgba(13, 18, 24, 0.95);
    border-bottom: 1px solid #00ff88;
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 6px;
  }

  .arcade-title-group {
    gap: 8px;
    flex-shrink: 0;
  }

  .arcade-back-link {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .arcade-title {
    font-size: 0.72rem;
    white-space: nowrap;
  }

  /* In mobile landscape, hide the bulky secondary warp and cheat buttons */
  .arcade-btn-group .btn-secondary-arcade {
    display: none !important;
  }

  .arcade-btn-group {
    gap: 4px;
    flex-wrap: nowrap;
    margin-left: auto;
  }

  .mobile-only-btn {
    display: inline-flex !important;
  }

  .arcade-btn {
    padding: 2px 7px;
    font-size: 0.65rem;
    height: 24px;
    line-height: 20px;
  }

  /* Slim overlay HUD docked inside the top edge of viewport */
  .hud-bar {
    padding: 3px 12px;
    font-size: 0.68rem;
    background: rgba(7, 10, 14, 0.85);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(31, 39, 53, 0.8);
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    z-index: 25;
    pointer-events: none;
  }

  .hud-boss-meter {
    width: 65px;
    height: 6px;
  }

  /* Viewport takes full height under header */
  #super-cypher-viewport {
    flex: 1;
    position: relative;
    height: calc(100vh - 32px);
    width: 100vw;
  }

  /* Touch controls optimized for thumbs with safe area insets */
  .touch-controls {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    align-items: flex-end;
  }

  /* D-Pad cross */
  .dpad-grid {
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(3, 40px);
    gap: 3px;
  }

  .touch-btn {
    width: 40px;
    height: 40px;
    font-size: 0.82rem;
    background: rgba(14, 18, 24, 0.72);
    backdrop-filter: blur(6px);
  }

  .touch-btn-center {
    width: 40px;
    height: 40px;
  }

  .touch-btn-diag {
    width: 40px;
    height: 40px;
  }

  .touch-btn:active, .touch-btn.active {
    background: #00ff88;
    color: #000000;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.8);
  }

  /* Action buttons cluster */
  .action-container {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .action-sub-row {
    display: flex;
    gap: 6px;
  }

  .touch-btn-pause, .touch-btn-wpn {
    width: 36px;
    height: 36px;
    font-size: 0.65rem;
  }

  .action-main-cluster {
    display: flex;
    gap: 12px;
    align-items: center;
  }

  .touch-btn-fire {
    width: 56px;
    height: 56px;
    font-size: 0.82rem;
    background: rgba(255, 71, 87, 0.3);
    border-color: #ff4757;
    color: #ff4757;
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.35);
  }

  .touch-btn-fire:active {
    background: #ff4757;
    color: #ffffff;
    box-shadow: 0 0 18px rgba(255, 71, 87, 0.8);
  }

  .touch-btn-jump {
    width: 56px;
    height: 56px;
    font-size: 0.82rem;
    background: rgba(0, 255, 136, 0.3);
    border-color: #00ff88;
    color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.35);
  }

  .touch-btn-jump:active {
    background: #00ff88;
    color: #000000;
    box-shadow: 0 0 18px rgba(0, 255, 136, 0.8);
  }

  /* Start overlay in landscape */
  .sc-modal-overlay {
    padding: 8px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .sc-modal-title {
    font-size: 1.05rem;
    margin-bottom: 2px;
  }

  .sc-modal-sub {
    font-size: 0.68rem;
    margin-bottom: 6px;
  }

  .sc-mode-tabs {
    margin-bottom: 6px;
    gap: 6px;
  }

  .sc-mode-tab {
    font-size: 0.72rem;
    padding: 5px 12px;
  }

  .sc-launch-btn {
    font-size: 0.8rem;
    padding: 7px 16px;
  }

  .sc-controls-card {
    padding: 6px 10px;
    margin: 6px 0;
  }

  .sc-controls-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3px 8px;
  }

  .sc-ctrl-row {
    font-size: 0.65rem;
    padding: 2px 0;
  }

  .keycap {
    min-width: 18px;
    height: 18px;
    font-size: 0.62rem;
    padding: 0 3px;
  }

  .sc-dialog-box {
    max-height: 90vh;
    padding: 10px;
  }
  /* In landscape mode: compact intel dialog & mode cards */
  .sc-mode-cards {
    gap: 6px;
  }
  .sc-mode-card {
    padding: 6px 8px;
  }
  .sc-mode-card-title {
    font-size: 0.68rem;
  }
  .sc-mode-card-sub {
    font-size: 0.58rem;
  }
  .sc-intel-btn {
    padding: 5px 10px;
    font-size: 0.68rem;
  }
  .sc-dialog-box.sc-intel-dialog {
    max-height: 94vh;
    padding: 8px 14px;
    max-width: 92vw;
  }
  .sc-intel-tabs {
    margin-bottom: 6px;
    padding-bottom: 6px;
  }
  .sc-intel-tab {
    font-size: 0.68rem;
    padding: 4px 10px;
  }
  .sc-intel-view {
    max-height: calc(94vh - 105px);
  }
  .sc-intel-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .sc-intel-card {
    padding: 6px 8px;
    gap: 8px;
  }
  .sc-intel-visual {
    width: 54px;
    height: 54px;
  }
  .sc-intel-name {
    font-size: 0.72rem;
  }
  .sc-intel-badge {
    font-size: 0.55rem;
    padding: 1px 4px;
  }
  .sc-intel-desc {
    font-size: 0.62rem;
    line-height: 1.3;
  }
  .sc-intel-meta {
    font-size: 0.58rem;
  }

  /* In landscape mode: compact operative selector cards */
  .sc-char-selector-wrap {
    margin-bottom: 6px;
  }
  .sc-char-cards {
    gap: 5px;
  }
  .sc-char-card {
    padding: 4px 6px;
    gap: 6px;
  }
  .sc-char-visual {
    width: 28px;
    height: 28px;
  }
  .sc-char-name {
    font-size: 0.65rem;
  }
  .sc-char-role {
    font-size: 0.52rem;
  }

  /* In landscape mode: compact title hero and actions */
  .sc-title-hero-wrap {
    max-width: 280px;
    max-height: none;
    aspect-ratio: 1376 / 768;
    margin-bottom: 4px;
  }
  .sc-title-hero-art {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
  }
  .sc-title-hero-badge-left,
  .sc-title-hero-badge-right {
    font-size: 0.5rem;
    padding: 1px 4px;
    bottom: 4px;
  }
  .sc-start-actions-row {
    margin: 6px 0 4px 0;
    gap: 4px;
  }
  .sc-start-action-btn {
    font-size: 0.62rem;
    padding: 4px 6px;
  }
  .sc-quick-keys-bar {
    display: none;
  }
}

/* Squad Formation Selector */
.sc-squad-selector-wrap {
  width: 100%;
  margin-top: 10px;
}

.sc-squad-cards {
  display: flex;
  gap: 8px;
  width: 100%;
}

.sc-squad-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  user-select: none;
  transition: all 0.2s ease;
}

.sc-squad-card.squad-card-active#btn-squad-solo {
  background: rgba(0, 255, 136, 0.14);
  border: 1.5px solid #00ff88;
  color: #00ff88;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.sc-squad-card.squad-card-active#btn-squad-coop {
  background: rgba(59, 130, 246, 0.16);
  border: 1.5px solid #3b82f6;
  color: #60a5fa;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

.sc-squad-card.squad-card-active#btn-squad-bot {
  background: rgba(168, 85, 247, 0.16);
  border: 1.5px solid #a855f7;
  color: #c084fc;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.sc-squad-card.squad-card-inactive {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #334155;
  color: #94a3b8;
  opacity: 0.75;
}

.sc-squad-card:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.sc-squad-radio {
  font-size: 0.85rem;
  font-weight: 900;
}

#btn-coop-toggle.on {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #60a5fa;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* Keep the demo HUD inside narrow screens, including the second operative. */
@media (max-width: 950px) {
  .hud-bar, .hud-left, .hud-right { flex-wrap: wrap; min-width: 0; gap: 6px; }
  .hud-stage-name { white-space: normal; overflow-wrap: anywhere; }
  .sc-squad-card { min-width: 0; overflow-wrap: anywhere; }
}

/* A shared action column keeps both players' mappings easy to compare. */
.sc-control-grid { display:grid;grid-template-columns:minmax(90px,1fr) minmax(100px,1fr) minmax(100px,1fr);gap:8px;align-items:center;margin:16px 0; }
.sc-control-grid button { white-space:normal;min-height:42px; }
.sc-control-grid strong { color:#93c5fd; }
#sc-control-status { min-height:2.5em;color:#facc15; }
@media(max-width:480px) { .sc-control-grid { gap:5px;font-size:12px;grid-template-columns:75px 1fr 1fr; } }

.sc-online-actions {display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;}
#sc-online-invite {display:block;width:100%;box-sizing:border-box;padding:10px;margin:8px 0;background:#0f172a;color:#e2e8f0;border:1px solid #475569;border-radius:4px;}
#sc-online-banner {position:relative;flex-shrink:0;z-index:120;background:rgba(15,23,42,.94);color:#e2e8f0;padding:8px;border:1px solid #38bdf8;font-size:12px;}
#sc-online-banner[hidden] {display:none;}
#sc-online-banner button {margin-left:8px;cursor:pointer;}

/* ==========================================================================
   In-Game HUD Announcement Banner (#sc-banner)
   ========================================================================== */
#sc-banner,
.sc-announcement-banner {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 12, 20, 0.85);
  border: 1px solid rgba(0, 255, 136, 0.65);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75);
  padding: 5px 16px;
  text-align: center;
  display: none;
  pointer-events: none;
  z-index: 120;
  max-width: 85%;
  box-sizing: border-box;
  font-family: var(--font-mono, monospace);
  transition: opacity 0.25s ease;
}

#sc-banner-title {
  font-size: 11px;
  font-weight: 800;
  color: #00ff88;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 1.2;
}

#sc-banner-sub {
  font-size: 9.5px;
  color: #cbd5e1;
  margin-top: 2px;
  letter-spacing: 0.8px;
  line-height: 1.2;
}

@media (max-width: 900px), (max-height: 540px) {
  #sc-banner,
  .sc-announcement-banner {
    top: 34px !important;
    padding: 2px 8px !important;
    max-width: 94% !important;
    background: rgba(8, 12, 20, 0.72) !important;
    border: 1px solid rgba(0, 255, 136, 0.45) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  #sc-banner-title {
    font-size: 9.5px !important;
    letter-spacing: 0.8px !important;
  }
  #sc-banner-sub {
    font-size: 8px !important;
    margin-top: 1px !important;
    letter-spacing: 0.4px !important;
  }
  #toast {
    display: none !important;
  }
}

/* Keep active-play notices to two readable lines, including short phone screens. */
#sc-banner { top: 8px !important; width: calc(100% - 16px); max-width: 640px !important; padding: 5px 8px !important; }
#sc-banner-title, #sc-banner-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0 !important; }
@media (max-width: 900px), (max-height: 540px) {
  #sc-banner-title { font-size: 11px !important; line-height: 14px; }
  #sc-banner-sub { font-size: 10px !important; line-height: 13px; }
}

.sc-rule-select {width:100%;padding:10px;background:#0f172a;color:#e2e8f0;border:1px solid #475569;border-radius:6px;font:inherit;}
.sc-ranked-locked {opacity:.5;cursor:not-allowed;}
#sc-ranked-live-status {flex-shrink:0;padding:4px 8px;background:#172034;color:#facc15;font:11px monospace;}
#sc-ranked-live-status[hidden], #sc-ranked-entry[hidden], #sc-ranked-retry[hidden] {display:none;}

/* Optional market links stay inside menus, never over active gameplay. */
.sc-coin-link { display:inline-block; margin:12px 8px; padding:8px; border:0; background:transparent; color:#94d7ca; font:inherit; font-size:11px; text-decoration:underline; text-underline-offset:4px; cursor:pointer; }
.sc-coin-link:hover,.sc-coin-link:focus-visible { color:#fff; }
#sc-coin-dialog { width:min(460px,calc(100vw - 32px)); box-sizing:border-box; max-height:calc(100dvh - 32px); overflow:auto; padding:26px; border:1px solid #38bda2; border-radius:12px; background:#0b1520; color:#e2e8f0; font-family:inherit; box-shadow:0 18px 70px #000a; }
#sc-coin-dialog::backdrop { background:#000b; }
#sc-coin-dialog h2 { margin:0 32px 16px 0; font-size:20px; color:#5df0c3; }
#sc-coin-dialog p { font-size:13px; line-height:1.6; }
#sc-coin-close { position:absolute; top:10px; right:10px; width:36px; height:36px; border:0; background:transparent; color:#fff; font-size:20px; cursor:pointer; }
.sc-coin-options { display:grid; gap:8px; margin:18px 0; }
.sc-coin-options a { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:13px; border:1px solid #334155; border-radius:6px; color:#fff; text-decoration:none; font-size:14px; }
.sc-coin-options a:hover,.sc-coin-options a:focus-visible { border-color:#5df0c3; background:#13302c; }
.sc-coin-options span { color:#a7b8cc; font-size:11px; }
#sc-coin-dialog .sc-coin-address { font-size:10px; color:#94a3b8; overflow-wrap:anywhere; }

/* ===== Start menu layout (2026-09-24): two columns on wide screens so the whole menu fits one view.
   Left = title art + launch, right = mission setup. Narrow screens stack: art, setup, then launch. ===== */
.sc-overlay-card.sc-menu { max-width: 1120px; gap: 0 28px; }
.sc-menu-left, .sc-menu-right { display: flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 540px; min-width: 0; }
.sc-menu .sc-title-hero-wrap { max-width: none; }
.sc-menu .sc-modal-sub { margin: 4px 0 10px; }
.sc-menu-launch { display: flex; flex-direction: column; align-items: center; width: 100%; }
.sc-menu .sc-launch-btn { width: 100%; padding: 14px 20px; font-size: 1rem; }
.sc-menu .sc-mode-desc { margin-top: 8px; max-width: none; }
.sc-menu .sc-start-actions-row { max-width: none; margin: 10px 0 0; }
.sc-menu .sc-coin-link { margin: 8px 0 0; }
.sc-menu .sc-mode-selector-wrap, .sc-menu .sc-char-selector-wrap { max-width: none; margin-bottom: 12px; }
.sc-menu .sc-squad-selector-wrap { margin: 0 0 12px; }
.sc-menu .sc-squad-card { padding: 9px 8px; }
.sc-menu .sc-mode-card { padding: 9px 12px; }
.sc-menu .sc-char-card { padding: 6px 8px; flex: 1 1 0; min-width: 0; }
.sc-menu .sc-char-visual { flex-shrink: 0; }
.sc-menu .sc-char-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-rule-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; width: 100%; text-align: left; }
.sc-rule-field { display: flex; flex-direction: column; min-width: 0; }
.sc-menu .sc-rule-select { padding: 8px 10px; font-size: 0.78rem; }
.sc-rule-note { margin: 6px 0 12px; font-size: 0.62rem; color: #64748b; text-align: left; line-height: 1.4; }
.sc-ranked-note { text-align: left; font-size: 0.66rem; color: #cbd5e1; background: rgba(250, 204, 21, 0.08); border: 1px solid rgba(250, 204, 21, 0.4); border-radius: 6px; padding: 8px 12px; }
.sc-ranked-note p { margin: 4px 0 0; line-height: 1.4; }
.sc-online-details { width: 100%; text-align: left; border: 1px solid #334155; border-radius: 6px; background: rgba(15, 23, 42, 0.7); }
.sc-online-details > summary { cursor: pointer; padding: 10px 12px; font-size: 0.72rem; font-weight: 700; color: #7dd3fc; letter-spacing: 0.05em; list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sc-online-details > summary::-webkit-details-marker { display: none; }
.sc-online-details > summary::after { content: '\25B8'; margin-left: auto; color: #94a3b8; transition: transform 0.15s; }
.sc-online-details[open] > summary::after { transform: rotate(90deg); }
.sc-online-details > summary span { font-weight: 400; color: #94a3b8; font-size: 0.62rem; letter-spacing: 0; }
.sc-online-panel { padding: 0 12px 12px; font-size: 0.66rem; color: #cbd5e1; }
.sc-online-panel p { margin: 0 0 8px; line-height: 1.4; }
.sc-online-panel label { display: block; margin-bottom: 4px; color: #94a3b8; }
.sc-online-panel input { width: 100%; box-sizing: border-box; padding: 8px 10px; background: #0f172a; color: #e2e8f0; border: 1px solid #475569; border-radius: 6px; font: inherit; margin-bottom: 8px; }
.sc-online-panel .sc-online-actions { margin-bottom: 10px; }

@media (min-width: 900px), (orientation: landscape) and (min-width: 640px) {
  .sc-modal-overlay:has(.sc-menu) { justify-content: center; }
  .sc-overlay-card.sc-menu { flex-direction: row; align-items: flex-start; justify-content: center; }
  .sc-menu-left { flex: 1 1 0; position: sticky; top: 0; }
  .sc-menu-right { flex: 1 1 0; }
}
@media (max-width: 899px) and (orientation: portrait), (max-width: 639px) {
  /* Stack: art, then setup, then launch, so players choose before they press Play. */
  .sc-menu-left { display: contents; }
  .sc-menu .sc-title-hero-wrap { order: 1; max-width: 540px; }
  .sc-menu .sc-modal-sub { order: 2; }
  .sc-menu-right { order: 3; }
  .sc-menu-launch { order: 4; max-width: 540px; margin-top: 4px; }
}
@media (max-width: 520px) {
  .sc-rule-row { grid-template-columns: 1fr; }
  .sc-menu .sc-start-actions-row { flex-wrap: wrap; }
  .sc-menu .sc-start-action-btn { flex: 1 1 45%; }
  .sc-menu .sc-char-cards { flex-direction: column; }
}
@media (max-height: 540px) and (orientation: landscape) {
  /* Short landscape (phones): cap the art by height so setup and Play stay near the top. */
  .sc-overlay-card.sc-menu { gap: 0 16px; }
  .sc-menu .sc-title-hero-wrap { width: min(100%, calc(42vh * 1376 / 768)); max-width: none; align-self: center; }
  .sc-menu .sc-modal-sub { font-size: 0.55rem; margin: 2px 0 6px; }
  .sc-menu .sc-launch-btn { padding: 10px 12px; font-size: 0.8rem; }
  .sc-menu .sc-mode-desc { display: none; }
  .sc-menu .sc-start-actions-row { flex-wrap: wrap; }
  .sc-menu .sc-start-action-btn { flex: 1 1 45%; }
  .sc-menu .sc-mode-selector-wrap, .sc-menu .sc-char-selector-wrap, .sc-menu .sc-squad-selector-wrap { margin-bottom: 8px; }
  .sc-menu .sc-rule-note { display: none; }
  .sc-menu .sc-char-role { display: none; }
}
.sc-volume-row { display:flex; align-items:center; gap:10px; margin-top:10px; font-size:0.72rem; font-weight:700; letter-spacing:0.08em; color:#94a3b8; }
.sc-volume-row input { flex:1; accent-color:#00ff88; cursor:pointer; }
.sc-volume-row span { min-width:38px; text-align:right; color:#00ff88; }
