/* SENAFÓNICA Custom Design System - Duolingo-style Andean Gamification */

[x-cloak] {
  display: none !important;
}

:root {
  --sena-green: #39A900;
  --sena-dark-green: #297A00;
  --sena-light-green: #5CD61E;
  --gold-amber: #F59E0B;
  --gold-dark: #D97706;
  --heart-red: #EF4444;
  --heart-dark: #B91C1C;
  --andean-bg: #0B111A;
  --andean-card: #121A26;
  --andean-card-border: rgba(255, 255, 255, 0.08);
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
}

/* Base Body & Reset for Senafonica */
.senafonica-shell {
  min-height: 100vh;
  background: radial-gradient(
    circle at 50% 0%,
    color-mix(in srgb, var(--instrument-accent, #1A2738) 18%, #1A2738) 0%,
    #0B111A 60%,
    #070B11 100%
  );
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.scene-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background-position: center;
  background-size: cover;
  transition: opacity 500ms ease;
}

.scene-background-visible {
  opacity: 1;
}

.instrument-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.9);
}

.instrument-card:hover,
.instrument-card-active {
  border-color: var(--instrument-accent, var(--sena-green));
  background: color-mix(in srgb, var(--instrument-accent, var(--sena-green)) 18%, #0f172a);
  box-shadow: 0 0 0 1px var(--instrument-accent, var(--sena-green)), 0 8px 22px rgba(0, 0, 0, 0.25);
}

/* Touch Accessibility standard (min 48x48px) */
button, .touch-target {
  min-height: 48px;
  min-width: 48px;
  touch-action: manipulation;
}

/* Duolingo-Style 3D Buttons */
.btn-duo-primary {
  background-color: var(--sena-green);
  box-shadow: 0 4px 0 var(--sena-dark-green);
  border-radius: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.08s ease;
  color: #FFFFFF;
}
.btn-duo-primary:hover:not(:disabled) {
  background-color: var(--sena-light-green);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 var(--sena-dark-green);
}
.btn-duo-primary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--sena-dark-green);
}
.btn-duo-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}

.btn-duo-amber {
  background-color: var(--gold-amber);
  box-shadow: 0 4px 0 var(--gold-dark);
  border-radius: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.08s ease;
  color: #111827;
}
.btn-duo-amber:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 var(--gold-dark);
}
.btn-duo-amber:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--gold-dark);
}

.btn-duo-secondary {
  background-color: #1E293B;
  box-shadow: 0 4px 0 #0F172A;
  border-radius: 16px;
  font-weight: 700;
  color: #F8FAFC;
  transition: all 0.08s ease;
}
.btn-duo-secondary:hover:not(:disabled) {
  background-color: #334155;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #0F172A;
}
.btn-duo-secondary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 #0F172A;
}

/* Option Card in Session */
.option-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 0 rgba(15, 23, 42, 0.8);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-weight: 700;
  font-size: 1.05rem;
  color: #FFFFFF;
  transition: all 0.12s ease;
  cursor: pointer;
  width: 100%;
}
.option-btn:hover:not(:disabled) {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(15, 23, 42, 0.9);
}
.option-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 rgba(15, 23, 42, 0.9);
}
.option-btn.is-correct {
  background: rgba(57, 169, 0, 0.25) !important;
  border-color: #39A900 !important;
  box-shadow: 0 4px 0 #297A00 !important;
  color: #4ADE80 !important;
}
.option-btn.is-wrong {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #EF4444 !important;
  box-shadow: 0 4px 0 #B91C1C !important;
  color: #F87171 !important;
}

/* Mascot Stage & Character Animations */
.mascot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-top: 4px;
  margin-bottom: 12px;
}
.mascot-avatar-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}
.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mascot Moods */
.mascot-idle {
  animation: mascotBreathe 3.5s ease-in-out infinite;
}
.mascot-celebrating {
  animation: mascotJump 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate;
}
.mascot-sad {
  animation: mascotShake 0.6s ease-in-out;
}
.mascot-listening {
  animation: mascotTilt 2.0s ease-in-out infinite;
}

@keyframes mascotBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.02); }
}
@keyframes mascotJump {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-16px) scale(1.06); }
}
@keyframes mascotShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px) rotate(-3deg); }
  40%, 80% { transform: translateX(8px) rotate(3deg); }
}
@keyframes mascotTilt {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(4deg) scale(1.03); }
}

/* Speech Bubble */
.speech-bubble {
  position: relative;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #FFFFFF;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  margin-top: 8px;
  animation: bubblePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.speech-bubble::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent rgba(30, 41, 59, 0.95) transparent;
}
@keyframes bubblePop {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* Sound Wave Ripple Effect when playing audio */
.sound-ripple {
  position: relative;
}
.sound-ripple::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--sena-green);
  opacity: 0;
  animation: rippleGlow 1.4s ease-out infinite;
}
@keyframes rippleGlow {
  0% { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Duolingo Winding Path Elements */
.path-node {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 4px solid #FFFFFF;
  margin: 0 auto;
}
.path-node.unlocked {
  background: radial-gradient(circle, #4ADE80 0%, #39A900 100%);
  box-shadow: 0 8px 0 #297A00, 0 16px 25px rgba(57, 169, 0, 0.4);
  color: #FFFFFF;
}
.path-node.unlocked:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 0 #297A00, 0 20px 30px rgba(57, 169, 0, 0.5);
}
.path-node.unlocked:active {
  transform: translateY(8px);
  box-shadow: 0 0 0 #297A00;
}
.path-node.locked {
  background: #334155;
  border-color: #475569;
  box-shadow: 0 6px 0 #1E293B;
  color: #94A3B8;
  cursor: not-allowed;
  opacity: 0.75;
}
.path-node.boss {
  width: 88px;
  height: 88px;
  background: radial-gradient(circle, #FBBF24 0%, #D97706 100%);
  box-shadow: 0 8px 0 #B45309, 0 16px 30px rgba(245, 158, 11, 0.5);
  border-color: #FEF3C7;
  color: #111827;
}

/* Star Rating Pills */
.stars-badge {
  position: absolute;
  bottom: -10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.75rem;
  display: flex;
  gap: 2px;
}

/* Pulse Heart on Life Loss */
.heart-pulse {
  animation: heartLostAnim 0.5s ease-in-out;
}
@keyframes heartLostAnim {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35) rotate(-10deg); color: #DC2626; }
}

/* Canvas confetti positioning */
#senafonica-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Onboarding & Legal Screen */
.onboarding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: radial-gradient(circle at 50% 20%, #1A2738 0%, #070B11 90%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.onboarding-card {
  background: rgba(18, 26, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  max-width: 480px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
}

/* Station Cultural Modal Card */
.station-preview-card {
  background: rgba(18, 26, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  animation: modalBounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalBounce {
  0% { transform: scale(0.9) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Mascot Transparent Isolated Grid */
.mascot-center-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  pointer-events: none;
}
.mascot-center-grid > * {
  pointer-events: auto;
}
