/* ============================================================
   ¡Hola Español! — warm, friendly Latin-American theme.
   Mobile-first, rounded cards, zero image assets.
   ============================================================ */

:root {
  --sun:     #f5a623;
  --orange:  #e8543f;
  --pink:    #e0457b;
  --teal:    #1fa39a;
  --green:   #3fb56b;
  --cream:   #fff7ec;
  --ink:     #2a2320;
  --muted:   #8a7f76;
  --card:    #ffffff;
  --line:    #efe3d3;
  --shadow:  0 6px 0 rgba(0,0,0,0.08), 0 10px 24px rgba(0,0,0,0.10);
  --ok:      #3fb56b;
  --bad:     #e8543f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px; line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }

.screen { max-width: 640px; margin: 0 auto; padding: 18px; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font: inherit; font-weight: 800; color: #fff;
  background: var(--orange); border: none; border-radius: 16px;
  padding: 15px 20px; min-height: 52px; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15); transition: transform .05s ease, filter .1s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.15); }
.btn--full { display: block; width: 100%; }
.btn--big { font-size: 1.15rem; padding: 18px; }
.btn--teal { background: var(--teal); }
.btn--pink { background: var(--pink); }
.btn--ghost { background: #fff; color: var(--ink); box-shadow: 0 0 0 2px var(--line) inset, 0 4px 0 rgba(0,0,0,0.06); }
.btn:disabled { opacity: .5; }

/* ============================================================
   Lock / PIN
   ============================================================ */
#screen-lock {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--sun) 0%, var(--orange) 55%, var(--pink) 100%);
}
.lock-box {
  width: 100%; max-width: 340px; background: var(--card); border-radius: 24px;
  padding: 24px; text-align: center; box-shadow: var(--shadow);
}
.logo { font-size: 1.6rem; font-weight: 900; color: var(--orange); }
.lock-hello { font-size: 1.3rem; font-weight: 800; margin: 14px 0 2px; }
.lock-sub { color: var(--muted); margin: 0 0 14px; font-size: .95rem; }
.pin-display { height: 40px; display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--orange); }
.pin-dot--empty { background: var(--line); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-key {
  font: inherit; font-size: 1.4rem; font-weight: 800; color: var(--ink);
  background: var(--cream); border: none; border-radius: 14px; padding: 16px 0; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.pin-key:active { transform: translateY(2px); }
.pin-key--ok { background: var(--green); color: #fff; }
.pin-key--wide { background: var(--line); }
.pin-error { color: var(--bad); min-height: 1.2em; margin: 12px 0 0; font-weight: 700; }

/* ---------- Profile picker (step 1 of the lock screen) ---------- */
.profile-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 4px; }
.profile-btn {
  font: inherit; font-size: 1.2rem; font-weight: 800; color: var(--ink);
  background: var(--cream); border: none; border-radius: 16px; padding: 16px; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.profile-btn:active { transform: translateY(2px); }
.profile-btn--last { box-shadow: inset 0 0 0 3px var(--sun), 0 3px 0 rgba(0,0,0,0.08); }
.lock-switch {
  margin-top: 14px; background: none; border: none; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 700; color: var(--muted);
}
.lock-switch:active { transform: translateY(1px); }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--orange); color: #fff;
}
.topbar-home { font-size: 1.3rem; background: none; border: none; cursor: pointer; }
.topbar-name { font-weight: 800; flex: 1; }
.topbar-stats { display: flex; gap: 8px; }
.stat { font-weight: 800; font-size: .9rem; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.22); }

/* ============================================================
   Home
   ============================================================ */
.home-greeting { font-size: 1.6rem; font-weight: 900; margin: 18px 0 2px; }
.home-sub { color: var(--muted); margin: 0 0 18px; }
.home-streak {
  display: flex; gap: 14px; margin: 0 0 18px;
}
.home-streak .chip {
  flex: 1; background: var(--card); border-radius: 18px; padding: 14px; text-align: center;
  box-shadow: var(--shadow);
}
.home-streak .chip b { display: block; font-size: 1.6rem; }
.home-streak .chip span { color: var(--muted); font-size: .85rem; }

