/* ==========================================================================
   CSS GLOBAL Y DE DISEÑO PREMIUM PARA MAGAGOTCHI
   ========================================================================== */

:root {
  /* Paleta de Colores Moderna (Neón & Pastel) */
  --bg-day: linear-gradient(135deg, #a8c0ff 0%, #f12711 100%);
  --bg-night: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  
  --device-color: #ff9a9e;
  --device-border: #fecfef;
  --screen-bg: #e6f7ff;
  --screen-border: #b3e0ff;
  
  --primary: #ff758f;
  --primary-dark: #ff4d6d;
  --secondary: #4cc9f0;
  --success: #4ad66d;
  --warning: #ffb703;
  --danger: #ff4d6d;
  
  --text-dark: #2b2b2b;
  --text-light: #ffffff;

  /* Colores de las barras */
  --hunger-bar: #ff9f1c;
  --thirst-bar: #4cc9f0;
  --happy-bar: #ffb703;
  --hygiene-bar: #7209b7;
  --energy-bar: #f72585;
  --bladder-bar: #b5e2fa;
  
  /* Sombras y Glassmorphism */
  --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.25), 0 5px 15px rgba(0, 0, 0, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Reset Básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', 'Outfit', sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-day);
  transition: background 3s ease;
}

body.night {
  background: var(--bg-night);
}

/* Barra Superior de Navegación Oficial Akemi */
.akemi-top-bar {
  width: 100%;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50px;
  padding: 10px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
  z-index: 10;
}

body.night .akemi-top-bar {
  background: rgba(18, 24, 38, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.akemi-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.akemi-brand-link:hover {
  transform: translateX(-3px);
}

.back-arrow {
  width: 32px;
  height: 32px;
  background: #ff4757;
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 3px 10px rgba(255, 71, 87, 0.35);
}

.brand-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: #ff4757;
  letter-spacing: 0.5px;
}

.brand-sub {
  color: #2b2b2b;
}

body.night .brand-sub {
  color: #ffffff;
}

.akemi-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-official {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 71, 87, 0.12);
  color: #ff4757;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 71, 87, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body.night .badge-official {
  background: rgba(255, 71, 87, 0.25);
  color: #ff758f;
}

.btn-akemi-home {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  background: #ff4757;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 50px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.35);
  display: inline-flex;
  align-items: center;
}

.btn-akemi-home:hover {
  background: #e03646;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 71, 87, 0.45);
}

/* Contenedor Principal con Fondo Dinámico */
.app-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1rem;
  z-index: 1;
}

/* Fondo Dinámico de Cielo (Día / Noche) */
.sky-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  z-index: -2;
  pointer-events: none;
}

body.night .stars {
  opacity: 0.8;
}

body.night .sun-moon {
  transform: translate(calc(50vw - 40px), 80px) rotate(180deg);
  background: #f0f3f4;
  box-shadow: 0 0 30px #f0f3f4;
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background-image: radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px);
  background-size: 100px 100px;
  background-position: 0 0;
  opacity: 0;
  transition: opacity 3s ease;
}

.sun-moon {
  position: absolute;
  top: 40px;
  left: 10%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #fdb813;
  box-shadow: 0 0 45px #ffb703;
  transition: transform 3s cubic-bezier(0.4, 0, 0.2, 1), background 3s ease, box-shadow 3s ease;
  z-index: -1;
}

.clouds {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, rgba(255,255,255,0.7) 10%, transparent 60%);
  background-size: 200px 100px;
  opacity: 0.4;
  animation: floatClouds 120s linear infinite;
}

@keyframes floatClouds {
  0% { background-position: 0 20%; }
  100% { background-position: 2000px 20%; }
}

/* Header */
.main-header {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.main-header h1 {
  font-size: 3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: -1px;
}

.main-header h1 span.badge {
  font-size: 0.8rem;
  font-family: 'Press Start 2P', monospace;
  background-color: var(--warning);
  color: var(--text-dark);
  padding: 4px 8px;
  border-radius: 6px;
  text-shadow: none;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  animation: pulseBadge 1.5s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.main-header .subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Layout del juego */
.game-wrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 3rem;
  width: 100%;
  max-width: 900px;
  flex-grow: 1;
}

/* PANTALLA PRINCIPAL (CONTENEDOR DE LA MASCOTA) */
.tamagotchi-device {
  position: relative;
  width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow), var(--shadow-premium);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  user-select: none;
  transition: transform 0.2s ease;
}

.tamagotchi-device:hover {
  transform: translateY(-3px);
}

/* El lazo superior del llavero */
.device-loop {
  display: none;
}

/* Pantalla Contenedora del Tamagotchi */
.device-screen-outer {
  width: 100%;
  flex-grow: 1;
  min-height: 350px;
  background-color: #292929;
  border: 8px solid #1a1a1a;
  border-radius: 18px;
  padding: 8px;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.9);
  margin-top: 0;
  display: flex;
  flex-direction: column;
}

