/* ============================================================
   KLSC — Survival Chinese, level skin.
   Layout only. Every colour, shadow, radius and font comes from
   assets/kuaile-ds.css. Where KLSC pushes brighter than KLCPH0
   (v2 §5) it does so by saturating the DS tokens, never by
   inventing a second palette.
   ============================================================ */

/* ---- per-stage accents: each hub card owns a colour ---------- */
:root {
  --klsc-preview: #4A7FE0;
  --klsc-learn:   #E8A93C;
  --klsc-say:     #F1806F;
  --klsc-drills:  #4CB963;
  --klsc-boss:    #7A5AF0;
  --klsc-prog:    #2A7B88;
  --klsc-teal:    #2A7B88;
}

/* iOS: bottom controls must clear the Safari toolbar (v1 §9) */
/* HEIGHT, not min-height. With only a min-height the frame grows to fit its
   content, so nothing ever compresses: the scroll area never scrolled and the
   pinned footer (mic · Next · Skip) was pushed 80-90px past the bottom of a
   phone screen — the Director's "kepotong", 2026-08-07. A definite height
   makes .klsc-scroll actually scroll and keeps the footer on screen. Desktop
   (≥520px) is unaffected: .kl-frame.kl-phone wins on specificity there. */
.klsc-app { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
@supports (-webkit-touch-callout: none) { .klsc-app { height: -webkit-fill-available; } }

.klsc-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.klsc-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 18px 26px; }
.klsc-foot {
  flex-shrink: 0; padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}

/* ---- header ------------------------------------------------- */
.klsc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 6px; }
.klsc-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.klsc-brand img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(20,40,80,.18)); }
.klsc-brand .name { font-weight: 900; font-size: 12.5px; color: var(--blue); line-height: 1.1; white-space: nowrap; }
.klsc-brand .eyebrow { font-weight: 800; font-size: 10.5px; color: var(--gold-text); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.klsc-pills { display: flex; gap: 7px; flex-shrink: 0; }

.klsc-back {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px;
  background: none; border: none; padding: 6px 2px; cursor: pointer;
  color: var(--blue); font-family: inherit; font-weight: 800; font-size: 13px; text-decoration: none;
}

/* ---- level title block -------------------------------------- */
.klsc-title-eyebrow { font-weight: 900; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); }
.klsc-title { margin: 4px 0 2px; font-size: 30px; font-weight: 900; color: var(--blue); letter-spacing: -.01em; line-height: 1.1; }
.klsc-title .cn { font-family: var(--font-hanzi); color: var(--blue); margin-left: 8px; font-size: 26px; }
.klsc-lede { margin: 6px 0 16px; color: var(--muted); font-weight: 700; font-size: 14.5px; line-height: 1.5; }

/* ---- hub cards ---------------------------------------------- */
.klsc-cards { display: flex; flex-direction: column; gap: 11px; }
.klsc-card {
  position: relative; overflow: hidden; width: 100%; text-align: left; font-family: inherit;
  display: flex; align-items: center; gap: 14px; padding: 13px 15px;
  border: var(--glass-border); border-radius: var(--radius-card);
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-tile); cursor: pointer; color: inherit; text-decoration: none;
  transition: transform .09s var(--ease-press), box-shadow .18s ease, opacity .2s ease;
}
.klsc-card, .klsc-card:link, .klsc-card:visited, .klsc-card * { text-decoration: none; }
.klsc-card::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 4px; height: 34%;
  border-radius: var(--radius-pill); background: var(--gloss); pointer-events: none; opacity: .7;
}
.klsc-card > * { position: relative; }
.klsc-card:active { transform: scale(.98) translateY(2px); box-shadow: var(--shadow-tile-press); }
.klsc-card.is-locked { opacity: .45; }
.klsc-card.is-locked:active { transform: none; }
.klsc-card.shake { animation: klscShake .2s; }
@keyframes klscShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-7px)} 75%{transform:translateX(7px)} }
.klsc-card.lift { animation: klscLift .7s var(--ease-pop); }
@keyframes klscLift { 0%,100%{transform:translateY(0)} 45%{transform:translateY(-9px)} }

