/* ==========================================================================
   SUPER MARIO BIRTHDAY PARTY — NINTENDO SWITCH
   Hoja de estilos de la Consola Interactiva & Reino Champiñón
   ========================================================================== */

:root {
  --color-cyan: #00c3e3;
  --color-cyan-dark: #008fa8;
  --color-cyan-glow: rgba(0, 195, 227, 0.35);
  
  --color-coral: #ff3c28;
  --color-coral-dark: #d62615;
  --color-coral-glow: rgba(255, 60, 40, 0.35);

  --color-chassis: #171920;
  --color-chassis-dark: #0f1116;
  --color-chassis-edge: #232732;

  --color-mario-red: #e52521;
  --color-mario-blue: #0026a8;
  --color-mario-sky: #5c94fc;
  --color-mario-sky-light: #8ec3fd;
  --color-mario-green: #00a838;
  --color-mario-pipe: #007020;
  --color-mario-gold: #fdb813;
  --color-mario-star: #ffe600;
  --color-mario-brick: #b84418;

  --color-text-white: #ffffff;
  --color-text-dark: #1e1e24;
  --color-text-muted: #8e9bb0;

  --font-display: 'Kanit', sans-serif;
  --font-stats: 'Russo One', sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-chassis: 32px;
  --radius-joycon: 32px;
  --radius-screen: 16px;
  --radius-card: 14px;

  --ease-game: cubic-bezier(0.2, 0.9, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset y caja base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: #080a10;
  color: var(--color-text-white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
}

/* ==========================================================================
   Fondo Atmosférico
   ========================================================================== */
.ambient-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  width: 48vw;
  height: 48vw;
  max-width: 600px;
  max-height: 600px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  transition: opacity 0.8s ease;
}

.glow-cyan {
  top: 15%;
  left: -10%;
  background: radial-gradient(circle, var(--color-cyan) 0%, transparent 70%);
}

.glow-coral {
  bottom: 15%;
  right: -10%;
  background: radial-gradient(circle, var(--color-coral) 0%, transparent 70%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.6;
}

/* Destello y Canvas de Confeti */
.screen-flash {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}

.screen-flash.active {
  opacity: 0.85;
  transition: none;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  pointer-events: none;
}

/* ==========================================================================
   Viewport y Contenedor de Consola
   ========================================================================== */
.console-viewport {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 14px 8px;
}

.console-wrapper {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  max-width: 1040px;
  height: 630px;
  max-height: 94vh;
  border-radius: var(--radius-chassis);
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.85),
    0 6px 16px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.25s var(--ease-game);
}

.console-wrapper.rumble {
  animation: consoleRumble 0.4s ease-in-out;
}

@keyframes consoleRumble {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-4px, 3px) rotate(-0.5deg); }
  40% { transform: translate(4px, -2px) rotate(0.5deg); }
  60% { transform: translate(-3px, 1px) rotate(-0.3deg); }
  80% { transform: translate(2px, -1px) rotate(0.2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* ==========================================================================
   Joy-Cons Laterales (Izquierdo y Derecho)
   ========================================================================== */
.joycon {
  position: relative;
  flex: 0 0 135px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 10px 18px 10px;
  user-select: none;
  z-index: 2;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.25);
  transition: transform 0.5s var(--ease-bounce);
}

.joycon-left {
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-cyan-dark) 100%);
  border-radius: var(--radius-joycon) 0 0 var(--radius-joycon);
  border-right: 2px solid rgba(0, 0, 0, 0.4);
}

.joycon-right {
  background: linear-gradient(225deg, var(--color-coral) 0%, var(--color-coral-dark) 100%);
  border-radius: 0 var(--radius-joycon) var(--radius-joycon) 0;
  border-left: 2px solid rgba(0, 0, 0, 0.4);
}

/* Desacople en estado apagado */
body.power-off .joycon-left {
  transform: translateX(-8px) translateY(4px);
}
body.power-off .joycon-right {
  transform: translateX(8px) translateY(4px);
}

.trigger-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.shoulder-btn {
  background: #2b2f38;
  color: #8c93a3;
  border: 1px solid rgba(0, 0, 0, 0.4);
  font-family: var(--font-stats);
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.15s ease;
  min-height: 28px;
}

.shoulder-btn:hover {
  background: #393e4a;
  color: #ffffff;
}

.shoulder-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.btn-zl, .btn-zr {
  background: #1e2229;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 4px;
}

.joycon-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  flex: 1;
  gap: 8px;
}

.joycon-top-row, .joycon-bottom-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

.ctrl-btn {
  background: #252830;
  color: #adb4c4;
  border: none;
  font-family: var(--font-stats);
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.35);
  transition: all 0.15s ease;
  min-width: 44px;
  min-height: 44px;
}

.btn-minus, .btn-plus {
  width: 44px;
  height: 44px;
}

.btn-capture, .btn-home {
  width: 44px;
  height: 44px;
}

.btn-capture .square-icon {
  width: 14px;
  height: 14px;
  border: 2px solid #adb4c4;
  border-radius: 3px;
}

.ctrl-btn:hover {
  background: #323640;
  color: #ffffff;
}

.ctrl-btn:active {
  transform: scale(0.92);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.analog-stick-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.analog-stick {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #434855 0%, #1e2128 80%);
  border: 2px solid rgba(0, 0, 0, 0.4);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.45),
    inset 0 1px 2px rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.analog-stick:active {
  transform: translate(2px, 2px) scale(0.97);
}

.stick-cap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #2b2e38 0%, #181a20 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stick-ridge {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.stick-ridge.top { top: 3px; left: 50%; width: 4px; height: 6px; transform: translateX(-50%); }
.stick-ridge.right { right: 3px; top: 50%; width: 6px; height: 4px; transform: translateY(-50%); }
.stick-ridge.bottom { bottom: 3px; left: 50%; width: 4px; height: 6px; transform: translateX(-50%); }
.stick-ridge.left { left: 3px; top: 50%; width: 6px; height: 4px; transform: translateY(-50%); }

.stick-center-dot {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.dpad-cluster, .action-btn-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.dpad-middle-row, .action-middle-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dpad-center, .action-center {
  width: 12px;
  height: 12px;
}

.dpad-btn, .action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #252830;
  color: #adb4c4;
  border: none;
  font-family: var(--font-stats);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.35);
  transition: all 0.12s ease;
}

.dpad-btn:hover, .action-btn:hover {
  background: #343844;
  color: #ffffff;
}

.dpad-btn:active, .action-btn:active {
  transform: scale(0.92);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-a {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.joycon-rail-line {
  position: absolute;
  top: 15%;
  bottom: 15%;
  width: 3px;
  background: rgba(0, 0, 0, 0.25);
}
.joycon-left .joycon-rail-line { right: 2px; }
.joycon-right .joycon-rail-line { left: 2px; }

/* ==========================================================================
   Cuerpo Central: Bisel y Pantalla OLED
   ========================================================================== */
.console-screen-unit {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-chassis);
  border-top: 1px solid var(--color-chassis-edge);
  border-bottom: 2px solid #0b0d10;
  padding: 10px 14px;
  overflow: hidden;
  z-index: 1;
}

.bezel-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 10px;
  padding: 0 16px;
  margin-bottom: 6px;
}

