/* ==================================================================
   Glória PT — Aurora Glossy + Glassmorphism design system
   Mobile-first (min 360px), content capped at ~520px on desktop.
   Palette is taken verbatim from the brief (glossy circles).
   ================================================================== */

/* ---- Local fonts (zero CDN) ---------------------------------- */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;        /* variable font */
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/playfair-latin.woff2') format('woff2');
  font-weight: 400 900;        /* variable font */
  font-display: swap;
  font-style: normal;
}

/* ---- Design tokens ------------------------------------------- */
:root {
  /* Paleta principal (fundos) */
  --base-soft:   #F6B1C3;
  --base-light:  #FCDCE2;
  --base-glow:   #FFF9E6;
  /* Destaque / CTAs */
  --pink-strong: #F41B8C;
  --pink-mid:    #FA65A7;
  /* Secundária */
  --lilac:       #D2C4E3;
  --pearl:       #EBE6ED;
  --holo:        #C5D1F7;

  --ink:        #3a2733;   /* texto principal (rosa-escuro neutro) */
  --ink-soft:   #6d5763;   /* texto secundário */
  --ok:         #1faa6c;
  --err:        #e23d6d;

  --glass-bg:     rgba(255, 255, 255, 0.40);
  --glass-bg-2:   rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.60);
  --glass-blur:   12px;
  --radius:       28px;
  --radius-sm:    16px;
  --shadow:       0 10px 30px rgba(196, 60, 120, 0.18);
  --shadow-strong:0 14px 38px rgba(244, 27, 140, 0.28);

  --maxw: 520px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: var(--base-light);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ---- Aurora líquida: 3 radial-gradients sobrepostos ---------- */
