

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

.blocks-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;
  height: min(650px, calc(100vh - 200px));
  min-height: 520px;
  width: 100%;
  margin: 0 auto;
  gap: 20px;
  padding: 0 20px;
}

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

@media (max-width: 1024px) {
  .mobile-settings-toggle {
    display: flex;
  }
  .game-body {
    overflow-x: hidden;
    height: 100vh;
    height: 100dvh;
  }
  .game-viewport {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: calc(100dvh - 56px);
    height: calc(100vh - 56px);
    overflow-y: auto;
    position: relative;
    padding: 6px 12px;
    gap: 8px;
    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 {
    border: none;
    padding: 0;
    background: transparent;
    width: 100%;
    max-width: 440px;
    order: -1;
  }
  .game-stats-hud {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    justify-content: space-between;
  }
  .hud-stat-box {
    padding: 6px 8px;
    flex: 1 1 calc(25% - 6px);
    min-width: 70px;
    text-align: center;
    border-radius: 8px;
    align-items: center;
  }
  .hud-stat-label {
    font-size: 9px;
  }
  .hud-stat-num {
    font-size: 18px;
  }
  .keyboard-legend {
    display: none;
  }
}

.game-arena-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}


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

.panel-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

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

.skin-btn, .mode-btn, .speed-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-smooth);
  text-align: left;
}

.skin-btn:hover, .mode-btn:hover, .speed-btn:hover {
  background: var(--panel-hover-bg);
  border-color: var(--text-muted);
}

.skin-btn.active, .mode-btn.active, .speed-btn.active {
  background: rgba(var(--primary-accent-rgb), 0.15);
  border-color: var(--primary-accent);
  color: var(--primary-accent);
  box-shadow: 0 0 12px rgba(var(--primary-accent-rgb), 0.1);
}

.skin-emoji {
  font-size: 18px;
}

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

.speed-selector {
  flex-direction: row;
}
.speed-btn {
  flex: 1;
  justify-content: center;
  padding: 10px;
}


