

.game-body {
  overflow-x: hidden;
  min-height: 100vh;
}

.bounce-shell {
  background: #0a0d18;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 90px rgba(0, 0, 0, 0.55);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 26px;
  background: #0f1322;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: var(--transition-smooth);
}
.back-link:hover {
  color: var(--primary-accent);
}

.hud-game-title {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 2px;
  font-weight: bold;
}

.sound-toggle-btn {
  background: #171d30;
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: #b7aed1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}
.sound-toggle-btn:hover {
  background: #232b47;
  color: var(--primary-accent);
  border-color: rgba(217, 188, 122, 0.4);
}


.game-viewport {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  min-height: 560px;
  height: clamp(560px, calc(100vh - 200px), 820px);
  width: 100%;
  margin: 0 auto;
  gap: 16px;
  padding: 0 16px;
  box-sizing: border-box;
}

.mobile-settings-toggle {
  display: none;
}


.control-panel-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}


.skin-selector, .mode-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.level-selector {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-border) transparent;
}
.level-selector::-webkit-scrollbar {
  width: 5px;
}
.level-selector::-webkit-scrollbar-track {
  background: transparent;
}
.level-selector::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 4px;
}

.bounce-shell .game-sidebar {
  padding: 12px 10px;
  gap: 10px;
}

.settings-sidebar,
.gameplay-sidebar {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-border) transparent;
  padding-right: 4px;
  min-height: 0;
  box-sizing: border-box;
}

.settings-sidebar::-webkit-scrollbar,
.gameplay-sidebar::-webkit-scrollbar {
  width: 5px;
}
.settings-sidebar::-webkit-scrollbar-track,
.gameplay-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.settings-sidebar::-webkit-scrollbar-thumb,
.gameplay-sidebar::-webkit-scrollbar-thumb {
  background: var(--panel-border, rgba(255, 255, 255, 0.15));
  border-radius: 4px;
}

.skin-btn, .mode-btn, .action-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  text-align: left;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease;
}

.skin-btn .skin-emoji {
  margin-right: 12px;
  font-size: 16px;
}

.mode-btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.mode-btn .mode-name {
  font-size: 14px;
  font-weight: 700;
}
.mode-btn .mode-desc {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.skin-btn:hover, .mode-btn:hover, .action-btn:hover {
  background: var(--panel-hover-bg);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.skin-btn.active, .mode-btn.active {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(255, 107, 107, 0.05) 100%);
  border-color: var(--primary-accent);
  box-shadow: 0 0 12px rgba(255, 107, 107, 0.15);
  color: var(--primary-accent);
}
.skin-btn.active .skin-emoji {
  filter: drop-shadow(0 0 4px var(--primary-accent));
}

.action-btn {
  justify-content: center;
  background: var(--panel-bg);
  font-size: 14px;
}


.mode-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.05);
}

.level-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}
.level-selector .mode-btn {
  padding: 6px 8px;
  border-radius: 6px;
  gap: 1px;
}
.level-selector .mode-btn .mode-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.level-selector .mode-btn .mode-desc {
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95px;
}


.game-arena-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 8px;
  position: relative;
  background: rgba(10, 10, 15, 0.2);
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.canvas-holder {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}


.nokia-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.4s ease;
}

.nokia-phone {
  background: linear-gradient(135deg, hsl(210, 15%, 52%) 0%, hsl(210, 15%, 35%) 100%);
  border: 8px solid hsl(210, 15%, 22%);
  border-radius: 40px / 60px;
  width: 360px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.5), 
    inset 0 4px 6px rgba(255, 255, 255, 0.2),
    inset 0 -8px 12px rgba(0, 0, 0, 0.4);
  position: relative;
}

.nokia-earpiece {
  width: 50px;
  height: 6px;
  background-color: #222;
  border-radius: 3px;
  border-bottom: 2px solid #555;
}

.nokia-brand {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  color: #cdd5df;
  letter-spacing: 3px;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.8);
}