.due-note { text-align: center; color: var(--muted); margin: 0 0 10px; font-weight: 700; }

.section-title { font-size: 1.05rem; font-weight: 800; margin: 22px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.deck-list { display: grid; gap: 12px; }
.deck-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card); border: none; border-radius: 18px; padding: 16px; cursor: pointer;
  box-shadow: var(--shadow);
}
.deck-card:active { transform: translateY(2px); }
.deck-ico { font-size: 2rem; width: 46px; text-align: center; flex: none; }
.deck-meta { flex: 1; min-width: 0; }
.deck-name { font-weight: 800; }
.deck-name .de { color: var(--muted); font-weight: 600; font-size: .9rem; }
.deck-note { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.deck-bar { height: 8px; background: var(--line); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.deck-bar-fill { height: 100%; background: var(--green); border-radius: 999px; }
.deck-badge { font-size: 1.3rem; flex: none; }

/* ============================================================
   Study session
   ============================================================ */
.study-progress { height: 8px; background: var(--line); border-radius: 999px; margin: 6px 0 20px; overflow: hidden; }
.study-progress-fill { height: 100%; background: var(--teal); transition: width .3s ease; }

.card {
  background: var(--card); border-radius: 24px; padding: 26px 20px; text-align: center;
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-kind { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: .8rem; margin-bottom: 14px; }
.card-prompt { font-size: 1.1rem; color: var(--muted); margin-bottom: 6px; }
.card-de { font-size: 1.7rem; font-weight: 800; }
.card-es { font-size: 2rem; font-weight: 900; color: var(--orange); margin: 6px 0; }
.card-example { color: var(--muted); font-style: italic; margin-top: 10px; }
.card-example .es { color: var(--teal); font-style: normal; font-weight: 700; }
.card-note { color: var(--pink); font-size: .9rem; font-weight: 700; margin-top: 8px; }

.speak-hint { color: var(--muted); font-weight: 700; margin: 8px 0 0; }

.btn-listen {
  font: inherit; font-weight: 800; font-size: 1.05rem; color: var(--teal);
  background: #eafaf8; border: none; border-radius: 999px; padding: 12px 20px; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,0.06); margin: 6px 0;
}
.btn-listen:active { transform: translateY(2px); }
.audio-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.rate-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.rate {
  font: inherit; font-weight: 800; color: #fff; border: none; border-radius: 16px; padding: 14px 6px; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}
.rate:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.15); }
.rate small { display: block; font-weight: 600; font-size: .72rem; opacity: .9; }
.rate--again { background: var(--bad); }
.rate--ok    { background: var(--sun); color: var(--ink); }
.rate--easy  { background: var(--green); }

/* multiple choice (listen) */
.choice-list { display: grid; gap: 10px; }
.choice {
  width: 100%; text-align: left; font: inherit; font-weight: 700; color: var(--ink);
  background: var(--card); border: none; border-radius: 16px; padding: 15px; cursor: pointer;
  box-shadow: 0 0 0 2px var(--line) inset, 0 4px 0 rgba(0,0,0,0.06);
}
.choice:active { transform: translateY(2px); }
.choice.is-correct { box-shadow: 0 0 0 3px var(--ok) inset; background: #eafaf0; }
.choice.is-wrong { box-shadow: 0 0 0 3px var(--bad) inset; background: #fdeeea; }
.choice.is-locked { pointer-events: none; }

.study-actions { display: flex; gap: 10px; margin-top: 8px; }
.study-actions .btn { flex: 1; }

/* session summary */
.summary { text-align: center; padding: 24px 12px; }
.summary .big { font-size: 3.2rem; }
.summary h2 { margin: 8px 0; }
.summary .reward { color: var(--green); font-weight: 900; font-size: 1.25rem; margin: 8px 0 20px; }

/* ============================================================
   Toast
   ============================================================ */
.toast-layer {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 10px; right: 10px;
  z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 800;
  box-shadow: var(--shadow); transform: translateY(-16px); opacity: 0; transition: all .3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