body::before {
  content: '';
  position: fixed;
  inset: -20% -20% -20% -20%;
  z-index: -2;
  background:
    radial-gradient(50% 55% at 18% 22%, var(--base-soft) 0%, rgba(246,177,195,0) 60%),
    radial-gradient(48% 50% at 85% 18%, var(--holo) 0%, rgba(197,209,247,0) 62%),
    radial-gradient(60% 60% at 75% 88%, var(--base-glow) 0%, rgba(255,249,230,0) 60%),
    radial-gradient(55% 55% at 10% 90%, var(--lilac) 0%, rgba(210,196,227,0) 60%),
    linear-gradient(135deg, var(--base-light), var(--base-glow));
  will-change: transform;
  animation: auroraDrift 24s ease-in-out infinite alternate;
}
/* segunda camada glossy de luz */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    /* base-light band at the very top so the sticky header blends into the
       page instead of cutting hard into the aurora mesh below it */
    linear-gradient(to bottom, var(--base-light) 64px, rgba(252, 220, 226, 0) 168px),
    radial-gradient(40% 30% at 70% 10%, rgba(255,255,255,0.45), transparent 70%),
    radial-gradient(35% 25% at 20% 5%, rgba(255,255,255,0.30), transparent 70%);
}
@keyframes auroraDrift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(-2%, 1.5%, 0) scale(1.05); }
  100% { transform: translate3d(2%, -1%, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* ---- App shell ---------------------------------------------- */
.app {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---- Header -------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 12px;
  background: linear-gradient(to bottom, var(--base-light) 40%, rgba(252,220,226,0));
}
.header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.header .logo {
  width: 65px; height: 65px;
  border-radius: 32.5px;
  object-fit: cover;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.header .title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  font-size: 22px;
  line-height: 1;
  letter-spacing: .2px;
  background: linear-gradient(120deg, var(--pink-strong), var(--pink-mid));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.header .subtitle { font-size: 11px; color: var(--ink-soft); margin-top: 3px; }

/* language selector */
.lang {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.lang button {
  border: 0;
  background: transparent;
  font-size: 16px;
  width: 30px; height: 30px;
  border-radius: 999px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .15s, background .15s;
  font-family: inherit;
}
.lang button.active { background: #fff; box-shadow: var(--shadow); transform: scale(1.05); }
.lang button:active { transform: scale(.92); }
.lang.collapsed button:not(.active) { display: none; }   /* only current flag shown until opened */

/* streak flame chip in the header (shows when streak > 0 and enabled) */
.streak-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 9px 16px 9px 12px; border-radius: 999px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--pink-strong); font-weight: 700; font-size: 14px; cursor: pointer;
  font-family: inherit; flex-shrink: 0;
}
.streak-chip svg { width: 18px; height: 18px; filter: drop-shadow(0 2px 4px rgba(244,27,140,.35)); }
.streak-chip:active { transform: scale(.93); }

/* mini speaker inside conjugation tables */
.tts-mini {
  border: 0; background: transparent; color: var(--pink-mid); cursor: pointer;
  width: 26px; height: 26px; border-radius: 8px; padding: 0;
  display: inline-grid; place-items: center; vertical-align: middle; flex: 0 0 auto;
}
.tts-mini:hover { background: rgba(244,27,140,.08); color: var(--pink-strong); }
.tts-mini:disabled { opacity: .35; cursor: not-allowed; }
.tts-mini svg { width: 16px; height: 16px; }
.conj-table td.val { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---- Glass surfaces ----------------------------------------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---- Streak / queue banners --------------------------------- */
.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.banner.lock {
  background: linear-gradient(120deg, rgba(244,27,140,.14), rgba(250,101,167,.14));
  border: 1px solid rgba(244,27,140,.35);
}
.banner .banner-txt { flex: 1; font-size: 13px; line-height: 1.35; }
.banner .banner-txt b { color: var(--pink-strong); }

/* ---- Module grid (cards iguais) ----------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.mod-card {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 16px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.mod-card:hover, .mod-card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-strong); outline: none; }
.mod-card:active { transform: translateY(-1px) scale(.99); }
.mod-card .ic {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.55);
  color: var(--pink-strong);
}
.mod-card .ic svg { width: 26px; height: 26px; }
.mod-card h3 { font-size: 16px; font-weight: 700; line-height: 1.15; }
.mod-card p { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
/* accent tints per module */
.mod-card.tint-geo   { background: linear-gradient(150deg, rgba(210,196,227,.55), var(--glass-bg)); }
.mod-card.tint-horas { background: linear-gradient(150deg, rgba(197,232,247,.6), var(--glass-bg)); }
.horas-period { font-size: 15px; color: var(--ink-soft); margin-top: 4px; font-style: italic; text-align: center; }
.mod-card.tint-num  { background: linear-gradient(150deg, rgba(246,177,195,.5), var(--glass-bg)); }
.mod-card.tint-color{ background: linear-gradient(150deg, rgba(197,209,247,.5), var(--glass-bg)); }
.mod-card.tint-voc  { background: linear-gradient(150deg, rgba(250,101,167,.4), var(--glass-bg)); }
.mod-card.locked { opacity: .5; pointer-events: none; filter: grayscale(.3); }
.mod-card .lockbadge { position: absolute; top: 12px; right: 12px; color: var(--pink-strong); }
/* the Vocabulary card is the hero: it spans two rows */
.mod-card.span2 { grid-row: span 2; aspect-ratio: auto; }
.mod-card.span2 .ic { width: 54px; height: 54px; }
.mod-card.span2 .ic svg { width: 30px; height: 30px; }
.mod-card.span2 h3 { font-size: 19px; }

/* ---- View / panel ------------------------------------------- */
.view { animation: fadeIn .3s ease; padding-top: 4px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px);} to {opacity:1; transform:none;} }
.view-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 16px; }
.view-head h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px; font-weight: 700; flex: 1;
}
.back-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 999px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  cursor: pointer; color: var(--ink); flex-shrink: 0;
}
.back-btn:active { transform: scale(.92); }

.panel { padding: 20px; border-radius: var(--radius); margin-bottom: 14px; }

