/**
 * Arcade Shell - CRT Cabinet Visual System
 * Unified retro arcade aesthetics for all games
 */

/* ============================================
   CSS CUSTOM PROPERTIES (CRT THEMING)
   ============================================ */
:root {
  /* Fixed CRT screen dimensions (4:3 aspect ratio) */
  --crt-width: 800px;
  --crt-height: 600px;

  --crt-curve: 8px;
  --crt-glow-color: var(--border-accent, #326b78);
  --crt-glow-intensity: 0.6;
  --crt-scanline-opacity: 0.08;
  --crt-vignette-intensity: 0.4;
  --crt-phosphor-blur: 1px;
  --crt-flicker-intensity: 0.02;
  --bezel-color: #1a1a1a;
  --bezel-highlight: #333;
  --bezel-shadow: #0a0a0a;
}

/* ============================================
   ARCADE CABINET STRUCTURE
   ============================================ */
.arcade-cabinet {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - 92px);
  padding: 20px;
  box-sizing: border-box;
}

/* ============================================
   GAME-SPECIFIC CRT DIMENSIONS (+20% buffer)
   Real arcade cabinets have fixed CRT sizes.
   Each game gets its own optimal dimensions.
   ============================================ */

/* Snake: 900×900 canvas + header/footer + 20% buffer */
.arcade-cabinet.crt-snake {
  --crt-width: 1104px;
  --crt-height: 1200px;
}

/* Pong: 900×600 canvas + UI + 20% buffer */
.arcade-cabinet.crt-pong {
  --crt-width: 1104px;
  --crt-height: 840px;
}

/* Breakout: 800×600 canvas + UI + 20% buffer */
.arcade-cabinet.crt-breakout {
  --crt-width: 984px;
  --crt-height: 840px;
}

/* Tetris: 280px canvas + 2×110px side panels + padding + 20% buffer (portrait) */
.arcade-cabinet.crt-tetris {
  --crt-width: 672px;
  --crt-height: 768px;
}

/* Pokemon Arena: Complex flex UI + 20% buffer */
.arcade-cabinet.arena-cabinet {
  --crt-width: 1080px;
  --crt-height: 900px;
}

/* Vault Escape: Text adventure terminal (4:3 aspect ratio) */
.arcade-cabinet.crt-adventure {
  --crt-width: 1200px;
  --crt-height: 900px;
}

/* Number Guess: Oracle UI with difficulty buttons + 5-entry leaderboard */
.arcade-cabinet.crt-oracle {
  --crt-width: 720px;
  --crt-height: 1020px;
}

/* Puzzle Games */
.arcade-cabinet.crt-hangman {
  --crt-width: 720px;
  --crt-height: 900px;
}

/* Primarch Guess: Clue panel + input + checklist */
.arcade-cabinet.crt-primarch {
  --crt-width: 780px;
  --crt-height: 1050px;
}

.arcade-cabinet.crt-simon {
  --crt-width: 600px;
  --crt-height: 750px;
}

.arcade-cabinet.crt-memory {
  --crt-width: 720px;
  --crt-height: 840px;
}

.arcade-cabinet.crt-minesweeper {
  --crt-width: 960px;
  --crt-height: 720px;
}

.arcade-cabinet.crt-2048 {
  --crt-width: 600px;
  --crt-height: 780px;
}

/* Challenge Games */
.arcade-cabinet.crt-reaction {
  --crt-width: 720px;
  --crt-height: 660px;
}

.arcade-cabinet.crt-typing {
  --crt-width: 960px;
  --crt-height: 720px;
}

.arcade-cabinet.crt-breach {
  --crt-width: 1080px;
  --crt-height: 810px;
}

