/* ========================================
   IC Summer Island · Estilos
   Paleta inspirada en el logo de IC Edusolutions
   ======================================== */

:root {
  --ic-blue:       #1FA9E4;
  --ic-turquoise:  #22C2C5;
  --ic-yellow:     #FFD66B;
  --ic-coral:      #FF8A75;
  --ic-cream:      #FFFBF2;
  --ic-deep:       #0E5C8A;
  --ic-bg-top:     #87CEEB;
  --ic-bg-mid:     #BFE9FF;
  --ic-bg-bottom:  #FFFBF2;
  --ic-text:       #1B2734;
  --ic-muted:      #5F7181;
  --shadow-soft:   0 6px 24px rgba(31,169,228,0.18);
  --shadow-card:   0 4px 14px rgba(14,92,138,0.12);
  --shadow-pop:    0 12px 30px rgba(31,169,228,0.32);
  --radius:        20px;
  --radius-sm:     12px;
  --header-h:      80px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Nunito', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ic-text);
  background: linear-gradient(180deg, #6FC3FF 0%, #BFE9FF 45%, #FFFBF2 75%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ========================================
   ESCENA VERANIEGA DE FONDO
   ======================================== */
.summer-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.sun-wrap {
  position: absolute;
  top: 60px;
  right: 70px;
  width: 160px;
  height: 160px;
  animation: sunSpin 60s linear infinite;
}
@keyframes sunSpin { to { transform: rotate(360deg); } }
.sun { width: 100%; height: 100%; filter: drop-shadow(0 0 30px rgba(255, 214, 107, 0.6)); }

.cloud {
  position: absolute;
  background: rgba(255,255,255,0.92);
  border-radius: 60px;
  box-shadow: 0 6px 20px rgba(14,92,138,0.08);
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud-a {
  top: 110px; left: -160px;
  width: 130px; height: 32px;
  animation: drift 50s linear infinite;
}
.cloud-a::before { top: -22px; left: 20px; width: 56px; height: 56px; }
.cloud-a::after  { top: -14px; left: 70px; width: 38px; height: 38px; }

.cloud-b {
  top: 220px; left: -180px;
  width: 100px; height: 26px;
  opacity: 0.85;
  animation: drift 70s linear infinite;
  animation-delay: -28s;
}
.cloud-b::before { top: -18px; left: 14px; width: 42px; height: 42px; }
.cloud-b::after  { top: -10px; left: 54px; width: 30px; height: 30px; }

.cloud-c {
  top: 70px; left: -130px;
  width: 90px; height: 24px;
  opacity: 0.75;
  animation: drift 60s linear infinite;
  animation-delay: -42s;
}
.cloud-c::before { top: -16px; left: 12px; width: 36px; height: 36px; }
.cloud-c::after  { top: -8px;  left: 50px; width: 26px; height: 26px; }

.cloud-d {
  top: 300px; left: -110px;
  width: 80px; height: 22px;
  opacity: 0.7;
  animation: drift 80s linear infinite;
  animation-delay: -55s;
}
.cloud-d::before { top: -14px; left: 10px; width: 30px; height: 30px; }
.cloud-d::after  { top: -6px;  left: 44px; width: 22px; height: 22px; }

@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100vw + 200px)); }
}

.birds {
  position: absolute;
  top: 180px;
  left: -100px;
  width: 100px; height: 30px;
  animation: drift 35s linear infinite;
  animation-delay: -10s;
}
.bird-1 { animation: flap 1.8s ease-in-out infinite; }
.bird-2 { animation: flap 1.8s ease-in-out infinite; animation-delay: -0.6s; }
.bird-3 { animation: flap 1.8s ease-in-out infinite; animation-delay: -1.2s; }
@keyframes flap {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.horizon {
  position: absolute;
  bottom: 100px;
  left: 0;
  width: 100%;
  height: 240px;
}
.horizon-svg { width: 100%; height: 100%; display: block; }

.foreground-waves {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  height: 120px;
}
.foreground-waves svg { width: 100%; height: 100%; display: block; }
.wave-1 { animation: waveSway 6s ease-in-out infinite; }
.wave-2 { animation: waveSway 7s ease-in-out infinite; animation-delay: -1s; }
.wave-3 { animation: waveSway 8s ease-in-out infinite; animation-delay: -2s; }
@keyframes waveSway {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-22px); }
}

.sand-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(180deg, #FFE8C4 0%, #F5C77A 100%);
  border-top: 2px solid rgba(255, 255, 255, 0.7);
}