.klsc-card .tile {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 27px;
  box-shadow: 0 6px 14px rgba(40,80,150,.24); color: #fff;
}
.klsc-card .body { flex: 1; min-width: 0; display: block; }
.klsc-card .t { display: block; font-weight: 900; font-size: 19px; color: var(--blue); line-height: 1.25; }
.klsc-card .s { display: block; margin-top: 2px; font-weight: 700; font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.klsc-card .slot { flex-shrink: 0; display: flex; align-items: center; gap: 8px; color: var(--blue); font-size: 22px; font-weight: 900; }
.klsc-card .slot .done { color: var(--klsc-teal); font-size: 20px; }
.klsc-card .slot .done.pop { animation: kl-bop .55s var(--ease-pop) both; }
.klsc-dots { display: inline-flex; gap: 4px; }
.klsc-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(140,160,195,.45); display: block; }
.klsc-dots i.on { background: var(--klsc-teal); }

.klsc-reason {
  margin: 8px 2px 0; font-size: 13px; font-weight: 800; color: var(--gold-text);
  background: var(--glass-tint-gold); border: 1px solid rgba(210,134,10,.3);
  border-radius: 14px; padding: 9px 13px;
}

/* ---- stacked pinyin over hanzi ------------------------------ */
.klsc-zh { display: inline-flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 2px 10px; }
.klsc-zh .w { display: inline-flex; gap: 2px; }             /* one word */
.klsc-zh.by-word .w { flex-direction: column; align-items: center; gap: 2px; }
.klsc-zh .u { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; gap: 2px; }
.klsc-zh .py { font-family: var(--font-ui); font-weight: 800; font-size: 14px; color: var(--ink-soft); letter-spacing: .01em; white-space: nowrap; }
.klsc-zh .cn { font-family: var(--font-hanzi); font-weight: 700; font-size: 30px; color: var(--blue); }
.klsc-zh.xl .py { font-size: 19px; } .klsc-zh.xl .cn { font-size: 46px; }
.klsc-zh.lg .py { font-size: 16px; } .klsc-zh.lg .cn { font-size: 36px; }
.klsc-zh.sm .py { font-size: 11.5px; } .klsc-zh.sm .cn { font-size: 21px; }
.klsc-zh.on-fill .py { color: rgba(255,255,255,.88); } .klsc-zh.on-fill .cn { color: #fff; }
.klsc-zh .w.tappable { cursor: pointer; border-radius: 8px; padding: 0 3px; transition: background .15s ease; }
.klsc-zh .w.tappable:active, .klsc-zh .w.tappable.lit { background: rgba(42,123,136,.14); }

/* ---- word gloss card ---------------------------------------- */
.klsc-gloss-back { position: fixed; inset: 0; z-index: 1300; background: rgba(20,40,80,.34); display: flex; align-items: flex-end; justify-content: center; }
.klsc-gloss {
  width: 100%; max-width: 420px; border-top-left-radius: var(--radius-sheet); border-top-right-radius: var(--radius-sheet);
  background: linear-gradient(180deg, #fff, #EEF5FF); box-shadow: var(--shadow-sheet);
  padding: 20px 22px calc(24px + env(safe-area-inset-bottom));
  animation: kl-rise .32s var(--ease-sheet) both;
}
.klsc-gloss .row { display: flex; align-items: center; gap: 14px; }
.klsc-gloss .meaning { margin-top: 12px; font-weight: 800; font-size: 16px; color: var(--blue); }
.klsc-gloss .note { margin-top: 8px; font-weight: 700; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.klsc-gloss .close { margin-top: 16px; }

/* ---- generic stage bits ------------------------------------- */
.klsc-instruction { margin: 2px 0 14px; font-weight: 800; font-size: 15px; color: var(--ink-soft); }
.klsc-art {
  /* max-height keeps the photo from eating a short phone screen — it was
     pushing the Say It mic below the pinned footer (Director, 2026-08-06).
     object-fit: cover crops gracefully when the cap bites. */
  width: 100%; aspect-ratio: 16 / 10; max-height: 32vh; border-radius: var(--radius-card); overflow: hidden;
  background: linear-gradient(160deg, #E8F1FF, #DCEAFF); border: 1.5px solid rgba(255,255,255,.9);
  box-shadow: 0 8px 20px rgba(40,80,150,.14); display: flex; align-items: center; justify-content: center;
}
.klsc-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.klsc-art .ph { font-size: 54px; opacity: .5; }

.klsc-row { display: flex; align-items: center; gap: 10px; }
.klsc-center { display: flex; flex-direction: column; align-items: center; }
.klsc-en { margin-top: 12px; font-weight: 800; font-size: 17px; color: var(--muted); text-align: center; }
.klsc-en.hidden { opacity: 0; }
.klsc-en.show { animation: klscFade .4s ease both; opacity: 1; }
@keyframes klscFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- preview list ------------------------------------------- */
.klsc-plist { display: flex; flex-direction: column; gap: 9px; }
.klsc-prow {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 20px; border: 1.5px solid var(--glass-edge);
  background: var(--glass-fill); box-shadow: var(--shadow-tile); cursor: pointer; font-family: inherit;
  transition: transform .09s var(--ease-press), border-color .2s ease, background .2s ease;
}
.klsc-prow:active { transform: translateY(3px); }
.klsc-prow.playing { border-color: var(--klsc-teal); background: linear-gradient(180deg, #fff, #E3F3F5); }
.klsc-prow .txt { flex: 1; min-width: 0; }
.klsc-prow .py { font-weight: 800; font-size: 13.5px; color: var(--ink-soft); }
.klsc-prow .cn { font-family: var(--font-hanzi); font-weight: 700; font-size: 25px; color: var(--blue); line-height: 1.25; }
.klsc-prow .en { font-weight: 700; font-size: 13px; color: var(--muted); margin-top: 1px; }
.klsc-prow .spk { font-size: 21px; color: var(--blue); flex-shrink: 0; }
.klsc-prow .heard { position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--klsc-teal); }

/* ---- drills ------------------------------------------------- */
.klsc-skill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  background: rgba(42,123,136,.12); border: 1px solid rgba(42,123,136,.25);
  color: var(--klsc-teal); font-weight: 900; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
}
.klsc-prompt { margin: 12px 0 4px; font-weight: 900; font-size: 19px; color: var(--blue); line-height: 1.3; }
.klsc-sit {
  margin: 12px 0 6px; padding: 18px 18px; border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(214,240,243,.85));
  border: 1.5px solid rgba(42,123,136,.28); box-shadow: 0 8px 22px rgba(42,123,136,.16);
  font-weight: 800; font-size: 17.5px; line-height: 1.45; color: var(--ink-soft);
}
.klsc-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.klsc-opt {
  position: relative; overflow: hidden; width: 100%; font-family: inherit; text-align: center;
  min-height: 60px; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 16px; border: 1.5px solid var(--glass-edge); border-radius: 20px;
  background: var(--glass-fill); color: var(--ink-soft); font-weight: 800; font-size: 17px; cursor: pointer;
  box-shadow: 0 6px 0 rgba(180,200,232,.6), 0 10px 20px rgba(40,80,150,.12);
  transition: transform .08s var(--ease-press), box-shadow .18s ease, background .25s ease, opacity .25s ease;
}
.klsc-opt::before { content: ""; position: absolute; left: 8%; right: 8%; top: 4px; height: 36%; border-radius: 999px; background: var(--gloss); pointer-events: none; opacity: .8; }
.klsc-opt > * { position: relative; }
.klsc-opt:not(.is-done):active { transform: scale(.96); }
.klsc-opt.right {
  background: linear-gradient(90deg, var(--green-lite), var(--green)); color: #fff;
  border-color: rgba(255,255,255,.5); box-shadow: 0 6px 0 var(--green-lip), 0 10px 20px var(--green-glow);
  animation: klscSweep .26s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes klscSweep { from { background-size: 0 100%; } to { background-size: 100% 100%; } }
/* wrong is NEUTRAL GREY, never red (v1 §4) */
.klsc-opt.miss { background: linear-gradient(180deg, #E7ECF3, #D9E1EC); color: #6B7A92; box-shadow: 0 6px 0 #BFCADA; animation: klscNudge .3s; }
@keyframes klscNudge { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }
/* the hanzi inside an option carries its own colour, so the answered
   states have to reclaim it or blue text lands on a green fill */
.klsc-opt.right .klsc-zh .cn, .klsc-opt.right .klsc-zh .py { color: #fff; }
.klsc-opt.miss .klsc-zh .cn, .klsc-opt.miss .klsc-zh .py { color: #6B7A92; }
.klsc-opt.is-done { pointer-events: none; }
.klsc-opt.dim { opacity: .45; }
.klsc-opt .tick { font-size: 21px; animation: kl-bop .26s cubic-bezier(.34,1.56,.64,1) both; }

/* tile builder */
.klsc-slots { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; min-height: 76px; margin: 16px 0 4px; }
.klsc-slot {
  width: 62px; height: 74px; border-radius: 16px; border: 2.5px dashed rgba(140,160,195,.55);
  background: rgba(255,255,255,.42); display: flex; align-items: center; justify-content: center;
}
.klsc-slot.filled { border-style: solid; border-color: transparent; background: transparent; padding: 0; }
.klsc-bank { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 18px; }
.klsc-tile {
  width: 62px; height: 74px; border-radius: 16px; border: 1.5px solid var(--glass-edge);
  background: var(--glass-fill); box-shadow: 0 6px 0 rgba(180,200,232,.6), 0 10px 18px rgba(40,80,150,.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer; font-family: inherit; padding: 4px;
  transition: transform .12s var(--ease-press), opacity .12s ease;
}
.klsc-tile:active { transform: translateY(3px); }
.klsc-tile .py { font-weight: 800; font-size: 11.5px; color: var(--ink-soft); }
.klsc-tile .cn { font-family: var(--font-hanzi); font-weight: 700; font-size: 27px; color: var(--blue); line-height: 1.05; }
.klsc-tile.used { visibility: hidden; }
.klsc-tile.in-slot { box-shadow: 0 4px 0 rgba(180,200,232,.6); }
/* a multi-character unit (WiFi, CA981) is one tile but several glyphs wide */
.klsc-tile.wide { width: auto; min-width: 62px; padding-left: 10px; padding-right: 10px; }
.klsc-tile.wide .cn { font-size: 20px; letter-spacing: .3px; }
.klsc-slot.wide { width: auto; min-width: 62px; }
.klsc-slots.right .klsc-tile { background: linear-gradient(180deg, var(--green-lite), var(--green)); box-shadow: 0 5px 0 var(--green-lip); }
.klsc-slots.right .klsc-tile .cn, .klsc-slots.right .klsc-tile .py { color: #fff; }
.klsc-slots.miss { animation: klscNudge .3s; }

/* drag & pair — two shuffled columns, tap one then the other */
.klsc-pair { display: flex; gap: 10px; margin-top: 16px; }
.klsc-paircol { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.klsc-pairitem {
  position: relative; overflow: hidden; width: 100%; min-height: 60px; font-family: inherit;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 11px 10px; border: 1.5px solid var(--glass-edge); border-radius: 18px;
  background: var(--glass-fill); color: var(--ink-soft); font-weight: 800; font-size: 14.5px;
  cursor: pointer; box-shadow: 0 5px 0 rgba(180,200,232,.6), 0 9px 16px rgba(40,80,150,.12);
  transition: transform .08s var(--ease-press), box-shadow .16s ease, background .2s ease, opacity .2s ease;
}
.klsc-pairitem:active { transform: translateY(3px); }
.klsc-pairitem.picked { background: linear-gradient(180deg, var(--blue-lite), var(--blue)); color: #fff; box-shadow: 0 5px 0 var(--blue-lip); }
.klsc-pairitem.picked .klsc-zh .cn, .klsc-pairitem.picked .klsc-zh .py { color: #fff; }
.klsc-pairitem.done { background: linear-gradient(180deg, var(--green-lite), var(--green)); color: #fff; box-shadow: 0 5px 0 var(--green-lip); pointer-events: none; }
.klsc-pairitem.done .klsc-zh .cn, .klsc-pairitem.done .klsc-zh .py { color: #fff; }
.klsc-pairitem.bad { animation: klscNudge .3s; }

/* drag & cloze — a two-line exchange with the reply missing */
.klsc-convo { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.klsc-bubble {
  max-width: 88%; padding: 13px 16px; border-radius: 20px; border: 1.5px solid var(--glass-edge);
  background: var(--glass-fill); box-shadow: var(--shadow-soft);
}
.klsc-bubble.a { align-self: flex-start; border-bottom-left-radius: 6px; }
.klsc-bubble.b { align-self: flex-end; border-bottom-right-radius: 6px; background: linear-gradient(180deg, #fff, var(--glass-tint-blue)); }
.klsc-gap {
  display: inline-flex; align-items: center; justify-content: center; min-width: 96px; min-height: 46px;
  border: 2.5px dashed rgba(140,160,195,.6); border-radius: 14px; padding: 4px 12px;
  color: var(--muted); font-weight: 900; font-size: 20px;
}
.klsc-gap.filled { border-style: solid; border-color: transparent; background: rgba(255,255,255,.6); }
.klsc-gap.right { background: linear-gradient(180deg, var(--green-lite), var(--green)); }
.klsc-gap.right .klsc-zh .cn, .klsc-gap.right .klsc-zh .py { color: #fff; }
.klsc-gap.miss { background: #E7ECF3; }
.klsc-gap.miss .klsc-zh .cn, .klsc-gap.miss .klsc-zh .py { color: #6B7A92; }
.klsc-chip {
  font-family: inherit; cursor: pointer; padding: 10px 14px; border-radius: 16px;
  border: 1.5px solid var(--glass-edge); background: var(--glass-fill);
  box-shadow: 0 5px 0 rgba(180,200,232,.6), 0 9px 16px rgba(40,80,150,.12);
  transition: transform .08s var(--ease-press), opacity .2s ease;
}
.klsc-chip:active { transform: translateY(3px); }
.klsc-chip.is-done { pointer-events: none; }
.klsc-chip.right { background: linear-gradient(180deg, var(--green-lite), var(--green)); box-shadow: 0 5px 0 var(--green-lip); }
.klsc-chip.right .klsc-zh .cn, .klsc-chip.right .klsc-zh .py { color: #fff; }
.klsc-chip.miss { background: linear-gradient(180deg, #E7ECF3, #D9E1EC); box-shadow: 0 5px 0 #BFCADA; }
.klsc-chip.miss .klsc-zh .cn, .klsc-chip.miss .klsc-zh .py { color: #6B7A92; }

/* ---- learner controls: pinyin off / English off ------------- */
/* Both default ON. OFF is a difficulty lever, not a preference — and it
   never blanks a drill's own answer options, or the item becomes
   unanswerable rather than harder. */
.klsc-toggles { display: flex; gap: 8px; margin: 0 0 12px; }
.klsc-toggle {
  display: inline-flex; align-items: center; gap: 6px; font-family: inherit; cursor: pointer;
  padding: 7px 12px; border-radius: 999px; border: 1.5px solid rgba(12,112,224,.28);
  background: rgba(255,255,255,.72); color: var(--blue); font-weight: 900; font-size: 12px;
  box-shadow: 0 3px 8px rgba(40,80,150,.10);
}
.klsc-toggle .state { font-size: 10.5px; letter-spacing: .06em; opacity: .8; }
.klsc-toggle[aria-pressed="true"] { background: rgba(226,238,255,.55); color: var(--muted); border-color: rgba(140,160,195,.4); }
body.klsc-nopy .klsc-zh .py,
body.klsc-nopy .klsc-tile .py,
body.klsc-nopy .klsc-prow .py,
body.klsc-nopy .klsc-srow .py { visibility: hidden; }
body.klsc-noen .klsc-en,
body.klsc-noen .klsc-prow .en { visibility: hidden; }

/* say-it-back */
.klsc-mic {
  width: 84px; height: 84px; border-radius: 50%; border: none; cursor: pointer; color: #fff; font-size: 34px;
  background: linear-gradient(180deg, var(--gold-lite), var(--gold)); box-shadow: 0 7px 0 var(--gold-lip), 0 14px 26px var(--gold-glow);
  display: inline-flex; align-items: center; justify-content: center; font-family: inherit;
}
.klsc-mic:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--gold-lip); }
.klsc-mic.on { background: linear-gradient(180deg, var(--red-lite), var(--red)); box-shadow: 0 7px 0 var(--red-lip), 0 14px 26px var(--red-glow); animation: klscPulse 1.1s ease-in-out infinite; }
@keyframes klscPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.07)} }
.klsc-hint { font-weight: 800; font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 10px; min-height: 19px; }
.klsc-linkbtn { background: none; border: none; font-family: inherit; font-weight: 800; font-size: 13.5px; color: var(--blue); text-decoration: underline; cursor: pointer; padding: 10px; }

/* feedback bar under a drill */
.klsc-fb { margin-top: 14px; padding: 15px 16px; border-radius: 20px; font-weight: 800; font-size: 14.5px; line-height: 1.5; animation: klscFade .28s ease both; }
.klsc-fb.good { background: rgba(224,246,232,.92); border: 1.5px solid rgba(42,150,85,.35); color: var(--green-lip); }
.klsc-fb.soft { background: rgba(238,243,250,.95); border: 1.5px solid rgba(140,160,195,.42); color: var(--ink-soft); }
.klsc-fb .lead { display: block; font-size: 16px; font-weight: 900; margin-bottom: 5px; }

/* results / progress */
.klsc-badge { font-size: 74px; text-align: center; animation: klscBadge 1.2s var(--ease-pop) both; }
@keyframes klscBadge { 0%{transform:scale(0) rotate(-25deg)} 60%{transform:scale(1.2) rotate(6deg)} 100%{transform:scale(1) rotate(0)} }
.klsc-bigstat { display: flex; justify-content: center; gap: 12px; margin: 14px 0 4px; flex-wrap: wrap; }
.klsc-can { margin: 16px 0 4px; padding: 16px 18px; border-radius: var(--radius-card); background: rgba(255,255,255,.75); border: 1.5px solid var(--glass-edge); }
.klsc-can h3 { margin: 0 0 8px; font-size: 13px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: var(--klsc-teal); }
.klsc-can li { font-weight: 800; font-size: 15px; color: var(--ink-soft); line-height: 1.6; }
.klsc-can ul { margin: 0; padding-left: 20px; }
.klsc-strength { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.klsc-srow { display: flex; align-items: center; gap: 10px; }
.klsc-srow .cn { font-family: var(--font-hanzi); font-weight: 700; font-size: 19px; color: var(--blue); flex: 1; }
.klsc-srow .py { font-weight: 700; font-size: 12px; color: var(--muted); }
.klsc-srow .pips { display: inline-flex; gap: 4px; }
.klsc-srow .pips i { width: 9px; height: 9px; border-radius: 50%; background: rgba(140,160,195,.4); display: block; }
.klsc-srow .pips i.on { background: var(--gold); }
.klsc-next-up { margin-top: 12px; font-weight: 800; font-size: 13px; color: var(--muted); }

.klsc-muted { color: var(--muted); font-weight: 700; font-size: 13px; }
.klsc-soon { font-weight: 900; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .klsc-card.lift, .klsc-card.shake, .klsc-opt.right, .klsc-opt.miss, .klsc-slots.miss,
  .klsc-badge, .klsc-mic.on, .klsc-en.show, .klsc-fb, .klsc-gloss { animation: none !important; }
  .klsc-opt, .klsc-card, .klsc-tile { transition: none !important; }
}

/* Azure pronunciation score — arrives late, never blocks, never scolds */
.klsc-score { margin-top: 8px; min-height: 18px; font-weight: 900; font-size: 14px; color: var(--muted); text-align: center; }

/* boss round — speaker label above the bubble */
.klsc-speaker { font-weight: 900; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.klsc-convo .klsc-bubble.a .klsc-row { align-items: center; gap: 10px; }

/* the play buttons must not crowd the characters underneath them */
.klsc-phrase-block { margin-top: 18px; }

/* fill-the-gap inside a phrase */
.klsc-clozeline { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 6px 12px; margin: 18px 0 6px; }
.klsc-clozeword { display: inline-flex; }
.klsc-clozeline .klsc-gap { min-width: 84px; min-height: 52px; font-size: 26px; }
.klsc-clozeline .klsc-gap.filled { font-family: var(--font-hanzi); font-weight: 700; font-size: 30px; color: var(--blue); }
.klsc-clozeline .klsc-gap.filled.right { color: #fff; }
.klsc-clozeline .klsc-gap.filled.miss { color: #6B7A92; }
.klsc-clozeopt { font-family: var(--font-hanzi); font-weight: 700; font-size: 25px; color: var(--blue); }
.klsc-opt.right .klsc-clozeopt, .klsc-opt.miss .klsc-clozeopt { color: inherit; }

/* ============================================================
   DESKTOP / LANDSCAPE (≥900px) — Director 2026-08-31: the responsive
   shell is now the house standard. Phone portrait (420px) on mobile,
   wide shell on web. One HTML, one CSS — the breakpoint decides.
   Ported from KLCPH5/6/7 so every module reads as one family.
   ============================================================ */
@media (min-width: 720px) {
  /* frame widening now lives in assets/kuaile-ds.css — one copy for the whole estate */
  .klsc-app .klsc-head { padding: 16px max(18px, calc((100% - 720px) / 2)) 6px; }
  .klsc-app .klsc-scroll { padding: 4px max(18px, calc((100% - 720px) / 2)) 26px; }
  .klsc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .klsc-cards .klsc-card { margin: 0; }
}