/* ---- Buttons ------------------------------------------------- */
.btn {
  font-family: inherit;
  font-size: 15px; font-weight: 600;
  border: 0; cursor: pointer;
  padding: 14px 18px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(120deg, var(--pink-strong), var(--pink-mid));
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, filter .15s;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-strong); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { filter: grayscale(.6) opacity(.6); cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.ghost {
  background: var(--glass-bg-2); color: var(--ink);
  border: 1px solid var(--glass-border); box-shadow: none;
}
.btn.ghost:hover { box-shadow: var(--shadow); }
.btn.ok  { background: linear-gradient(120deg, #16b378, #41d39a); }
.btn.ok-light { background: linear-gradient(120deg, #e6f8ee, #f2fcf6); color: #15623d; border: 1px solid rgba(31,170,108,.28); box-shadow: 0 6px 18px rgba(31,170,108,.12); }
.btn.again { background: var(--glass-bg-2); color: var(--ink); border: 1px solid var(--glass-border); box-shadow: none; }
.btn.again:hover { box-shadow: var(--shadow); }
.btn.sm  { padding: 9px 14px; font-size: 13px; border-radius: 12px; }

/* "give up the cards" — small, low-emphasis escape hatch */
.give-up { display: block; margin: 30px auto 0; background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 12px; color: var(--ink-soft); text-decoration: underline;
  text-underline-offset: 3px; opacity: .5; transition: opacity .15s, color .15s; }
.give-up:hover { color: var(--err); opacity: 1; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* keep inline SVG icons inside controls at a sane size */
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn.sm svg { width: 15px; height: 15px; }
.back-btn svg { width: 22px; height: 22px; }
.tts-btn svg { width: 22px; height: 22px; }
.banner svg { width: 24px; height: 24px; flex: 0 0 auto; }
.lockbadge svg { width: 18px; height: 18px; }
.search-row .tts-btn { pointer-events: none; }
.search-row .tts-btn svg { width: 20px; height: 20px; }

/* icon-only round speaker button */
.tts-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-2);
  border-radius: 999px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  cursor: pointer; color: var(--pink-strong);
  transition: transform .15s;
  flex-shrink: 0;
}
.tts-btn:active { transform: scale(.9); }
.tts-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---- Forms --------------------------------------------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
input[type="text"], input[type="number"], select {
  width: 100%;
  font-family: inherit; font-size: 16px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-2);
  color: var(--ink);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--pink-mid); box-shadow: 0 0 0 3px rgba(250,101,167,.22); }
.inline-num { width: 84px; display: inline-block; padding: 7px 10px; font-size: 14px; }

/* radio + checkbox chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-2);
  cursor: pointer; font-size: 14px; user-select: none;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.chip.on { background: linear-gradient(120deg, var(--pink-strong), var(--pink-mid)); color: #fff; border-color: transparent; box-shadow: var(--shadow); }
.chip input { display: none; }
.chip.row { display: flex; width: 100%; justify-content: flex-start; }
.chip .topx { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin-left: auto; }
.chip .topx input { display: inline-block; width: 64px; padding: 4px 6px; font-size: 12px; border-radius: 8px; }

/* "click to activate" indicator in the add-cards modal */
.add-hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--pink-strong); margin: 2px 0 10px; font-weight: 600; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink-strong); flex: 0 0 auto; box-shadow: 0 0 0 0 rgba(244,27,140,.5); animation: pulse 1.7s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(244,27,140,.5); } 70% { box-shadow: 0 0 0 9px rgba(244,27,140,0); } 100% { box-shadow: 0 0 0 0 rgba(244,27,140,0); } }
/* small description under each review button */
.btn-desc { font-size: 10.5px; color: var(--ink-soft); text-align: center; line-height: 1.25; margin-top: 5px; padding: 0 2px; }
.btn-col { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.btn-col .btn { width: 100%; }

/* ---- Modal --------------------------------------------------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(120, 60, 90, .28);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 18px;
  animation: fadeIn .2s ease;
}
.modal {
  width: 100%; max-width: 440px;
  max-height: 88vh; overflow-y: auto;
  padding: 22px;
  background: var(--glass-bg-2);
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
  animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: scale(.92); opacity: 0;} to {transform: none; opacity: 1;} }
.modal h3 { font-family: 'Playfair Display', serif; font-size: 21px; margin-bottom: 6px; }
.modal .modal-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; }

/* ---- Flashcard ---------------------------------------------- */
.flash {
  text-align: center;
  padding: 26px 20px;
  border-radius: var(--radius);
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.flash .word {
  font-family: 'Playfair Display', serif;
  font-size: 38px; font-weight: 700; line-height: 1.1;
  margin: 6px 0 4px;
  word-break: break-word;
}
.flash .pos-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: var(--pink-strong); background: rgba(244,27,140,.1);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 14px;
}
.flash .example {
  font-size: 15px; color: var(--ink-soft); font-style: italic;
  line-height: 1.5; margin: 12px 4px 4px;
}
.flash .def { font-size: 14px; color: var(--ink); margin-top: 4px; line-height: 1.45; }
.flash .tts-row { display: flex; justify-content: center; margin-top: 6px; }
.flash-direct {
  font-size: 22px; font-weight: 700; color: var(--pink-strong);
  margin: 6px 0 2px;
}
.flash-def-section {
  position: relative; text-align: left; margin-top: 12px;
}
.def-lang-toggle {
  position: absolute; top: 0; right: 0;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  color: var(--ink-soft); background: rgba(0,0,0,.07);
  border: none; border-radius: 6px; padding: 2px 8px; cursor: pointer;
}
.example-wrap { text-align: left; margin: 10px 0 0; }
.example-actions { margin-top: 3px; }
.trans-toggle {
  font-size: 11px; color: var(--ink-soft); background: none;
  border: none; padding: 0 2px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.trans-toggle.active { color: var(--pink-strong); }
.example-ko {
  font-size: 13px; color: var(--ink-soft); font-style: normal;
  margin-top: 4px; padding-left: 8px;
  border-left: 2px solid var(--pink-strong);
  line-height: 1.5;
}
.progress-pill { text-align: center; font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }

/* ---- Quiz answer options ------------------------------------ */
.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.opt {
  padding: 16px 12px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-2);
  cursor: pointer; font-size: 16px; font-weight: 600;
  text-align: center; transition: transform .15s, box-shadow .15s, background .15s, color .15s, border-color .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 60px;
}
.opt:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.opt.correct { background: linear-gradient(120deg,#16b378,#41d39a); color:#fff; border-color: transparent; }
.opt.wrong   { background: linear-gradient(120deg,#e23d6d,#f06a8e); color:#fff; border-color: transparent; }
.opt:disabled { cursor: default; }
.swatch { width: 100%; height: 56px; border-radius: 14px; border: 2px solid rgba(255,255,255,.7); box-shadow: var(--shadow); }
.swatch-wrap { cursor: pointer; }
.swatch-wrap:hover .swatch { transform: translateY(-2px); }
.swatch-wrap.correct .swatch { outline: 3px solid var(--ok); outline-offset: 2px; }
.swatch-wrap.wrong .swatch { outline: 3px solid var(--err); outline-offset: 2px; }

.prompt-big {
  font-family: 'Playfair Display', serif;
  font-size: 30px; font-weight: 700; text-align: center;
  margin: 8px 0 4px; word-break: break-word;
}
.prompt-sub { text-align:center; color: var(--ink-soft); font-size: 13px; margin-bottom: 10px; }
.feedback { text-align: center; font-weight: 600; margin: 14px 0 6px; min-height: 22px; }
.feedback.ok { color: var(--ok); }
.feedback.err { color: var(--err); }
.write-hint { text-align: center; margin-bottom: 10px; }
.write-hint-trans {
  font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; line-height: 1.45;
}
.write-hint-dict {
  font-size: 12px; color: var(--pink-strong); background: none; border: none;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px; padding: 0;
}
.rule-box {
  font-size: 13px; color: var(--ink-soft); line-height: 1.5;
  background: rgba(255,255,255,.45); border-radius: 14px; padding: 12px 14px; margin-top: 12px;
  border: 1px solid var(--glass-border);
}

/* ---- Stats --------------------------------------------------- */
.streak-card { display: flex; align-items: center; gap: 16px; padding: 20px; margin-bottom: 16px; }
.streak-flame { color: var(--pink-strong); filter: drop-shadow(0 4px 8px rgba(244,27,140,.35)); }
.streak-flame svg { width: 54px; height: 54px; }
.streak-num { font-family:'Playfair Display',serif; font-size: 40px; font-weight: 700; line-height: 1; }
.streak-lbl { font-size: 13px; color: var(--ink-soft); }
.stat-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.stat-tabs::-webkit-scrollbar { display: none; }
.stat-tab {
  white-space: nowrap; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--glass-border); background: var(--glass-bg-2);
  font-size: 13px; cursor: pointer; flex-shrink: 0; font-family: inherit; color: var(--ink);
}
.stat-tab.on { background: linear-gradient(120deg,var(--pink-strong),var(--pink-mid)); color:#fff; border-color: transparent; }
.stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 16px; }
.stat-box { padding: 16px; border-radius: var(--radius-sm); text-align: center; background: var(--glass-bg-2); border: 1px solid var(--glass-border); }
.stat-box .v { font-family:'Playfair Display',serif; font-size: 28px; font-weight: 700; }
.stat-box .v.ok { color: var(--ok); } .stat-box .v.err { color: var(--err); }
.stat-box .l { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.chart-wrap { padding: 16px; border-radius: var(--radius); margin-bottom: 16px; }
.chart-wrap h4 { font-size: 14px; margin-bottom: 12px; color: var(--ink-soft); font-weight: 600; }
canvas { width: 100%; display: block; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-radius: var(--radius-sm); }
.switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { display: none; }
.switch .track { position:absolute; inset:0; border-radius:999px; background: rgba(120,90,110,.25); transition:.2s; cursor:pointer; }
.switch .track::after { content:''; position:absolute; top:3px; left:3px; width:24px; height:24px; border-radius:50%; background:#fff; transition:.2s; box-shadow: var(--shadow); }
.switch input:checked + .track { background: linear-gradient(120deg,var(--pink-strong),var(--pink-mid)); }
.switch input:checked + .track::after { transform: translateX(22px); }

/* ---- Dictionary / lists ------------------------------------- */
.search-row { display: flex; gap: 10px; margin-bottom: 14px; }
.search-row input { flex: 1; }
.dict-list { display: flex; flex-direction: column; gap: 10px; }
.dict-item {
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--glass-bg-2); border: 1px solid var(--glass-border);
  cursor: pointer; transition: transform .12s;
}
.dict-item:active { transform: scale(.99); }
.dict-item .di-head { display: flex; align-items: center; gap: 8px; }
.dict-item .di-word { font-weight: 700; font-size: 16px; }
.dict-item .di-pos { font-size: 11px; color: var(--pink-strong); background: rgba(244,27,140,.1); padding: 2px 8px; border-radius: 999px; }
.dict-item .di-def { font-size: 13px; color: var(--ink-soft); margin-top: 4px; line-height: 1.4; }
.dict-item .di-freq { margin-left: auto; font-size: 11px; color: var(--ink-soft); }

.conj-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.conj-table caption { font-weight: 700; text-align: left; padding: 10px 0 6px; color: var(--pink-strong); }
.conj-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.5); font-size: 14px; }
.conj-table td:first-child { color: var(--ink-soft); font-size: 13px; width: 38%; }
.conj-table td:last-child { font-weight: 600; }

/* ---- About / cover overlay (logo tap on home) --------------- */
.about {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; cursor: pointer;
  padding: 48px 28px calc(22px + env(safe-area-inset-bottom));
  background: rgba(252, 220, 226, .72);
  backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px);
  animation: fadeIn .28s ease;
}
.about-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.about-logo { width: 142px; height: 142px; border-radius: 72px; box-shadow: var(--shadow-strong); animation: pop .4s cubic-bezier(.2,.9,.3,1.2); }
.about-title {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 34px; line-height: 1.05;
  background: linear-gradient(120deg, var(--pink-strong), var(--pink-mid));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.about-slogan { font-size: 15px; color: var(--ink-soft); margin-top: -4px; }
.about-teacher {
  margin-top: 20px; display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px; color: var(--pink-strong); text-decoration: none;
  padding: 11px 20px; border-radius: 999px;
  background: var(--glass-bg-2); border: 1px solid var(--glass-border); box-shadow: var(--shadow);
}
.about-teacher svg { width: 19px; height: 19px; }
.about-teacher:active { transform: scale(.96); }
.about-creator { font-size: 12px; color: var(--ink-soft); opacity: .65; text-decoration: none; }
.about-creator:hover { opacity: 1; text-decoration: underline; }

/* ---- Toast --------------------------------------------------- */
.toast-host { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 460px; width: max-content; max-width: calc(100% - 8px);
  padding: 12px 18px; border-radius: 14px;
  background: rgba(58,39,51,.92); color: #fff; font-size: 14px;
  box-shadow: var(--shadow-strong);
  animation: toastIn .25s ease, toastOut .3s ease forwards 2.7s;
}
@keyframes toastIn { from { transform: translateY(20px); opacity: 0;} to {transform:none; opacity:1;} }
@keyframes toastOut { to { transform: translateY(20px); opacity: 0; } }

/* ---- Loading dots ------------------------------------------- */
.loading { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 30px; color: var(--ink-soft); font-size: 13px; }
.dots span { display:inline-block; width:7px; height:7px; border-radius:50%; background: var(--pink-mid); margin: 0 2px; animation: blink 1.2s infinite both; }
.dots span:nth-child(2){ animation-delay:.2s; } .dots span:nth-child(3){ animation-delay:.4s; }
@keyframes blink { 0%,80%,100%{opacity:.25;} 40%{opacity:1;} }

.empty { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 30px 16px; }
.hint { font-size: 12px; color: var(--ink-soft); margin-top: 8px; line-height: 1.4; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }

/* slightly wider columns on bigger phones / desktop */
@media (min-width: 460px) {
  .options { grid-template-columns: repeat(3, 1fr); }
}