.game-stats-hud {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hud-stat-box {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  padding: 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

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

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

.mode-spec-indicator {
  border-color: var(--danger-color);
  background: rgba(239, 83, 80, 0.03);
}

.warning-flash {
  animation: flash-red 1s infinite alternate;
}
@keyframes flash-red {
  0% { color: var(--text-primary); }
  100% { color: var(--danger-color); }
}


.keyboard-legend {
  background: rgba(var(--panel-bg), 0.5);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.legend-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.legend-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.legend-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}
kbd {
  background-color: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.2), inset 0 2px 0 0 rgba(255,255,255,0.1);
  color: var(--text-primary);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 6px;
  white-space: nowrap;
}


.nokia-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nokia-phone {
  background: linear-gradient(135deg, hsl(210, 15%, 52%) 0%, hsl(210, 15%, 35%) 100%);
  border: 7px solid hsl(210, 15%, 22%);
  border-radius: 36px / 52px;
  width: min(340px, 94vw);
  max-height: calc(100vh - 100px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  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;
  box-sizing: border-box;
}

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

.nokia-brand {
  font-family: var(--font-sans);
  font-size: 12px;
  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: 16px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
  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: 5px double hsl(76, 55%, 15%);
  width: 100%;
  height: clamp(230px, 34vh, 280px);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

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

.nokia-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 8px;
  border-bottom: 1px solid hsl(76, 55%, 15%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: hsl(76, 55%, 12%);
  font-weight: 900;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.canvas-holder {
  flex: 1;
  min-height: 0;
  position: relative;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}

#nokia-canvas {
  height: 100%;
  max-height: 100%;
  aspect-ratio: 10 / 20;
  width: auto;
  object-fit: contain;
  display: block;
  image-rendering: pixelated;
  border-left: 2px solid hsl(76, 55%, 15%);
  border-right: 2px solid hsl(76, 55%, 15%);
}


.screen-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: hsl(76, 40%, 52%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 6;
}

.overlay-content {
  padding: 10px;
}

.lcd-title {
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: hsl(76, 55%, 10%);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.lcd-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: hsl(76, 55%, 15%);
  line-height: 1.4;
  font-weight: 800;
}


.nokia-keypad {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 6px;
  box-sizing: border-box;
}

.keypad-row-sys {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 6px;
}

.nokia-key {
  background: linear-gradient(180deg, #eceff1 0%, #b0bec5 100%);
  border: 2px solid #37474f;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 
    0 2px 0 #37474f, 
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 3px 5px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.05s, box-shadow 0.05s;
}

.nokia-key:active {
  transform: translateY(2px);
  box-shadow: 
    0 1px 0 #37474f, 
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 2px 3px rgba(0, 0, 0, 0.2);
}

.key-nav, .key-clear {
  width: 58px;
  height: 26px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 800;
  color: #37474f;
  border-radius: 7px;
}

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

.num-key {
  height: 30px;
  border-radius: 8px 8px 10px 10px / 8px;
}

.num-key .num {
  font-size: 13px;
  font-weight: 800;
  color: #263238;
}

.num-key .letters {
  font-size: 7px;
  font-weight: 600;
  color: #546e7a;
  text-transform: uppercase;
  margin-top: -2px;
}

.key-five {
  background: linear-gradient(180deg, #ffb300 0%, #ff8f00 100%);
  border-color: #5d4037;
  box-shadow: 
    0 3px 0 #5d4037, 
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 4px 6px rgba(0, 0, 0, 0.3);
}
.key-five .num, .key-five .letters {
  color: #3e2723;
}



.arcade-wrapper,
.terminal-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.arcade-cabinet {
  background: linear-gradient(180deg, #1e0b36 0%, #0c0214 100%);
  border: 4px solid #3d0c73;
  border-radius: 20px;
  width: 100%;
  max-width: min(480px, calc((100vh - 180px) * 0.58));
  padding: 16px;
  box-shadow: 
    0 0 30px rgba(186, 12, 248, 0.3), 
    inset 0 0 15px rgba(255, 0, 128, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
}

.arcade-marquee {
  background: #05010a;
  border: 3px solid #ff007f;
  border-radius: 8px;
  width: 100%;
  padding: 10px;
  text-align: center;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.5);
}

.neon-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  text-shadow: 
    0 0 4px #fff,
    0 0 8px #ff007f,
    0 0 16px #ff007f;
  letter-spacing: 3px;
}

.arcade-screen-container {
  background: #000;
  border: 4px solid #00ffff;
  border-radius: 12px;
  width: auto;
  height: min(700px, calc(100vh - 240px));
  aspect-ratio: 10 / 20;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 0 20px rgba(0, 255, 255, 0.4), 
    inset 0 0 20px rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

#arcade-canvas {
  height: 100%;
  max-height: 100%;
  aspect-ratio: 10 / 20;
  width: auto;
  margin: 0 auto;
  display: block;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.25);
}

.arcade-wrapper .screen-overlay {
  background: rgba(5, 1, 10, 0.85);
  z-index: 10;
}

.decal {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  opacity: 0.3;
  pointer-events: none;
}
.decal-left {
  left: 0;
  background: linear-gradient(90deg, #ff007f, transparent);
}
.decal-right {
  right: 0;
  background: linear-gradient(-90deg, #00ffff, transparent);
}

.arcade-overlay-panel {
  background: rgba(5, 1, 10, 0.9);
  border: 2px solid #ff007f;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.4);
  max-width: 85%;
  z-index: 10;
}

.arcade-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 24px;
  color: #00ffff;
  margin-bottom: 15px;
}

.death-neon {
  color: #ff0055;
  text-shadow: 0 0 8px #ff0055, 0 0 15px #ff0055;
  animation: flicker 0.15s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.arcade-score-text {
  font-family: var(--font-mono);
  color: #fff;
  font-size: 14px;
  margin-bottom: 15px;
}
.arcade-score-text span {
  font-size: 18px;
  color: #ff007f;
  font-weight: 700;
}

.arcade-start-btn {
  background: linear-gradient(180deg, #ff007f 0%, #c40062 100%);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
  transition: var(--transition-smooth);
}
.arcade-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.8);
}
.arcade-start-btn:active {
  transform: translateY(1px);
}

.arcade-btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}


.arcade-joystick-panel {
  background: #110620;
  border-top: 3px solid #ff007f;
  border-bottom: 4px solid #3d0c73;
  width: 100%;
  padding: 12px;
  border-radius: 4px 4px 10px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.joystick-base {
  width: 44px;
  height: 44px;
  background: #080310;
  border: 3px solid #00ffff;
  border-radius: 50%;
  box-shadow: inset 0 0 6px rgba(0, 255, 255, 0.5);
  position: relative;
}

.joystick-shaft {
  width: 6px;
  height: 24px;
  background: #b0bec5;
  border-radius: 3px;
  position: absolute;
  top: 10px;
  left: 19px;
  transform-origin: bottom center;
  transition: transform 0.1s ease;
}

.joystick-knob {
  width: 16px;
  height: 16px;
  background: radial-gradient(circle at 5px 5px, #ff0055, #88002d);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  position: absolute;
  top: 2px;
  left: 14px;
  transition: transform 0.1s ease;
}

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

.arc-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  outline: none;
}

.btn-red {
  background: radial-gradient(circle at 12px 12px, #ff3d00, #a30000);
  box-shadow: 0 4px 0 #6e0000, 0 6px 10px rgba(0,0,0,0.5);
}
.btn-red:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #6e0000, 0 3px 5px rgba(0,0,0,0.5);
}

.btn-blue {
  background: radial-gradient(circle at 12px 12px, #00b0ff, #0060b0);
  box-shadow: 0 4px 0 #003a6c, 0 6px 10px rgba(0,0,0,0.5);
}
.btn-blue:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #003a6c, 0 3px 5px rgba(0,0,0,0.5);
}

.btn-cap {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  pointer-events: none;
}



.terminal-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.terminal-monitor {
  background: #181b16;
  border: 12px solid #2e352c;
  border-radius: 24px;
  width: 360px;
  padding: 10px;
  box-shadow: 
    0 15px 30px rgba(0, 0, 0, 0.6),
    inset 0 4px 8px rgba(255, 255, 255, 0.05);
}

.crt-bezel {
  background: #0f110d;
  border: 4px solid #080a07;
  border-radius: 12px;
  padding: 8px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.9);
}

.crt-screen {
  background: #020701;
  border-radius: 8px;
  width: 100%;
  height: clamp(380px, 56vh, 460px);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 255, 0, 0.15);
  display: flex;
  flex-direction: column;
}


.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%
  ), linear-gradient(
    90deg, 
    rgba(255, 0, 0, 0.06), 
    rgba(0, 255, 0, 0.02), 
    rgba(0, 0, 255, 0.06)
  );
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 8;
  opacity: 0.65;
}

.crt-screen::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 9;
}