.speaker-grill {
  display: flex;
  gap: 4px;
}

.speaker-grill span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #0d0f14;
}

.sensor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0d0f14;
  box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.2);
}

.bezel-bottom-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 12px;
  margin-top: 6px;
}

.console-led {
  width: 8px;
  height: 4px;
  border-radius: 2px;
  background: #252830;
  transition: all 0.3s ease;
}

body:not(.power-off) .console-led {
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
}

/* ==========================================================================
   Pantalla Activa OLED
   ========================================================================== */
.active-screen {
  position: relative;
  flex: 1;
  width: 100%;
  min-width: 0;
  background: #0a0d14;
  border-radius: var(--radius-screen);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    inset 0 0 20px rgba(0, 0, 0, 0.9),
    0 2px 8px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen-glass-gloss {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 25;
}

/* Vistas de Pantalla */
.screen-view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.screen-view.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.screen-view:not(.active) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.screen-view:not(.active) * {
  pointer-events: none !important;
}

/* ==========================================================================
   ESTADO A: Consola Apagada
   ========================================================================== */
.view-power-off {
  z-index: 20;
  background: radial-gradient(circle at center, #10151f 0%, #06080d 100%);
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
}

.view-booting {
  z-index: 30;
}

.view-game-os {
  z-index: 10;
}

.power-off-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 320px;
}

.console-logo-mark {
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.power-off-title {
  font-family: var(--font-stats);
  font-size: 26px;
  letter-spacing: 1px;
  color: #ffffff;
  margin-bottom: 2px;
}

.power-off-subtitle {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--color-cyan);
  margin-bottom: 24px;
}

.btn-power-on {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #1f2736 0%, #131924 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 40px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.6),
    0 0 15px rgba(0, 195, 227, 0.2);
  transition: all 0.2s ease;
  min-height: 48px;
}

.btn-power-on:hover {
  background: linear-gradient(135deg, #2b364a 0%, #192130 100%);
  box-shadow: 
    0 10px 28px rgba(0, 0, 0, 0.8),
    0 0 25px rgba(0, 195, 227, 0.4);
  transform: translateY(-2px);
}

.btn-power-on:active {
  transform: translateY(1px);
}

.power-icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00e676;
}

.power-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 46px;
  border: 2px solid var(--color-cyan);
  opacity: 0.4;
  animation: pulseRing 2s infinite var(--ease-game);
  pointer-events: none;
}

@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 0.1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

.power-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.hint-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #252830;
  color: #ffffff;
  border-radius: 50%;
  font-family: var(--font-stats);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   ESTADO B: Secuencia de Arranque con Mario, Tubería y Bloque [?]
   ========================================================================== */
.view-booting {
  background: linear-gradient(180deg, var(--color-mario-sky) 0%, var(--color-mario-sky-light) 75%, #58a52b 75%, #3d7a1c 100%);
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 16px;
  overflow: hidden;
}

.booting-mario-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 380px;
  height: 100%;
  justify-content: center;
}

.boot-sky-clouds {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 60px;
  pointer-events: none;
}

.mario-cloud {
  position: absolute;
  width: 60px;
  height: 24px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  opacity: 0.9;
}
.mario-cloud::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 12px;
  width: 26px;
  height: 26px;
  background: #ffffff;
  border-radius: 50%;
}
.mario-cloud::after {
  content: '';
  position: absolute;
  top: -6px;
  right: 12px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
}
.cloud-1 { top: 10px; left: 15%; animation: floatCloud 12s linear infinite alternate; }
.cloud-2 { top: 35px; right: 15%; animation: floatCloud 16s linear infinite alternate-reverse; }

@keyframes floatCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(30px); }
}

.mario-pipe-scene {
  position: relative;
  width: 140px;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.pipe-question-block {
  position: absolute;
  top: 0;
  width: 54px;
  height: 54px;
  z-index: 5;
  transition: transform 0.2s var(--ease-bounce);
}

.img-block-bounce {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.boot-coin-burst {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(0) scale(0);
  width: 32px;
  height: 32px;
  z-index: 4;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s ease;
}

.boot-coin-burst.active {
  transform: translateX(-50%) translateY(-54px) scale(1.2);
  opacity: 1;
}

.pipe-mario-actor {
  position: absolute;
  bottom: 50px;
  width: 70px;
  height: 90px;
  z-index: 3;
  transform: translateY(60px);
  transition: transform 0.5s var(--ease-bounce);
}

.pipe-mario-actor.jump {
  transform: translateY(-20px);
}

.img-mario-jump {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.pipe-base {
  width: 90px;
  height: 70px;
  z-index: 4;
}

.img-pipe-green {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.boot-intro-banner {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.4s var(--ease-bounce);
  margin-bottom: 12px;
}

.boot-intro-banner.show {
  opacity: 1;
  transform: scale(1);
}

.boot-intro-tag {
  display: inline-block;
  background: var(--color-mario-gold);
  color: #1e1302;
  font-family: var(--font-stats);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 4px;
}

.boot-intro-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 
    -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
    0 4px 10px rgba(0, 0, 0, 0.5);
  line-height: 1.1;
  margin-bottom: 4px;
}

.boot-level-pill {
  display: inline-block;
  background: var(--color-mario-red);
  color: #ffffff;
  font-family: var(--font-stats);
  font-size: 14px;
  padding: 3px 12px;
  border-radius: 14px;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.boot-progress-container {
  width: 100%;
  max-width: 240px;
  height: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.boot-progress-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-mario-gold) 0%, var(--color-mario-red) 100%);
  border-radius: 4px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.15s ease-out;
}

.btn-skip-intro {
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.btn-skip-intro:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   ESTADO C: Sistema Operativo & Reino Champiñón
   ========================================================================== */
.view-game-os {
  background: linear-gradient(180deg, #4b89ee 0%, #7db1fc 60%, #52a326 60%, #3e801c 100%);
}

/* Status Bar Superior */
.os-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(14, 20, 32, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  z-index: 10;
}

.player-avatar-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-mario-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.avatar-meta {
  display: flex;
  flex-direction: column;
}

.avatar-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-mario-gold);
}

.avatar-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  line-height: 1.1;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--font-stats);
  font-size: 10px;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  min-height: 32px;
}

.btn-sound-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-sound-toggle.muted .sound-icon-on { display: none; }
.btn-sound-toggle:not(.muted) .sound-icon-off { display: none; }
.btn-sound-toggle.muted {
  color: var(--color-text-muted);
  border-color: rgba(255, 255, 255, 0.1);
}

.system-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
}

.battery-icon {
  display: flex;
  align-items: center;
}

.battery-body {
  width: 18px;
  height: 9px;
  border: 1px solid #ffffff;
  border-radius: 2px;
  padding: 1px;
}

.battery-level {
  display: block;
  width: 100%;
  height: 100%;
  background: #00e676;
  border-radius: 1px;
}

.battery-terminal {
  width: 2px;
  height: 5px;
  background: #ffffff;
  border-radius: 0 1px 1px 0;
}

.system-time {
  font-family: var(--font-stats);
  font-size: 11px;
  color: #ffffff;
}

