/* ========================================================
   Color Quest: Kolorowa Przygoda - Arkusz stylów CSS
   Kolorowy, przyjazny dzieciom, bezpieczny i w pełni responsywny
   ======================================================== */

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

:root {
  --primary-color: #6366F1;
  --primary-hover: #4F46E5;
  --bg-gradient: linear-gradient(135deg, #F0FDF4 0%, #EFF6FF 50%, #FAF5FF 100%);
  --card-bg: #FFFFFF;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 10px;
  --box-shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --box-shadow-pop: 0 20px 30px -10px rgba(99, 102, 241, 0.25);
  --font-family: 'Fredoka', 'Nunito', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* App Wrapper */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header & Top Bar */
.top-header {
  background: #FFFFFF;
  border-radius: var(--border-radius-lg);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--box-shadow-card);
  flex-wrap: wrap;
  gap: 12px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-palette-icon {
  font-size: 2.2rem;
  animation: gentle-float 3s ease-in-out infinite;
}

.logo-text h1 {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(90deg, #EF4444, #F59E0B, #10B981, #3B82F6, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.logo-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stars-badge {
  background: #FEF3C7;
  color: #B45309;
  border: 2px solid #FCD34D;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.toggle-btn {
  background: #F1F5F9;
  border: 2px solid #CBD5E1;
  color: #475569;
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn.active {
  background: #EEF2FF;
  border-color: #818CF8;
  color: #4338CA;
}

.toggle-btn:hover {
  transform: translateY(-2px);
}

/* Mascot Section */
.mascot-area {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

.leon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 750px;
  width: 100%;
}

.leon-svg-container {
  width: 120px;
  height: 105px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.leon-svg-container:hover {
  transform: scale(1.08);
}

.leon-speech-bubble {
  background: #FFFFFF;
  border: 3px solid #E2E8F0;
  border-radius: 20px;
  padding: 12px 18px;
  position: relative;
  box-shadow: var(--box-shadow-card);
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.leon-speech-bubble::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 10px 12px 10px 0;
  border-style: solid;
  border-color: transparent #E2E8F0 transparent transparent;
}

.leon-speech-bubble::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 10px 8px 0;
  border-style: solid;
  border-color: transparent #FFFFFF transparent transparent;
}

#leon-bubble-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.bubble-sound-btn {
  background: #F3E8FF;
  border: 2px solid #D8B4FE;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, background-color 0.2s;
}

.bubble-sound-btn:hover {
  transform: scale(1.1);
  background: #E9D5FF;
}

/* Nav Tabs */
.main-navigation {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-tab-btn {
  background: #FFFFFF;
  border: 3px solid #E2E8F0;
  color: #475569;
  border-radius: 999px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.nav-tab-btn:hover {
  transform: translateY(-3px);
  border-color: #CBD5E1;
  color: #1E293B;
}

.nav-tab-btn.active {
  background: #4F46E5;
  border-color: #4338CA;
  color: #FFFFFF;
  box-shadow: var(--box-shadow-pop);
  transform: translateY(-2px);
}

/* Main Game Stage */
.game-stage-container {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--box-shadow-card);
  min-height: 480px;
  position: relative;
}

/* Sub-tabs inside modes */
.sub-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #F1F5F9;
  padding-bottom: 12px;
}

.sub-tab-btn {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--border-radius-md);
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-tab-btn.active {
  background: #EEF2FF;
  border-color: #6366F1;
  color: #4338CA;
}

/* ========================================================
   MODE 1: LEARN & PALETTE STYLES
   ======================================================== */

.learn-grid-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

.palette-sidebar {
  background: #F8FAFC;
  border-radius: var(--border-radius-md);
  padding: 16px;
  border: 2px solid #E2E8F0;
}

.palette-title {
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: #334155;
}

.color-chips-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.chip-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1E293B;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}

.chip-btn:hover {
  border-color: var(--chip-border);
  transform: translateX(4px);
}

.chip-btn.active {
  background: #EEF2FF;
  border-color: #6366F1;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
}

.chip-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.chip-label {
  flex: 1;
}

.chip-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.chip-star {
  font-size: 0.85rem;
}

/* Color Card Details */
.hero-color-card {
  border: 3px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.1);
}

.card-top-banner {
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.english-word {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.word-phonetics {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.phonetic-badge {
  background: rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.polish-trans {
  font-size: 1.05rem;
  opacity: 0.95;
}

.btn-listen-card {
  background: #FFFFFF;
  color: #1E293B;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-listen-card:hover {
  transform: scale(1.08);
}

.card-body {
  padding: 24px 28px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.examples-header h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1E293B;
}

.examples-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}

.example-tile {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--border-radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: inherit;
}

.example-tile:hover {
  border-color: var(--accent-color);
  transform: translateY(-4px);
  background: #FFFFFF;
  box-shadow: 0 8px 16px -4px rgba(0,0,0,0.1);
}

.tile-icon {
  font-size: 2.8rem;
  margin-bottom: 6px;
}

.tile-en {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1E293B;
  text-transform: capitalize;
}

.tile-pl {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tile-speaker {
  font-size: 0.8rem;
  margin-top: 4px;
  opacity: 0.6;
}

.fun-fact-box {
  border-radius: var(--border-radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px dashed rgba(0,0,0,0.1);
  font-size: 0.95rem;
  color: #1E293B;
}

.bulb-icon {
  font-size: 1.6rem;
}

/* ========================================================
   COLOR MIXER TAB STYLES
   ======================================================== */

.mixer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.mixer-intro h3 {
  font-size: 1.4rem;
  color: #1E293B;
  margin-bottom: 6px;
}

.mixer-intro p {
  color: var(--text-muted);
  max-width: 600px;
}

.mixer-workspace {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.tube-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.slot-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tube-display {
  width: 130px;
  height: 110px;
  border-radius: 20px;
  border: 3px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.tube-display.empty {
  border-style: dashed;
  color: #94A3B8;
  font-size: 0.9rem;
}

.plus-sign, .equals-sign {
  font-size: 2.2rem;
  font-weight: 900;
  color: #94A3B8;
}

.result-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.result-box {
  width: 150px;
  height: 110px;
  background: #F1F5F9;
  border-color: #6366F1;
  border-width: 4px;
}

.result-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-text strong {
  font-size: 1.3rem;
}

.result-text small {
  font-size: 0.85rem;
  opacity: 0.9;
}

.mixer-actions {
  display: flex;
  gap: 12px;
}

.btn-mix-go {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  padding: 12px 30px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
  transition: transform 0.15s ease;
}

.btn-mix-go:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-mix-go:not(:disabled):hover {
  transform: translateY(-3px) scale(1.02);
}

.btn-reset-mix {
  background: #F1F5F9;
  border: 2px solid #CBD5E1;
  color: #475569;
  border-radius: 999px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.tubes-palette {
  background: #F8FAFC;
  border-radius: var(--border-radius-md);
  padding: 18px;
  border: 2px solid #E2E8F0;
  width: 100%;
  max-width: 700px;
}

.tubes-palette h4 {
  margin-bottom: 12px;
  font-size: 1.05rem;
  color: #334155;
}

.tubes-list {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.paint-tube-btn {
  background: #FFFFFF;
  border: 3px solid var(--tube-color);
  border-radius: 14px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.paint-tube-btn:hover {
  transform: scale(1.08);
}

.tube-cap {
  font-size: 1.4rem;
}

.tube-name {
  font-size: 0.95rem;
  color: #1E293B;
}

.tube-pl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================================
   MODE 2: BALLOON POP STYLES
   ======================================================== */

.mode-balloons {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.hud-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hud-value {
  font-size: 1.3rem;
  font-weight: 900;
  color: #1E293B;
}

.target-badge {
  background: #3B82F6;
  color: #FFFFFF;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.target-audio-btn {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.btn-game-toggle {
  background: #4F46E5;
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-game-toggle:hover {
  background: #4338CA;
}

.canvas-wrapper {
  position: relative;
  background: linear-gradient(180deg, #BAE6FD 0%, #E0F2FE 70%, #FEF08A 100%);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  border: 4px solid #7DD3FC;
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.06);
}

#balloon-canvas {
  display: block;
  width: 100%;
  cursor: pointer;
}

.start-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay-modal {
  background: #FFFFFF;
  border-radius: var(--border-radius-lg);
  padding: 32px 36px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.modal-icon {
  font-size: 3.5rem;
}

.overlay-modal h2 {
  font-size: 1.6rem;
  color: #1E293B;
  font-weight: 800;
}

.overlay-modal p {
  color: var(--text-muted);
  font-size: 1rem;
}

.btn-primary-large {
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  padding: 14px 34px;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s ease;
}

.btn-primary-large:hover {
  transform: scale(1.05);
}

/* ========================================================
   MODE 3: MEMORY MATCH STYLES
   ======================================================== */

.mode-memory {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.memory-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.mem-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1E293B;
}

.styled-select {
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  border: 2px solid #CBD5E1;
  font-family: inherit;
  font-weight: 700;
  background: #FFFFFF;
  cursor: pointer;
}

.btn-secondary {
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  color: #334155;
  border-radius: 999px;
  padding: 8px 18px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}

.memory-grid {
  display: grid;
  gap: 14px;
  justify-content: center;
}

.grid-6 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-8 {
  grid-template-columns: repeat(4, 1fr);
}

.memory-card {
  perspective: 1000px;
  aspect-ratio: 1;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.45s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: var(--border-radius-md);
}

.memory-card.flipped .card-inner,
.memory-card.matched .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-back {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  border: 3px solid #4F46E5;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-back-icon {
  font-size: 2.2rem;
}

.card-back-pattern {
  font-size: 1.2rem;
  opacity: 0.8;
}

.card-front {
  transform: rotateY(180deg);
  background: #FFFFFF;
}

.card-front-word {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  gap: 4px;
}

.card-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  opacity: 0.75;
}

.card-en-word {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.1;
}

.card-pl-trans {
  font-size: 0.8rem;
  opacity: 0.9;
}

.card-sound-icon {
  font-size: 0.85rem;
  margin-top: 2px;
}

.card-front-visual {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border-radius: var(--border-radius-md);
  padding: 8px;
}

.card-vis-icon {
  font-size: 2.6rem;
}

.card-vis-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1E293B;
  margin-top: 2px;
}

.card-vis-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.memory-card.matched {
  cursor: default;
}

.memory-card.matched .card-inner {
  animation: match-pulse 0.6s ease;
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.6);
}

.memory-victory-modal {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: var(--border-radius-lg);
}

/* ========================================================
   MODE 4: QUIZ & SPELLING STYLES
   ======================================================== */

.quiz-score-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.quiz-score-badge {
  background: #FEF3C7;
  color: #92400E;
  border: 2px solid #FCD34D;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 1.05rem;
  font-weight: 800;
}

.quiz-card-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.quiz-prompt-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.quiz-prompt-header h3 {
  font-size: 1.35rem;
  color: #1E293B;
}

.btn-listen-huge {
  background: linear-gradient(135deg, #EC4899, #DB2777);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(219, 39, 119, 0.3);
  transition: transform 0.15s ease;
}

.btn-listen-huge:hover {
  transform: scale(1.06);
}

.quiz-hint-small {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quiz-pots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 800px;
}

.paint-pot-btn {
  background: #FFFFFF;
  border: 3px solid var(--pot-border);
  border-radius: var(--border-radius-lg);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 12px rgba(0,0,0,0.06);
}

.paint-pot-btn:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 20px rgba(0,0,0,0.12);
}

.pot-paint-splash {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.2), 0 4px 8px rgba(0,0,0,0.1);
  border: 3px solid rgba(255,255,255,0.8);
}

.pot-label-en {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1E293B;
}

.pot-label-pl {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quiz-feedback-box {
  border-radius: var(--border-radius-md);
  padding: 14px 24px;
  font-size: 1.1rem;
  font-weight: 700;
  animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 600px;
  width: 100%;
}

.success-msg {
  background: #DCFCE7;
  color: #15803D;
  border: 2px solid #86EFAC;
}

.error-msg {
  background: #FEF2F2;
  color: #B91C1C;
  border: 2px solid #FECACA;
}

/* Spelling Challenge styles */
.spelling-card-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}

.spelling-visual-prompt {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--border-radius-md);
  padding: 16px 24px;
}

.prompt-splash {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.prompt-icon {
  font-size: 2.2rem;
}

.prompt-meta {
  text-align: left;
}

.prompt-meta h3 {
  font-size: 1.2rem;
  color: #1E293B;
}

.btn-listen-inline {
  background: #EEF2FF;
  border: 2px solid #C7D2FE;
  color: #4338CA;
  border-radius: 999px;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}

.letter-slots-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.letter-slot {
  width: 52px;
  height: 60px;
  border: 3px dashed #CBD5E1;
  border-radius: 12px;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: #1E293B;
  transition: all 0.2s ease;
}

.letter-slot.filled {
  border: 3px solid #6366F1;
  background: #EEF2FF;
  color: #4338CA;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

.scrambled-letters-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.letter-tile-btn {
  width: 54px;
  height: 58px;
  background: #FFFFFF;
  border: 3px solid #CBD5E1;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1.8rem;
  font-weight: 900;
  color: #1E293B;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.08);
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.letter-tile-btn:not(:disabled):hover {
  transform: translateY(-4px) scale(1.05);
  border-color: #6366F1;
  color: #4338CA;
}

.letter-tile-btn.used {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  border-style: dashed;
}

.spelling-controls {
  display: flex;
  gap: 12px;
}

/* ========================================================
   MODE 5: BADGES & ALBUM STYLES
   ======================================================== */

.badges-header {
  text-align: center;
  margin-bottom: 24px;
}

.badges-header h2 {
  font-size: 1.6rem;
  color: #1E293B;
}

.badges-header p {
  color: var(--text-muted);
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.badge-card {
  background: #FFFFFF;
  border-radius: var(--border-radius-md);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  border: 3px solid #E2E8F0;
  transition: all 0.2s ease;
}

.badge-card.unlocked {
  border-color: #FBBF24;
  background: linear-gradient(180deg, #FFFFFF 60%, #FEF9C3 100%);
  box-shadow: 0 8px 16px -2px rgba(245, 158, 11, 0.2);
}

.badge-card.locked {
  opacity: 0.6;
  background: #F8FAFC;
}

.badge-icon-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.badge-icon {
  font-size: 3rem;
}

.badge-check {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.2rem;
}

.badge-lock {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.1rem;
}

.badge-title {
  font-size: 1.1rem;
  color: #1E293B;
}

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

.badge-status-tag {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 4px;
}

.badge-card.unlocked .badge-status-tag {
  background: #DCFCE7;
  color: #15803D;
}

.badge-card.locked .badge-status-tag {
  background: #E2E8F0;
  color: #64748B;
}

/* Badge Toast Notification */
.badge-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #FFFFFF;
  border: 3px solid #F59E0B;
  border-radius: var(--border-radius-md);
  padding: 14px 20px;
  box-shadow: 0 15px 30px -5px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1000;
}

.toast-badge-icon {
  font-size: 2.2rem;
}

.toast-badge-info strong {
  display: block;
  font-size: 0.95rem;
  color: #B45309;
}

.toast-badge-info span {
  font-size: 0.85rem;
  color: #1E293B;
}

/* ========================================================
   ANIMATIONS & KEYFRAMES
   ======================================================== */

@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pop-in {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.animate-pop {
  animation: pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-fade {
  animation: fade-in 0.25s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.leon-cheering {
  animation: mascot-cheer 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mascot-cheer {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-16px) rotate(-6deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
  75% { transform: translateY(-12px) rotate(-2deg); }
}

.pulse-tile {
  animation: pulse-tap 0.3s ease;
}

@keyframes pulse-tap {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.shake-wrong {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.splash-anim {
  animation: splash-grow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes splash-grow {
  0% { transform: scale(0.6); opacity: 0.4; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .top-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-tools {
    width: 100%;
    justify-content: space-between;
  }
  .learn-grid-layout {
    grid-template-columns: 1fr;
  }
  .palette-sidebar {
    max-height: 180px;
  }
  .color-chips-list {
    flex-direction: row;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 8px;
  }
  .chip-btn {
    white-space: nowrap;
  }
  .english-word {
    font-size: 2.2rem;
  }
  .leon-wrapper {
    flex-direction: column;
    text-align: center;
  }
  .leon-speech-bubble::before,
  .leon-speech-bubble::after {
    display: none;
  }
  .grid-6, .grid-8 {
    grid-template-columns: repeat(3, 1fr);
  }
}
