/* ============================================================
   单词听写电台 · 沪教版七上 U1–U3
   ============================================================ */

:root {
  --paper: #f6f1e7;
  --paper-deep: #eee5d4;
  --card: #fffdf8;
  --ink: #1e2923;
  --ink-2: #46564c;
  --muted: #8b9189;
  --line: #e3d8c5;
  --line-strong: #d3c4aa;
  --coral: #d9583b;
  --coral-deep: #b8432a;
  --coral-soft: #f7ddd4;
  --green: #2e5b4e;
  --green-2: #3d7363;
  --green-soft: #dfe9e2;
  --gold: #bf9a3a;
  --u1: #d9583b;
  --u2: #2e5b4e;
  --u3: #3f6b9a;
  --shadow: 0 26px 60px -34px rgba(47, 40, 24, .45), 0 1px 0 rgba(255, 255, 255, .8) inset;
  --shadow-soft: 0 12px 30px -22px rgba(47, 40, 24, .4);
  --radius: 26px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
html { overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--coral-soft); }

/* ---------- background ---------- */
.bg-art { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.orb-a {
  width: 52vw; height: 52vw; left: -16vw; top: -22vw;
  background: radial-gradient(circle, rgba(217, 88, 59, .28), rgba(217, 88, 59, 0) 68%);
}
.orb-b {
  width: 56vw; height: 56vw; right: -20vw; bottom: -30vw;
  background: radial-gradient(circle, rgba(46, 91, 78, .22), rgba(46, 91, 78, 0) 68%);
}
.grain {
  position: absolute; inset: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='.055'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- top bar ---------- */
.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--green);
  color: #f9f3e6;
  box-shadow: 0 8px 18px -10px rgba(30, 60, 50, .8);
  flex: none;
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 16.5px; font-weight: 650; letter-spacing: .01em; }
.brand-text small { font-size: 11.5px; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }
.top-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.on-air {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 700; letter-spacing: .16em;
  color: var(--coral-deep);
  padding: 6px 11px; border: 1px solid rgba(217, 88, 59, .32);
  border-radius: 999px; background: rgba(255, 250, 244, .55);
}
.on-air i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--coral);
  box-shadow: 0 0 0 3px rgba(217, 88, 59, .15);
  animation: blink 1.8s ease-in-out infinite;
}
.icon-btn {
  font-size: 13px; padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-2);
  background: rgba(255, 252, 245, .5);
  transition: .2s ease;
}
.icon-btn:hover { border-color: var(--ink-2); color: var(--ink); }