/* ==========================================================================
   Navegación del Reino Champiñón (Destinos)
   ========================================================================== */
.mario-world-nav {
  padding: 6px 10px;
  background: rgba(10, 14, 24, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 5;
}

.world-nav-wrapper {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.world-nav-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #e2eaf5;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 6px 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease-bounce);
  min-height: 44px;
}

.nav-btn-thumb {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.world-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

.world-nav-btn.active {
  background: linear-gradient(135deg, #ff4538 0%, #d82315 100%);
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 3px 10px rgba(229, 37, 33, 0.4);
  transform: scale(1.03);
}

/* ==========================================================================
   Viewport de Destinos (Escenario del Reino Champiñón)
   ========================================================================== */
.mario-stage-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.mario-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-game), visibility 0.3s ease;
}

.mario-panel.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.panel-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.panel-scroll-content::-webkit-scrollbar {
  width: 4px;
}
.panel-scroll-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* ==========================================================================
   VISTA 1: Castillo del Cumpleaños
   ========================================================================== */
.mario-hero-scene {
  position: relative;
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.castle-backdrop-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.85;
}

.hero-castle-art {
  max-height: 100%;
  max-width: 85%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.mario-jumping-wrap {
  position: relative;
  z-index: 2;
  width: 110px;
  height: 130px;
  animation: marioHover 2s ease-in-out infinite alternate;
}

.hero-mario-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

@keyframes marioHover {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.mario-hero-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-level-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #182236;
  border: 1px solid var(--color-mario-gold);
  border-radius: 20px;
  padding: 4px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-mario-gold);
  margin-bottom: 4px;
}

.tag-block-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.celebrant-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 
    -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
    0 4px 12px rgba(0, 0, 0, 0.6);
  line-height: 1.1;
  margin-bottom: 6px;
}

.celebrant-age-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--color-mario-red) 0%, #b81613 100%);
  border: 2px solid #ffffff;
  border-radius: 24px;
  padding: 4px 16px;
  box-shadow: 0 4px 14px rgba(229, 37, 33, 0.4);
  margin-bottom: 12px;
}

.age-text {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
}

.age-number {
  font-family: var(--font-stats);
  font-size: 22px;
  line-height: 1;
  color: var(--color-mario-gold);
}

.mario-speech-bubble {
  position: relative;
  background: #ffffff;
  color: #1a1a24;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  margin-bottom: 12px;
  max-width: 480px;
  width: 100%;
}

.speech-tail {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #ffffff;
}

.speech-quote {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.mario-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 14px;
}

.mario-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 6px 4px;
}

.stat-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  margin-bottom: 2px;
}

.stat-lbl {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.stat-val {
  font-family: var(--font-stats);
  font-size: 12px;
  color: var(--color-mario-gold);
}

.panel-bottom-cta {
  margin-top: auto;
  width: 100%;
  max-width: 480px;
}

.btn-mario-primary, .btn-mario-next {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--color-mario-red) 0%, #b81613 100%);
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 12px;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(229, 37, 33, 0.45);
  transition: all 0.2s ease;
  min-height: 48px;
}

.btn-mario-primary:hover, .btn-mario-next:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-mario-primary:active, .btn-mario-next:active {
  transform: translateY(1px);
}

/* ==========================================================================
   VISTA 2: Casa de Toad (Coordenadas)
   ========================================================================== */
.toad-header-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.toad-avatar-wrap {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.toad-guide-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.toad-header-text {
  display: flex;
  flex-direction: column;
}

.section-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--color-mario-gold);
}

.section-heading {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
}

.toad-speech-hint {
  font-size: 11px;
  color: #c4d4eb;
}

.mario-countdown-box {
  background: #141b29;
  border: 2px solid var(--color-mario-brick);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 10px;
  text-align: center;
}

.countdown-brick-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-mario-gold);
  margin-bottom: 6px;
}

.brick-star-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.countdown-units-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.mario-cd-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 46px;
  background: #1f2a3f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 6px;
}

.cd-digit {
  font-family: var(--font-stats);
  font-size: 18px;
  color: #00e676;
  text-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}

.cd-unit {
  font-size: 8px;
  font-weight: 800;
  color: #8da1bf;
}

.cd-colon {
  font-family: var(--font-stats);
  font-size: 16px;
  color: var(--color-mario-gold);
}

.mario-info-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.mario-info-tile {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #131926;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
}

.tile-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.block-gold { background: rgba(253, 184, 19, 0.15); }
.block-pipe { background: rgba(0, 168, 56, 0.15); }

.tile-block-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.tile-content {
  display: flex;
  flex-direction: column;
}

.tile-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--color-mario-gold);
}

.tile-primary-text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.tile-secondary-text {
  font-size: 12px;
  color: #b0c2dd;
}

.mario-actions-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-mario-map, .btn-mario-cal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-mario-map {
  background: #182338;
  color: #72b0fd;
  border-color: rgba(114, 176, 253, 0.3);
}

.btn-mario-map:hover {
  background: #233454;
  color: #ffffff;
}

.btn-mario-cal {
  background: #281d1c;
  color: #ff9187;
  border-color: rgba(255, 60, 40, 0.3);
}

.btn-mario-cal:hover {
  background: #3b2827;
  color: #ffffff;
}

/* ==========================================================================
   VISTA 3: Mario — Desafío de Monedas (Minijuego)
   ========================================================================== */
.mario-game-lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 0;
}

.lobby-banner-box {
  margin-bottom: 6px;
}

.lobby-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--color-mario-gold);
}

.lobby-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
}

.lobby-duel-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
}

.lobby-actor {
  width: 60px;
  height: 60px;
}

.img-lobby-mario, .img-lobby-bowser {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.lobby-vs-badge {
  font-family: var(--font-stats);
  font-size: 16px;
  color: var(--color-mario-red);
  background: #ffffff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.lobby-rules-card {
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 14px;
  max-width: 320px;
  margin-bottom: 12px;
}

.rules-text {
  font-size: 13px;
  color: #d6e2f5;
  line-height: 1.35;
  margin-bottom: 8px;
}

.rules-icons-hint {
  display: flex;
  justify-content: space-around;
  font-size: 11px;
  color: var(--color-mario-gold);
}

.hint-ico {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  object-fit: contain;
}

.btn-start-mario-game {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 280px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--color-mario-gold) 0%, #e6a000 100%);
  color: #1a1200;
  border: 2px solid #ffffff;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(253, 184, 19, 0.4);
  transition: all 0.2s ease;
  min-height: 48px;
  margin-bottom: 8px;
}