.crt-flicker {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 255, 0, 0.02);
  pointer-events: none;
  z-index: 7;
  animation: crt-flickering 0.15s infinite;
}
@keyframes crt-flickering {
  0% { opacity: 0.8; }
  50% { opacity: 0.9; }
  100% { opacity: 0.8; }
}

.terminal-hud {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #33ff33;
  text-shadow: 0 0 4px #33ff33;
  border-bottom: 1px solid rgba(51, 255, 51, 0.2);
  z-index: 2;
  flex-shrink: 0;
}

.crt-canvas-holder {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

#terminal-canvas {
  height: 100%;
  max-height: 100%;
  aspect-ratio: 10 / 20;
  width: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 0 0 1px rgba(51, 255, 51, 0.35);
}

.terminal-wrapper .screen-overlay {
  background-color: rgba(2, 7, 1, 0.96);
  z-index: 10;
  backdrop-filter: blur(4px);
}

.terminal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.terminal-prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #33ff33;
  text-shadow: 0 0 4px #33ff33;
  line-height: 1.6;
  margin-bottom: 8px;
}

.terminal-cursor {
  width: 8px;
  height: 14px;
  background-color: #33ff33;
  box-shadow: 0 0 4px #33ff33;
  animation: blink-cursor 0.8s infinite;
  margin-left: 2px;
  display: inline-block;
  vertical-align: middle;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.terminal-btn {
  background: transparent;
  border: 1px solid #33ff33;
  border-radius: 4px;
  color: #33ff33;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: bold;
  padding: 6px 12px;
  margin-top: 15px;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(51, 255, 51, 0.2);
  text-transform: uppercase;
  transition: var(--transition-smooth);
}
.terminal-btn:hover {
  background: #33ff33;
  color: #000;
  box-shadow: 0 0 10px rgba(51, 255, 51, 0.6);
}




.mobile-dpad-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 12px auto 0;
  width: 100%;
  max-width: 280px;
  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;
  align-items: center;
  justify-content: center;
}

