/* ==========================================================================
   SyncTeam - Super Mario 5 Levels & Boss Fight Stylesheet
   Features: Boss Health Bar, Level Transition Splash, CRT Scanlines & Neon Glows
   ========================================================================== */

body.mario-page {
  background-color: var(--bg-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.mario-main-container {
  padding-top: 90px;
  padding-bottom: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  flex: 1;
  position: relative;
  z-index: 2;
}

/* ARCADE CABINET CONTAINER */
.arcade-cabinet {
  width: 100%;
  max-width: 860px;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(11, 15, 25, 0.98) 100%
  );
  border: 1px solid rgba(236, 72, 153, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 35px rgba(236, 72, 153, 0.15);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[data-theme="light"] .arcade-cabinet {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%);
}

/* MARQUEE HEADER */
.arcade-marquee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 20px;
}

.marquee-title {
  font-family: 'Press Start 2P', cursive, monospace;
  font-size: 1rem;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
}

.retro-sub {
  color: var(--accent-amber);
  font-size: 0.8rem;
}

.marquee-lights {
  display: flex;
  gap: 6px;
}

.marquee-lights span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-pink);
  box-shadow: 0 0 8px var(--accent-pink);
  animation: lightPulse 1.2s infinite ease-in-out alternate;
}

.marquee-lights span:nth-child(2) { animation-delay: 0.4s; background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }
.marquee-lights span:nth-child(3) { animation-delay: 0.8s; background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }

@keyframes lightPulse {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

/* ARCADE HUD BAR */
.mario-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-family: 'Press Start 2P', cursive, monospace;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hud-label {
  font-size: 0.625rem;
  color: #ef4444;
}

.hud-value {
  font-size: 0.78rem;
  color: #ffffff;
  letter-spacing: 1px;
}

/* BOSS HP BAR OVERLAY */
.boss-hp-container {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: pulseGlow 1.5s infinite alternate;
}

.boss-hp-container.hidden {
  display: none !important;
}

.boss-label-row {
  display: flex;
  justify-content: space-between;
  font-family: 'Press Start 2P', cursive, monospace;
  font-size: 0.72rem;
  color: #fca5a5;
}

.boss-hp-track {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 50%, #f59e0b 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  box-shadow: 0 0 10px #ef4444;
}

/* CANVAS WRAPPER & CRT SCANLINES */
.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #5c94fc;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

#marioCanvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.crt-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  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: 5;
  opacity: 0.6;
}

/* LEVEL SPLASH OVERLAY */
.level-splash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ffffff;
  font-family: 'Press Start 2P', cursive, monospace;
  animation: fadeIn 0.3s ease;
}

.level-splash-overlay.hidden {
  display: none !important;
}

.splash-world-title {
  font-size: 1.8rem;
  color: #fde047;
  text-shadow: 0 0 15px rgba(253, 224, 71, 0.6);
}

.splash-world-sub {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* OVERLAYS (START, GAME OVER, VICTORY) */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.game-overlay.hidden {
  display: none !important;
}

.overlay-card {
  text-align: center;
  max-width: 480px;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.overlay-title {
  font-family: 'Press Start 2P', cursive, monospace;
  font-size: 1.1rem;
  line-height: 1.45;
}

.error-text { color: #ef4444; text-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
.success-text { color: #10b981; text-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }

.overlay-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.high-score-badge, .score-summary {
  font-family: 'Press Start 2P', cursive, monospace;
  font-size: 0.72rem;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* CONTROLS GUIDE */
.arcade-controls-guide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}

kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-main);
  box-shadow: 0 2px 0 rgba(0,0,0,0.4);
}

/* MOBILE TOUCH CONTROLS */
.mobile-touch-controls {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
}

@media (max-width: 768px) {
  .mobile-touch-controls {
    display: flex;
  }
}

.dpad-container {
  display: flex;
  gap: 10px;
}

.touch-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-color);
  color: #ffffff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
}

.action-btn-a {
  width: 70px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  font-weight: 800;
  font-size: 0.85rem;
}
