/* ========================================================
   Gra „Nadmuchaj balon” — Logonauts
   Styling: Rune Liquid Glass UI & Responsive Layout
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@500;700&family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  /* Logonauts Brand Palette */
  --brand-teal: #3b8796;
  --brand-teal-light: #52a6b7;
  --brand-teal-dark: #225661;
  --brand-coral: #e88d68;
  --brand-coral-light: #f5a98a;
  --brand-sand: #f5e4bd;
  --brand-cream: #fbf8f1;
  --brand-mint: #84beb6;

  /* Accent & Status Colors */
  --accent-gold: #fbc02d;
  --accent-gold-glow: rgba(251, 192, 45, 0.45);
  --success-green: #4caf50;
  --danger-red: #f44336;

  /* Typography */
  --font-main: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Comfortaa', cursive, var(--font-main);

  /* Liquid Glass / Wet Glass Variables (Rune Standard) */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-blur: blur(28px) saturate(210%) contrast(108%);
  --glass-shadow: 
    inset 0 1px 1.2px rgba(255, 255, 255, 0.85),
    inset 0 -1.5px 2px rgba(0, 0, 0, 0.08),
    0 16px 40px -10px rgba(35, 88, 100, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.05);

  --mouse-x: 50%;
  --mouse-y: 50%;
  --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  font-family: var(--font-main);
  background-color: var(--brand-cream);
  color: #2c3e50;
}

/* ========================================================
   Main Game Viewport & Scenery
   ======================================================== */
.game-viewport {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, #d8f1fc 0%, #ebf7fd 45%, #fcf7ec 85%, #dff2e1 100%);
}

/* Scenic Landscape Elements */
.scenery {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Sun with Gentle Warm Rays */
.sun {
  position: absolute;
  top: 30px;
  right: 50px;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, #fff7b2 20%, #ffd54f 60%, rgba(255, 213, 79, 0) 75%);
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(255, 224, 130, 0.8);
  animation: sunPulse 6s ease-in-out infinite alternate;
}

/* Animated Gentle Clouds */
.cloud {
  position: absolute;
  background: #ffffff;
  border-radius: 100px;
  filter: drop-shadow(0 8px 16px rgba(100, 150, 180, 0.1));
  opacity: 0.85;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
}
.cloud-1 {
  width: 170px;
  height: 50px;
  top: 75px;
  left: 10%;
  animation: floatCloud 45s linear infinite;
}
.cloud-1::before {
  width: 70px;
  height: 70px;
  top: -30px;
  left: 25px;
}
.cloud-1::after {
  width: 50px;
  height: 50px;
  top: -20px;
  left: 85px;
}

.cloud-2 {
  width: 220px;
  height: 60px;
  top: 130px;
  left: 55%;
  animation: floatCloud 65s linear infinite reverse;
}
.cloud-2::before {
  width: 90px;
  height: 90px;
  top: -40px;
  left: 35px;
}
.cloud-2::after {
  width: 65px;
  height: 65px;
  top: -25px;
  left: 115px;
}

/* Rolling Hills */
.hill-back {
  position: absolute;
  bottom: -40px;
  left: -10%;
  width: 120%;
  height: 28vh;
  background: linear-gradient(180deg, #99d8b7 0%, #76c29b 100%);
  border-radius: 60% 50% 0 0 / 100% 100% 0 0;
  opacity: 0.65;
}

.hill-front {
  position: absolute;
  bottom: -50px;
  left: -5%;
  width: 110%;
  height: 20vh;
  background: linear-gradient(180deg, #82cf9a 0%, #5bb877 100%);
  border-radius: 50% 60% 0 0 / 100% 100% 0 0;
  box-shadow: inset 0 6px 12px rgba(255, 255, 255, 0.3);
}

/* Flowers on the hills */
.flower {
  position: absolute;
  font-size: 20px;
  animation: flowerSway 3s ease-in-out infinite alternate;
  transform-origin: bottom center;
}
.flower-1 { bottom: 35px; left: 8%; animation-delay: 0.2s; }
.flower-2 { bottom: 50px; left: 24%; animation-delay: 0.7s; }
.flower-3 { bottom: 40px; right: 18%; animation-delay: 1.1s; }
.flower-4 { bottom: 30px; right: 35%; animation-delay: 0.4s; }

/* Interactive Particle Canvas (Breath streams & Confetti) */
#effectsCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* ========================================================
   Rune Liquid Glass Components: Header & Top HUD
   ======================================================== */
.top-hud {
  position: relative;
  z-index: 30;
  width: 100%;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Left Group (Brand & Session Counter) */
.hud-group-left, .hud-group-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Liquid Glass Pill Base */
.glass-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  color: var(--brand-teal-dark);
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.2s var(--spring-ease), box-shadow 0.2s ease, background 0.2s ease;
  will-change: transform;
}

/* Brand Badge */
.brand-badge {
  padding: 6px 14px 6px 8px;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  text-decoration: none;
}
.brand-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -6px rgba(59, 135, 150, 0.3);
}
.brand-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.brand-text-col {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--brand-teal);
}
.brand-tagline {
  font-size: 10px;
  font-weight: 600;
  color: var(--brand-coral);
}

/* Round Progress / Balloon Counter */
.round-pill {
  background: rgba(255, 255, 255, 0.75);
}
.balloon-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.balloon-dot {
  width: 14px;
  height: 18px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: #cbd5e1;
  transition: all 0.3s var(--spring-ease);
  position: relative;
}
.balloon-dot.completed {
  background: var(--brand-coral);
  box-shadow: 0 2px 6px rgba(232, 141, 104, 0.5);
  transform: scale(1.1);
}
.balloon-dot.current {
  background: var(--brand-teal);
  box-shadow: 0 0 10px var(--brand-teal-light);
  transform: scale(1.25);
  animation: pulseDot 1.5s infinite;
}

/* Microphone Status Pill */
.mic-pill {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.85);
}
.mic-pill:hover {
  transform: translateY(-2px);
}
.mic-icon-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff9800;
  box-shadow: 0 0 8px #ff9800;
}
.mic-pill.listening .mic-icon-dot {
  background: var(--success-green);
  box-shadow: 0 0 10px var(--success-green);
  animation: pulseMic 1.2s infinite;
}
.mic-pill.error .mic-icon-dot {
  background: var(--danger-red);
  box-shadow: 0 0 8px var(--danger-red);
}