/* ---------- shared layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 20px 28px 70px; }
.view { animation: viewIn .45s cubic-bezier(.2, .7, .2, 1) backwards; }
[hidden] { display: none !important; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .24em;
  color: var(--coral-deep);
}
.hero { padding: 42px 0 34px; max-width: 780px; }
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 5.6vw, 66px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.025em;
}
.hero h1 em {
  font-style: italic;
  color: var(--coral);
  white-space: nowrap;
}
.hero .lead {
  margin: 22px 0 0;
  max-width: 560px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.85;
}

.panel {
  background: rgba(255, 253, 248, .74);
  border: 1px solid rgba(211, 196, 170, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 24px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: .02em; }
.text-btn {
  font-size: 12px; color: var(--coral-deep); padding: 4px 2px;
  border-bottom: 1px solid transparent; transition: .2s;
}
.text-btn:hover { border-bottom-color: var(--coral); }

.setup-grid {
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  gap: 18px;
  align-items: start;
}

/* ---------- unit cards ---------- */
.unit-list { display: flex; flex-direction: column; gap: 10px; }
.unit-card {
  --unit: var(--u1);
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 15px 16px 15px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, .55);
  transition: .22s ease;
  position: relative;
  overflow: hidden;
}
.unit-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--unit);
  opacity: .28; transition: .22s;
}
.unit-card:hover { border-color: rgba(211, 196, 170, 1); transform: translateY(-1px); }
.unit-card.selected {
  border-color: var(--unit);
  background: linear-gradient(100deg, rgba(255, 253, 248, .95), rgba(255, 253, 248, .55));
  box-shadow: 0 10px 26px -22px var(--unit);
}
.unit-card.selected::before { opacity: 1; width: 5px; }
.unit-check {
  width: 22px; height: 22px; border-radius: 8px;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  color: transparent; transition: .18s;
  background: rgba(255, 255, 255, .5);
}
.unit-check svg { width: 13px; height: 13px; }
.unit-card.selected .unit-check {
  background: var(--unit); border-color: var(--unit); color: #fff;
}
.unit-main { display: flex; flex-direction: column; min-width: 0; }
.unit-no {
  font-size: 9.5px; font-weight: 700; letter-spacing: .18em;
  color: var(--unit); opacity: .85; margin-bottom: 3px;
}
.unit-main strong {
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  letter-spacing: -.01em; line-height: 1.2;
}
.unit-cn { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.unit-count {
  font-size: 11px; color: var(--ink-2); white-space: nowrap;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(227, 216, 197, .45);
}
.progress-note {
  margin-top: 15px; padding-top: 14px; border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--muted); line-height: 1.7;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.progress-note b { color: var(--green); font-weight: 650; }
.progress-note button { color: var(--coral-deep); border-bottom: 1px solid var(--coral-soft); }

/* ---------- options ---------- */
.options-panel { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field-label {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12px; font-weight: 650; color: var(--ink-2); letter-spacing: .03em;
}
.field-label b { font-family: var(--serif); font-size: 17px; color: var(--green); font-weight: 600; }
.field-hint { margin: 0; font-size: 11px; line-height: 1.6; color: var(--muted); }

.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 13px;
  background: rgba(238, 229, 212, .42);
}
.seg button {
  padding: 9px 6px; border-radius: 9px;
  font-size: 12px; color: var(--ink-2);
  transition: .18s ease;
}
.seg button:hover { color: var(--ink); background: rgba(255, 253, 248, .7); }
.seg button.active {
  background: var(--green); color: #fbf6ea;
  box-shadow: 0 5px 14px -9px rgba(30, 60, 50, .9);
}

.size-row { display: flex; gap: 8px; align-items: center; }
.size-row button {
  min-width: 54px; padding: 9px 12px; border-radius: 11px;
  border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
  background: rgba(255, 253, 248, .55); transition: .18s;
}
.size-row button:hover { border-color: var(--line-strong); }
.size-row button.active { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 650; }
.size-row input {
  width: 66px; margin-left: auto; padding: 9px 8px; text-align: center;
  border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255, 253, 248, .7); font-size: 13px;
  -moz-appearance: textfield;
}
.size-row input::-webkit-outer-spin-button,
.size-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.size-row input:focus { outline: 2px solid var(--coral-soft); border-color: var(--coral); }

/* ---------- settings mounts ---------- */
.settings-mount { border-top: 1px dashed var(--line); padding-top: 19px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.setting { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.setting-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  font-size: 11px; color: var(--muted); letter-spacing: .02em;
}
.setting-label b { font-weight: 650; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.seg.small { border-radius: 11px; padding: 3px; }
.seg.small button { padding: 6px 4px; font-size: 11.5px; border-radius: 8px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(90deg, var(--coral) var(--fill, 50%), var(--line) var(--fill, 50%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px;
  border-radius: 50%; background: var(--card);
  border: 2px solid var(--coral); box-shadow: 0 2px 6px rgba(80, 40, 25, .2);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--coral); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--card);
  border: 2px solid var(--coral);
}

.start-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 17px 20px;
  border-radius: 16px;
  background: var(--ink);
  color: #fbf5e8;
  font-size: 15px; font-weight: 650; letter-spacing: .02em;
  box-shadow: 0 18px 32px -22px rgba(30, 41, 35, .9);
  transition: .22s ease;
}
.start-btn svg { width: 21px; height: 21px; transition: .22s; }
.start-btn:hover { background: var(--green); transform: translateY(-1px); }
.start-btn:hover svg { transform: translateX(4px); }
.start-btn:active { transform: translateY(0); }

.tips {
  margin-top: 26px; padding: 14px 4px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted); line-height: 1.7;
}
.tips b { color: var(--ink-2); font-weight: 650; margin-right: 4px; }
.tips-divider { opacity: .5; }

/* ---------- player ---------- */
.player-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 18px;
  align-items: start;
  padding-top: 8px;
}
.player-main { min-width: 0; }
.player-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.ghost-btn {
  font-size: 12px; color: var(--ink-2); padding: 8px 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 253, 248, .45); transition: .18s;
}
.ghost-btn:hover { border-color: var(--line-strong); background: rgba(255, 253, 248, .9); }
.session-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--muted); white-space: nowrap;
}
.pill-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.console {
  position: relative;
  border: 1px solid rgba(211, 196, 170, .8);
  border-radius: 30px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255, 255, 255, .95), rgba(255, 253, 248, .7) 60%),
    var(--card);
  box-shadow: var(--shadow);
  padding: 22px 26px 20px;
  overflow: hidden;
  min-height: 436px;
  display: flex; flex-direction: column;
}
.console::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--coral), var(--gold), var(--green), transparent);
  opacity: .7;
}
.console-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.unit-tag {
  --unit: var(--u1);
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  color: var(--unit);
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--unit) 30%, transparent);
  background: color-mix(in srgb, var(--unit) 7%, transparent);
}
.counter { font-size: 11px; color: var(--muted); letter-spacing: .08em; font-variant-numeric: tabular-nums; }