.arcade-bezel {
  position: relative;
  background: linear-gradient(
    145deg,
    var(--bezel-highlight) 0%,
    var(--bezel-color) 50%,
    var(--bezel-shadow) 100%
  );
  padding: 12px;
  border-radius: calc(var(--crt-curve) + 8px);
  box-shadow:
    0 0 0 2px var(--bezel-shadow),
    0 4px 20px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.arcade-bezel::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 30%,
    rgba(255, 255, 255, 0.15) 70%,
    transparent 100%
  );
  border-radius: 50%;
}

/* ============================================
   CRT SCREEN CONTAINER
   ============================================ */
.arcade-screen {
  position: relative;
  background-color: #000;
  border-radius: var(--crt-curve);
  overflow: hidden;

  /* FIXED CRT dimensions - like a real arcade monitor */
  width: var(--crt-width);
  height: var(--crt-height);
  min-width: var(--crt-width);
  min-height: var(--crt-height);
  max-width: var(--crt-width);
  max-height: var(--crt-height);

  /* CRT curvature illusion */
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.8),
    inset 0 0 20px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(var(--crt-glow-color), var(--crt-glow-intensity));
}

/* Scanlines overlay */
.arcade-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 1px,
    rgba(0, 0, 0, var(--crt-scanline-opacity)) 1px,
    rgba(0, 0, 0, var(--crt-scanline-opacity)) 2px
  );
  pointer-events: none;
  z-index: 100;
  animation: scanlineScroll 10s linear infinite;
}

/* Vignette overlay */
.arcade-screen::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, var(--crt-vignette-intensity)) 100%
  );
  pointer-events: none;
  z-index: 101;
}

/* Optional: CRT flicker effect (subtle) */
.arcade-screen.crt-flicker {
  animation: crtFlicker 0.15s infinite;
}

/* ============================================
   PHOSPHOR TEXT GLOW
   ============================================ */
.arcade-text,
.arcade-score,
.arcade-screen h1,
.arcade-screen h2,
.arcade-screen h3,
.arcade-screen .score-value,
.arcade-screen .menu-btn {
  text-shadow:
    0 0 var(--crt-phosphor-blur) var(--crt-glow-color),
    0 0 calc(var(--crt-phosphor-blur) * 2) var(--crt-glow-color),
    0 0 calc(var(--crt-phosphor-blur) * 4) rgba(var(--crt-glow-color), 0.5);
}

/* Stronger glow for important elements */
.arcade-text-bright,
.arcade-screen .game-title,
.arcade-screen .final-score {
  text-shadow:
    0 0 2px var(--crt-glow-color),
    0 0 4px var(--crt-glow-color),
    0 0 8px var(--crt-glow-color),
    0 0 16px rgba(var(--crt-glow-color), 0.6);
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Subtle scanline scroll */
@keyframes scanlineScroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

/* CRT flicker effect */
@keyframes crtFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: calc(1 - var(--crt-flicker-intensity)); }
}

/* Boot sequence: TV static */
@keyframes bootStatic {
  0%, 100% { background-position: 0 0; }
  10% { background-position: -5% -10%; }
  20% { background-position: -15% 5%; }
  30% { background-position: 7% -25%; }
  40% { background-position: 20% 25%; }
  50% { background-position: -25% 10%; }
  60% { background-position: 15% -5%; }
  70% { background-position: 0 15%; }
  80% { background-position: -10% -15%; }
  90% { background-position: 5% 5%; }
}

/* Boot power-on line */
@keyframes bootLine {
  0% {
    height: 2px;
    opacity: 1;
  }
  50% {
    height: 2px;
    opacity: 1;
  }
  100% {
    height: 100%;
    opacity: 0;
  }
}