.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--screen-bg);
  border: 4px solid var(--screen-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Encabezado interno de la pantalla */
.screen-header {
  height: 26px;
  border-bottom: 2px solid var(--screen-border);
  background-color: rgba(255, 255, 255, 0.5);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px;
  z-index: 10;
}

.screen-header .stat-indicator {
  display: flex;
  align-items: center;
  gap: 2px;
}

.screen-header .stat-indicator .icon {
  font-size: 10px;
}

/* Capa de luces para dormir */
.screen-light-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 10, 30, 0.9);
  opacity: 0;
  pointer-events: none;
  z-index: 9;
  transition: opacity 1.5s ease;
}

.screen-light-overlay.lights-off {
  opacity: 1;
}

/* Área de animación del pet */
.pet-viewport {
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Burbujas de Ducha */
.bubbles-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
}

.bubble {
  position: absolute;
  bottom: -20px;
  background-color: rgba(173, 216, 230, 0.7);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.6);
  animation: floatBubble 2s ease-out forwards;
}

@keyframes floatBubble {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  20% { opacity: 0.8; }
  100% { transform: translateY(-160px) scale(1.2); opacity: 0; }
}

/* Efectos de medicina o corazones */
.effects-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
}

.effect-particle {
  position: absolute;
  font-size: 16px;
  animation: floatParticle 1.5s ease-out forwards;
}

@keyframes floatParticle {
  0% { transform: translate(0, 40px) scale(0.5); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(var(--x, 0), -60px) scale(1.3); opacity: 0; }
}

/* Comida Overlay */
.food-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
}

.falling-food {
  position: absolute;
  font-size: 24px;
  top: 0;
  left: calc(50% - 12px);
  animation: fallAndEat 1.2s ease-in forwards;
}

@keyframes fallAndEat {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  80% { transform: translateY(80px) rotate(360deg); opacity: 1; }
  100% { transform: translateY(80px) scale(0); opacity: 0; }
}

/* Cacas en pantalla */
.poop-container {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.poop {
  position: absolute;
  font-size: 24px;
  animation: bounceMini 2s infinite ease-in-out alternate;
}

@keyframes bounceMini {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

/* Zzz Flotantes */
.zzz-container {
  position: absolute;
  top: 30%;
  right: 15%;
  width: 60px;
  height: 60px;
  pointer-events: none;
  z-index: 8;
}

.zzz {
  position: absolute;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #7209b7;
  text-shadow: 0 0 4px #b5179e;
  animation: zzzFloat 2.5s infinite linear;
}

@keyframes zzzFloat {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translate(20px, -40px) scale(1.2); opacity: 0; }
}

/* Minijuego Overlay */
.minigame-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(230, 247, 255, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.3s ease;
}

.minigame-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.minigame-box {
  text-align: center;
  padding: 10px;
}

.minigame-box h3 {
  font-size: 13px;
  font-family: 'Press Start 2P', monospace;
  margin-bottom: 10px;
}

.minigame-box p {
  font-size: 10px;
  margin-bottom: 12px;
}

.minigame-choices {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.game-btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  background-color: var(--secondary);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  font-size: 12px;
  transition: transform 0.1s ease;
}

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

.minigame-result {
  margin-top: 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--primary-dark);
  min-height: 12px;
}

/* Burbuja de estado rápido */
.pet-status-bubble {
  position: absolute;
  top: 15%;
  background-color: #ffffff;
  border: 2.5px solid var(--text-dark);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 800;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pet-status-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #ffffff transparent;
  display: block;
  width: 0;
}

.pet-status-bubble::before {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px 7px 0;
  border-style: solid;
  border-color: var(--text-dark) transparent;
  display: block;
  width: 0;
  z-index: -1;
}

.pet-status-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}

/* MASCOTA Y ANIMACIONES */
.pet-wrapper {
  width: 140px;
  height: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
}

#petSvg {
  width: 100%;
  height: 100%;
}

/* Animación Idle (Bote natural) */
.anim-idle {
  animation: petFloat 1.8s infinite ease-in-out;
}

@keyframes petFloat {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px) scaleY(0.95); }
  100% { transform: translateY(0); }
}

/* Animación Comer (Escala de masticar) */
.anim-eat {
  animation: petEat 0.3s infinite alternate ease-in-out;
}

@keyframes petEat {
  0% { transform: scale(1); }
  100% { transform: scale(1.1, 0.9) translateY(4px); }
}

/* Animación Jugar (Giros y saltos) */
.anim-play {
  animation: petPlay 1s infinite linear;
}