/* Glass Action Buttons */
.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  color: var(--brand-teal-dark);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--spring-ease);
  outline: none;
}
.glass-btn:hover {
  transform: translateY(-2px) scale(1.03);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 28px -6px rgba(35, 88, 100, 0.25);
}
.glass-btn:active {
  transform: translateY(1px) scale(0.97);
}
.glass-btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  font-size: 16px;
}

/* Speech Prompt Banner (Placed below top-hud) */
.speech-prompt-container {
  position: relative;
  z-index: 25;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 16px 6px;
  pointer-events: auto;
}
.speech-prompt-pill {
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--brand-mint);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(59, 135, 150, 0.16);
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-teal-dark);
  text-align: center;
  backdrop-filter: blur(16px);
  animation: promptFloat 3s ease-in-out infinite alternate;
}

/* Phonation Gauge Ring / Sound Meter */
.phonation-progress-bar-wrap {
  width: 100%;
  max-width: 280px;
  height: 8px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 10px;
  margin: 6px auto 0;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
}
.phonation-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff9800 0%, #4caf50 70%, #00e676 100%);
  border-radius: 10px;
  transition: width 0.08s linear;
}

/* ========================================================
   Main Stage: Character & Balloon
   ======================================================== */
.game-stage {
  position: relative;
  z-index: 10;
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

.stage-layout {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 25px;
}

/* Boy Character Wrapper (Anchor on left) */
.boy-container {
  position: absolute;
  left: 6%;
  bottom: 4%;
  width: 280px;
  max-width: 28vw;
  height: 380px;
  max-height: 52vh;
  z-index: 12;
  transition: transform 0.3s ease;
}

.boy-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 15px 25px rgba(35, 88, 100, 0.2));
}

/* Balloon Playground (Massive open space center & right) */
.balloon-playground {
  position: absolute;
  left: 30%;
  right: 5%;
  top: 5%;
  bottom: 8%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 14;
}

.balloon-anchor {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.balloon-object {
  position: relative;
  transform-origin: center bottom;
  filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.18));
  cursor: pointer;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* ========================================================
   Bottom Control Dock (Rune Liquid Glass Standard)
   ======================================================== */