.btn-start-mario-game:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-star-glow {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.btn-skip-mario-game {
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.btn-skip-mario-game:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Arena de Juego Activo */
.mario-game-arena {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* HUD Reorganizado Limpio: Monedas | Tiempo | Salir */
.mario-hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #101624;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 6px;
}

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

.hud-coin-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.hud-stat-text {
  font-family: var(--font-stats);
  font-size: 15px;
  color: var(--color-mario-gold);
}

.btn-quit-mario-game {
  background: #252830;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.mario-game-stage {
  position: relative;
  flex: 1;
  min-height: 180px;
  max-height: 240px;
  background: linear-gradient(180deg, #5c94fc 0%, #8ec3fd 75%, #58a52b 75%, #3e801c 100%);
  border: 2px solid #ffffff;
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.stage-bowser-hazard {
  position: absolute;
  top: 6px;
  right: 12px;
  width: 52px;
  height: 52px;
  pointer-events: none;
  animation: bowserRoar 2s ease-in-out infinite alternate;
}

.stage-bowser-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

@keyframes bowserRoar {
  0% { transform: scale(1); }
  100% { transform: scale(1.08) rotate(-3deg); }
}

.stage-items-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.falling-mario-item {
  position: absolute;
  pointer-events: none;
}

.item-coin-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(253, 184, 19, 0.8));
  animation: spinCoin 0.8s linear infinite;
}

@keyframes spinCoin {
  0% { transform: rotateY(0); }
  100% { transform: rotateY(360deg); }
}

.item-star-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 230, 0, 0.9));
  animation: pulseStar 0.4s ease-in-out infinite alternate;
}

@keyframes pulseStar {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.15); }
}

.item-mushroom-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.item-shell-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  animation: spinShell 0.3s linear infinite;
}

@keyframes spinShell {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

.stage-mario-player {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 60px;
  pointer-events: none;
  transition: transform 0.05s linear;
  z-index: 5;
}

.player-mario-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.stage-ground-blocks {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18px;
  background: repeating-linear-gradient(90deg, #b84418, #b84418 16px, #8b2c0a 16px, #8b2c0a 18px);
  border-top: 2px solid #58a52b;
}

.mario-touch-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 8px;
}

.mario-touch-btn {
  flex: 1;
  background: #182236;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  min-height: 46px;
}

.mario-touch-btn:active {
  background: var(--color-mario-red);
}

.touch-bar-hint {
  font-size: 10px;
  color: #a8bbd8;
}

/* Vista de Victoria Mario Party */
.mario-victory-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 0;
}

.victory-header-burst {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.victory-big-star {
  width: 32px;
  height: 32px;
  object-fit: contain;
  animation: starSpinVictory 1.5s ease-in-out infinite alternate;
}

@keyframes starSpinVictory {
  0% { transform: scale(1) rotate(-5deg); }
  100% { transform: scale(1.2) rotate(5deg); }
}

.victory-level-cleared {
  font-family: var(--font-stats);
  font-size: 20px;
  color: var(--color-mario-gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.mario-player-pass-card {
  width: 100%;
  max-width: 330px;
  background: linear-gradient(135deg, #1b2336 0%, #101624 100%);
  border: 2px solid var(--color-mario-gold);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  margin-bottom: 8px;
  text-align: left;
}

.pass-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pass-brand {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-mario-gold);
}

.pass-vip-badge {
  background: var(--color-mario-red);
  color: #ffffff;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.pass-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.pass-mario-thumb {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.pass-mario-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pass-data {
  display: flex;
  flex-direction: column;
}

.pass-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
}

.pass-event {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-cyan);
}

.pass-meta, .pass-venue {
  font-size: 10px;
  color: #b5c3d8;
}

.pass-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  padding-top: 6px;
}

.pass-barcode-lines {
  display: inline-block;
  width: 100px;
  height: 12px;
  background: repeating-linear-gradient(90deg, #ffffff, #ffffff 2px, transparent 2px, transparent 4px);
  opacity: 0.6;
}

.pass-stamp {
  font-family: var(--font-stats);
  font-size: 9px;
  color: var(--color-mario-gold);
}

.victory-congrats-msg {
  font-size: 12px;
  color: #d6e2f5;
  margin-bottom: 10px;
}

.victory-button-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 290px;
}

.btn-mario-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 6px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-mario-ghost:hover {
  color: #ffffff;
}

/* Vista de Tiempo Agotado */
.mario-timeout-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0;
}

.timeout-art-wrap {
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
}

.timeout-bowser-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.timeout-heading {
  font-family: var(--font-stats);
  font-size: 20px;
  color: var(--color-mario-red);
  margin-bottom: 6px;
}

.timeout-text {
  font-size: 13px;
  color: #c0cfeb;
  max-width: 260px;
  margin-bottom: 14px;
}

.timeout-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}

/* ==========================================================================
   VISTA 4: Pase de Jugador & Fiesta (RSVP)
   ========================================================================== */
.rsvp-cast-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.cast-group-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.cast-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.cast-welcome-text {
  font-size: 11px;
  color: #c4d4eb;
}

.mario-rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.mario-form-label {
  font-size: 12px;
  font-weight: 600;
  color: #d6e2f5;
  display: flex;
  align-items: center;
  gap: 4px;
}

.req-star {
  color: var(--color-mario-red);
  font-weight: 800;
}

.mario-form-input, .mario-form-select, .mario-form-textarea {
  width: 100%;
  background: #101624;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s ease;
  min-height: 44px;
}

.mario-form-input:focus, .mario-form-select:focus, .mario-form-textarea:focus {
  outline: none;
  border-color: var(--color-mario-gold);
  box-shadow: 0 0 10px rgba(253, 184, 19, 0.4);
}

.mario-form-textarea {
  resize: none;
  min-height: 52px;
}

.field-error {
  font-size: 11px;
  color: #ff6b6b;
  display: none;
}

.field-error.active {
  display: block;
}

.attendance-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.att-card {
  cursor: pointer;
}

.att-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.att-card-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #111724;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 44px;
  transition: all 0.15s ease;
}

.att-card input[type="radio"]:checked + .att-card-box {
  border-color: var(--color-mario-gold);
  background: #1b253b;
  box-shadow: 0 0 10px rgba(253, 184, 19, 0.25);
}

.att-card-icon {
  font-size: 16px;
}

.att-card-txt {
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
}

.form-feedback {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.form-feedback.success {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid #00e676;
}

.form-feedback.error {
  background: rgba(229, 37, 33, 0.15);
  color: #ff8577;
  border: 1px solid var(--color-mario-red);
}

.form-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-mario-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #00c853 0%, #009624 100%);
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 12px;
  padding: 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 200, 83, 0.4);
  transition: all 0.2s ease;
  min-height: 48px;
}

.btn-mario-submit:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-mario-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25d366;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 12px;
  padding: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-mario-whatsapp:hover {
  background: #22bf5b;
  transform: translateY(-1px);
}

/* ==========================================================================
   Barra Inferior de Guía de Teclas
   ========================================================================== */
.os-footer-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 5px 12px;
  background: rgba(10, 14, 24, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: #9bb0cd;
}

.legend-chip {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e2433;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-stats);
  font-size: 9px;
}

/* ==========================================================================
   Accesibilidad & Focus Visible
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--color-mario-gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .mario-jumping-wrap, .mario-cloud, .stage-bowser-hazard, .item-coin-img, .item-star-img, .item-shell-img {
    animation: none !important;
  }
}

/* ==========================================================================
   Adaptación Móvil Responsiva (360, 390, 430 px)
   ========================================================================== */