.nokia-screen-bezel {
  background: #3c444f;
  border: 4px solid #1f2329;
  border-radius: 20px;
  padding: 14px;
  width: 100%;
  box-shadow: 
    inset 0 3px 6px rgba(0, 0, 0, 0.6), 
    0 2px 2px rgba(255, 255, 255, 0.1);
}

.nokia-screen-lcd {
  background-color: hsl(76, 40%, 52%); 
  border: 6px double hsl(76, 55%, 15%);
  width: 100%;
  height: 310px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.nokia-lcd-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background: 
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.35;
  z-index: 5;
}

.nokia-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  font-weight: bold;
  color: hsl(76, 60%, 10%);
  padding: 4px 8px;
  border-bottom: 1px solid hsl(76, 60%, 15%);
}

#nokia-canvas {
  image-rendering: pixelated;
  width: 100%;
  height: calc(100% - 22px);
}

.screen-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 8;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(1px);
}

.nokia-screen-lcd .screen-overlay {
  background-color: rgba(144, 168, 80, 0.85); 
}

.overlay-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lcd-title {
  font-family: 'VT323', monospace;
  font-size: 32px;
  color: hsl(76, 60%, 8%);
  margin: 0;
  letter-spacing: 2px;
}

.lcd-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: hsl(76, 60%, 12%);
  margin: 0;
  animation: blink 1.2s infinite steps(2);
}


.nokia-keypad {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 10px;
}

.keypad-row-sys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 0 20px;
}