.dpad-row-bottom {
  margin-top: 2px;
}

.dpad-btn {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  color: var(--text-primary);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s, background-color 0.08s;
}

.dpad-btn:active,
.dpad-btn.touch-active {
  background-color: var(--primary-accent);
  color: #000;
  transform: scale(0.92);
}

.dpad-pause {
  font-size: 14px;
  font-weight: bold;
  border-color: var(--secondary-accent);
  color: var(--secondary-accent);
}

.dpad-harddrop {
  width: auto;
  min-width: 100px;
  height: 52px;
  border-radius: 26px;
  padding: 0 16px;
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--primary-accent);
  color: var(--primary-accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}



@media (max-width: 1024px) {
  .nokia-phone {
    width: min(340px, 94vw);
    max-width: 100%;
    padding: 10px 10px;
    gap: 6px;
    border-width: 5px;
    border-radius: 28px;
  }
  .nokia-screen-bezel {
    padding: 6px;
    border-width: 3px;
  }
  .nokia-screen-lcd {
    height: clamp(210px, 32vh, 250px);
  }
  .canvas-holder {
    width: 100%;
    flex: 1;
    min-height: 0;
  }
  #nokia-canvas, #arcade-canvas, #terminal-canvas {
    height: 100%;
    max-height: 100%;
    aspect-ratio: 10 / 20;
    width: auto;
    object-fit: contain;
  }
  .keypad-grid-nums {
    gap: 5px 8px;
  }
  .num-key {
    height: 28px;
    padding: 2px 0;
  }



@media (min-width: 1441px) {
  .game-viewport {
    grid-template-columns: 320px 1fr 320px;
    max-width: 1840px;
    gap: 24px;
  }
  .arcade-cabinet, .terminal-monitor {
    max-width: min(500px, calc((100vh - 170px) * 0.58));
  }
  .arcade-screen-container, .crt-screen {
    height: min(720px, calc(100vh - 220px));
  }
  .hud-stat-num {
    font-size: 32px;
  }
}


@media (min-width: 1025px) and (max-width: 1440px) {
  .game-viewport {
    grid-template-columns: 280px 1fr 280px;
    max-width: 1400px;
    gap: 16px;
  }
  .arcade-cabinet, .terminal-monitor {
    max-width: min(440px, calc((100vh - 180px) * 0.58));
  }
  .arcade-screen-container, .crt-screen {
    height: min(600px, calc(100vh - 230px));
  }
}


@media (min-width: 769px) and (max-width: 1024px) {
  .game-viewport {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 12px 20px;
  }
  .settings-sidebar {
    display: none;
  }
  .mobile-settings-toggle {
    display: flex;
  }
  .gameplay-sidebar {
    order: -1;
    width: 100%;
    max-width: 500px;
    border: none;
    padding: 0;
    margin-bottom: 12px;
  }
  .game-stats-hud {
    flex-direction: row;
    width: 100%;
  }
  .hud-stat-box {
    flex: 1;
    text-align: center;
  }
  .arcade-cabinet, .terminal-monitor {
    width: 100%;
    max-width: 420px;
  }
  .arcade-screen-container, .crt-screen {
    height: 520px;
  }
}