.bottom-dock {
  position: relative;
  z-index: 20;
  width: 100%;
  padding: 10px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.dock-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}

.btn-blow-touch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-teal-light) 100%);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(59, 135, 150, 0.4);
  transition: all 0.2s var(--spring-ease);
}
.btn-blow-touch:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 26px rgba(59, 135, 150, 0.5);
}
.btn-blow-touch:active, .btn-blow-touch.active {
  transform: translateY(2px) scale(0.96);
  background: linear-gradient(135deg, var(--brand-coral) 0%, #ff7043 100%);
  box-shadow: 0 4px 12px rgba(232, 141, 104, 0.4);
}

.vu-meter-bar {
  width: 80px;
  height: 10px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.vu-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-mint);
  border-radius: 10px;
  transition: width 0.05s ease-out;
}
.vu-fill.active {
  background: var(--brand-coral);
}

.license-dock-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.license-dock-badge.trial {
  background: rgba(255, 152, 0, 0.2);
  color: #d84315;
  border: 1px solid rgba(255, 152, 0, 0.4);
}
.license-dock-badge.licensed {
  background: rgba(76, 175, 80, 0.2);
  color: #2e7d32;
  border: 1px solid rgba(76, 175, 80, 0.4);
}

/* ========================================================
   Modals & Overlays
   ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 45, 55, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.glass-modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: 
    0 25px 60px -15px rgba(18, 50, 60, 0.35),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.9);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s var(--spring-ease);
}
.modal-overlay.active .glass-modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-teal-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-close-modal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-close-modal:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.1);
}

.setting-item {
  margin-bottom: 20px;
}
.setting-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #37474f;
  margin-bottom: 8px;
}
.setting-value {
  color: var(--brand-teal);
  font-weight: 800;
}
.setting-range {
  width: 100%;
  height: 8px;
  border-radius: 8px;
  background: #cfd8dc;
  outline: none;
  -webkit-appearance: none;
}
.setting-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-teal);
  box-shadow: 0 2px 8px rgba(59, 135, 150, 0.5);
  cursor: pointer;
  transition: transform 0.1s;
}

.setting-select, .setting-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #b0bec5;
  background: #ffffff;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  color: #37474f;
  outline: none;
}
.setting-select:focus, .setting-input:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px rgba(59, 135, 150, 0.2);
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.color-swatch-btn {
  height: 42px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: transform 0.2s var(--spring-ease);
}
.color-swatch-btn.selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px var(--brand-teal);
  transform: scale(1.08);
}

.victory-card {
  text-align: center;
  padding: 36px 30px;
}
.victory-trophy {
  font-size: 64px;
  margin-bottom: 15px;
  animation: bounceTrophy 1.2s infinite alternate;
}
.victory-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--brand-teal-dark);
  margin-bottom: 10px;
}
.victory-desc {
  font-size: 16px;
  color: #546e7a;
  margin-bottom: 24px;
  line-height: 1.4;
}
.victory-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 32px;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}
.btn-primary-modal {
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-teal-dark) 100%);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(35, 88, 100, 0.3);
  transition: all 0.2s var(--spring-ease);
}
.btn-primary-modal:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 24px rgba(35, 88, 100, 0.4);
}

/* ========================================================
   Responsive Breakpoints: Mobile, Tablet, Desktop
   ======================================================== */
@media (max-width: 860px) {
  .top-hud {
    padding: 10px 12px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .brand-tagline {
    display: none;
  }
  .boy-container {
    left: 2%;
    bottom: 4%;
    width: 220px;
    max-width: 36vw;
    height: 320px;
  }
  .balloon-playground {
    left: 32%;
    right: 2%;
    top: 5%;
    bottom: 8%;
  }
}

@media (max-width: 580px) {
  .glass-btn span:not(.btn-icon) {
    display: none;
  }
  .glass-btn {
    padding: 8px 10px;
  }
  .speech-prompt-pill {
    font-size: 13px;
    padding: 8px 14px;
  }
  .phonation-progress-bar-wrap {
    max-width: 200px;
  }
  .boy-container {
    left: 4%;
    bottom: 3%;
    width: 170px;
    max-width: 44vw;
    height: 260px;
  }
  .balloon-playground {
    left: 25%;
    right: 2%;
    top: 5%;
    bottom: 12%;
  }
}