@media (max-width: 820px) and (min-height: 501px) {
  .console-viewport {
    padding: 6px 2px;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
  }

  .console-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    height: auto;
    min-height: 94vh;
    max-height: 98vh;
    border-radius: 20px;
  }

  .joycon {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    padding: 8px 3px;
    box-sizing: border-box;
  }

  body.power-off .joycon-left {
    transform: translateX(-2px);
  }
  body.power-off .joycon-right {
    transform: translateX(2px);
  }

  .joycon-body {
    gap: 4px;
    width: 100%;
    align-items: center;
  }

  .shoulder-btn,
  .btn-zl, .btn-zr,
  .joycon-rail-line {
    display: none;
  }

  .trigger-group {
    height: 8px;
    margin-bottom: 0;
  }

  .ctrl-btn {
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .btn-minus, .btn-plus, .btn-capture, .btn-home {
    width: 24px;
    height: 24px;
  }

  .btn-capture .square-icon {
    width: 8px;
    height: 8px;
  }

  .analog-stick {
    width: 30px;
    height: 30px;
  }

  .stick-cap {
    width: 22px;
    height: 22px;
  }

  .dpad-cluster, .action-btn-cluster {
    gap: 1px;
    width: 36px;
  }

  .dpad-middle-row, .action-middle-row {
    gap: 1px;
    width: 36px;
    justify-content: center;
  }

  .dpad-btn, .action-btn {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .dpad-center, .action-center {
    width: 2px;
    height: 2px;
  }

  .console-screen-unit {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    padding: 6px 6px;
  }

  .os-status-bar {
    padding: 5px 6px;
    gap: 4px;
  }

  .avatar-meta .avatar-tag {
    display: none;
  }

  .avatar-meta .avatar-name {
    font-size: 11px;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-sound-toggle {
    padding: 3px 6px;
    font-size: 9px;
    min-height: 26px;
  }

  .btn-sound-toggle .sound-label {
    display: none;
  }

  .mario-world-nav {
    padding: 4px 4px;
  }

  .world-nav-wrapper {
    gap: 3px;
  }

  .world-nav-btn {
    padding: 6px 4px;
    font-size: 10px;
    gap: 3px;
  }

  .nav-btn-thumb {
    width: 16px;
    height: 16px;
  }

  .mario-panel {
    padding: 6px 6px;
  }

  .celebrant-title {
    font-size: 20px;
  }

  .mario-hero-scene {
    height: 120px;
  }

  .mario-jumping-wrap {
    width: 80px;
    height: 100px;
  }

  .section-heading {
    font-size: 16px;
  }

  .mario-actions-pair {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .mario-hud-row {
    padding: 4px 8px;
  }

  .hud-coin-img {
    width: 18px;
    height: 18px;
  }

  .hud-stat-text {
    font-size: 13px;
  }

  .os-footer-legend {
    display: none;
  }
}

@media (max-width: 380px) and (min-height: 501px) {
  .joycon {
    flex: 0 0 38px;
    padding: 6px 2px;
  }

  .ctrl-btn, .dpad-btn, .action-btn {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .analog-stick {
    width: 30px;
    height: 30px;
  }

  .stick-cap {
    width: 22px;
    height: 22px;
  }

  .celebrant-title {
    font-size: 18px;
  }
}


/* ==========================================================================
   MODO TELÉFONO — EXPERIENCIA VERTICAL PRIMERO
   --------------------------------------------------------------------------
   La consola completa NO es un buen contenedor en un teléfono: en horizontal
   deja un área de lectura de ~390x180 px reales y el teclado del RSVP la
   destruye. Aquí la consola pasa a ser un ACTO DE LA INTRODUCCIÓN: se muestra
   entera y sin deformar, y al encenderla su pantalla se expande a pantalla
   completa. Los Joy-Con se retiran y reaparecen como dock inferior táctil.
   Funciona en vertical y en horizontal: nunca se obliga a girar el teléfono.
   ========================================================================== */
@media (max-width: 540px), (max-height: 500px) and (max-width: 1000px), (max-width: 900px) and (orientation: portrait) {

  html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  /* ----- Lienzo fijo ----- */
  .console-viewport {
    position: fixed;
    inset: 0;
    display: block;
    min-height: 0;
    padding: 0;
  }

  /* Refuerzo visual: invitación a tocar la consola (sólo mientras está apagada) */
  .console-viewport::after {
    content: "Toca la consola para encender";
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--app-h, 100svh) / 2 + var(--mini-h) / 2 + 26px);
    text-align: center;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #9fb4d4;
    pointer-events: none;
    transition: opacity 0.3s ease;
    animation: phoneHintPulse 2.2s ease-in-out infinite;
  }

  body:not(.power-off) .console-viewport::after {
    opacity: 0;
    animation: none;
  }

  @keyframes phoneHintPulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
  }

  /* ----- La consola: de mini-consola a pantalla completa ----- */
  /* Las medidas de la mini-consola se publican en body para que también las
     use el rótulo de invitación situado debajo. */
  body {
    --mini-w: min(94vw, 440px, calc(var(--app-h, 100svh) * 0.6 * 1.95));
    --mini-h: calc(var(--mini-w) / 1.95);
  }

  .console-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--mini-w);
    height: var(--mini-h);
    max-width: none;
    max-height: none;
    min-height: 0;
    flex-direction: row;
    border-radius: 20px;
    transform: translate(calc(50vw - 50%), calc(var(--app-h, 100svh) / 2 - 50%));
    transition:
      width 0.6s var(--ease-game),
      height 0.6s var(--ease-game),
      transform 0.6s var(--ease-game),
      border-radius 0.5s ease;
  }

  body.console-expanded .console-wrapper {
    width: 100vw;
    height: var(--app-h, 100svh);
    border-radius: 0;
    transform: translate(0px, 0px);
    box-shadow: none;
  }

  /* ----- Joy-Con: decorativos en la intro, se retiran al expandir ----- */
  .joycon {
    flex: 0 0 clamp(38px, 12%, 58px);
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 10px 6px;
    overflow: hidden;
    transition:
      flex-basis 0.6s var(--ease-game),
      opacity 0.35s ease,
      transform 0.5s var(--ease-game);
  }

  body.power-off .joycon-left,
  body.power-off .joycon-right {
    transform: none;
  }

  /* El interior real del Joy-Con no se usa en teléfono: nada de objetivos
     táctiles de 16 px ni foco atrapado. Se dibuja su silueta con pseudo-elementos. */
  .joycon-body > * {
    display: none;
  }

  .joycon-body {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
  }

  .joycon-body::before,
  .joycon-body::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Palanca analógica */
  .joycon-body::before {
    width: min(58%, 26px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #3a4152 0%, #1b2029 70%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.22), 0 2px 4px rgba(0, 0, 0, 0.4);
  }

  /* Grupo de cuatro botones */
  .joycon-body::after {
    width: min(74%, 34px);
    aspect-ratio: 1;
    background:
      radial-gradient(circle at 50% 12%, #1b2029 0 20%, transparent 21%),
      radial-gradient(circle at 12% 50%, #1b2029 0 20%, transparent 21%),
      radial-gradient(circle at 88% 50%, #1b2029 0 20%, transparent 21%),
      radial-gradient(circle at 50% 88%, #1b2029 0 20%, transparent 21%);
  }

  .joycon-left .joycon-body::before  { top: 24%; }
  .joycon-left .joycon-body::after   { bottom: 16%; }
  .joycon-right .joycon-body::before { bottom: 18%; }
  .joycon-right .joycon-body::after  { top: 20%; }

  body.console-expanded .joycon {
    flex-basis: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
  }
  body.console-expanded .joycon-left  { transform: translateX(-28px); }
  body.console-expanded .joycon-right { transform: translateX(28px); }

  /* ----- Chasis y bisel: desaparecen al expandir ----- */
  .console-screen-unit {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px;
    border: none;
    transition: padding 0.5s var(--ease-game), background 0.5s ease;
  }

  body.console-expanded .console-screen-unit {
    padding: 0;
    background: #0a0d14;
  }

  .bezel-top-bar,
  .bezel-bottom-bar {
    height: 7px;
    margin: 0 0 3px;
    padding: 0 10px;
    transition: height 0.45s ease, opacity 0.35s ease, margin 0.45s ease;
  }
  .bezel-bottom-bar { margin: 3px 0 0; }

  body.console-expanded .bezel-top-bar,
  body.console-expanded .bezel-bottom-bar {
    height: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
  }

  .active-screen {
    border-radius: 10px;
    transition: border-radius 0.5s ease;
  }

  body.console-expanded .active-screen {
    border-radius: 0;
    border-color: transparent;
    box-shadow: none;
  }

  body.console-expanded .screen-glass-gloss {
    display: none;
  }

  /* ======================================================================
     ESTADO A — Portada dentro de la mini-consola
     ====================================================================== */
  .view-power-off {
    padding: 8px 10px;
  }

  .power-off-content {
    max-width: 100%;
  }

  .console-logo-mark {
    margin-bottom: 4px;
  }
  .console-logo-mark svg {
    width: clamp(24px, 9vh, 40px);
    height: clamp(24px, 9vh, 40px);
  }

  .power-off-title {
    font-size: clamp(15px, 4.6vw, 22px);
    letter-spacing: 0.06em;
  }

  .power-off-subtitle {
    font-size: clamp(8px, 2.4vw, 11px);
    letter-spacing: 0.14em;
    margin-bottom: 10px;
  }

  .btn-power-on {
    padding: 10px 18px;
    font-size: clamp(11px, 3.2vw, 14px);
    min-height: 44px;
    gap: 7px;
  }
  .btn-power-on svg {
    width: 19px;
    height: 19px;
  }

  /* La pista de tecla "A" es de mando físico: no aplica en teléfono. */
  .power-hint {
    display: none;
  }

  /* ======================================================================
     ESTADO B — Arranque, ya a pantalla completa
     ====================================================================== */
  .view-booting {
    padding: 18px 16px;
  }

  .boot-intro-name {
    font-size: clamp(28px, 9vw, 46px);
  }

  .btn-skip-intro {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 13px;
  }

  /* ======================================================================
     ESTADO C — Sistema: cabecera + escena + dock inferior
     ====================================================================== */
  .os-status-bar {
    order: 1;
    flex: 0 0 auto;
    padding:
      max(7px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
      7px max(12px, env(safe-area-inset-left));
  }

  .avatar-mario-icon { width: 30px; height: 30px; }
  .avatar-tag { font-size: 10px; }
  .avatar-name { font-size: 15px; max-width: 42vw; }
  .system-time { font-size: 13px; }

  .btn-sound-toggle {
    min-height: 40px;
    min-width: 40px;
    padding: 6px 12px;
    font-size: 11px;
  }
  .btn-sound-toggle .sound-label { display: inline; }
  .btn-sound-toggle svg { width: 18px; height: 18px; }

  .mario-stage-viewport {
    order: 2;
    flex: 1 1 auto;
    min-height: 0;
  }

  .os-footer-legend { display: none; }

  /* ----- DOCK INFERIOR: los Joy-Con vuelven como controles táctiles ----- */
  .mario-world-nav {
    order: 3;
    flex: 0 0 auto;
    padding:
      8px max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    background: linear-gradient(180deg, rgba(10, 14, 24, 0.86) 0%, rgba(6, 9, 16, 0.98) 100%);
    border-bottom: none;
    border-top: 2px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  }

  .world-nav-wrapper { gap: 7px; }

  .world-nav-btn {
    flex-direction: column;
    gap: 4px;
    min-height: 60px;
    padding: 7px 4px;
    border-radius: 14px;
    font-size: 11px;
    line-height: 1.1;
    white-space: normal;
    text-align: center;
  }

  .world-nav-btn:hover { transform: none; }

  .world-nav-btn.active {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(229, 37, 33, 0.5);
  }

  .nav-btn-thumb { width: 25px; height: 25px; }

  /* ======================================================================
     Escenas: tipografía y ritmo pensados para leerse de un vistazo
     ====================================================================== */
  .mario-panel {
    padding: 12px max(14px, env(safe-area-inset-right)) 4px max(14px, env(safe-area-inset-left));
  }

  .panel-scroll-content {
    padding-right: 2px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-bottom: 24px;
  }

  .mario-hero-scene { height: clamp(120px, 22vh, 190px); }
  .mario-jumping-wrap { width: clamp(84px, 26vw, 130px); }

  .celebrant-title { font-size: clamp(27px, 8.6vw, 44px); }
  .hero-level-tag { font-size: 11px; }
  .section-heading { font-size: clamp(18px, 5.4vw, 24px); }
  .section-kicker { font-size: 11px; }
  .speech-quote { font-size: 15px; line-height: 1.45; }
  .stat-lbl { font-size: 9px; }
  .stat-val { font-size: 13px; }

  .cd-digit { font-size: clamp(22px, 7vw, 32px); }
  .cd-unit  { font-size: 9px; }

  .tile-primary-text { font-size: 16px; line-height: 1.3; }
  .tile-secondary-text { font-size: 13px; }
  .tile-kicker { font-size: 10px; }

  .toad-speech-hint,
  .cast-welcome-text { font-size: 13px; }

  .mario-actions-pair {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .btn-mario-map,
  .btn-mario-cal,
  .btn-mario-primary,
  .btn-mario-next,
  .btn-mario-ghost {
    min-height: 50px;
    font-size: 14px;
  }

  /* ======================================================================
     Minijuego táctil: escenario alto y D-pad grande
     ====================================================================== */
  .mario-game-stage {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
  }

  .stage-mario-player { width: 58px; height: 66px; }

  .mario-touch-bar {
    margin-top: 10px;
    gap: 10px;
    align-items: stretch;
  }

  .mario-touch-btn {
    flex: 0 0 34%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 64px;
    padding: 8px;
    border-radius: 16px;
    background: linear-gradient(180deg, #223049 0%, #141c2c 100%);
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
  }

  .touch-btn-glyph { font-size: 20px; line-height: 1; }
  .touch-btn-label { font-size: 11px; letter-spacing: 0.08em; }

  .mario-touch-btn:active,
  .mario-touch-btn.is-held {
    background: linear-gradient(180deg, #ff5040 0%, #d3211a 100%);
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  }

  .touch-bar-hint {
    flex: 1 1 auto;
    font-size: 10px;
    line-height: 1.3;
    text-align: center;
    align-self: center;
  }

  .lobby-title { font-size: clamp(20px, 6vw, 28px); }
  .rules-text { font-size: 13px; }
  .btn-start-mario-game { min-height: 54px; font-size: 15px; }
  .btn-skip-mario-game { min-height: 44px; font-size: 13px; }
  .hud-stat-text { font-size: 16px; }
  .btn-quit-mario-game { width: 40px; height: 40px; font-size: 15px; }

  /* ======================================================================
     RSVP: 16 px en los campos (evita el zoom automático de iOS)
     ====================================================================== */
  .mario-form-input,
  .mario-form-select,
  .mario-form-textarea {
    font-size: 16px;
    min-height: 50px;
    padding: 12px 14px;
  }

  .mario-form-textarea { min-height: 70px; }
  .mario-form-label { font-size: 13px; }
  .field-error { font-size: 12px; }

  .att-card-box { min-height: 52px; padding: 10px 14px; }
  .att-card-txt { font-size: 14px; }
  .att-card-icon { font-size: 19px; }

  .btn-mario-submit { min-height: 54px; font-size: 16px; }
  .btn-mario-whatsapp { min-height: 52px; font-size: 15px; }
  .form-feedback { font-size: 13px; padding: 12px 14px; }

  .cast-img { width: 46px; height: 46px; }

  /* Con el teclado abierto se recorta lo decorativo para dejar sitio al campo */
  body.keyboard-open .rsvp-cast-header { display: none; }
  body.keyboard-open .os-status-bar    { display: none; }
  body.keyboard-open .mario-world-nav  { display: none; }
}

/* --------------------------------------------------------------------------
   Teléfono en HORIZONTAL: la misma experiencia, sólo más ancha y más baja.
   No se pide girar el dispositivo en ningún momento.
   -------------------------------------------------------------------------- */
@media (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  .os-status-bar {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: 5px;
  }

  .world-nav-btn {
    flex-direction: row;
    gap: 7px;
    min-height: 48px;
    font-size: 12px;
  }
  .nav-btn-thumb { width: 20px; height: 20px; }
  .mario-world-nav { padding-top: 6px; }

  .mario-hero-scene { height: clamp(96px, 30vh, 150px); }
  .celebrant-title { font-size: clamp(24px, 5.2vh, 34px); }

  /* Dos columnas: se aprovecha el ancho en vez de obligar a desplazarse */
  .mario-info-cards { grid-template-columns: 1fr 1fr; }
  .mario-actions-pair { grid-template-columns: 1fr 1fr; }
  .form-btn-group { flex-direction: row; }
  .form-btn-group > * { flex: 1; }
  .attendance-cards { flex-direction: row; }
  .attendance-cards .att-card { flex: 1; }
  .victory-button-stack { flex-direction: row; }
  .victory-button-stack > * { flex: 1; }
  .timeout-buttons { flex-direction: row; }
  .timeout-buttons > * { flex: 1; }

  .mario-touch-btn { min-height: 54px; flex: 0 0 26%; }
  .cast-group-art { gap: 16px; }
  .cast-img { width: 38px; height: 38px; }
}

/* --------------------------------------------------------------------------
   TELÉFONO EN VERTICAL — portada y arranque compuestos para el formato alto
   -------------------------------------------------------------------------- */
@media (max-width: 900px) and (orientation: portrait) {

  /* ----- Portada: Mario y una estrella acompañan a la mini-consola ----- */
  .console-viewport::before {
    content: "";
    position: fixed;
    left: 50%;
    top: calc(var(--app-h, 100svh) / 2 - var(--mini-h) / 2 - 8px);
    width: clamp(96px, 30vw, 132px);
    aspect-ratio: 0.82;
    transform: translate(calc(-1 * var(--mini-w) / 2 + 14px), -78%);
    background: url("assets/personajes/mario-salto.png") no-repeat center bottom / contain;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.5s var(--ease-game);
    animation: phoneCoverFloat 3.4s ease-in-out infinite;
    z-index: 2;
  }

  body:not(.power-off) .console-viewport::before {
    opacity: 0;
    animation: none;
  }

  @keyframes phoneCoverFloat {
    0%, 100% { transform: translate(calc(-1 * var(--mini-w) / 2 + 14px), -78%); }
    50%      { transform: translate(calc(-1 * var(--mini-w) / 2 + 14px), -90%); }
  }

  /* ----- Arranque a pantalla completa: Mario sale de la tubería sobre
           la línea de hierba, el nombre arriba y los controles abajo ----- */
  .view-booting {
    padding: 0;
    background: linear-gradient(
      180deg,
      var(--color-mario-sky) 0%,
      var(--color-mario-sky-light) 78%,
      #58a52b 78%,
      #3d7a1c 100%);
  }

  /* Suelo de ladrillos en la línea del horizonte */
  .view-booting::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 78%;
    height: 15px;
    background: repeating-linear-gradient(90deg, #b84418 0 16px, #8b2c0a 16px 18px);
    border-top: 3px solid #6fc02c;
    pointer-events: none;
    z-index: 1;
  }

  .booting-mario-stage {
    max-width: 100%;
    height: 100%;
    justify-content: flex-end;
    padding: 0 18px calc(var(--app-h, 100svh) * 0.22);
  }

  .boot-sky-clouds { top: 6%; height: 18%; }
  .mario-cloud { width: 82px; height: 32px; }
  .mario-cloud::before { width: 34px; height: 34px; top: -14px; }
  .mario-cloud::after { width: 26px; height: 26px; top: -8px; }
  .cloud-1 { top: 0; left: 8%; }
  .cloud-2 { top: 54px; right: 8%; }

  /* Nombre y nivel: protagonistas, en el tercio superior */
  .boot-intro-banner {
    position: absolute;
    top: 22%;
    left: 0;
    right: 0;
    margin: 0;
    z-index: 3;
  }

  .boot-intro-tag { font-size: 13px; padding: 5px 14px; }
  .boot-level-pill { font-size: 16px; padding: 5px 16px; }

  /* Escena de la tubería, apoyada sobre la hierba */
  .mario-pipe-scene {
    width: clamp(190px, 56vw, 250px);
    height: clamp(215px, 30vh, 280px);
    margin-bottom: 0;
    z-index: 2;
  }

  .pipe-question-block { width: 70px; height: 70px; }
  .boot-coin-burst { width: 40px; height: 40px; }
  .boot-coin-burst.active { transform: translateX(-50%) translateY(-70px) scale(1.2); }
  .pipe-mario-actor { width: 96px; height: 120px; bottom: 62px; }
  .pipe-base { width: 118px; height: 92px; }

  /* Carga y "saltar" anclados abajo, siempre alcanzables con el pulgar */
  .boot-progress-container {
    position: absolute;
    left: 50%;
    bottom: 76px;
    transform: translateX(-50%);
    width: min(64%, 260px);
    height: 9px;
    margin: 0;
    z-index: 4;
  }

  .btn-skip-intro {
    position: absolute;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 4;
  }
}

/* --------------------------------------------------------------------------
   TELÉFONO EN HORIZONTAL — el arranque se compacta, no se recorta
   -------------------------------------------------------------------------- */
@media (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  .view-booting { padding: 10px 16px; }

  .booting-mario-stage {
    max-width: 100%;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 22px;
    padding-bottom: 8px;
  }

  .mario-pipe-scene {
    width: clamp(130px, 22vw, 170px);
    height: clamp(150px, 62vh, 200px);
    margin-bottom: 0;
  }

  .boot-intro-banner {
    margin-bottom: 0;
    padding-bottom: 14px;
  }

  .boot-intro-name { font-size: clamp(24px, 6.4vh, 36px); }

  .boot-progress-container {
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    width: min(50%, 240px);
    margin: 0;
  }

  .btn-skip-intro {
    position: absolute;
    right: max(4px, env(safe-area-inset-right));
    bottom: 4px;
    min-height: 40px;
  }

  .boot-sky-clouds { height: 40px; }
}

/* --------------------------------------------------------------------------
   TELÉFONO — ajustes de acabado tras las pruebas en 360 / 390 / 430 px
   -------------------------------------------------------------------------- */
@media (max-width: 540px), (max-height: 500px) and (max-width: 1000px), (max-width: 900px) and (orientation: portrait) {

  /* Suelo de ladrillos del Reino Champiñón: da sentido a la franja verde
     que queda bajo el contenido y refuerza el mundo de Mario. */
  .mario-stage-viewport::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 24px;
    background:
      repeating-linear-gradient(90deg, #b84418 0 18px, #8b2c0a 18px 20px);
    border-top: 3px solid #6fc02c;
    pointer-events: none;
    z-index: 0;
  }

  .os-status-bar,
  .mario-stage-viewport,
  .mario-world-nav {
    position: relative;
    z-index: 1;
  }

  /* El suelo decorativo nunca debe taparse con el contenido de la escena */
  .mario-panel { z-index: 1; }

  /* "Omitir" era casi invisible sobre el cielo azul: ahora es un enlace
     legible y con área táctil clara, sin competir con el botón principal. */
  .btn-skip-mario-game,
  .btn-timeout-skip,
  .btn-mario-ghost {
    align-self: center;
    justify-content: center;
    width: auto;
    margin-top: 4px;
    padding: 10px 18px;
    border-radius: 22px;
    background: rgba(8, 14, 28, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* El texto de reglas del minijuego debe leerse sobre el cielo */
  .lobby-rules-card { background: rgba(8, 14, 28, 0.72); }
  .rules-icons-hint { font-size: 11px; }
}

/* En vertical el contenido respira: la llamada a la acción se ancla abajo,
   cerca del pulgar, sin dejar un hueco vacío enorme. */
@media (max-width: 900px) and (orientation: portrait) {
  .panel-bottom-cta { margin-top: 22px; }
  .panel-scroll-content { padding-bottom: 10px; }
  .mario-game-lobby { padding-bottom: 8px; }
}

/* --------------------------------------------------------------------------
   TELÉFONO EN HORIZONTAL — se aprovecha el ancho en vez de obligar a
   desplazarse por un contenido pensado para una columna alta.
   -------------------------------------------------------------------------- */
@media (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {

  /* Escena 1 — Castillo: arte a la izquierda, datos a la derecha */
  #panel-castillo .panel-scroll-content {
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
  }

  #panel-castillo .mario-hero-scene {
    flex: 0 0 32%;
    height: auto;
    min-height: 130px;
    margin-bottom: 0;
  }

  #panel-castillo .mario-hero-info {
    flex: 1 1 auto;
    min-width: 0;
    /* Nunca 'center': si el contenido crece se recortaría por arriba
       y quedaría fuera del alcance del desplazamiento. */
    justify-content: flex-start;
  }

  .mario-jumping-wrap { width: clamp(76px, 12vw, 108px); }

  .mario-speech-bubble { margin-bottom: 8px; }
  .speech-quote { font-size: 13.5px; }

  .mario-stats-strip { gap: 6px; }

  /* Escena 4 — RSVP en dos columnas: cabe casi entero sin desplazarse */
  .mario-rsvp-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    align-items: start;
  }

  .mario-rsvp-form .form-row:nth-of-type(4),
  .mario-rsvp-form .form-feedback,
  .mario-rsvp-form .form-btn-group {
    grid-column: 1 / -1;
  }

  .rsvp-cast-header {
    flex-direction: row;
    gap: 16px;
    text-align: left;
    padding: 8px 14px;
    margin-bottom: 8px;
  }

  .cast-group-art { margin-bottom: 0; }
  .cast-header-info { flex: 1 1 auto; }

  /* Escena 2 — Casa de Toad: cabecera horizontal y cuenta regresiva compacta */
  .toad-header-strip { align-items: center; }
  .mario-countdown-box { margin-bottom: 8px; }
  .cd-digit { font-size: clamp(20px, 5.6vh, 28px); }

  /* Escena 3 — Lobby del minijuego: arte y reglas en paralelo */
  .mario-game-lobby { gap: 8px; }
  .lobby-duel-art { gap: 14px; }
  .img-lobby-mario, .img-lobby-bowser { max-height: 88px; }
  .lobby-rules-card { padding: 8px 12px; }
  .rules-text { font-size: 12.5px; }

  /* Pase VIP de la victoria: más ancho, menos alto */
  .mario-player-pass-card { max-width: 520px; }
  .victory-big-star { width: 44px; height: 44px; }
}

/* --------------------------------------------------------------------------
   TELÉFONO EN HORIZONTAL — el escenario del minijuego es bajo: Mario y los
   objetos se reducen para que quede pista real por la que correr.
   -------------------------------------------------------------------------- */
@media (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  .mario-hud-row { padding: 4px 12px; margin-bottom: 4px; }
  .btn-quit-mario-game { width: 36px; height: 36px; }

  .mario-game-stage { min-height: 150px; }

  .stage-mario-player { width: 44px; height: 50px; bottom: 14px; }
  .stage-ground-blocks { height: 14px; }
  .stage-bowser-hazard { width: 40px; height: 40px; top: 4px; right: 8px; }

  .item-coin-img,
  .item-mushroom-img,
  .item-shell-img { width: 23px; height: 23px; }
  .item-star-img { width: 28px; height: 28px; }

  .mario-touch-bar { margin-top: 6px; gap: 8px; }
  .mario-touch-btn { min-height: 48px; padding: 5px; }
  .touch-btn-glyph { font-size: 17px; }
  .touch-btn-label { font-size: 10px; }

  /* Cuenta regresiva compacta: deja ver la fecha y la dirección sin desplazarse */
  .countdown-brick-banner { font-size: 10px; padding: 3px 8px; }
  .countdown-units-grid { gap: 4px; }
  .mario-cd-cell { padding: 4px 8px; }
  .toad-header-strip { margin-bottom: 8px; }
  .toad-guide-img { max-height: 58px; }
}

/* --------------------------------------------------------------------------
   Movimiento reducido: la experiencia no depende de ninguna animación.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .console-viewport::after,
  .console-viewport::before {
    animation: none !important;
  }

  .console-wrapper,
  .joycon,
  .bezel-top-bar,
  .bezel-bottom-bar,
  .console-screen-unit,
  .active-screen {
    transition-duration: 0.01ms !important;
  }
}