.word-face {
  flex: 1;
  display: grid; place-items: center;
  padding: 18px 8px 14px;
  min-height: 292px;
}
.listen-face { display: flex; flex-direction: column; align-items: center; text-align: center; }
.rings { position: relative; width: 168px; height: 168px; display: grid; place-items: center; margin-bottom: 22px; }
.rings i {
  position: absolute; inset: 8px; border-radius: 50%;
  border: 1px solid rgba(46, 91, 78, .35);
  opacity: 0;
  animation: ringPulse 2.8s cubic-bezier(.2, .6, .3, 1) infinite;
}
.rings i:nth-child(2) { animation-delay: .9s; }
.rings i:nth-child(3) { animation-delay: 1.8s; }
.ring-core {
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 32% 26%, var(--green-2), var(--green));
  color: #f7f0df;
  box-shadow: 0 18px 32px -18px rgba(30, 60, 50, .9), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.ring-core svg { width: 38px; height: 38px; }
.listen-title {
  margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 600;
  letter-spacing: .01em; color: var(--ink);
}
.listen-sub { margin: 8px 0 0; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.console.is-idle .rings i { animation-play-state: paused; }

.answer-face {
  width: 100%; text-align: center;
  animation: answerIn .42s cubic-bezier(.2, .7, .2, 1) both;
}
.answer-eyebrow {
  margin: 0 0 12px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .24em; color: var(--coral-deep); opacity: .8;
}
.answer-en {
  margin: 0 auto;
  max-width: 100%;
  font-family: var(--serif);
  font-size: clamp(42px, 6.4vw, 72px);
  font-weight: 600; line-height: 1.08; letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.answer-en.long { font-size: clamp(27px, 3.9vw, 46px); line-height: 1.18; }
.answer-meta {
  margin-top: 20px;
  display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: wrap;
}
.pos-pill {
  font-size: 11.5px; font-weight: 650; color: var(--coral-deep);
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid rgba(217, 88, 59, .32);
  background: rgba(247, 221, 212, .4);
}
.answer-zh {
  font-size: clamp(19px, 2.4vw, 25px); color: var(--ink-2);
  letter-spacing: .02em;
}

.wait-track {
  height: 2px; border-radius: 99px; background: rgba(227, 216, 197, .55);
  overflow: hidden; flex: none;
}
.wait-track i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  border-radius: 99px;
}
.answer-actions {
  min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 18px;
  padding-top: 10px;
}
.link-btn {
  font-size: 11.5px; color: var(--ink-2);
  border-bottom: 1px solid var(--line-strong);
  padding: 2px 0; transition: .18s;
}
.link-btn:hover { color: var(--coral-deep); border-bottom-color: var(--coral); }

.transport {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  margin: 22px 0 0;
}
.round-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 253, 248, .6);
  display: grid; place-items: center; color: var(--ink-2);
  transition: .18s;
}
.round-btn svg { width: 21px; height: 21px; }
.round-btn:hover { border-color: var(--ink-2); color: var(--ink); transform: translateY(-1px); }
.play-btn {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--green); color: #fbf5e8;
  display: grid; place-items: center;
  box-shadow: 0 18px 34px -20px rgba(30, 60, 50, .95);
  transition: .18s;
}
.play-btn svg { width: 26px; height: 26px; }
.play-btn:hover { background: var(--green-2); transform: scale(1.03); }
.play-btn:active { transform: scale(.98); }
.transport-note {
  text-align: center; margin: 12px 0 0;
  font-size: 10.5px; color: var(--muted); letter-spacing: .06em;
}
.settings-mount.live {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 248, .55);
}

/* ---------- playlist ---------- */
.playlist {
  border: 1px solid rgba(211, 196, 170, .75);
  border-radius: 22px;
  background: rgba(255, 253, 248, .7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 19px;
  position: sticky; top: 18px;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-soft);
}
.playlist .panel-head { margin-bottom: 10px; }
#playlistItems {
  list-style: none; margin: 0; padding: 0;
  overflow-y: auto; flex: 1;
  scrollbar-width: thin;
}
#playlistItems li {
  position: relative;
  padding: 9px 8px 9px 28px;
  border-radius: 10px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--muted);
  transition: .18s;
}
#playlistItems li .idx {
  position: absolute; left: 7px; top: 9px;
  font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