@media (max-width: 768px) {
  .mobile-settings-toggle {
    display: flex;
  }
  .game-body {
    overflow-x: hidden;
    height: 100vh;
    height: 100dvh;
  }
  .game-viewport {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: calc(100dvh - 56px);
    height: calc(100vh - 56px);
    overflow-y: auto;
    position: relative;
    padding: 6px 12px;
    gap: 8px;
    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;
  }
  .gameplay-sidebar {
    border: none;
    padding: 0;
    background: transparent;
    width: 100%;
    max-width: 400px;
    order: -1;
  }
  .game-stats-hud {
    flex-direction: row;
    gap: 8px;
    width: 100%;
  }
  .hud-stat-box {
    padding: 6px 10px;
    flex: 1;
    text-align: center;
    border-radius: 8px;
  }
  .hud-stat-num {
    font-size: 20px;
  }
  .keyboard-legend {
    display: none;
  }
  .arcade-cabinet, .terminal-monitor {
    width: min(360px, 94vw);
    max-width: 100%;
    border-radius: 16px;
    padding: 10px;
  }
  .arcade-marquee {
    padding: 6px 0;
  }
  .neon-text {
    font-size: 16px;
  }
  .arcade-screen-container, .crt-screen {
    height: clamp(300px, 46vh, 400px);
  }
  .arcade-joystick-panel {
    padding: 8px;
    height: 68px;
  }
}


.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;
}


.blocks-shell:fullscreen,
.blocks-shell.pseudo-fullscreen,
.blocks-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: #060913 !important;
  z-index: 999999 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.blocks-shell:fullscreen .game-header,
.blocks-shell.pseudo-fullscreen .game-header,
.blocks-shell.is-fullscreen .game-header {
  flex-shrink: 0 !important;
  border-radius: 0 !important;
  z-index: 20 !important;
}

.blocks-shell:fullscreen .instructions-bar,
.blocks-shell.pseudo-fullscreen .instructions-bar,
.blocks-shell.is-fullscreen .instructions-bar {
  flex-shrink: 0 !important;
  border-radius: 0 !important;
  z-index: 20 !important;
}


.blocks-shell:fullscreen .settings-sidebar:not(.mobile-open),
.blocks-shell.pseudo-fullscreen .settings-sidebar:not(.mobile-open),
.blocks-shell.is-fullscreen .settings-sidebar:not(.mobile-open),
.blocks-shell:fullscreen .gameplay-sidebar,
.blocks-shell.pseudo-fullscreen .gameplay-sidebar,
.blocks-shell.is-fullscreen .gameplay-sidebar,
.blocks-shell:fullscreen .arcade-marquee,
.blocks-shell.pseudo-fullscreen .arcade-marquee,
.blocks-shell.is-fullscreen .arcade-marquee,
.blocks-shell:fullscreen .arcade-joystick-panel,
.blocks-shell.pseudo-fullscreen .arcade-joystick-panel,
.blocks-shell.is-fullscreen .arcade-joystick-panel {
  display: none !important;
}


.blocks-shell:fullscreen .game-viewport,
.blocks-shell.pseudo-fullscreen .game-viewport,
.blocks-shell.is-fullscreen .game-viewport {
  flex: 1 1 0% !important;
  height: 100% !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  grid-template-columns: none !important;
}

.blocks-shell:fullscreen .game-arena-container,
.blocks-shell.pseudo-fullscreen .game-arena-container,
.blocks-shell.is-fullscreen .game-arena-container {
  flex: 1 1 0% !important;
  height: 100% !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.blocks-shell:fullscreen .arcade-cabinet,
.blocks-shell.pseudo-fullscreen .arcade-cabinet,
.blocks-shell.is-fullscreen .arcade-cabinet,
.blocks-shell:fullscreen .terminal-monitor,
.blocks-shell.pseudo-fullscreen .terminal-monitor,
.blocks-shell.is-fullscreen .terminal-monitor {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: auto !important;
  width: auto !important;
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.blocks-shell:fullscreen .arcade-screen-container,
.blocks-shell.pseudo-fullscreen .arcade-screen-container,
.blocks-shell.is-fullscreen .arcade-screen-container,
.blocks-shell:fullscreen .crt-screen,
.blocks-shell.pseudo-fullscreen .crt-screen,
.blocks-shell.is-fullscreen .crt-screen {
  width: min(calc((100dvh - 130px) * 0.65), calc(100vw - 32px)) !important;
  height: min(calc(100dvh - 130px), calc((100vw - 32px) / 0.65)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100dvh - 130px) !important;
  margin: auto !important;
  border-radius: 16px !important;
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.25) !important;
}

.blocks-shell:fullscreen canvas,
.blocks-shell.pseudo-fullscreen canvas,
.blocks-shell.is-fullscreen canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain !important;
}