/* Screen wipe */
@keyframes screenWipeDown {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@keyframes screenWipeUp {
  0% { transform: translateY(100%); }
  100% { transform: translateY(-100%); }
}

@keyframes screenWipeLeft {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

@keyframes screenWipeRight {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Screen flash */
@keyframes screenFlash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

/* Score tick animation */
@keyframes scoreTick {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Glow pulse */
@keyframes glowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 5px var(--crt-glow-color));
  }
  50% {
    filter: drop-shadow(0 0 15px var(--crt-glow-color))
            drop-shadow(0 0 30px var(--crt-glow-color));
  }
}

/* Insert coin blink */
@keyframes insertCoinBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Countdown pulse */
@keyframes countdownPulse {
  0% {
    transform: scale(2);
    opacity: 0;
  }
  30% {
    transform: scale(1);
    opacity: 1;
  }
  70% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.5);
    opacity: 0;
  }
}

/* Glitch effect */
@keyframes glitchHard {
  0% {
    transform: translate(0);
    filter: none;
  }
  10% {
    transform: translate(-5px, 2px);
    filter: hue-rotate(90deg);
  }
  20% {
    transform: translate(3px, -3px);
    filter: hue-rotate(180deg);
  }
  30% {
    transform: translate(-3px, 1px);
    filter: saturate(2);
  }
  40% {
    transform: translate(2px, -2px);
    filter: hue-rotate(270deg);
  }
  50% {
    transform: translate(-2px, 3px);
    filter: invert(1);
  }
  60% {
    transform: translate(4px, -1px);
    filter: hue-rotate(45deg);
  }
  70% {
    transform: translate(-4px, 2px);
    filter: saturate(0.5);
  }
  80% {
    transform: translate(1px, -3px);
    filter: hue-rotate(135deg);
  }
  90% {
    transform: translate(-1px, 1px);
    filter: none;
  }
  100% {
    transform: translate(0);
    filter: none;
  }
}

/* Typewriter cursor */
@keyframes typewriterCursor {
  0%, 100% { border-right-color: var(--crt-glow-color); }
  50% { border-right-color: transparent; }
}

/* Card materialize */
@keyframes cardMaterialize {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    filter: blur(10px);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.05) translateY(-5px);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

/* Firework burst */
@keyframes fireworkBurst {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* ============================================
   TRANSITION OVERLAY ELEMENTS
   ============================================ */

/* Static noise overlay */
.arcade-static {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  mix-blend-mode: overlay;
}

.arcade-static.active {
  opacity: 0.4;
  animation: bootStatic 0.1s steps(10) infinite;
}

/* Boot line (CRT power on) */
.arcade-boot-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--crt-glow-color) 20%,
    #fff 50%,
    var(--crt-glow-color) 80%,
    transparent 100%
  );
  transform: translateY(-50%);
  z-index: 201;
  opacity: 0;
}

.arcade-boot-line.active {
  animation: bootLine 0.5s ease-out forwards;
}

/* Screen wipe element */
.arcade-wipe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--crt-glow-color) 45%,
    #fff 50%,
    var(--crt-glow-color) 55%,
    transparent 100%
  );
  z-index: 202;
  pointer-events: none;
  opacity: 0;
}

.arcade-wipe.active-down {
  opacity: 1;
  animation: screenWipeDown 0.4s ease-in-out forwards;
}

.arcade-wipe.active-up {
  opacity: 1;
  animation: screenWipeUp 0.4s ease-in-out forwards;
}

/* Screen flash */
.arcade-flash {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 203;
  pointer-events: none;
  opacity: 0;
}

.arcade-flash.active {
  animation: screenFlash 0.15s ease-out forwards;
}

/* ============================================
   INSERT COIN / ATTRACT MODE
   ============================================ */
.arcade-attract {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  z-index: 150;
}

.arcade-insert-coin {
  font-size: 24px;
  font-weight: bold;
  color: var(--crt-glow-color);
  text-transform: uppercase;
  letter-spacing: 4px;
  animation: insertCoinBlink 1s steps(1) infinite;
}

.arcade-insert-coin::before {
  content: '[ ';
}

.arcade-insert-coin::after {
  content: ' ]';
}

/* Countdown overlay */
.arcade-countdown {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 160;
}