/* ========================================
   HEADER
   ======================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 12px 24px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31,169,228,0.18);
  height: var(--header-h);
}
.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brand { display: none; }
.brand img { height: 44px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ic-deep);
  margin: 0;
}
.brand-sub { font-size: 13px; color: var(--ic-muted); margin: 0; }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.icon-btn {
  border: 1px solid rgba(31,169,228,0.18);
  background: white;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ic-deep);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform .12s ease, background .15s ease;
}
.icon-btn:hover { transform: translateY(-2px); background: #EAF8FF; }
.icon-btn span {
  background: var(--ic-yellow);
  color: var(--ic-deep);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 12px;
}

#ui-lang {
  border: 1px solid rgba(31,169,228,0.3);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  background: white;
  font-size: 14px;
  color: var(--ic-text);
}

/* ========================================
   MAIN / SCREENS
   ======================================== */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.screen { display: none; }
.screen.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

/* ========================================
   TOAST DE LOGROS
   ======================================== */
.achievement-toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-200px);
  z-index: 200;
  background: linear-gradient(135deg, #FFD66B 0%, #FF8A75 100%);
  color: white;
  border-radius: 16px;
  padding: 14px 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.25);
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 280px;
  max-width: 380px;
  opacity: 0;
  transition: transform .4s cubic-bezier(.22,1.3,.5,1), opacity .3s ease;
}
.achievement-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast-icon { font-size: 42px; }
.toast-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.9; font-weight: 700; }
.toast-name { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 18px; }
.toast-desc { font-size: 12px; opacity: 0.95; margin-top: 2px; }

/* ========================================
   MODAL DE LOGROS
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 92, 138, 0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .25s ease;
}
.modal-card {
  background: white;
  border-radius: 22px;
  padding: 28px;
  max-width: 760px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.modal-header h2 {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  color: var(--ic-deep);
  font-size: 26px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.ach-card {
  background: #F4FCFF;
  border: 2px solid #E2EEF6;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}
.ach-card.unlocked {
  background: linear-gradient(135deg, #EAF8FF, #F4FCFF);
  border-color: var(--ic-blue);
  box-shadow: 0 4px 14px rgba(31, 169, 228, 0.3);
}
.ach-card.locked { opacity: 0.65; filter: grayscale(0.4); }
.ach-icon { font-size: 38px; margin-bottom: 6px; }
.ach-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  color: var(--ic-deep);
  margin-bottom: 4px;
}
.ach-desc { font-size: 12px; color: var(--ic-muted); min-height: 32px; }
.ach-status { font-size: 11px; font-weight: 800; margin-top: 6px; color: var(--ic-deep); }
.ach-card.locked .ach-status { color: var(--ic-muted); }

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-weight: 700;
  font-size: 15px;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--ic-blue), var(--ic-turquoise));
  color: white;
  box-shadow: var(--shadow-soft);
}
.btn-secondary {
  background: white;
  color: var(--ic-deep);
  border: 1px solid rgba(31,169,228,0.3);
}
.btn-ghost { background: transparent; color: var(--ic-deep); }
.btn-ghost:hover { background: rgba(31,169,228,0.08); }
.btn-xl { padding: 16px 32px; font-size: 18px; border-radius: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ========================================
   WELCOME
   ======================================== */
.welcome-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}
.welcome-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-radius: 28px;
  padding: 40px;
  max-width: 760px;
  width: 100%;
  box-shadow: var(--shadow-pop);
  text-align: center;
}
.welcome-emoji { font-size: 48px; letter-spacing: 8px; margin-bottom: 8px; }
.welcome-card h1 {
  font-family: 'Fredoka', sans-serif;
  color: var(--ic-deep);
  margin: 12px 0 8px;
  font-size: 32px;
}
.welcome-text {
  color: var(--ic-muted);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.55;
}
.field { text-align: left; margin: 22px 0; }
.field label, .field-label {
  display: block;
  font-weight: 700;
  color: var(--ic-deep);
  margin-bottom: 10px;
}
.field input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #E2EEF6;
  border-radius: var(--radius-sm);
  font-size: 16px;
  outline: none;
  transition: border-color .15s ease;
}
.field input:focus { border-color: var(--ic-blue); }
.tier-grid, .lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 600px) {
  .tier-grid, .lang-grid { grid-template-columns: 1fr; }
}
.tier-card, .lang-card {
  background: white;
  border: 2px solid #E2EEF6;
  border-radius: var(--radius);
  padding: 18px 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ic-deep);
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.tier-card:hover, .lang-card:hover {
  border-color: var(--ic-blue);
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}
.tier-card.selected, .lang-card.selected {
  border-color: var(--ic-blue);
  background: linear-gradient(135deg, #EAF8FF, #F4FCFF);
  box-shadow: var(--shadow-soft);
}
.tier-icon, .lang-flag { font-size: 36px; margin-bottom: 6px; }
.tier-name { font-size: 17px; }
.tier-age { font-size: 13px; color: var(--ic-muted); font-weight: 600; margin-top: 2px; }
.lang-name { font-size: 16px; }
#start-btn {
  display: block;
  margin: 28px auto 0;
  min-width: 220px;
}
.welcome-footnote { margin-top: 24px; font-size: 13px; color: var(--ic-muted); }