@keyframes petPlay {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(-15deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-15px) rotate(15deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

/* Animación de Baño (Tiembla y rebota) */
.anim-clean {
  animation: petClean 0.6s infinite ease-in-out alternate;
}

@keyframes petClean {
  0% { transform: rotate(-5deg) translateY(0); }
  100% { transform: rotate(5deg) translateY(-6px); }
}

/* Animación Enfermo (Temblor rápido) */
.anim-sick {
  animation: petSick 0.15s infinite linear;
}

@keyframes petSick {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(0px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(2px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(2px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* Avisos Críticos (Footer de pantalla) */
.screen-footer-alerts {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.4);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
}

.screen-alert {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--danger);
  animation: flashAlert 0.8s infinite alternate;
}

.screen-alert.hidden {
  display: none !important;
}

@keyframes flashAlert {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}



/* PANEL DE CONTROL LATERAL (GLASSMORPHISM) */
.control-panel {
  width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--glass-shadow), var(--shadow-premium);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-dark);
  border-bottom: 2px solid rgba(0,0,0,0.06);
  padding-bottom: 10px;
}

/* Grid de Botones de Cuidado */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  background: #ffffff;
  color: var(--text-dark);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  background: var(--screen-bg);
}

.action-btn:active {
  transform: scale(0.97);
}

.action-btn .btn-icon {
  font-size: 1.4rem;
}

/* Dropdown de Comida e Hidratación */
.dropdown-action {
  position: relative;
}

.dropdown-action .action-btn {
  width: 100%;
}

.dropdown-menu {
  position: absolute;
  top: 105%;
  left: 0;
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
  animation: dropShow 0.2s forwards;
}

.dropdown-menu.show {
  display: flex;
}

@keyframes dropShow {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.menu-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: var(--text-dark);
  transition: background 0.15s;
}

.menu-item:hover {
  background-color: var(--screen-bg);
  color: var(--primary-dark);
}

/* Panel de estadísticas */
.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: rgba(255,255,255,0.4);
  padding: 18px;
  border-radius: 18px;
}

.stats-panel h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.stat-bar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
}

.progress-bar-outer {
  width: 100%;
  height: 12px;
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  border-radius: 6px;
  width: 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;
}

/* Estilos de Color para Barras */
.hunger-bar { background-color: var(--hunger-bar); }
.thirst-bar { background-color: var(--thirst-bar); }
.happy-bar { background-color: var(--happy-bar); }
.hygiene-bar { background-color: var(--hygiene-bar); }
.energy-bar { background-color: var(--energy-bar); }
.bladder-bar { background-color: var(--bladder-bar); }

/* Panel de Footer */
.panel-footer {
  display: flex;
  gap: 10px;
}

.footer-btn {
  flex-grow: 1;
  padding: 10px;
  border-radius: 12px;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.footer-btn:active {
  transform: scale(0.98);
}

.reset-btn {
  background-color: var(--danger);
  color: white;
}

.mute-btn {
  background-color: #dfdfdf;
  color: var(--text-dark);
}

/* MODAL DE GAME OVER */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  padding: 2.5rem;
  border-radius: 28px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  0% { transform: scale(0.85) translateY(30px); }
  100% { transform: scale(1) translateY(0); }
}

.modal-content h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--danger);
  margin-bottom: 12px;
}

.modal-content p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #555555;
  margin-bottom: 24px;
}

.grave-illustration {
  font-size: 80px;
  margin-bottom: 24px;
  animation: sway 2s infinite ease-in-out;
}

@keyframes sway {
  0% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
  100% { transform: rotate(-5deg); }
}

.primary-modal-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  color: white;
  padding: 14px 28px;
  border-radius: 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 117, 143, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.primary-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 117, 143, 0.5);
}

/* FOOTER GENERAL DE LA PÁGINA */
.game-footer {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  opacity: 0.95;
  margin-top: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-tip {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 8px 18px;
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.akemi-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0;
}

.footer-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  opacity: 0.9;
  font-size: 0.85rem;
  transition: opacity 0.2s, color 0.2s;
}

.footer-link:hover {
  color: #ff4d6d;
  opacity: 1;
}

.brand-sub-link {
  color: #ff758f;
  font-weight: 700;
  text-decoration: none;
}

.brand-sub-link:hover {
  text-decoration: underline;
}

.sep {
  opacity: 0.4;
}

/* RESPONSIVE DESIGN (Celulares y Tablets) */
@media (max-width: 768px) {
  .game-wrapper {
    flex-direction: column;
    align-items: center; /* Centrar ambas tarjetas en móvil */
    gap: 2rem;
  }
  
  .tamagotchi-device {
    width: 100%;
    max-width: 420px;
    padding: 16px;
  }
  
  .device-screen-outer {
    width: 100%;
    height: 280px;
  }
  
  .control-panel {
    width: 100%;
    max-width: 420px; /* Ancho unificado con el visor */
    padding: 18px;
  }
  
  .actions-grid {
    gap: 8px;
  }
  
  .action-btn {
    padding: 10px 12px;
    font-size: 0.95rem;
  }
  
  .main-header h1 {
    font-size: 2.2rem;
  }

  .akemi-top-bar {
    padding: 8px 14px;
    border-radius: 25px;
    margin-bottom: 1rem;
  }

  .brand-text {
    font-size: 1rem;
  }

  .back-arrow {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .btn-akemi-home {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .badge-official {
    display: none;
  }
}
