/* Grill Language — tema claro. Poppins (texto) y Kanit (títulos). */
:root {
  --bg: #f4f9ec;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #eef6e0;
  --line: #d9e6c6;
  --text: #263318;
  --muted: #66765a;
  --primary: #5aa61e;
  --primary2: #3f8a0d;
  --cyan: #14a39a;
  --pink: #f2764e;
  --ok: #25a36a;
  --ok-bg: rgba(37, 163, 106, .12);
  --bad: #e5484d;
  --bad-bg: rgba(229, 72, 77, .1);
  --gold: #f5b82e;
  --radius: 18px;
  --shadow: 0 8px 22px rgba(60, 100, 20, .1);
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-title: 'Kanit', 'Poppins', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  background: radial-gradient(1000px 520px at 85% -10%, #e1f2c4 0%, rgba(225, 242, 196, 0) 60%),
              radial-gradient(800px 500px at -10% 110%, #fdf0c6 0%, rgba(253, 240, 198, 0) 55%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}
.stars {
  position: fixed; inset: 0; pointer-events: none; opacity: .5; z-index: 0;
  background-image: radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 80%, var(--primary2) 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 65%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 90%, #a5f3fc 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 45%, #fff 50%, transparent 51%);
  background-size: 400px 400px;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 900; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; margin-top: 1em; }
p { margin: .4em 0; }
button { font: inherit; color: inherit; }
kbd { font-family: inherit; }
.grad { background: linear-gradient(90deg, var(--cyan), var(--primary), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.good { color: var(--ok); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.row.gap { gap: 12px; }
.row.wrap { flex-wrap: wrap; }

/* ───── topbar ───── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 12px max(16px, calc((100vw - 960px) / 2));
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { background: none; border: 0; font-weight: 900; font-size: 1.15rem; cursor: pointer; padding: 0; white-space: nowrap; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav button { background: none; border: 0; padding: 8px 12px; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 700; }
.topbar nav button:hover, .topbar nav button.active { color: var(--text); background: var(--card); }
.hdr-stats { margin-left: auto; display: flex; gap: 12px; align-items: center; font-weight: 800; white-space: nowrap; }
.lvl-mini { background: var(--primary); padding: 2px 10px; border-radius: 999px; font-size: .85rem; }
body.in-player .topbar nav { visibility: hidden; }

main { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 24px 16px 80px; }
main > section, .summary > * { margin-bottom: 18px; }

/* ───── cards & buttons ───── */
.card { background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card2); font-weight: 800; cursor: pointer;
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary2)); border-color: transparent; box-shadow: 0 4px 0 #2f6b0a, 0 8px 24px rgba(88, 166, 24, .3); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 #2f6b0a; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.big { padding: 14px 26px; font-size: 1.08rem; margin: 10px 0 4px; }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.icon-btn { background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.icon-btn:hover { color: var(--text); }
.input, .textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 1.05rem; outline: none;
}
.input:focus, .textarea:focus { border-color: var(--primary); }
.input.right { border-color: var(--ok); background: var(--ok-bg); }
.input.wrong { border-color: var(--bad); background: var(--bad-bg); }
select.input { cursor: pointer; }
.label { display: block; font-weight: 800; margin: 14px 0 6px; }
.form-card .row { margin-top: 16px; }
input[type=range] { width: 100%; accent-color: var(--primary); margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800;
  background: color-mix(in srgb, var(--c, var(--primary)) 18%, transparent); color: var(--c, var(--primary2)); border: 1px solid color-mix(in srgb, var(--c, var(--primary)) 40%, transparent); }
.chip.lvl { --c: var(--muted); }
.chip.rev { --c: var(--gold); }
.chip.voice { --c: var(--muted); align-self: center; }

/* ───── tutor ───── */
.tutor { display: flex; gap: 14px; align-items: flex-start; margin: 14px 0; }
.orb {
  flex: none; width: 56px; height: 56px; border-radius: 50%; background: #fff; border: 2px solid var(--line);
  box-shadow: 0 4px 12px rgba(60, 100, 20, .18); display: grid; place-items: center; overflow: hidden;
  animation: float 3s ease-in-out infinite;
}
.orb img { width: 46px; height: 46px; }
.tutor.happy .tutor.sad .orb { filter: grayscale(.6); }
.tutor.happy .orb { animation: hop 1.2s ease-in-out infinite; }
@keyframes hop { 50% { transform: translateY(-6px) rotate(-4deg); } }
.bubble { position: relative; background: var(--card2); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 12px 16px; flex: 1; }
.bubble p { margin: .3em 0; }
@keyframes float { 50% { transform: translateY(-4px); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }

/* ───── welcome ───── */
.welcome { max-width: 680px; margin: 0 auto; }
.big-title { font-size: clamp(2.2rem, 7vw, 3.4rem); margin-top: .4em; }
.lead { font-size: 1.12rem; color: var(--muted); }
.level-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; }
.level-btn { flex-direction: column; gap: 2px; padding: 12px; }
.level-btn b { font-size: 1.3rem; }
.level-btn span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 24px; }
.features div { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: rgba(45, 90, 15, .04); border: 1px solid var(--line); }
.features span { color: var(--muted); font-size: .92rem; }

/* ───── home ───── */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero-main { flex: 1; min-width: 240px; }
.lvl-badge { display: inline-block; padding: 2px 16px; border-radius: 14px; background: linear-gradient(135deg, var(--cyan), var(--primary)); }
.ring { position: relative; width: 150px; height: 150px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--cyan); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-label b { font-size: 1.8rem; }
.ring-label span { font-size: .75rem; color: var(--muted); max-width: 90px; line-height: 1.2; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 16px; }
.action { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; cursor: pointer; transition: transform .12s, border-color .15s; }
.action:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--primary); }
.action:disabled { opacity: .55; cursor: default; }
.a-icon { font-size: 1.8rem; }
.bar { height: 12px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--primary)); border-radius: 999px; transition: width .6s; }