/* ========================================
   MAP
   ======================================== */
.map-header {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  background: rgba(255,255,255,0.96);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.player-card { display: flex; gap: 12px; align-items: center; }
.player-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ic-blue), var(--ic-turquoise));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.player-name { font-weight: 800; color: var(--ic-deep); font-size: 17px; }
.player-meta { font-size: 13px; color: var(--ic-muted); }
.map-progress { margin-left: auto; min-width: 220px; flex: 1; max-width: 380px; }
.progress-label { font-size: 13px; font-weight: 700; color: var(--ic-deep); margin-bottom: 6px; }
.progress-bar {
  height: 12px;
  background: #E2EEF6;
  border-radius: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ic-turquoise), var(--ic-yellow));
  width: 0%;
  transition: width .5s ease;
  border-radius: 8px;
}
.progress-stats { font-size: 13px; color: var(--ic-muted); margin-top: 4px; }

.map-title {
  font-family: 'Fredoka', sans-serif;
  color: var(--ic-deep);
  font-size: 28px;
  margin: 12px 0 18px;
  text-shadow: 0 1px 0 white;
}
.island-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.island-card {
  background: white;
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.island-card:hover:not(.locked) {
  transform: translateY(-4px);
  box-shadow: var(--shadow-pop);
}
.island-card .island-bg {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  z-index: 0;
}
.island-card .island-content { position: relative; z-index: 1; }
.island-icon { font-size: 48px; margin: 6px 0 8px; }
.island-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 19px;
  color: var(--ic-deep);
  margin-bottom: 6px;
}
.island-blurb { font-size: 13px; color: var(--ic-muted); min-height: 32px; }
.island-status {
  margin-top: 10px;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 12px;
  display: inline-block;
}
.island-card.completed .island-status { background: #D6F4DD; color: #1E7A3E; }
.island-card.unlocked .island-status { background: #FFE7A1; color: #8A5A00; }
.island-card.locked { opacity: 0.55; cursor: not-allowed; }
.island-card.locked .island-status { background: #E2EEF6; color: var(--ic-muted); }
.island-stars { margin-top: 8px; font-size: 18px; letter-spacing: 2px; }

/* ========================================
   GAME
   ======================================== */
.game-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.96);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}
.game-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 22px;
  color: var(--ic-deep);
  flex: 1;
  text-align: center;
}
.streak-indicator {
  background: var(--ic-coral);
  color: white;
  padding: 8px 14px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,1.3,.5,1);
}
.streak-indicator.show {
  opacity: 1;
  transform: scale(1);
}
.streak-indicator span {
  background: white;
  color: var(--ic-coral);
  padding: 0 6px;
  border-radius: 6px;
  margin-left: 4px;
}
.game-container {
  background: rgba(255,255,255,0.96);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  min-height: 420px;
  position: relative;
  backdrop-filter: blur(8px);
}
.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.round-pill, .score-pill {
  background: var(--ic-blue);
  color: white;
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
}
.score-pill { background: var(--ic-yellow); color: var(--ic-deep); }
.game-area { padding: 20px 0; min-height: 220px; position: relative; }
.game-feedback {
  min-height: 36px;
  margin-top: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  position: relative;
}
.game-feedback.ok { color: #2DAA60; }
.game-feedback.ko { color: #E04F4F; }
.feedback-icon { font-size: 22px; margin-right: 4px; }

/* Confetti burst */
.confetti {
  position: absolute;
  pointer-events: none;
  font-size: 22px;
  animation: confettiBurst var(--d, 0.7s) ease-out forwards;
}
@keyframes confettiBurst {
  0%   { transform: translate(0, 0) scale(0.4); opacity: 1; }
  100% { transform: translate(var(--x, 0), 110px) scale(1); opacity: 0; }
}

/* Match */
.game-prompt { text-align: center; margin-bottom: 18px; }
.prompt-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 32px;
  color: var(--ic-deep);
}
.prompt-sub { color: var(--ic-muted); font-size: 14px; margin-top: 4px; }
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
}
@media (max-width: 560px) {
  .match-grid { grid-template-columns: repeat(2, 1fr); }
}
.match-card {
  background: #F4FCFF;
  border: 2px solid #E2EEF6;
  border-radius: 18px;
  padding: 18px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ic-deep);
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 92px;
  justify-content: center;
}
.match-card:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--ic-blue);
}
.match-card.is-correct {
  background: #D6F4DD;
  border-color: #2DAA60;
  color: #1E7A3E;
}
.match-card.is-wrong {
  background: #FBE1E1;
  border-color: #E04F4F;
  color: #B43232;
}
.match-card.is-shake { animation: shake .35s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.match-emoji { font-size: 38px; }

/* Listen */
.listen-prompt { text-align: center; margin-bottom: 18px; }
.listen-word {
  font-family: 'Fredoka', sans-serif;
  font-size: 28px;
  color: var(--ic-deep);
  margin-top: 8px;
  transition: opacity .4s ease;
}
.btn-listen {
  background: linear-gradient(135deg, var(--ic-coral), #FFB3A2);
  color: white;
  border-radius: 50%;
  width: 84px; height: 84px;
  font-size: 32px;
  border: none;
  box-shadow: var(--shadow-pop);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .12s ease;
}
.btn-listen:hover { transform: scale(1.05); }
.btn-listen.listening { animation: pulse 1.2s infinite; }
@keyframes pulse {
  0%,100% { transform: scale(1); box-shadow: var(--shadow-pop); }
  50%      { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(255,138,117,0.2); }
}

/* Chips */
.chips-pool, .chips-answer {
  background: #F4FCFF;
  border: 2px dashed #CFE6F4;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  transition: border-color .3s ease;
}
.chips-answer {
  border-style: solid;
  border-color: var(--ic-blue);
  background: white;
  margin-bottom: 14px;
  min-height: 70px;
}
.chip {
  background: white;
  border: 2px solid var(--ic-blue);
  color: var(--ic-deep);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s ease, background .15s ease;
  user-select: none;
}
.chip:hover { transform: translateY(-2px); background: #EAF8FF; }
.chip.pool-chip { background: #F4FCFF; }
.chip.answer-chip {
  background: var(--ic-blue);
  color: white;
  border-color: var(--ic-deep);
  position: relative;
  padding-right: 32px;
  cursor: pointer;
}
.chip.answer-chip::after {
  content: "×";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  opacity: 0.85;
  transition: opacity .15s, background .15s;
  pointer-events: none;
}
.chip.answer-chip:hover::after {
  opacity: 1;
  background: rgba(255,255,255,0.55);
}
.chip.answer-chip:hover {
  background: #1787BD;
  transform: translateY(-2px);
}
.chips-hint { text-align: center; color: var(--ic-muted); font-size: 13px; margin-top: 8px; }
.btn-clear {
  background: transparent;
  color: var(--ic-muted);
  border: 1px solid #E2EEF6;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.btn-clear:hover { background: #F4FCFF; color: var(--ic-deep); }

/* Type / Fillblank */
.type-area { text-align: center; }
.type-prompt {
  font-family: 'Fredoka', sans-serif;
  font-size: 28px;
  color: var(--ic-deep);
  margin-bottom: 14px;
}
.type-input {
  width: 100%;
  max-width: 420px;
  padding: 14px 16px;
  font-size: 18px;
  border: 2px solid #E2EEF6;
  border-radius: var(--radius-sm);
  text-align: center;
  outline: none;
  transition: border-color .15s ease;
}
.type-input:focus { border-color: var(--ic-blue); }
.type-input.correct { border-color: #2DAA60; background: #EAF8EB; }
.type-input.wrong { border-color: #E04F4F; background: #FBEDED; }
.type-actions { margin-top: 14px; display: flex; gap: 10px; justify-content: center; }

.fillblank-sentence {
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  color: var(--ic-deep);
  margin-bottom: 18px;
  line-height: 1.4;
}
.fillblank-gap {
  display: inline-block;
  min-width: 60px;
  border-bottom: 3px solid var(--ic-yellow);
  padding: 0 8px;
  font-weight: 800;
  text-align: center;
}
.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.option-card {
  background: #F4FCFF;
  border: 2px solid #E2EEF6;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  color: var(--ic-deep);
  transition: border-color .15s ease, transform .12s ease;
}
.option-card:hover:not(:disabled) {
  border-color: var(--ic-blue);
  transform: translateY(-2px);
}
.option-card.is-correct { background: #D6F4DD; border-color: #2DAA60; color: #1E7A3E; }
.option-card.is-wrong { background: #FBE1E1; border-color: #E04F4F; color: #B43232; }

/* Result */
.result-wrap {
  text-align: center;
  background: rgba(255,255,255,0.96);
  border-radius: 28px;
  padding: 36px 24px;
  box-shadow: var(--shadow-pop);
  max-width: 800px;
  margin: 0 auto;
  backdrop-filter: blur(8px);
}
.trophy {
  font-size: 80px;
  margin-bottom: 8px;
  animation: bounce 1.6s infinite;
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-10px); }
}
.result-wrap h2 {
  font-family: 'Fredoka', sans-serif;
  color: var(--ic-deep);
  font-size: 32px;
  margin: 8px 0;
}
.result-stats {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 18px 0 24px;
}
.stat-pill {
  background: var(--ic-yellow);
  color: var(--ic-deep);
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
}
.diploma-preview {
  margin: 20px auto;
  border: 2px solid var(--ic-blue);
  border-radius: 18px;
  overflow: hidden;
  max-width: 720px;
  box-shadow: var(--shadow-soft);
  background: white;
}
#diploma-canvas { width: 100%; height: auto; display: block; }
.result-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ========================================
   COOKIE BANNER
   ======================================== */
.cookie-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 100;
  display: none;
}
.cookie-banner.show { display: block; }
.cookie-card {
  max-width: 640px;
  margin: 0 auto;
  background: white;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
}
.cookie-card h3 { margin: 0 0 8px; color: var(--ic-deep); font-family: 'Fredoka', sans-serif; font-size: 20px; }
.cookie-card p { margin: 0 0 12px; color: var(--ic-muted); font-size: 14px; line-height: 1.5; }
.cookie-prefs {
  background: #F4FCFF;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cookie-prefs label { font-size: 14px; color: var(--ic-text); font-weight: 600; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ========================================
   FOOTER
   ======================================== */
.app-footer {
  background: linear-gradient(180deg, #0E5C8A 0%, #073D5E 100%);
  color: rgba(255,255,255,0.85);
  padding: 36px 20px 22px;
  margin-top: 60px;
  position: relative;
  z-index: 1;
}
.footer-cols {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
}
@media (max-width: 600px) {
  .footer-cols { grid-template-columns: 1fr; }
}
.footer-logo {
  height: 44px;
  background: white;
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.app-footer p { font-size: 13px; line-height: 1.6; }
.app-footer strong { display: block; margin-bottom: 8px; color: white; }
.app-footer a { display: block; color: rgba(255,255,255,0.85); text-decoration: none; font-size: 13px; padding: 3px 0; }
.app-footer a:hover { color: var(--ic-yellow); }
.footer-bottom {
  max-width: 1200px;
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 12px;
  text-align: center;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 1024px) {
  .brand { display: flex; align-items: center; }
}

@media (max-width: 720px) {
  :root { --header-h: 64px; }
  .brand-block { gap: 0; }
  .brand-title { font-size: 16px; }
  .brand-sub { display: none; }
  .header-actions { gap: 4px; }
  .app-header { padding: 10px 14px; }
  .app-main { padding: 18px 12px 60px; overflow-x: hidden; }
  body { overflow-x: hidden; }
  .icon-btn { padding: 5px 8px; font-size: 13px; }
  .icon-btn span { font-size: 11px; }
  .welcome-card { padding: 26px 18px; border-radius: 22px; }
  .welcome-emoji { font-size: 36px; letter-spacing: 4px; }
  .welcome-card h1 { font-size: 24px; }
  .sun-wrap { width: 100px; height: 100px; top: 36px; right: 22px; }
  .horizon { height: 160px; bottom: 70px; }
  .foreground-waves { height: 80px; bottom: 20px; }
  .sand-bottom { height: 22px; }
  .game-header { padding: 10px 14px; }
  .game-title { font-size: 17px; }
  .prompt-text { font-size: 24px; }
  .match-emoji { font-size: 30px; }
  .match-card { min-height: 76px; padding: 14px 6px; }
  .achievement-toast { min-width: 240px; padding: 12px 16px; }
  .toast-icon { font-size: 32px; }
}