#playlistItems li .word { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#playlistItems li .zh { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
#playlistItems li.done .word { color: var(--ink-2); }
#playlistItems li.done .zh { color: var(--muted); }
#playlistItems li.current { background: rgba(247, 221, 212, .35); }
#playlistItems li.current::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  border-radius: 2px; background: var(--coral);
}
#playlistItems li.current .word { color: var(--ink); font-weight: 650; }
#playlistItems li.locked .word { color: #b3b4ac; letter-spacing: .12em; }
.playlist-note { margin: 12px 0 0; font-size: 10px; color: var(--muted); line-height: 1.6; }

/* ---------- done ---------- */
.done-card {
  max-width: 780px; margin: 34px auto 0;
  border: 1px solid rgba(211, 196, 170, .8);
  border-radius: 32px;
  background: rgba(255, 253, 248, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 44px 40px 38px;
  text-align: center;
  animation: viewIn .45s both;
}
.done-mark {
  width: 62px; height: 62px; margin: 0 auto 20px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: #f8f1e1;
  box-shadow: 0 16px 30px -18px rgba(30, 60, 50, .9);
}
.done-mark svg { width: 30px; height: 30px; }
.done-card h2 {
  margin: 0; font-family: var(--serif); font-size: clamp(32px, 4.2vw, 46px);
  font-weight: 600; letter-spacing: -.02em;
}
.done-summary { margin: 12px 0 26px; font-size: 13px; color: var(--muted); }
.done-words {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px; text-align: left;
  max-height: 330px; overflow-y: auto;
  padding: 4px; margin-bottom: 28px;
}
.done-word {
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 11px; border-radius: 10px;
  background: rgba(238, 229, 212, .35);
  font-size: 12px; min-width: 0;
}
.done-word b { font-family: var(--serif); font-size: 14px; font-weight: 600; }
.done-word span { color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.done-actions .start-btn { width: auto; min-width: 190px; padding: 15px 20px; }

/* ---------- backdrop ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(30, 41, 35, .3);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.backdrop.show { opacity: 1; pointer-events: auto; }
@media (min-width: 981px) { .backdrop { display: none !important; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: var(--ink); color: #fbf5e8;
  font-size: 12px; padding: 11px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .28s ease;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .5);
  z-index: 50; max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- animations ---------- */
@keyframes ringPulse {
  0% { transform: scale(.72); opacity: 0; }
  22% { opacity: .55; }
  100% { transform: scale(1.32); opacity: 0; }
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes answerIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .setup-grid { grid-template-columns: 1fr; }
  .player-grid { grid-template-columns: 1fr; }
  .playlist {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(330px, 86vw);
    z-index: 40; border-radius: 22px 0 0 22px;
    transform: translateX(105%);
    transition: transform .3s cubic-bezier(.2, .7, .2, 1);
    max-height: none;
    background: #fcf8ef;
    box-shadow: -26px 0 60px -30px rgba(0, 0, 0, .45);
  }
  .playlist.open { transform: translateX(0); }
}

@media (max-width: 640px) {
  .topbar { padding: 16px 18px 4px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .brand-mark svg { width: 23px; height: 23px; }
  .brand-text strong { font-size: 14.5px; }
  .brand-text small { font-size: 10px; }
  .on-air { display: none; }
  main { padding: 10px 18px 60px; }
  .hero { padding: 28px 0 24px; }
  .hero h1 { font-size: clamp(32px, 9.6vw, 42px); }
  .hero .lead { font-size: 13px; margin-top: 16px; line-height: 1.75; }
  .panel { padding: 18px; border-radius: 22px; }
  .unit-main strong { font-size: 18px; }
  .settings-grid { grid-template-columns: 1fr; gap: 16px; }
  .settings-mount.live { padding: 16px; }
  .console { min-height: 396px; padding: 18px 18px 14px; border-radius: 24px; }
  .word-face { min-height: 270px; }
  .rings { width: 142px; height: 142px; margin-bottom: 16px; }
  .ring-core { width: 80px; height: 80px; }
  .answer-en { font-size: clamp(34px, 10vw, 50px); }
  .answer-en.long { font-size: clamp(24px, 6.6vw, 32px); }
  .transport { gap: 20px; }
  .play-btn { width: 64px; height: 64px; }
  .round-btn { width: 44px; height: 44px; }
  .done-card { padding: 32px 20px 26px; border-radius: 24px; }
  .done-words { grid-template-columns: 1fr; max-height: 300px; }
  .done-actions { flex-direction: column; }
  .done-actions .start-btn { width: 100%; }
  .tips-divider { display: none; }
  .session-pill { display: none; }
  .player-top { justify-content: space-between; }
}

@media (max-width: 380px) {
  .hero h1 em { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