.nokia-key {
  background: linear-gradient(to bottom, #eaeaea 0%, #bcbcbc 100%);
  border: 1px solid #777;
  border-radius: 8px;
  color: #333;
  padding: 8px 4px;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 
    0 3px 0 #888,
    0 4px 6px rgba(0,0,0,0.3);
  transition: all 0.05s ease;
  user-select: none;
}
.nokia-key:active {
  transform: translateY(2px);
  box-shadow: 
    0 1px 0 #888,
    0 2px 3px rgba(0,0,0,0.2);
}

.key-clear {
  border-top-left-radius: 20px 10px;
  border-bottom-left-radius: 10px 5px;
}
.key-nav {
  border-top-right-radius: 20px 10px;
  border-bottom-right-radius: 10px 5px;
}

.keypad-grid-nums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.keypad-grid-nums .nokia-key {
  border-radius: 50% 50% 40% 40% / 20px;
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.nokia-key .num {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
}

.nokia-key .letters {
  font-size: 7px;
  color: #555;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ctrl-key {
  background: linear-gradient(to bottom, #d2dbe5 0%, #a6b7c9 100%);
  border-color: #5d6e7f;
}

.key-five {
  background: linear-gradient(to bottom, #ff9b9b 0%, #e66565 100%) !important;
  border-color: #b53838 !important;
  color: #fff !important;
}
.key-five .letters {
  color: rgba(255,255,255,0.8) !important;
}



.arcade-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  animation: fadeIn 0.4s ease;
}

.arcade-cabinet {
  background: #12121e;
  border: 4px solid #ff007f;
  border-radius: 18px;
  width: 100%;
  max-width: min(560px, calc((100vh - 230px) * 0.95), 100%);
  height: 100%;
  max-height: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 
    0 0 30px rgba(255, 0, 127, 0.3),
    0 15px 35px rgba(0, 0, 0, 0.6);
  position: relative;
  box-sizing: border-box;
}

.arcade-marquee {
  flex-shrink: 0;
  background: #080811;
  border: 2px solid #00f0ff;
  border-radius: 8px;
  padding: 6px 12px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.neon-text {
  font-family: 'VT323', monospace;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 4px;
  text-shadow: 
    0 0 4px #fff,
    0 0 10px #00f0ff,
    0 0 20px #00f0ff,
    0 0 30px #ff007f;
  animation: neonGlow 2s infinite alternate;
}

.arcade-screen-container {
  position: relative;
  background: #020205;
  border: 3px solid #1a1a2f;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.9);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#arcade-canvas {
  display: block;
  background: #050510;
  box-shadow: 0 0 15px rgba(255,255,255,0.05);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  width: auto;
  height: auto;
  object-fit: contain;
}

.decal {
  position: absolute;
  bottom: 0;
  width: 40px;
  height: 120px;
  pointer-events: none;
  opacity: 0.15;
}
.decal-left {
  left: 0;
  background: linear-gradient(90deg, #ff007f, transparent);
  clip-path: polygon(0 0, 100% 30%, 100% 100%, 0 100%);
}
.decal-right {
  right: 0;
  background: linear-gradient(-90deg, #00f0ff, transparent);
  clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
}

.arcade-wrapper .screen-overlay {
  background-color: rgba(5, 5, 15, 0.85);
}

.arcade-overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 30px;
  border: 2px solid #ff007f;
  background: rgba(10, 10, 22, 0.95);
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.2);
  border-radius: 12px;
  max-width: 320px;
}

.arcade-title {
  font-family: 'VT323', monospace;
  font-size: 36px;
  margin: 0;
  color: #00f0ff;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
  letter-spacing: 2px;
}

.arcade-title.neon-pulse {
  animation: arcadePulse 1s infinite alternate;
}

.arcade-title.death-neon {
  color: #ff007f;
  text-shadow: 0 0 8px rgba(255, 0, 127, 0.8);
}

.arcade-score-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  color: #fff;
  margin: 0;
  letter-spacing: 1px;
}

.arcade-score-text span {
  color: #ff007f;
  font-weight: bold;
}

.arcade-start-btn {
  background: #ff007f;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-family: 'VT323', monospace;
  font-size: 22px;
  padding: 10px 24px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
  letter-spacing: 1px;
  transition: all 0.2s ease;
}
.arcade-start-btn:hover {
  background: #ff3399;
  box-shadow: 0 0 18px rgba(255, 0, 127, 0.85);
  transform: scale(1.05);
}
.arcade-start-btn:active {
  transform: scale(0.95);
}


.arcade-joystick-panel {
  flex-shrink: 0;
  background: #1c1c2e;
  border: 2px solid #2e2e4a;
  border-radius: 10px;
  height: 74px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 14px;
  position: relative;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
  box-sizing: border-box;
}

.joystick-assembly {
  width: 58px;
  height: 58px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.joystick-base {
  width: 44px;
  height: 44px;
  background: #111;
  border: 3px solid #333;
  border-radius: 50%;
  position: relative;
}

.joystick-shaft {
  position: absolute;
  top: 50%; left: 50%;
  width: 7px; height: 30px;
  background: linear-gradient(90deg, #aaa, #ddd, #555);
  border-radius: 4px;
  transform: translate(-50%, -85%);
  transform-origin: bottom center;
  transition: transform 0.1s ease;
}

.joystick-knob {
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  background: radial-gradient(circle at 7px 7px, #ff3b30, #990000);
  border-radius: 50%;
  transform: translate(-50%, -150%);
  box-shadow: 0 3px 6px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 0.1s ease;
}

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

.arc-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid #111;
  cursor: pointer;
  position: relative;
  box-shadow: 0 3px 0 #111, 0 4px 8px rgba(0,0,0,0.4);
  transition: all 0.05s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arc-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #111, 0 2px 4px rgba(0,0,0,0.3);
}

.btn-green {
  background: radial-gradient(circle at 10px 10px, #34c759, #248a3d);
}
.btn-red {
  background: radial-gradient(circle at 10px 10px, #ff3b30, #c30000);
}
.btn-blue {
  background: radial-gradient(circle at 10px 10px, #007aff, #004ecc);
}

.arc-btn .btn-cap {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 1px;
}



.terminal-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  animation: fadeIn 0.4s ease;
}

.terminal-monitor {
  background: #2a2a22;
  border: 8px solid #3c3c32;
  border-radius: 20px;
  padding: 10px;
  width: 100%;
  max-width: min(560px, calc((100vh - 230px) * 0.95), 100%);
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 
    0 20px 40px rgba(0,0,0,0.6),
    inset 0 4px 10px rgba(255,255,255,0.05);
  position: relative;
  box-sizing: border-box;
}

.crt-bezel {
  background: #181812;
  border: 4px solid #0c0c08;
  border-radius: 14px;
  padding: 6px;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.9);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.crt-screen {
  position: relative;
  background: #020b02;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 255, 0, 0.15);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#terminal-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #010601;
}

.crt-scanlines {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 6;
}

.crt-flicker {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(18, 16, 16, 0.1);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  animation: crtFlickerAnim 0.15s infinite;
}

.terminal-hud {
  position: absolute;
  top: 8px; left: 12px; right: 12px;
  display: flex;
  justify-content: space-between;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: #33ff33;
  opacity: 0.8;
  z-index: 4;
}

.terminal-wrapper .screen-overlay {
  background-color: rgba(2, 10, 2, 0.9);
}

.terminal-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px;
  font-family: 'Share Tech Mono', monospace;
  gap: 12px;
  max-width: 320px;
}

.terminal-prompt {
  color: #33ff33;
  font-size: 14px;
  text-align: left;
}

.terminal-cursor {
  width: 10px;
  height: 16px;
  background: #33ff33;
  animation: terminalBlink 1s infinite steps(2);
}

.terminal-btn {
  margin-top: 15px;
  background: transparent;
  border: 1px solid #33ff33;
  color: #33ff33;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.terminal-btn:hover {
  background: rgba(51, 255, 51, 0.15);
  box-shadow: 0 0 10px rgba(51, 255, 51, 0.3);
}


.mobile-dpad-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 14px auto 0;
  width: 100%;
  max-width: 300px;
  z-index: 20;
}


#skin-wrapper-nokia.active ~ .mobile-dpad-overlay,
.nokia-wrapper.active ~ .mobile-dpad-overlay {
  display: none !important;
}


@media (max-width: 1024px) {
  #skin-wrapper-arcade.active ~ .mobile-dpad-overlay,
  #skin-wrapper-terminal.active ~ .mobile-dpad-overlay,
  .arcade-wrapper.active ~ .mobile-dpad-overlay,
  .terminal-wrapper.active ~ .mobile-dpad-overlay {
    display: none !important;
  }
}

.dpad-row {
  display: flex;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.dpad-btn {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  color: var(--text-primary);
  height: 56px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, background 0.08s ease;
}

.dpad-btn:active,
.dpad-btn.touch-active {
  background: var(--panel-hover-bg);
  transform: scale(0.92);
  border-color: var(--primary-accent);
}

.dpad-left, .dpad-right {
  flex: 1;
}

.dpad-pause {
  width: 56px;
  font-size: 16px;
  border-color: var(--secondary-accent);
  color: var(--secondary-accent);
}

.dpad-jump {
  width: 100%;
  height: 60px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.25) 0%, rgba(255, 107, 107, 0.1) 100%);
  border-color: var(--primary-accent);
  color: var(--primary-accent);
  text-shadow: 0 0 6px rgba(255, 107, 107, 0.4);
  font-size: 18px;
  letter-spacing: 1px;
}






.game-stats-hud {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.hud-stat-box {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hud-stat-box:nth-child(5) {
  grid-column: span 2;
}

.hud-stat-label {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.hud-stat-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.keyboard-legend {
  background: rgba(var(--panel-bg), 0.1);
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.legend-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.legend-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 6px;
  font-size: 10.5px;
  padding: 0;
  margin: 0;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  white-space: nowrap;
}

kbd {
  background-color: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: var(--text-primary);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  box-shadow: 0 1px 0 var(--panel-border);
}


.mechanics-legend-card {
  background: rgba(18, 20, 29, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.mechanics-badges-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.mechanic-badge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 4px 6px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}

.mechanic-badge-item:hover {
  transform: translateY(-1px);
}

.mechanic-badge-item.badge-jump {
  border-color: rgba(57, 255, 20, 0.3);
}
.mechanic-badge-item.badge-jump:hover {
  border-color: #39ff14;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.25);
}

.mechanic-badge-item.badge-kill {
  border-color: rgba(255, 0, 127, 0.3);
}
.mechanic-badge-item.badge-kill:hover {
  border-color: #ff007f;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.25);
}

.mechanic-badge-item.badge-large {
  border-color: rgba(255, 149, 0, 0.3);
}
.mechanic-badge-item.badge-large:hover {
  border-color: #ff9500;
  box-shadow: 0 0 10px rgba(255, 149, 0, 0.25);
}

.mechanic-badge-item.badge-small {
  border-color: rgba(0, 240, 255, 0.3);
}
.mechanic-badge-item.badge-small:hover {
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.mechanic-icon-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  flex-shrink: 0;
}

.jump-icon-box {
  background: rgba(57, 255, 20, 0.12);
  color: #39ff14;
  border: 1px solid rgba(57, 255, 20, 0.4);
  box-shadow: inset 0 0 6px rgba(57, 255, 20, 0.2);
}

.kill-icon-box {
  background: rgba(255, 0, 127, 0.12);
  color: #ff007f;
  border: 1px solid rgba(255, 0, 127, 0.4);
  box-shadow: inset 0 0 6px rgba(255, 0, 127, 0.2);
}

.large-icon-box {
  background: rgba(255, 149, 0, 0.12);
  color: #ff9500;
  border: 1px solid rgba(255, 149, 0, 0.4);
  box-shadow: inset 0 0 6px rgba(255, 149, 0, 0.2);
}

.small-icon-box {
  background: rgba(0, 240, 255, 0.12);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: inset 0 0 6px rgba(0, 240, 255, 0.2);
}

.mechanic-icon-box svg {
  width: 14px;
  height: 14px;
}

.mechanic-tag {
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-top: 0px;
}

.ball-orb-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 900;
  font-family: var(--font-mono);
}

.ball-orb-large {
  width: 15px;
  height: 15px;
  background: radial-gradient(circle at 35% 35%, #ffa633, #e65c00);
  border: 1px solid #ffd280;
  box-shadow: 0 0 8px rgba(255, 149, 0, 0.6);
  font-size: 10px;
  color: #fff;
  line-height: 1;
}

.ball-orb-small {
  width: 11px;
  height: 11px;
  background: radial-gradient(circle at 35% 35%, #5ce1e6, #0099b8);
  border: 1px solid #a6f5f8;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
  font-size: 8px;
  color: #fff;
  line-height: 1;
}

.mechanic-text-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mechanic-name {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
}

.mechanic-desc {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.guide-mechanics-visual-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0 24px 0;
}

.guide-mechanic-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.guide-mechanic-card p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.guide-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}



@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes blink {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes neonGlow {
  from {
    text-shadow: 
      0 0 2px #fff,
      0 0 6px #00f0ff,
      0 0 12px #00f0ff,
      0 0 20px #ff007f;
  }
  to {
    text-shadow: 
      0 0 4px #fff,
      0 0 10px #00f0ff,
      0 0 20px #00f0ff,
      0 0 35px #ff007f;
  }
}

@keyframes arcadePulse {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

@keyframes crtFlickerAnim {
  0% { opacity: 0.15; }
  50% { opacity: 0.12; }
  100% { opacity: 0.15; }
}

@keyframes terminalBlink {
  from { opacity: 1; }
  to { opacity: 0; }
}


@media (min-width: 1441px) {
  .game-viewport {
    max-width: 1440px;
    grid-template-columns: 300px 1fr 300px;
  }
}

@media (max-width: 1440px) and (min-width: 1025px) {
  .game-viewport {
    max-width: 1280px;
    grid-template-columns: 260px 1fr 260px;
  }
}

@media (max-width: 1024px) {
  .mobile-settings-toggle {
    display: flex;
  }
  .game-body {
    overflow-x: hidden;
    min-height: 100vh;
  }
  .game-header {
    padding: 8px 12px !important;
    height: auto !important;
    min-height: 52px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .hud-center {
    gap: 8px !important;
    flex-wrap: wrap !important;
  }
  .hud-mode-pill {
    max-width: 160px;
    padding: 6px 10px;
    font-size: 12px;
  }
  .hud-stats-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .hud-stat-pill {
    padding: 4px 8px;
    font-size: 11px;
  }
  .hud-right {
    gap: 6px !important;
    margin-left: auto;
  }
  .game-viewport {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    min-height: 0;
    overflow: visible;
    position: relative;
    padding: 10px 12px 24px;
    gap: 12px;
    width: 100%;
  }
  .settings-sidebar {
    display: none;
  }
  .settings-sidebar.mobile-open {
    display: flex !important;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 32, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 99;
    padding: 24px;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
  }
  .gameplay-sidebar {
    display: none;
  }
  .game-arena-container {
    min-height: auto;
    padding: 8px 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
  }
  .arcade-cabinet, .terminal-monitor {
    width: min(420px, 94vw);
    max-width: 100%;
    height: auto;
    max-height: none;
    border-radius: 16px;
    padding: 10px;
    gap: 8px;
  }
  .arcade-marquee {
    padding: 6px 8px;
  }
  .neon-text {
    font-size: 20px;
  }
  .arcade-screen-container {
    padding: 0;
    border-radius: 8px;
  }
  #arcade-canvas, #terminal-canvas {
    width: 100%;
    max-width: 380px;
    height: auto;
    aspect-ratio: 1 / 1;
  }
  .arcade-joystick-panel {
    display: none;
  }
  .arcade-title {
    font-size: 28px;
  }
  .mobile-dpad-overlay {
    display: none !important;
  }
}


.hud-stats-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
}

.hud-stat-pill .pill-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.hud-stat-pill strong {
  font-family: var(--font-mono, monospace);
  color: #fff;
  font-size: 12px;
}


.bounce-shell:fullscreen,
.bounce-shell.pseudo-fullscreen,
.bounce-shell.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #040711 !important;
  z-index: 999999 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}


.bounce-shell:fullscreen .game-header,
.bounce-shell.pseudo-fullscreen .game-header,
.bounce-shell.is-fullscreen .game-header {
  position: absolute !important;
  top: 14px !important;
  left: 18px !important;
  right: 18px !important;
  width: auto !important;
  background: rgba(7, 12, 24, 0.78) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  padding: 8px 16px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
  z-index: 50 !important;
  margin: 0 !important;
}


.bounce-shell:fullscreen .instructions-bar,
.bounce-shell.pseudo-fullscreen .instructions-bar,
.bounce-shell.is-fullscreen .instructions-bar,
.bounce-shell:fullscreen .settings-sidebar:not(.mobile-open),
.bounce-shell.pseudo-fullscreen .settings-sidebar:not(.mobile-open),
.bounce-shell.is-fullscreen .settings-sidebar:not(.mobile-open),
.bounce-shell:fullscreen .gameplay-sidebar,
.bounce-shell.pseudo-fullscreen .gameplay-sidebar,
.bounce-shell.is-fullscreen .gameplay-sidebar,
.bounce-shell:fullscreen .arcade-marquee,
.bounce-shell.pseudo-fullscreen .arcade-marquee,
.bounce-shell.is-fullscreen .arcade-marquee,
.bounce-shell:fullscreen .arcade-joystick-panel,
.bounce-shell.pseudo-fullscreen .arcade-joystick-panel,
.bounce-shell.is-fullscreen .arcade-joystick-panel,
.bounce-shell:fullscreen .decal,
.bounce-shell.pseudo-fullscreen .decal,
.bounce-shell.is-fullscreen .decal,
.bounce-shell:fullscreen #mobile-dpad,
.bounce-shell.pseudo-fullscreen #mobile-dpad,
.bounce-shell.is-fullscreen #mobile-dpad {
  display: none !important;
}


.bounce-shell:fullscreen .game-viewport,
.bounce-shell.pseudo-fullscreen .game-viewport,
.bounce-shell.is-fullscreen .game-viewport {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  overflow: hidden !important;
}

.bounce-shell:fullscreen .game-arena-container,
.bounce-shell.pseudo-fullscreen .game-arena-container,
.bounce-shell.is-fullscreen .game-arena-container {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  overflow: hidden !important;
}


.bounce-shell:fullscreen .arcade-wrapper.active,
.bounce-shell.pseudo-fullscreen .arcade-wrapper.active,
.bounce-shell.is-fullscreen .arcade-wrapper.active,
.bounce-shell:fullscreen .terminal-wrapper.active,
.bounce-shell.pseudo-fullscreen .terminal-wrapper.active,
.bounce-shell.is-fullscreen .terminal-wrapper.active,
.bounce-shell:fullscreen .arcade-cabinet,
.bounce-shell.pseudo-fullscreen .arcade-cabinet,
.bounce-shell.is-fullscreen .arcade-cabinet,
.bounce-shell:fullscreen .terminal-monitor,
.bounce-shell.pseudo-fullscreen .terminal-monitor,
.bounce-shell.is-fullscreen .terminal-monitor,
.bounce-shell:fullscreen .crt-bezel,
.bounce-shell.pseudo-fullscreen .crt-bezel,
.bounce-shell.is-fullscreen .crt-bezel {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: block !important;
}

.bounce-shell:fullscreen .arcade-wrapper.hidden,
.bounce-shell.pseudo-fullscreen .arcade-wrapper.hidden,
.bounce-shell.is-fullscreen .arcade-wrapper.hidden,
.bounce-shell:fullscreen .terminal-wrapper.hidden,
.bounce-shell.pseudo-fullscreen .terminal-wrapper.hidden,
.bounce-shell.is-fullscreen .terminal-wrapper.hidden {
  display: none !important;
}


.bounce-shell:fullscreen .arcade-screen-container,
.bounce-shell.pseudo-fullscreen .arcade-screen-container,
.bounce-shell.is-fullscreen .arcade-screen-container,
.bounce-shell:fullscreen .crt-screen,
.bounce-shell.pseudo-fullscreen .crt-screen,
.bounce-shell.is-fullscreen .crt-screen {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  display: block !important;
}


.bounce-shell:fullscreen #arcade-canvas,
.bounce-shell.pseudo-fullscreen #arcade-canvas,
.bounce-shell.is-fullscreen #arcade-canvas,
.bounce-shell:fullscreen #terminal-canvas,
.bounce-shell.pseudo-fullscreen #terminal-canvas,
.bounce-shell.is-fullscreen #terminal-canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  display: block !important;
  object-fit: fill !important;
  touch-action: none !important;
  outline: none !important;
}


.bounce-shell:fullscreen .screen-overlay,
.bounce-shell.pseudo-fullscreen .screen-overlay,
.bounce-shell.is-fullscreen .screen-overlay {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 25 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.bounce-shell:fullscreen .screen-overlay.hidden,
.bounce-shell.pseudo-fullscreen .screen-overlay.hidden,
.bounce-shell.is-fullscreen .screen-overlay.hidden {
  display: none !important;
}


.touch-controls {
  display: none;
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 24px;
  z-index: 60;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.touch-controls .steer-buttons {
  display: flex;
  gap: 12px;
}
.touch-controls button {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  width: 60px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(14, 24, 44, 0.72);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: background 0.1s, transform 0.1s;
}
.touch-controls button:active,
.touch-controls button.held {
  background: rgba(0, 240, 255, 0.4);
  transform: scale(0.94);
}
.touch-controls .jump-button {
  width: 96px;
  color: #00f0ff;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 800;
}
@media (pointer: coarse), (max-width: 900px) {
  .touch-controls {
    display: none !important;
  }
}
.bounce-shell.has-touch .touch-controls,
.bounce-shell:fullscreen.has-touch .touch-controls,
.bounce-shell.pseudo-fullscreen.has-touch .touch-controls,
.bounce-shell.is-fullscreen.has-touch .touch-controls {
  display: none !important;
}
@media (max-width: 600px) {
  .bounce-shell:fullscreen .game-header,
  .bounce-shell.pseudo-fullscreen .game-header,
  .bounce-shell.is-fullscreen .game-header {
    top: 8px !important;
    left: 10px !important;
    right: 10px !important;
    padding: 6px 10px !important;
  }
  .touch-controls {
    left: 14px;
    right: 14px;
    bottom: 18px;
  }
}