.arcade-countdown-number {
  font-size: 120px;
  font-weight: bold;
  color: var(--crt-glow-color);
  animation: countdownPulse 1s ease-out forwards;
}

.arcade-countdown-text {
  font-size: 32px;
  color: var(--crt-glow-color);
  text-transform: uppercase;
  letter-spacing: 8px;
  animation: countdownPulse 0.8s ease-out forwards;
}

/* ============================================
   UNIFIED HUD (BOTTOM BAR)
   ============================================ */
.arcade-hud {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: linear-gradient(
    180deg,
    var(--bezel-color) 0%,
    var(--bezel-shadow) 100%
  );
  border-top: 2px solid var(--bezel-highlight);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  font-size: 14px;
}

.hud-left,
.hud-right {
  display: flex;
  gap: 10px;
}

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

.hud-btn {
  background: var(--bezel-shadow);
  border: 1px solid var(--bezel-highlight);
  color: var(--text-secondary, #888);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hud-btn:hover {
  background: var(--bezel-highlight);
  color: var(--text-primary, #fff);
  border-color: var(--crt-glow-color);
}

.hud-btn:active {
  transform: scale(0.95);
}

.hud-btn.active {
  background: var(--crt-glow-color);
  color: var(--bg-color, #000);
  border-color: var(--crt-glow-color);
}

.hud-score,
.hud-best {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary, #888);
}

.hud-score-label,
.hud-best-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hud-score-value,
.hud-best-value {
  font-size: 18px;
  font-weight: bold;
  color: var(--crt-glow-color);
  min-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hud-score-value.ticking {
  animation: scoreTick 0.1s ease;
}

.hud-best-value.new-best {
  animation: glowPulse 0.5s ease infinite;
  color: #ffd700;
}

/* ============================================
   LEADERBOARD THEATER
   ============================================ */
.arcade-leaderboard-reveal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  z-index: 170;
}

.leaderboard-checking {
  font-size: 20px;
  color: var(--text-secondary, #888);
  letter-spacing: 2px;
}

.leaderboard-checking::after {
  content: '';
  animation: loadingDots 1.5s steps(4) infinite;
}

@keyframes loadingDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

.leaderboard-result {
  text-align: center;
}

.leaderboard-rank {
  font-size: 64px;
  font-weight: bold;
  color: var(--crt-glow-color);
  margin-bottom: 10px;
}

.leaderboard-rank.top-3 {
  color: #ffd700;
  text-shadow:
    0 0 10px #ffd700,
    0 0 20px #ffd700,
    0 0 40px #ff8c00;
}

.leaderboard-message {
  font-size: 24px;
  color: var(--text-primary, #fff);
  text-transform: uppercase;
  letter-spacing: 4px;
}

/* Fireworks container */
.arcade-fireworks {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 175;
}

.firework-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: fireworkBurst 1s ease-out forwards;
}

/* ============================================
   SECRET UNLOCK EFFECTS
   ============================================ */
.arcade-glitch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  pointer-events: none;
}

.arcade-glitch-overlay.active {
  animation: glitchHard 0.1s steps(1) infinite;
}

.arcade-unlock-text {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: bold;
  color: #0f0;
  text-transform: uppercase;
  letter-spacing: 4px;
  white-space: nowrap;
  z-index: 10000;
  text-shadow:
    0 0 5px #0f0,
    0 0 10px #0f0,
    0 0 20px #0f0;
  border-right: 3px solid #0f0;
  overflow: hidden;
  animation: typewriterCursor 0.7s steps(1) infinite;
}

.card-unlocked {
  animation: cardMaterialize 0.6s ease-out forwards;
}

/* ============================================
   INITIALS ENTRY (AAA-STYLE)
   ============================================ */
.arcade-initials {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.arcade-initials-title {
  font-size: 18px;
  color: var(--crt-glow-color);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.arcade-initials-input {
  display: flex;
  gap: 15px;
}

.arcade-initial-char {
  width: 50px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: bold;
  color: var(--crt-glow-color);
  border: 2px solid var(--crt-glow-color);
  background: rgba(0, 0, 0, 0.5);
}

.arcade-initial-char.active {
  animation: glowPulse 0.5s ease infinite;
  border-width: 3px;
}

.arcade-initials-hint {
  font-size: 12px;
  color: var(--text-secondary, #888);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   Scale cabinets proportionally based on game size
   ============================================ */

/* Large games (Snake, Pong): scale more aggressively */
@media (max-width: 1150px) {
  .arcade-cabinet.crt-snake .arcade-bezel,
  .arcade-cabinet.crt-pong .arcade-bezel {
    transform: scale(0.85);
    transform-origin: top center;
  }
}

/* Medium games at tablet size */
@media (max-width: 1000px) {
  .arcade-cabinet.crt-breakout .arcade-bezel,
  .arcade-cabinet.arena-cabinet .arcade-bezel {
    transform: scale(0.9);
    transform-origin: top center;
  }
}

/* Adventure game needs earlier scaling due to 1200px width */
@media (max-width: 1250px) {
  .arcade-cabinet.crt-adventure .arcade-bezel {
    transform: scale(0.85);
    transform-origin: top center;
  }
}

/* Oracle games at tablet size */
@media (max-width: 900px) {
  .arcade-cabinet.crt-oracle .arcade-bezel {
    transform: scale(0.75);
    transform-origin: top center;
  }

  .arcade-cabinet {
    padding: 10px;
  }
}

/* Small tablet: scale all games down */
@media (max-width: 768px) {
  .arcade-cabinet.crt-snake .arcade-bezel,
  .arcade-cabinet.crt-pong .arcade-bezel {
    transform: scale(0.65);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-breakout .arcade-bezel,
  .arcade-cabinet.arena-cabinet .arcade-bezel {
    transform: scale(0.75);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-tetris .arcade-bezel {
    transform: scale(0.95);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-adventure .arcade-bezel {
    transform: scale(0.6);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-oracle .arcade-bezel {
    transform: scale(0.6);
    transform-origin: top center;
  }

  .arcade-cabinet {
    padding: 5px;
    min-height: auto;
  }

  :root {
    --crt-curve: 4px;
  }

  .arcade-hud {
    padding: 6px 10px;
    font-size: 12px;
  }

  .hud-center {
    gap: 15px;
  }

  .hud-score-value,
  .hud-best-value {
    font-size: 14px;
    min-width: 50px;
  }

  .hud-btn {
    padding: 4px 8px;
    font-size: 10px;
  }

  .arcade-countdown-number {
    font-size: 80px;
  }

  .arcade-insert-coin {
    font-size: 18px;
  }
}

/* Mobile: aggressive scaling for larger games */
@media (max-width: 550px) {
  .arcade-cabinet.crt-snake .arcade-bezel,
  .arcade-cabinet.crt-pong .arcade-bezel {
    transform: scale(0.45);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-breakout .arcade-bezel,
  .arcade-cabinet.arena-cabinet .arcade-bezel {
    transform: scale(0.55);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-tetris .arcade-bezel {
    transform: scale(0.8);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-adventure .arcade-bezel {
    transform: scale(0.45);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-oracle .arcade-bezel {
    transform: scale(0.48);
    transform-origin: top center;
  }
}

/* Very small mobile: scale all down further */
@media (max-width: 450px) {
  .arcade-cabinet.crt-snake .arcade-bezel,
  .arcade-cabinet.crt-pong .arcade-bezel {
    transform: scale(0.35);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-breakout .arcade-bezel,
  .arcade-cabinet.arena-cabinet .arcade-bezel {
    transform: scale(0.45);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-tetris .arcade-bezel {
    transform: scale(0.65);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-adventure .arcade-bezel {
    transform: scale(0.35);
    transform-origin: top center;
  }

  .arcade-cabinet.crt-oracle .arcade-bezel {
    transform: scale(0.38);
    transform-origin: top center;
  }

  .hud-left,
  .hud-right {
    gap: 5px;
  }

  .hud-score-label,
  .hud-best-label {
    display: none;
  }

  .arcade-countdown-number {
    font-size: 60px;
  }
}

/* ============================================
   REDUCED MOTION ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .arcade-screen::before,
  .arcade-screen.crt-flicker,
  .arcade-static.active,
  .arcade-insert-coin,
  .hud-best-value.new-best {
    animation: none;
  }

  .arcade-wipe.active-down,
  .arcade-wipe.active-up {
    animation-duration: 0.1s;
  }

  .arcade-countdown-number {
    animation-duration: 0.3s;
  }
}

/* ============================================
   OPTIONAL: DISABLE CRT EFFECTS
   ============================================ */
.arcade-screen.no-effects::before,
.arcade-screen.no-effects::after {
  display: none;
}

.arcade-screen.no-effects {
  box-shadow: none;
  border-radius: 0;
}

/* ============================================
   PUZZLE & CHALLENGE GAME RESPONSIVE SCALING
   ============================================ */

/* Medium games (720-780px width) */
@media (max-width: 800px) {
  .arcade-cabinet.crt-hangman .arcade-bezel,
  .arcade-cabinet.crt-memory .arcade-bezel,
  .arcade-cabinet.crt-reaction .arcade-bezel,
  .arcade-cabinet.crt-primarch .arcade-bezel {
    transform: scale(0.85);
    transform-origin: top center;
  }
}

/* Wide games (960-1080px width) */
@media (max-width: 1100px) {
  .arcade-cabinet.crt-minesweeper .arcade-bezel,
  .arcade-cabinet.crt-typing .arcade-bezel,
  .arcade-cabinet.crt-breach .arcade-bezel {
    transform: scale(0.85);
    transform-origin: top center;
  }
}

/* Small games (600px width) */
@media (max-width: 700px) {
  .arcade-cabinet.crt-simon .arcade-bezel,
  .arcade-cabinet.crt-2048 .arcade-bezel {
    transform: scale(0.9);
    transform-origin: top center;
  }
}

/* Tablet and smaller - scale all down */
@media (max-width: 768px) {
  .arcade-cabinet.crt-hangman .arcade-bezel,
  .arcade-cabinet.crt-memory .arcade-bezel,
  .arcade-cabinet.crt-reaction .arcade-bezel,
  .arcade-cabinet.crt-primarch .arcade-bezel {
    transform: scale(0.7);
  }

  .arcade-cabinet.crt-minesweeper .arcade-bezel,
  .arcade-cabinet.crt-typing .arcade-bezel,
  .arcade-cabinet.crt-breach .arcade-bezel {
    transform: scale(0.65);
  }

  .arcade-cabinet.crt-simon .arcade-bezel,
  .arcade-cabinet.crt-2048 .arcade-bezel {
    transform: scale(0.8);
  }
}

/* Mobile */
@media (max-width: 550px) {
  .arcade-cabinet.crt-hangman .arcade-bezel,
  .arcade-cabinet.crt-memory .arcade-bezel,
  .arcade-cabinet.crt-reaction .arcade-bezel,
  .arcade-cabinet.crt-primarch .arcade-bezel {
    transform: scale(0.5);
  }

  .arcade-cabinet.crt-minesweeper .arcade-bezel,
  .arcade-cabinet.crt-typing .arcade-bezel,
  .arcade-cabinet.crt-breach .arcade-bezel {
    transform: scale(0.45);
  }

  .arcade-cabinet.crt-simon .arcade-bezel,
  .arcade-cabinet.crt-2048 .arcade-bezel {
    transform: scale(0.65);
  }
}