.skills { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.skill { display: grid; grid-template-columns: 170px 1fr 48px; align-items: center; gap: 14px; background: none; border: 0; padding: 8px 10px; border-radius: 12px; text-align: left; cursor: pointer; }
.skills:not(.static) .skill:hover { background: rgba(45, 90, 15, .05); }
.skills.static .skill { cursor: default; }
.s-name { font-weight: 800; }
.s-bar { position: relative; height: 14px; background: var(--bg); border-radius: 999px; }
.s-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--c); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); transition: width .8s; }
.s-target { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--text); border-radius: 2px; opacity: .8; }
.s-lvl { font-weight: 900; text-align: right; color: var(--c); }

.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-weight: 700; }
.chart .target { stroke: var(--gold); stroke-dasharray: 6 5; stroke-width: 2; }
.chart .target-label { fill: var(--gold); }
.chart .line { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linejoin: round; }
.chart .dot { fill: var(--bg); stroke: var(--cyan); stroke-width: 2.5; }

/* ───── player ───── */
.player { max-width: 720px; margin: 0 auto; }
.player-top { display: flex; align-items: center; gap: 12px; }
.pbar { flex: 1; height: 14px; background: var(--card); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.pbar div { height: 100%; background: linear-gradient(90deg, var(--ok), var(--cyan)); border-radius: 999px; transition: width .4s; }
.combo { font-weight: 900; opacity: .4; min-width: 48px; text-align: right; transition: all .2s; }
.combo.on { opacity: 1; color: var(--gold); transform: scale(1.15); }
.timer { font-weight: 900; font-variant-numeric: tabular-nums; background: var(--card); padding: 4px 12px; border-radius: 10px; }
.timer.warn { color: var(--bad); }
.mode-label { color: var(--muted); font-weight: 700; font-size: .9rem; margin: 12px 0 8px; }
.q-card { animation: pop .25s ease; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.instr { color: var(--muted); font-size: .95rem; font-weight: 700; margin: 14px 0 6px; }
.prompt { font-size: clamp(1.15rem, 3vw, 1.4rem); font-weight: 800; margin: 10px 0 18px; }
.prompt.q { font-size: 1.1rem; }
.s1 { font-size: 1.1rem; padding: 12px 14px; background: rgba(45, 90, 15, .05); border-left: 4px solid var(--cyan); border-radius: 8px; }
.blank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--primary); margin: 0 4px; }
.keyword { display: inline-block; font-weight: 900; letter-spacing: .08em; padding: 4px 14px; border-radius: 8px; background: var(--gold); color: #1c1917; margin: 6px 0; }
.passage { background: #ffffff; color: var(--text); border-radius: 12px; padding: 16px 18px; margin: 10px 0; font-size: 1.02rem; line-height: 1.65; font-family: Georgia, 'Times New Roman', serif; }
.passage .blank { border-color: var(--primary2); min-width: 120px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg2);
  font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: border-color .12s, background .12s, transform .08s;
}
.opt:hover:not(:disabled) { border-color: var(--primary); background: var(--card2); }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt kbd { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--card2); border: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); animation: shake .35s; }
.opt.picked { border-color: var(--primary); background: var(--card2); }
.opt:disabled { cursor: default; }
.answer-row { display: flex; gap: 10px; margin-top: 12px; }
.answer-row .input { flex: 1; }
.audio { display: flex; gap: 10px; margin: 8px 0 16px; flex-wrap: wrap; }
.audio-btn { background: linear-gradient(135deg, var(--gold), #f59e0b); color: #1c1917; border: 0; font-size: 1.05rem; box-shadow: 0 4px 0 #b45309; }
.order-target { min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border: 2px dashed var(--line); border-radius: 14px; margin: 12px 0; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; min-height: 48px; }
.tile { padding: 9px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card2); font-weight: 800; font-size: 1.02rem; cursor: pointer; box-shadow: 0 3px 0 var(--line); animation: pop .15s; }
.tile:hover:not(:disabled) { border-color: var(--primary); }
.tile.placed { background: var(--bg2); }

.feedback { margin-top: 16px; padding: 16px 18px; border-radius: var(--radius); border: 2px solid; animation: slideup .25s ease; }
.feedback.ok { border-color: var(--ok); background: linear-gradient(180deg, var(--ok-bg), var(--bg2)); }
.feedback.bad { border-color: var(--bad); background: linear-gradient(180deg, var(--bad-bg), var(--bg2)); }
.feedback .tutor { margin-top: 0; }
.feedback .btn.big { width: 100%; }
.feedback .ex { color: var(--muted); }
.xp { color: var(--gold); font-size: .9rem; margin-left: 6px; }
.dict { font-size: 1.1rem; }
.dict .ok { color: var(--ok); }
.dict .miss { color: var(--bad); text-decoration: underline wavy; font-weight: 800; }
.levelup { padding: 12px 16px; border-radius: 14px; background: linear-gradient(90deg, rgba(245, 184, 46, .2), rgba(242, 118, 78, .16)); border: 1px solid var(--gold); font-weight: 700; margin: 10px 0; }

/* ───── summary ───── */
.summary { max-width: 720px; margin: 0 auto; text-align: center; }
.summary .card, .summary .tutor { text-align: left; }
.result-level { font-size: clamp(3.5rem, 12vw, 5.5rem); font-weight: 900; line-height: 1; margin: 10px 0; background: linear-gradient(135deg, var(--cyan), var(--primary), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .5s ease; }
.result-level.pass { background: linear-gradient(135deg, var(--ok), var(--cyan)); -webkit-background-clip: text; background-clip: text; }
.result-level.fail { background: linear-gradient(135deg, var(--gold), var(--pink)); -webkit-background-clip: text; background-clip: text; }
.sec { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sec:last-child { border: 0; }
.up { color: var(--ok); font-weight: 900; }
.down { color: var(--bad); font-weight: 900; }
.mistakes { display: flex; flex-direction: column; gap: 8px; }
.mistake { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.mistake summary { cursor: pointer; font-weight: 700; }
.mistake p { margin: 8px 0 0; }

/* ───── writing ───── */
.task { gap: 8px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; margin-top: 12px; align-items: start; }
.task-prompt { background: rgba(45, 90, 15, .05); border-radius: 12px; padding: 12px 14px; font-size: .96rem; }
.editor ul { padding-left: 20px; margin: 6px 0; }
.editor li { margin: 4px 0; color: var(--muted); }
.phrases { display: flex; flex-wrap: wrap; gap: 6px; }
.phrase { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .85rem; cursor: pointer; }
.phrase:hover { border-color: var(--cyan); color: var(--cyan); }
.textarea { min-height: 360px; resize: vertical; line-height: 1.6; margin-bottom: 10px; }
.w-result { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.score { font-size: 1.8rem; font-weight: 900; color: var(--cyan); }
.crit { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.dots { color: var(--primary); letter-spacing: 3px; }
.tips li { color: var(--text) !important; }

/* ───── misc ───── */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--card2); border: 1px solid var(--primary); padding: 12px 20px; border-radius: 14px; z-index: 50; transition: all .25s; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; top: 40vh; width: 10px; height: 14px; border-radius: 2px; z-index: 60; pointer-events: none; animation: confetti 1.6s ease-out forwards; }
.shake { animation: shake .35s; }
@keyframes confetti { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), 60vh) rotate(var(--rot)); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideup { 0% { transform: translateY(12px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (max-width: 760px) {
  .grid3, .grid2, .editor-grid { grid-template-columns: 1fr; }
  .skill { grid-template-columns: 1fr 44px; gap: 6px 10px; }
  .skill .s-bar { grid-column: 1 / -1; grid-row: 2; }
  .ring { margin: 0 auto; }
  .topbar { gap: 8px; }
  .topbar nav button { padding: 8px; }
  .hdr-stats { gap: 8px; font-size: .9rem; }
  .logo { font-size: 1rem; }
  .answer-row { flex-direction: column; }
}
@media (max-width: 480px) {
  .hdr-stats .lvl-mini { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ───── C1: nota Cambridge ───── */
.est-label { margin: 10px 0 0; color: var(--muted); font-weight: 700; font-size: .9rem; }
.est-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.est-score { font-size: clamp(3rem, 9vw, 4.2rem); font-weight: 900; line-height: 1; background: linear-gradient(135deg, var(--gold), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.est-score.pass { background: linear-gradient(135deg, var(--ok), var(--cyan)); -webkit-background-clip: text; background-clip: text; }
.est-grade { font-weight: 800; color: var(--muted); }
.est-inline { margin-top: 12px; }
.scale-bar { position: relative; display: block; height: 14px; background: var(--bg); border-radius: 999px; margin: 14px 0 22px; }
.scale-bar.small { height: 10px; margin: 0 0 16px; }
.sc-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--pink)); transition: width .8s; }
.sc-fill.pass { background: linear-gradient(90deg, var(--ok), var(--cyan)); }
.sc-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: rgba(45, 90, 15, .28); }
.sc-mark.main { background: var(--text); width: 3px; }
.sc-mark i { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .68rem; color: var(--muted); margin-top: 2px; }
.sc-mark.main i { color: var(--text); font-weight: 800; }
.countdown { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 150px; height: 150px; border-radius: 50%; border: 6px solid var(--cyan); text-align: center; flex: none; background: transparent; color: var(--text); }
.countdown b { font-size: 2.6rem; line-height: 1; }
.countdown span { font-size: .78rem; color: var(--muted); max-width: 100px; }
.countdown.set { border-style: dashed; cursor: pointer; font: inherit; }
.papers { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.paper-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: 14px; align-items: center; background: none; border: 0; padding: 6px 8px; border-radius: 10px; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.paper-row:hover { background: rgba(45, 90, 15, .05); }
.p-name { font-weight: 800; }
.p-val { text-align: right; display: flex; flex-direction: column; line-height: 1.1; }
.p-val b { font-size: 1.15rem; }
.p-val small { color: var(--muted); font-size: .7rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.section-title { margin-top: 28px; }
.warn-text { color: var(--gold); }

/* ───── Centro de examen ───── */
.format-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.format-grid div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: rgba(45, 90, 15, .04); border: 1px solid var(--line); }
.format-grid span { color: var(--muted); font-size: .88rem; }
.mock-card { margin-bottom: 14px; }
.mock-card.highlight { border-color: var(--cyan); }
.mock-card .action { padding: 14px; }
.parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.part-card { gap: 6px; }
.links { padding-left: 20px; }
.links li { margin: 6px 0; }
a { color: var(--cyan); }
code { background: var(--bg); padding: 1px 6px; border-radius: 6px; }

/* ───── Prueba ───── */
.paper { max-width: 1100px; margin: 0 auto; }
.paper-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.paper-title { flex: 1; }
.part-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ptab { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 800; color: var(--text); }
.ptab small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.ptab.on { border-color: var(--primary); background: var(--card2); }
.ptab.full small { color: var(--ok); }
.paper-card { margin-bottom: 14px; }
.rubric { font-style: italic; color: var(--muted); background: rgba(45, 90, 15, .04); border-left: 3px solid var(--primary); padding: 8px 12px; border-radius: 6px; }
.text-title { text-align: center; margin: 18px 0 8px; font-size: 1.15rem; }
.cloze, .long-text, .mini-text, .section, .para-opt, .completion { font-family: Georgia, "Times New Roman", serif; line-height: 1.9; font-size: 1.02rem; }
.cloze { background: #ffffff; color: var(--text); border-radius: 12px; padding: 18px 20px; }
.cloze p { margin: 0 0 1em; }
.gap-sel, .gap-in { font: inherit; font-family: 'Poppins', system-ui, sans-serif; font-size: .95rem; font-weight: 700; border: 2px solid var(--primary); border-radius: 8px; padding: 1px 6px; background: #eef6e0; color: var(--text); max-width: 100%; }
.gap-in { width: 130px; }
.gap-in.mid { width: 200px; }
.gap-in.wide { width: min(360px, 100%); }
.gap-sel.right, .gap-in.right { border-color: var(--ok); background: #d1fae5; color: #064e3b; }
.gap-sel.wrong, .gap-in.wrong { border-color: var(--bad); background: #ffe4e6; color: #881337; }
.gap-sel.half, .gap-in.half { border-color: var(--gold); background: #fef3c7; color: #78350f; }
.wf-word { font-family: 'Poppins', sans-serif; font-weight: 900; font-size: .75rem; letter-spacing: .06em; background: var(--gold); color: #1c1917; padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
.opt-table { display: grid; gap: 4px; margin-top: 14px; font-size: .9rem; }
.opt-table div { display: flex; gap: 14px; flex-wrap: wrap; padding: 4px 8px; border-radius: 8px; background: rgba(45, 90, 15, .04); }
.opt-table span { color: var(--muted); }
.kwt { padding: 12px 0; border-bottom: 1px solid var(--line); }
.kwt p { margin: 6px 0; }
.completion p { margin: 10px 0; }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.long-text { background: #ffffff; color: var(--text); border-radius: 12px; padding: 16px 20px; max-height: 75vh; overflow: auto; }
.long-text p { margin: 0 0 1em; }
.long-text h4 { font-family: 'Poppins', sans-serif; margin: 0 0 4px; color: #2f6b0a; }
.section { margin-bottom: 14px; }
.gap-slot { font-family: 'Poppins', sans-serif; margin: 6px 0 16px; padding: 10px; border: 2px dashed var(--primary); border-radius: 10px; text-align: center; }
.gap-slot .gap-sel { background: #fff; color: var(--text); }
.questions { display: flex; flex-direction: column; gap: 14px; }
.q p { margin: 0 0 6px; font-weight: 700; }
.q-opts { display: flex; flex-direction: column; gap: 6px; }
.q-opts.choose { flex-direction: row; flex-wrap: wrap; margin-bottom: 12px; }
.qopt { text-align: left; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg2); cursor: pointer; font: inherit; color: var(--text); white-space: pre-wrap; }
.qopt:hover:not(:disabled) { border-color: var(--primary); }
.qopt.sel { border-color: var(--primary); background: var(--card2); }
.qopt:disabled { cursor: default; }
.q-opts.right .qopt.sel { border-color: var(--ok); background: var(--ok-bg); }
.q-opts.wrong .qopt.sel { border-color: var(--bad); background: var(--bad-bg); }
.texts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.mini-text { background: #ffffff; color: var(--text); border-radius: 12px; padding: 12px 16px; font-size: .95rem; line-height: 1.7; }
.mini-text b { font-family: 'Poppins', sans-serif; color: #2f6b0a; }
.para-opt { background: rgba(45, 90, 15, .05); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .93rem; line-height: 1.6; }
.para-opt b { font-family: 'Poppins', sans-serif; color: var(--gold); margin-right: 4px; }
.paper-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0 30px; }
.fb-list { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.fb-line { padding: 8px 12px; border-radius: 10px; margin-bottom: 6px; border-left: 4px solid; }
.fb-line.ok { border-color: var(--ok); background: var(--ok-bg); }
.fb-line.bad { border-color: var(--bad); background: var(--bad-bg); }
.fb-line.half { border-color: var(--gold); background: rgba(251, 191, 36, .1); }
.fb-line p { margin: 4px 0 0; }
.result-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.summary .res-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }

/* Listening */
.extract { padding: 12px 0 18px; border-bottom: 1px solid var(--line); }
.x-intro { font-style: italic; color: var(--muted); }
.l-audio { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 16px; }
.a-prog { flex: 1; min-width: 120px; height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.a-prog div { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--pink)); transition: width .25s linear; }
.transcript { width: 100%; background: var(--bg); border-radius: 10px; padding: 10px 14px; font-size: .92rem; max-height: 300px; overflow: auto; }
.tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.task-box { background: rgba(45, 90, 15, .04); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.opt-list { font-size: .9rem; margin: 8px 0 12px; }
.opt-list div { padding: 2px 0; }
.opt-list b { color: var(--gold); margin-right: 6px; }
.match-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.match-row span { min-width: 80px; color: var(--muted); }

/* ───── Speaking ───── */
.examiner { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--muted); font-weight: 700; }
.ex-avatar { font-size: 1.8rem; }
.examiner .btn { margin-left: auto; }
.sp-q { font-size: 1.25rem; font-weight: 800; margin: 12px 0; }
.sp-qs p { margin: 4px 0; font-weight: 700; }
.pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.pic { background: #ffffff; color: var(--text); border-radius: 12px; padding: 12px; text-align: center; }
.pic-emoji { font-size: 2.6rem; display: block; }
.pic p { font-size: .88rem; margin: 4px 0 0; }
.mindmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; align-items: center; }
.mm-center { grid-column: 1 / -1; text-align: center; font-weight: 900; font-size: 1.1rem; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--primary2)); }
.mm-node { text-align: center; padding: 10px; border-radius: 999px; border: 2px solid var(--cyan); font-weight: 700; }
.rec-zone { margin-top: 16px; text-align: center; }
.btn.recording { background: linear-gradient(135deg, #f43f5e, #be123c); box-shadow: 0 4px 0 #881337; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { transform: scale(1.03); } }
.live { text-align: left; min-height: 60px; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg); font-size: 1.02rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 14px 0; }
.stat-row div { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.stat-row b { font-size: 1.6rem; }
.stat-row span { font-size: .78rem; color: var(--muted); text-align: center; }
.sp-rec { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sp-rec audio { width: 100%; margin: 6px 0; }
.sp-say { font-style: italic; color: var(--muted); }
.transcript-text { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.crit-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.crit-val { font-weight: 900; color: var(--cyan); }

@media (max-width: 860px) {
  .two-col, .tasks, .texts { grid-template-columns: 1fr; }
  .long-text { max-height: none; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid4, .pics { grid-template-columns: 1fr; }
  .paper-row { grid-template-columns: 1fr 70px; }
  .paper-row .scale-bar { grid-column: 1 / -1; grid-row: 2; }
  .countdown { width: 120px; height: 120px; margin: 0 auto; }
  .mindmap { grid-template-columns: 1fr 1fr; }
}

/* ───── Componentes de Grill Language ───── */
.lang-btn { margin-left: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-weight: 900; cursor: pointer; color: var(--text); }
.lang-btn:hover { border-color: var(--primary); }
.topbar .hdr-stats { margin-left: 8px; }
body.in-player .lang-btn { visibility: hidden; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.chip-row.center { justify-content: center; }
.chip-btn { padding: 7px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg2); font-weight: 900; cursor: pointer; color: var(--text); }
.chip-btn:hover { border-color: var(--primary); }
.chip-btn.on { background: linear-gradient(135deg, var(--primary), var(--primary2)); border-color: transparent; }
.chip.ok { --c: var(--ok); }
.chip.bad { --c: var(--bad); }
.gmeter { margin: 14px 0; }
.gm-top { display: flex; justify-content: space-between; align-items: baseline; }
.gm-top span { font-size: 1.25rem; font-weight: 900; }
.gm-top small { color: var(--muted); font-weight: 700; }
.gm-bar { position: relative; height: 14px; background: var(--bg); border-radius: 999px; margin: 8px 0 18px; }
.gm-bar.small { height: 10px; margin: 0 0 14px; }
.gm-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--pink)); transition: width .8s; }
.gm-bar i.pass { background: linear-gradient(90deg, var(--ok), var(--cyan)); }
.gm-bar u { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--text); border-radius: 2px; text-decoration: none; opacity: .85; }
.gm-bar u em { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .68rem; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.gm-bar.small u em { display: none; }
.papers .paper-row { cursor: default; }
.papers .paper-row:hover { background: none; }
.paper-row .p-name { font-size: .92rem; }
.accent-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.acc { min-width: 38px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); font-weight: 800; font-size: 1rem; cursor: pointer; color: var(--text); }
.acc:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
.acc:disabled { opacity: .4; cursor: default; }
.dict .acc-miss { color: var(--gold); text-decoration: underline dotted; font-weight: 800; }
.scene { background: #ffffff; color: var(--text); border-radius: 14px; padding: 14px; margin: 12px 0; text-align: center; }
.scene p { margin: 6px 0 0; }
.gloss { margin: 8px 0; font-size: .92rem; }
.gloss summary { cursor: pointer; color: var(--cyan); font-weight: 700; }
.ai-note { margin-bottom: 12px; font-size: .92rem; }
.ai-box { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: .95rem; }
.mini-hist { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.est-label { margin: 12px 0 4px; }
.hero .chip-row { margin-top: 4px; }
@media (max-width: 760px) { .topbar nav button { padding: 8px 6px; font-size: .9rem; } .lang-btn { padding: 6px 8px; } }

/* ───── Grill Language: fuentes y detalles del tema claro ───── */
.stars { display: none !important; }
h1, h2, h3, h4, .logo, .big-title, .result-level, .est-score, .score, .lvl-badge, .countdown b, .ring-label b, .btn.big, .tile, .chip-btn, .gm-top span, .stat-row b, .s-lvl { font-family: var(--font-title); }
h1, h2, h3 { font-weight: 700; letter-spacing: -.005em; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.35rem; color: var(--text); }
.logo img { width: 40px; height: 40px; }
.logo .grad { font-weight: 800; }
.hero-logo { width: 120px; height: 120px; display: block; margin: 8px 0 0; }
.btn.primary, .chip-btn.on, .lvl-badge, .lvl-mini, .mm-center { color: #fff; }
.btn.primary { text-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.btn.primary:disabled { box-shadow: none; }
.topbar { box-shadow: 0 1px 0 var(--line); }
.topbar nav button.active, .topbar nav button:hover { background: var(--card2); color: var(--text); }
.btn, .opt, .input, .textarea, .tile, .acc, .chip-btn, .phrase { box-shadow: none; }
.btn.primary { box-shadow: 0 4px 0 #2f6b0a, 0 8px 18px rgba(88, 166, 24, .3); }
.tile { box-shadow: 0 3px 0 var(--line); }
.opt:hover:not(:disabled) { background: var(--card2); }
.pbar, .bar, .s-bar, .gm-bar, .scale-bar { background: #e6efd8; }
.passage, .scene, .pic, .cloze, .long-text, .mini-text { border: 1px solid var(--line); }
.toast { background: #fff; color: var(--text); border-color: var(--primary); }
.timer { background: #fff; border: 1px solid var(--line); }
.mock-card.highlight { border-color: var(--primary); }
.chip { color: var(--c, var(--primary2)); }
.est-score { background: linear-gradient(135deg, var(--primary), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.est-score.pass { background: linear-gradient(135deg, var(--ok), var(--cyan)); -webkit-background-clip: text; background-clip: text; }
.result-level { background: linear-gradient(135deg, var(--primary), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad { background: linear-gradient(90deg, var(--primary), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.topbar nav button { white-space: nowrap; }

/* ───── Grill AI (chat del profesor) ───── */
.chat-page { max-width: 760px; margin: 0 auto; }
.chat { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; min-height: 160px; }
.chat-row { display: flex; gap: 10px; align-items: flex-start; }
.chat-row.me { justify-content: flex-end; }
.chat-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; font-size: .95rem; position: relative; }
.chat-msg p { margin: .25em 0; }
.chat-msg ul { margin: .3em 0 .3em 1.1em; padding: 0; }
.chat-msg.me { background: var(--primary); color: #fff; border-radius: 16px 4px 16px 16px; }
.chat-msg.bot { background: var(--card2); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; }
.chat-msg .say { position: absolute; right: -4px; bottom: -14px; padding: 2px 8px; font-size: .8rem; }
.orb.small { width: 34px; height: 34px; flex: none; }
.orb.small img { width: 22px; height: 22px; }
.chat-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; }
.chat-form textarea { flex: 1; resize: vertical; min-height: 48px; }
.typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); opacity: .4; animation: gl-dot 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes gl-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
#chat-mic.on { background: #f2764e; color: #fff; border-color: #f2764e; animation: gl-dot 1s infinite; }

.ask-ai { margin-top: 10px; }
.ask-ai .chat { min-height: 0; }

body.locked nav, body.locked .stats-bar { display: none !important; }
