/* =========================================================
   CVC 拼读乐园
   A tactile, calendar-inspired phonics playground.
   ========================================================= */

@font-face {
  font-family: "OpenDyslexic";
  src: url("assets/fonts/OpenDyslexic-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #eaf1ff;
  --bg-2: #f7f2ff;
  --ink: #21314a;
  --ink-soft: #435571;
  --muted: #72829a;
  --faint: #9aa8bb;
  --paper: #fffdf8;
  --white: #ffffff;
  --blue: #0b6db7;
  --blue-bright: #1679d2;
  --blue-soft: #e5f2fb;
  --red: #ed1c16;
  --red-soft: #ffecea;
  --green: #1a9e61;
  --green-soft: #e6f8ef;
  --amber: #d88a14;
  --amber-soft: #fff4dc;
  --violet: #7a5af8;
  --line: #dfe7f2;
  --line-warm: #e8e1d5;
  --device: #ece8df;
  --device-dark: #d9d3c7;
  --shadow-sm: 0 4px 12px rgba(33, 49, 74, 0.07);
  --shadow-md: 0 16px 36px -18px rgba(33, 49, 74, 0.28);
  --shadow-lg: 0 34px 70px -30px rgba(33, 49, 74, 0.4);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --font: "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-round: "Arial Rounded MT Bold", "Nunito", "Segoe UI", "PingFang SC",
    "Microsoft YaHei", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  color: #fff;
  background: var(--blue);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid #2b72ff;
  outline-offset: 3px;
}

/* ---------- background sky ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 8% -5%, #f8fbff 0%, transparent 58%),
    radial-gradient(900px 700px at 100% 0%, #ffefd8 0%, transparent 50%),
    linear-gradient(135deg, #e7f0ff 0%, #f4efff 47%, #eaf8f2 100%);
}

.sky::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.35;
  background-image: radial-gradient(rgba(33, 49, 74, 0.12) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 75%);
}

.cloud {
  position: absolute;
  width: 280px;
  height: 90px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  filter: blur(2px);
  animation: cloud-drift 22s ease-in-out infinite alternate;
}

.cloud::before,
.cloud::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  top: -42px;
  left: 48px;
  width: 120px;
  height: 120px;
}

.cloud::after {
  top: -24px;
  right: 38px;
  width: 86px;
  height: 86px;
}

.cloud-a {
  top: 16%;
  left: -80px;
  opacity: 0.8;
}

.cloud-b {
  right: -100px;
  bottom: 12%;
  width: 320px;
  opacity: 0.55;
  animation-delay: -8s;
}

.sun {
  position: absolute;
  top: 8%;
  right: 8%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff8d9, #ffd77a 66%, #ffc44f);
  box-shadow: 0 0 80px rgba(255, 198, 80, 0.35);
  opacity: 0.68;
}

.float-letter {
  position: absolute;
  color: rgba(33, 49, 74, 0.1);
  font-family: var(--font-round);
  font-size: clamp(100px, 14vw, 220px);
  font-weight: 900;
  line-height: 1;
  user-select: none;
}

.float-a {
  top: 28%;
  left: 2%;
  color: rgba(11, 109, 183, 0.1);
  transform: rotate(-12deg);
}

.float-b {
  right: 4%;
  bottom: 18%;
  color: rgba(237, 28, 22, 0.08);
  transform: rotate(10deg);
}

.float-c {
  bottom: 4%;
  left: 8%;
  color: rgba(26, 158, 97, 0.09);
  transform: rotate(-6deg);
}

.float-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.dot-a {
  top: 20%;
  left: 22%;
  background: var(--red);
  opacity: 0.35;
}

.dot-b {
  top: 46%;
  right: 12%;
  background: var(--green);
  opacity: 0.3;
}

.dot-c {
  bottom: 24%;
  left: 72%;
  width: 10px;
  height: 10px;
  background: var(--blue);
  opacity: 0.35;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  width: 64px;
  height: 64px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: 0 8px 18px -8px rgba(33, 49, 74, 0.35);
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.2;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-round);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-switch {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.mode-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

.mode-btn.is-active {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 5px 12px -5px rgba(33, 49, 74, 0.5);
}

.mode-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(33, 49, 74, 0.07);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.mode-btn.is-active .mode-count {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.icon-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.install-btn {
  width: auto;
  padding: 0 12px;
  gap: 4px;
  color: #fff;
  background: var(--green);
  border-color: transparent;
  font-size: 12px;
  font-weight: 800;
}

.install-btn:hover {
  color: #fff;
  background: #158a54;
}

.install-label {
  line-height: 1;
}

/* ---------- main / word panel ---------- */

.main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 30px;
}

.word-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(820px, 100%);
  margin: 0 auto 18px;
  padding: 22px 26px 20px 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 20px 50px -30px rgba(33, 49, 74, 0.35), inset 0 1px 0 #fff;
  backdrop-filter: blur(16px);
}

.word-panel::before {
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 0;
  width: 5px;
  content: "";
  border-radius: 0 99px 99px 0;
  background: linear-gradient(to bottom, var(--blue), var(--violet) 48%, var(--red));
  opacity: 0.72;
}

.word-panel::after {
  position: absolute;
  top: -48px;
  right: 22%;
  width: 180px;
  height: 180px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 166, 0.42), transparent 70%);
  pointer-events: none;
}

.word-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.word-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.kicker-line {
  display: inline-block;
  width: 22px;
  height: 2px;
  border-radius: 99px;
  background: var(--red);
}

.word-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.word-display {
  margin: 0;
  font-family: var(--font-round);
  font-size: clamp(42px, 5.2vw, 60px);
  font-weight: 900;
  letter-spacing: 0.025em;
  line-height: 1;
}

.word-part {
  display: inline-block;
  color: var(--part-color, var(--ink));
  text-shadow: 0 3px 0 rgba(33, 49, 74, 0.08);
}

.word-speak {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-soft);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.word-speak:hover {
  background: #d5eafb;
  transform: scale(1.05);
}

.word-speak svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.word-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 8px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.type-badge.is-real {
  color: #0c6f46;
  background: var(--green-soft);
}

.type-badge.is-pseudo {
  color: #825410;
  background: var(--amber-soft);
}

.type-badge.is-irregular {
  color: #a2350b;
  background: #ffeadf;
}

.word-gloss {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}

.word-hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.irregular-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 560px;
  margin-top: 10px;
  padding: 8px 11px;
  border: 1px solid #f1d3ba;
  border-radius: 11px;
  color: #8c3f16;
  background: #fff5ee;
  font-size: 11.5px;
  line-height: 1.5;
}

.irregular-note p {
  margin: 0;
}

.irregular-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  color: #fff;
  background: #d8642f;
  font-size: 12px;
  font-weight: 900;
}

.word-side {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  flex: none;
}

.word-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
  padding-right: 20px;
  border-right: 1px solid var(--line);
}

.word-count strong {
  color: var(--ink);
  font-family: var(--font-round);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.count-label {
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.count-label:first-child {
  margin-bottom: 3px;
}

.count-label:last-child {
  margin-top: 3px;
}

.word-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn-soft {
  border-color: var(--line);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.8);
}

.btn-soft:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  border-color: transparent;
  color: #fff;
  background: var(--ink);
}

.btn-primary:hover {
  background: #162338;
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-emoji {
  font-size: 15px;
  line-height: 1;
}

/* ---------- device ---------- */

.stage {
  position: relative;
}

.device {
  position: relative;
  width: min(820px, 100%, 68vh);
  margin: 0 auto;
  padding: 56px clamp(14px, 3.3vw, 34px) 22px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 40px 40px 30px 30px;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.82) 0%, rgba(251, 249, 243, 0.1) 24%, transparent 46%),
    linear-gradient(180deg, #f7f5ef 0%, #efece4 34%, #e3ded3 100%);
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 #fff,
    inset 0 -10px 22px rgba(122, 110, 91, 0.1);
}

.device::after {
  position: absolute;
  right: 7%;
  bottom: 12px;
  left: 7%;
  height: 6px;
  content: "";
  border-radius: 99px;
  background: rgba(112, 102, 86, 0.12);
  filter: blur(2px);
}

.rail {
  position: absolute;
  top: 25px;
  right: 9%;
  left: 9%;
  z-index: 2;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7f7f5 0%, #d6d3cb 45%, #aaa59a 100%);
  box-shadow: 0 3px 6px rgba(69, 62, 53, 0.18), inset 0 1px 0 #fff;
}

.rail::before {
  position: absolute;
  right: 4%;
  bottom: -4px;
  left: 4%;
  height: 3px;
  content: "";
  border-radius: 99px;
  background: rgba(90, 82, 70, 0.18);
}

.rail-cap {
  position: absolute;
  top: -7px;
  width: 14px;
  height: 27px;
  border-radius: 7px;
  background: linear-gradient(90deg, #b8b4ac, #f5f4f1 45%, #c8c4bb);
  box-shadow: 0 2px 4px rgba(69, 62, 53, 0.18);
}

.rail-left {
  left: -2px;
}

.rail-right {
  right: -2px;
}

.cards {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2.2vw, 22px);
  padding-top: 12px;
  padding-right: 44px;
}

.slot {
  min-width: 0;
  transition: opacity 0.2s ease;
}

.slot-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px 13px;
  color: var(--muted);
}

.slot-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--slot-color);
  background: var(--slot-soft);
  font-size: 9px;
  font-weight: 900;
}

.slot-role {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.slot-en {
  margin-left: auto;
  color: var(--faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.card-frame {
  position: relative;
  border-radius: 15px;
  background: #fff;
  box-shadow:
    0 20px 28px -18px rgba(53, 46, 37, 0.42),
    0 3px 0 rgba(154, 145, 130, 0.22);
  transform-origin: 50% 8%;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.24s ease;
}

.card-frame::after {
  position: absolute;
  inset: 0;
  z-index: 4;
  content: "";
  border: 1px solid rgba(33, 49, 74, 0.07);
  border-radius: inherit;
  pointer-events: none;
}

.card-ring {
  position: absolute;
  top: -19px;
  left: 50%;
  z-index: 5;
  width: 34px;
  height: 34px;
  border: 3px solid #b6b0a5;
  border-radius: 50%;
  background: linear-gradient(145deg, #fbfbf9, #dedbd4);
  box-shadow:
    inset 0 0 0 3px #f6f4ef,
    0 2px 4px rgba(69, 62, 53, 0.2);
  transform: translateX(-50%);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.card-tap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 360 / 577;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 15px;
  background:
    radial-gradient(circle at 28% 22%, #ffffff 0%, transparent 46%),
    linear-gradient(155deg, #fffefb 0%, #fbfaf6 100%);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  container-type: inline-size;
}

.card-letter {
  position: relative;
  z-index: 2;
  display: block;
  color: var(--slot-color);
  font-family: "OpenDyslexic", var(--font-round);
  font-size: 74cqw;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.9;
  text-align: center;
  text-shadow: 0 2px 0 rgba(33, 49, 74, 0.06);
  transform: translateY(-4%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-letter.is-two-letter {
  font-size: 50cqw;
  letter-spacing: -0.08em;
}

.hold-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: 5px;
  border-radius: 0 0 15px 15px;
  background: var(--slot-color);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

.card-tap.is-holding .hold-progress {
  opacity: 1;
  animation: hold-fill 2s linear forwards;
}

.card-tap.is-help-open .card-letter {
  animation: help-pulse 1.2s ease-in-out infinite;
}

.card-shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.35) 0%, transparent 28%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.change-card {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(33, 49, 74, 0.09);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 3px 8px rgba(33, 49, 74, 0.12);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  opacity: 0.7;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.change-card:hover {
  background: #fff;
  opacity: 1;
  transform: rotate(18deg);
}

.card-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 3px 2px;
}

.phone-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--slot-color);
  background: var(--slot-soft);
  font-family: "Segoe UI", var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.tap-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.tap-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--slot-color);
  opacity: 0.55;
}

/* card playing states */

.slot.is-active .card-frame {
  transform: translateY(-7px);
  box-shadow:
    0 0 0 3px var(--slot-color),
    0 20px 38px -18px var(--slot-color),
    0 3px 0 rgba(154, 145, 130, 0.22);
}

.slot.is-active .card-ring {
  border-color: var(--slot-color);
  box-shadow:
    inset 0 0 0 3px #f6f4ef,
    0 0 0 4px var(--slot-soft);
}

.slot.is-active .card-letter {
  transform: translateY(-5%) scale(1.035);
}

.slot.is-active .card-shine {
  opacity: 1;
}

.slot.is-active .tap-dot {
  animation: dot-pulse 0.8s ease-in-out infinite;
  opacity: 1;
}

.slot.is-visited .tap-hint {
  color: var(--slot-color);
}

.slot.is-speaking .card-frame {
  animation: card-bob 0.62s ease-in-out;
}

.slot.is-muted {
  opacity: 0.58;
}

/* ---------- side case toggle ---------- */

.case-toggle {
  position: absolute;
  top: 34%;
  right: 7px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 38px;
  min-height: 91px;
  padding: 7px 4px;
  border: 1px solid rgba(141, 131, 116, 0.2);
  border-radius: 14px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px -10px rgba(33, 49, 74, 0.35), inset 0 1px 0 #fff;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.case-toggle:hover {
  background: #fff;
  transform: translateX(-1px);
  box-shadow: 0 10px 22px -10px rgba(33, 49, 74, 0.4), inset 0 1px 0 #fff;
}

.case-toggle[aria-pressed="true"] {
  color: var(--blue);
  border-color: rgba(11, 109, 183, 0.28);
  background: var(--blue-soft);
}

.case-pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 16px;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.case-pair b {
  font-weight: 400;
}

.case-pair b:last-child {
  color: var(--slot-color, var(--blue));
  font-size: 14px;
}

.case-label {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  writing-mode: vertical-rl;
}

/* ---------- deck ---------- */

.deck {
  position: relative;
  z-index: 3;
  margin-top: 27px;
  padding: 17px 20px 13px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

.deck-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.speed-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.deck-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.deck-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speed-picker {
  display: flex;
  flex-direction: row-reverse;
  gap: 3px;
  flex: none;
  padding: 4px;
  border: 1px solid rgba(141, 131, 116, 0.14);
  border-radius: 999px;
  background: rgba(228, 223, 212, 0.7);
}

.speed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 70px;
  height: 35px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  color: #657184;
  background: transparent;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.speed-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.speed-btn.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 10px -3px rgba(33, 49, 74, 0.25);
}

.speed-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
}

.speed-btn.is-active .speed-dot {
  background: var(--blue);
  opacity: 1;
}

.speed-picker.is-disabled {
  opacity: 0.45;
}

.speed-picker.is-disabled .speed-btn {
  cursor: not-allowed;
}

.transport {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 48px;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
}

.icon-btn-transport {
  width: 44px;
  height: 44px;
  padding: 0;
  border-color: rgba(33, 49, 74, 0.08);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.65);
  font-size: 17px;
}

.icon-btn-transport:hover {
  background: #fff;
}

.blend-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 51px;
  padding: 0 22px;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.17), transparent 38%),
    linear-gradient(135deg, #1e63e9 0%, #244fd8 52%, #4738c9 100%);
  box-shadow:
    0 14px 24px -12px rgba(36, 79, 216, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-family: var(--font-round);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.blend-btn:hover {
  filter: brightness(1.04);
  box-shadow:
    0 18px 28px -12px rgba(36, 79, 216, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.blend-btn:active {
  transform: translateY(1px) scale(0.995);
}

.blend-btn.is-playing {
  filter: saturate(0.95);
}

.blend-btn.is-irregular {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.14), transparent 38%),
    linear-gradient(135deg, #c85f1e 0%, #d8452e 60%, #c52d52 100%);
  box-shadow: 0 14px 24px -12px rgba(200, 70, 40, 0.7);
}

.blend-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.blend-icon svg {
  width: 16px;
  height: 16px;
  margin-left: 2px;
  fill: #fff;
}

.blend-waves {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 16px;
  margin-left: 2px;
}

.blend-waves i {
  display: block;
  width: 2px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.68);
}

.blend-btn.is-playing .blend-waves i {
  animation: wave 0.75s ease-in-out infinite;
}

.blend-btn.is-playing .blend-waves i:nth-child(2) {
  animation-delay: 0.12s;
}

.blend-btn.is-playing .blend-waves i:nth-child(3) {
  animation-delay: 0.24s;
}

.btn-whole {
  height: 44px;
  padding: 0 15px;
  border-color: rgba(33, 49, 74, 0.08);
  border-radius: 13px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
}

.btn-whole:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 18px;
  margin-top: 10px;
  padding: 0 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
}

.status-light {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(26, 158, 97, 0.1);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.status-light.is-playing {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 109, 183, 0.12);
  animation: status-pulse 1s ease-in-out infinite;
}

.status-light.is-error {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(237, 28, 22, 0.12);
}

/* ---------- tips ---------- */

.tip-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(880px, 100%);
  margin: 14px auto 0;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.48);
}

.tip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 900;
}

.tip-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tip-item strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.tip-item span:last-child {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

/* ---------- product promotion ---------- */

.product-promo {
  width: min(880px, 100%);
  margin: 26px auto 0;
  padding: clamp(18px, 3.4vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  background:
    radial-gradient(500px 220px at 95% 0%, rgba(255, 225, 170, 0.4), transparent 68%),
    linear-gradient(150deg, rgba(255, 253, 247, 0.96), rgba(241, 247, 255, 0.92));
  box-shadow: 0 24px 60px -38px rgba(33, 49, 74, 0.4), inset 0 1px 0 #fff;
}

.promo-head {
  max-width: 680px;
}

.promo-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.promo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
}

.promo-dot.is-blue {
  background: var(--blue);
}

.promo-head h2 {
  margin: 0;
  font-family: var(--font-round);
  font-size: clamp(24px, 3.1vw, 32px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.promo-lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.product-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.product-shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid #e3e9f2;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 30px -24px rgba(33, 49, 74, 0.35);
}

.product-shot > a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f5f3ee;
}

.product-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.product-shot:hover img {
  transform: scale(1.025);
}

.product-shot figcaption {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 8px;
  padding: 12px 14px 14px;
}

.shot-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #0b6b46;
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 900;
}

.shot-tag.is-red {
  color: #a12620;
  background: var(--red-soft);
}

.product-shot figcaption strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.product-shot figcaption small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.promo-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 18px 21px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(300px 120px at 100% 0%, rgba(93, 139, 255, 0.32), transparent 70%),
    linear-gradient(135deg, #26364f, #1c2b42);
  box-shadow: 0 18px 30px -22px rgba(22, 35, 56, 0.55);
}

.promo-company {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.promo-company strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.promo-company span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.promo-mail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  flex: none;
  padding: 0 16px;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  transition: background 0.18s ease, transform 0.18s ease;
}

.promo-mail:hover {
  background: var(--blue-soft);
  transform: translateY(-1px);
}

.social-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: center;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #e5ebf4;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.social-copy h3 {
  margin: 0;
  font-family: var(--font-round);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.social-copy > p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.social-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.social-list.is-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.social-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid #e2e8f1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px -20px rgba(33, 49, 74, 0.3);
}

.social-card > a {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
}

.social-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease;
}

.social-card:hover img {
  transform: scale(1.025);
}

.social-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 11px 11px;
  text-align: center;
}

.social-card figcaption strong {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
}

.social-card figcaption span {
  color: var(--ink-soft);
  font-size: 10px;
}

.social-card figcaption small {
  color: var(--faint);
  font-size: 9px;
}

.social-card.is-dark {
  border-color: #cfd7e2;
}

@media (max-width: 720px) {
  .product-promo {
    margin-top: 18px;
    border-radius: 24px;
  }

  .product-gallery {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-shot > a {
    aspect-ratio: 16 / 10;
  }

  .promo-cta {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .promo-mail {
    width: 100%;
  }

  .social-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .social-list {
    gap: 8px;
  }

  .social-copy h3 {
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  .social-list {
    grid-template-columns: 1fr;
  }

  .social-list.is-three {
    grid-template-columns: 1fr;
  }

  .social-card {
    display: grid;
    grid-template-columns: 108px 1fr;
    align-items: center;
  }

  .social-card > a {
    aspect-ratio: 1 / 1;
  }

  .social-card figcaption {
    text-align: left;
    padding: 8px 10px;
  }
}

/* ---------- footer ---------- */

.footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 24px;
  color: var(--muted);
  font-size: 10.5px;
}

.footer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer p {
  margin: 0;
}

.footer-note {
  color: var(--faint);
}

.footer-company {
  color: #7f8b9e;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
  opacity: 0.9;
}

.footer-company a {
  color: inherit;
  text-decoration: none;
}

.footer-company a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.6;
}

.footer-legal a {
  color: inherit;
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* ---------- modal ---------- */

.modal {
  width: min(720px, calc(100vw - 28px));
  max-height: min(88dvh, 840px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 42px 90px -24px rgba(20, 31, 50, 0.5);
  font-family: var(--font);
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: modal-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal::backdrop {
  background: rgba(23, 37, 61, 0.42);
  backdrop-filter: blur(5px);
}

.modal-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 23px 26px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-kicker {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--font-round);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.modal-head p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: #fff;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.modal-close:hover {
  background: var(--blue-soft);
  transform: rotate(8deg);
}

.bank-tabs {
  display: flex;
  gap: 5px;
  padding: 14px 26px 0;
}

.bank-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.bank-tab:hover {
  background: #f3f6fb;
}

.bank-tab.is-active {
  color: var(--ink);
  background: #eef4ff;
  border-color: #d7e3fa;
}

.bank-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 15px 26px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.bank-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 66px;
  padding: 9px 10px;
  border: 1px solid #e6eaf1;
  border-radius: 13px;
  text-align: left;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.bank-option:hover {
  border-color: #c8d7eb;
  background: #f9fbff;
  transform: translateY(-1px);
}

.bank-option.is-selected {
  border-color: var(--option-color, var(--blue));
  background: var(--option-soft, var(--blue-soft));
  box-shadow: inset 0 0 0 1px var(--option-color, var(--blue));
}

.bank-option-key {
  color: var(--option-color, var(--ink));
  font-family: var(--font-round);
  font-size: 25px;
  font-weight: 900;
  line-height: 1.05;
}

.bank-option-ipa {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.bank-option-note {
  margin-top: 1px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.2;
}

.bank-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 26px 19px;
  border-top: 1px solid var(--line);
  background: #fbfbf8;
}

.bank-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bank-preview > span:first-child {
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.bank-preview strong {
  font-family: var(--font-round);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.bank-preview-ipa {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.bank-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* ---------- help modal ---------- */

.help-modal {
  width: min(760px, calc(100vw - 28px));
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 26px;
  overflow-y: auto;
}

.help-card {
  position: relative;
  padding: 15px 15px 14px;
  border: 1px solid #e7ebf2;
  border-radius: 17px;
  background: linear-gradient(160deg, #fff, #f8faff);
}

.help-card h3 {
  margin: 7px 0 4px;
  font-size: 13px;
  font-weight: 800;
}

.help-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

/* 字母、音标和英文标签统一使用 OpenDyslexic；中文继续使用系统中文字体。 */
.word-display,
.card-letter,
.bank-option-key,
.phone-pill,
.slot-en,
.eyebrow,
.word-kicker,
.bank-preview strong,
.blend-label,
.case-pair {
  font-family: "OpenDyslexic", var(--font-round);
  letter-spacing: 0.005em;
}

.word-display,
.card-letter,
.bank-option-key {
  font-weight: 400;
}

.help-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 21px;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.help-wide {
  grid-column: span 2;
}

.install-help {
  background: linear-gradient(140deg, #f2fbf6, #f7fbff);
  border-color: #d9eee2;
}

.install-help .help-step {
  color: var(--green);
  background: var(--green-soft);
}

.help-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 26px 19px;
  border-top: 1px solid var(--line);
  background: #fbfbf8;
}

.help-foot-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.help-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
}

.help-company {
  color: #7f8b9e !important;
  font-size: 10.5px !important;
  font-weight: 600;
  opacity: 0.9;
}

.help-product-link a {
  color: var(--blue);
  font-size: 10.5px;
  font-weight: 800;
  text-decoration: none;
}

.help-product-link a:hover {
  text-decoration: underline;
}

.help-company a {
  color: inherit;
  text-decoration: none;
}

/* ---------- toast / noscript ---------- */

.toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 90;
  max-width: min(420px, calc(100vw - 28px));
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  background: rgba(25, 38, 59, 0.94);
  box-shadow: 0 16px 30px -12px rgba(20, 31, 50, 0.5);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in 0.22s ease;
}

.noscript {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 100;
  padding: 14px;
  border-radius: 12px;
  color: #fff;
  background: var(--red);
  text-align: center;
}

/* ---------- word/deck animation ---------- */

.word-display.is-energized .word-part {
  animation: letter-pop 0.46s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.word-display.is-energized .word-part:nth-child(2) {
  animation-delay: 0.055s;
}

.word-display.is-energized .word-part:nth-child(3) {
  animation-delay: 0.11s;
}

.card-frame.is-flipping {
  animation: card-swap 0.3s ease;
}

.device.is-celebrating .deck {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 2px rgba(26, 158, 97, 0.22);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .topbar,
  .main,
  .footer {
    width: min(100% - 28px, 760px);
  }

  .topbar {
    padding-top: 16px;
  }

  .word-panel {
    padding: 20px 20px 18px 24px;
  }

  .word-side {
    gap: 12px;
  }

  .word-count {
    padding-right: 12px;
  }

  .tip-strip {
    gap: 8px;
  }

  .tip-item {
    padding: 10px;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .brand h1 {
    font-size: 22px;
  }

  .top-actions {
    flex: 1;
    justify-content: flex-end;
  }

  .mode-switch {
    flex: 1;
    max-width: 320px;
    min-width: 240px;
  }

  .mode-btn {
    flex: 1;
    min-width: 0;
    padding: 0 8px;
    font-size: 12px;
  }

  .mode-count {
    display: none;
  }

  .main {
    padding-top: 14px;
  }

  .word-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 12px;
    border-radius: 22px;
  }

  .word-side {
    align-items: center;
    justify-content: space-between;
    padding-top: 2px;
    border-top: 1px solid var(--line);
  }

  .word-count {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .word-count strong {
    font-size: 20px;
  }

  .count-label:first-child,
  .count-label:last-child {
    margin: 0;
  }

  .word-actions {
    flex-direction: row;
  }

  .word-actions .btn {
    min-height: 38px;
    padding: 0 12px;
  }

  .word-display {
    font-size: clamp(38px, 11vw, 52px);
  }

  .word-hint {
    max-width: 90%;
  }

  .device {
    padding: 45px 12px 14px;
    border-radius: 27px 27px 22px 22px;
  }

  .rail {
    top: 19px;
    right: 7%;
    left: 7%;
    height: 10px;
  }

  .rail-cap {
    top: -5px;
    height: 21px;
    width: 11px;
  }

  .cards {
    gap: 8px;
    padding-top: 9px;
  }

  .slot-heading {
    gap: 4px;
    margin: 0 2px 9px;
  }

  .slot-index {
    width: 17px;
    height: 17px;
    font-size: 8px;
  }

  .slot-role {
    font-size: 10.5px;
  }

  .slot-en {
    display: none;
  }

  .card-frame,
  .card-tap {
    border-radius: 11px;
  }

  .case-toggle {
    right: 4px;
    width: 33px;
    min-height: 80px;
    gap: 4px;
    padding: 5px 2px;
    border-radius: 11px;
  }

  .case-pair {
    font-size: 14px;
  }

  .case-pair b:last-child {
    font-size: 12px;
  }

  .case-label {
    font-size: 7px;
  }

  .card-ring {
    top: -13px;
    width: 26px;
    height: 26px;
    border-width: 2px;
    box-shadow: inset 0 0 0 2px #f6f4ef, 0 2px 4px rgba(69, 62, 53, 0.18);
  }

  .change-card {
    top: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .card-caption {
    padding-top: 7px;
  }

  .phone-pill {
    min-height: 20px;
    padding: 0 5px;
    font-size: 9.5px;
  }

  .tap-hint {
    display: none;
  }

  .slot.is-active .card-frame {
    transform: translateY(-4px);
  }

  .deck {
    margin-top: 20px;
    padding: 12px 12px 10px;
    border-radius: 18px;
  }

  .deck-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .deck-sub {
    display: none;
  }

  .speed-picker {
    width: 100%;
  }

  .speed-btn {
    flex: 1;
    min-width: 0;
    height: 33px;
    padding: 0 6px;
    font-size: 11.5px;
  }

  .transport {
    grid-template-columns: 38px minmax(0, 1fr) auto 38px;
    gap: 7px;
    margin-top: 10px;
  }

  .icon-btn-transport {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .blend-btn {
    height: 46px;
    padding: 0 10px;
    border-radius: 13px;
    font-size: 15px;
  }

  .blend-icon {
    width: 23px;
    height: 23px;
  }

  .blend-waves {
    display: none;
  }

  .btn-whole {
    height: 40px;
    padding: 0 10px;
    font-size: 11px;
  }

  .status-bar {
    margin-top: 8px;
    font-size: 9.5px;
  }

  .tip-strip {
    display: none;
  }

  .footer {
    padding-bottom: 18px;
    font-size: 9.5px;
  }

  .footer-note {
    display: none;
  }

  .modal {
    width: calc(100vw - 16px);
    max-height: 91dvh;
    border-radius: 22px;
  }

  .modal-head {
    padding: 18px 18px 13px;
  }

  .modal-head h2 {
    font-size: 23px;
  }

  .modal-head p:last-child {
    font-size: 11px;
  }

  .bank-tabs {
    padding: 11px 18px 0;
    gap: 3px;
  }

  .bank-tab {
    flex: 1;
    padding: 0 6px;
    font-size: 10px;
  }

  .bank-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 12px 18px 14px;
  }

  .bank-option {
    min-height: 61px;
    padding: 7px 8px;
  }

  .bank-option-key {
    font-size: 22px;
  }

  .bank-foot {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 11px 18px 15px;
  }

  .bank-actions {
    justify-content: flex-end;
  }

  .bank-preview strong {
    font-size: 20px;
  }

  .help-grid {
    grid-template-columns: 1fr;
    padding: 14px 18px;
  }

  .help-wide {
    grid-column: span 1;
  }

  .help-foot {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 11px 18px 15px;
  }

  .help-foot-copy > p:first-child {
    display: none;
  }

  .help-company {
    display: block;
    font-size: 8px !important;
  }

  .help-foot .btn {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .topbar,
  .main,
  .footer {
    width: calc(100% - 20px);
  }

  .eyebrow {
    font-size: 9px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
  }

  .top-actions {
    gap: 6px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .lang-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    font-size: 11px;
  }

  .install-btn {
    width: 40px;
    padding: 0;
  }

  .install-label {
    display: none;
  }

  .mode-switch {
    max-width: none;
    border-radius: 13px;
  }

  .mode-btn {
    min-height: 34px;
    font-size: 11px;
  }

  .word-panel {
    padding: 17px 16px 14px 19px;
  }

  .word-panel::before {
    top: 17px;
    bottom: 17px;
    width: 4px;
  }

  .word-display {
    font-size: 43px;
  }

  .word-speak {
    width: 36px;
    height: 36px;
  }

  .word-speak svg {
    width: 18px;
    height: 18px;
  }

  .word-side {
    gap: 8px;
  }

  .word-actions {
    gap: 6px;
  }

  .word-actions .btn {
    min-height: 36px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .word-gloss {
    font-size: 12.5px;
  }

  .word-hint {
    font-size: 11px;
  }

  .device {
    padding: 41px 9px 11px;
  }

  .rail {
    top: 17px;
  }

  .cards {
    gap: 6px;
  }

  .slot-heading {
    margin-bottom: 8px;
  }

  .slot-index {
    display: none;
  }

  .slot-role {
    font-size: 10px;
  }

  .card-ring {
    top: -11px;
    width: 22px;
    height: 22px;
  }

  .change-card {
    width: 23px;
    height: 23px;
    font-size: 11px;
  }

  .card-caption {
    padding: 6px 1px 0;
  }

  .phone-pill {
    min-height: 18px;
    padding: 0 4px;
    font-size: 8.5px;
  }

  .deck {
    margin-top: 16px;
    padding: 10px 9px 8px;
  }

  .deck-title {
    font-size: 11px;
  }

  .speed-btn {
    height: 31px;
    font-size: 10.5px;
  }

  .transport {
    grid-template-columns: 34px minmax(0, 1fr) auto 34px;
    gap: 5px;
  }

  .icon-btn-transport {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .blend-btn {
    height: 43px;
    font-size: 14px;
    gap: 6px;
  }

  .blend-icon {
    width: 21px;
    height: 21px;
  }

  .btn-whole {
    height: 37px;
    padding: 0 7px;
    font-size: 10px;
  }

  .btn-whole .btn-emoji {
    display: none;
  }

  .status-bar {
    font-size: 9px;
  }

  .bank-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 10px 14px 12px;
  }

  .bank-tabs,
  .modal-head {
    padding-right: 14px;
    padding-left: 14px;
  }

  .bank-foot,
  .help-grid {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 380px) {
  .install-btn {
    display: none !important;
  }

  .top-actions {
    flex: 0 0 auto;
  }

  .mode-switch {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .mode-btn {
    padding: 0 5px;
  }

  .word-actions .btn {
    padding: 0 8px;
  }

  .word-gloss {
    max-width: 190px;
  }

  .word-strip .word-gloss {
    display: none;
  }

  .bank-option-note {
    display: none;
  }
}

@media (max-height: 940px) and (min-width: 721px) {
  .device {
    width: min(820px, 100%, 64vh);
  }
}

@media (max-height: 700px) and (min-width: 721px) {
  .topbar {
    padding-top: 12px;
  }

  .main {
    padding-top: 10px;
  }

  .word-panel {
    padding-top: 16px;
    padding-bottom: 14px;
  }

  .word-display {
    font-size: 50px;
  }

  .device {
    padding-top: 46px;
  }

  .deck {
    margin-top: 20px;
  }
}

/* ---------- motion preferences ---------- */

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

/* ---------- keyframes ---------- */

@keyframes cloud-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(26px, 10px, 0);
  }
}

@keyframes dot-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--slot-soft);
  }
  50% {
    box-shadow: 0 0 0 4px var(--slot-soft);
  }
}

@keyframes card-bob {
  0%,
  100% {
    transform: translateY(-7px) rotate(0deg);
  }
  35% {
    transform: translateY(-11px) rotate(-0.8deg);
  }
  70% {
    transform: translateY(-6px) rotate(0.5deg);
  }
}

@keyframes card-swap {
  0% {
    opacity: 0.35;
    transform: translateY(-5px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes letter-pop {
  0% {
    opacity: 0.3;
    transform: translateY(7px) scale(0.9);
  }
  65% {
    transform: translateY(-2px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes status-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.35);
  }
}

@keyframes wave {
  0%,
  100% {
    height: 6px;
    opacity: 0.55;
  }
  50% {
    height: 15px;
    opacity: 1;
  }
}

@keyframes hold-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes help-pulse {
  0%,
  100% {
    transform: translateY(-4%) scale(1);
  }
  50% {
    transform: translateY(-4%) scale(1.045);
  }
}

/* =========================================================
   Focus layout: compact header, large cards, side promotion
   ========================================================= */

.workspace {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
}

.workspace > .main {
  width: 100%;
  margin: 0;
  padding: 12px 0 10px;
}

.focus-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(141, 131, 116, 0.18);
  border-radius: 13px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.focus-btn:hover {
  background: #fff;
}

.focus-btn[aria-pressed="true"] {
  color: #8a4b12;
  border-color: #f0cf9e;
  background: #fff4dc;
}

.focus-icon {
  font-size: 15px;
  line-height: 1;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  flex: none;
  padding: 0 10px;
  border: 1px solid rgba(141, 131, 116, 0.18);
  border-radius: 13px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-round);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.lang-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.desktop-only {
  display: none;
}

.mobile-only {
  display: inline;
}

/* compact word area */

.word-strip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  margin: 0 auto;
  padding: 9px 14px 9px 20px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.84);
  box-shadow: 0 15px 34px -28px rgba(33, 49, 74, 0.4), inset 0 1px 0 #fff;
  backdrop-filter: blur(14px);
}

.top-controls {
  position: relative;
  z-index: 24;
  width: 100%;
  margin: 0 auto 10px;
}

.top-controls .word-strip {
  margin-bottom: 0;
}

.word-strip::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 4px;
  content: "";
  border-radius: 0 99px 99px 0;
  background: linear-gradient(to bottom, var(--blue), var(--violet) 48%, var(--red));
  opacity: 0.75;
}

.word-strip-main {
  min-width: 0;
}

.word-strip .word-kicker {
  margin: 0 0 1px;
  font-size: 8px;
  letter-spacing: 0.14em;
}

.word-strip .word-line {
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.word-strip .word-display {
  font-size: clamp(36px, 3.6vw, 48px);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.word-strip .word-speak {
  width: 34px;
  height: 34px;
}

.word-strip .word-speak svg {
  width: 17px;
  height: 17px;
}

.word-strip .type-badge {
  min-height: 22px;
  padding: 0 8px;
  font-size: 10px;
}

.word-strip .word-gloss {
  overflow: hidden;
  max-width: 210px;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-soft);
  background: #f7f9fd;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.tools-toggle:hover {
  background: #fff;
  border-color: #cad8ea;
}

.tools-toggle[aria-expanded="true"] {
  background: var(--blue-soft);
  border-color: #c7e0f4;
}

.tools-chevron {
  display: inline-block;
  font-size: 13px;
  transition: transform 0.18s ease;
}

.tools-toggle[aria-expanded="true"] .tools-chevron {
  transform: rotate(180deg);
}

.tool-drawer {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.97);
  box-shadow: 0 22px 50px -22px rgba(33, 49, 74, 0.45);
  backdrop-filter: blur(16px);
  animation: drawer-in 0.18s ease;
}

.tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-row-bottom {
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.tool-drawer .mode-switch {
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
  padding: 3px;
  background: #f1f5fb;
  box-shadow: none;
}

.tool-drawer .mode-btn {
  min-height: 31px;
  padding: 0 10px;
  font-size: 11px;
}

.tool-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex: none;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.tool-count strong {
  color: var(--ink);
  font-family: var(--font-round);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.tool-row-bottom .word-hint {
  max-width: 62%;
  margin: 0;
  font-size: 10.5px;
  line-height: 1.45;
}

.tool-actions {
  display: flex;
  gap: 7px;
  flex: none;
}

.tool-actions .btn {
  min-height: 34px;
  padding: 0 11px;
  font-size: 11px;
}

.workspace .irregular-note {
  width: 100%;
  max-width: none;
  margin: 0 auto 8px;
}

/* side promotion */

.promo-rail {
  display: none;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  transition: opacity 0.28s ease, filter 0.28s ease;
}

.rail-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 18px 40px -32px rgba(33, 49, 74, 0.4), inset 0 1px 0 #fff;
  backdrop-filter: blur(14px);
}

.rail-kicker {
  margin: 0 0 5px;
  color: var(--blue);
  font-family: "OpenDyslexic", var(--font-round);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.rail-product h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-round);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.rail-product h2 span {
  display: inline-block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
}

.rail-shots {
  display: grid;
  gap: 7px;
  margin: 11px 0 9px;
}

.rail-shots a {
  display: block;
  overflow: hidden;
  border-radius: 11px;
  background: #f4f2ed;
}

.rail-shots img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.rail-shots a:hover img {
  transform: scale(1.03);
}

.rail-copy {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.rail-mail {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.18s ease;
}

.rail-mail:hover {
  background: var(--blue);
}

.rail-company {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 13px;
}

.rail-company span {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.45;
}

.rail-company a {
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.rail-social-card h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: var(--font-round);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.rail-social-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rail-social {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #e8edf4;
  border-radius: 13px;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.rail-social:hover {
  border-color: #c8d9ec;
  transform: translateX(1px);
}

.rail-social img {
  width: 70px;
  height: 70px;
  flex: none;
  border-radius: 9px;
  object-fit: cover;
}

.rail-social span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.rail-social b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.rail-social small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-social small:last-child {
  color: var(--faint);
  font-size: 8.5px;
}

/* lights-off focus mode */

body.focus-mode .promo-rail {
  opacity: 0.1;
  filter: blur(8px) saturate(0.3);
  pointer-events: none;
  user-select: none;
}

body.focus-mode .focus-btn {
  color: #fff;
  border-color: transparent;
  background: var(--ink);
}

.mobile-promo {
  display: block;
}

@media (max-width: 460px) {
  .workspace {
    width: calc(100% - 20px);
  }

  .word-strip {
    gap: 7px;
    padding: 8px 10px 8px 16px;
    border-radius: 16px;
  }

  .word-strip .word-display {
    font-size: 36px;
  }

  .word-strip .word-gloss {
    max-width: 130px;
    font-size: 10px;
  }

  .word-strip .type-badge {
    font-size: 9px;
  }

  .tools-toggle {
    min-height: 33px;
    padding: 0 8px;
    font-size: 10px;
  }

  .tool-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .tool-row-bottom {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .tool-drawer .mode-switch {
    width: 100%;
  }

  .tool-drawer .mode-btn {
    flex: 1;
  }

  .tool-count {
    align-self: flex-end;
  }

  .tool-row-bottom .word-hint {
    max-width: none;
  }

  .tool-actions .btn {
    flex: 1;
  }

  .mobile-promo {
    width: calc(100% - 20px);
    margin-right: auto;
    margin-left: auto;
  }
}

@media (min-width: 1280px) {
  .workspace {
    display: grid;
    grid-template-columns: clamp(190px, 17.5vw, 240px) minmax(0, 1fr) clamp(190px, 17.5vw, 240px);
    gap: 18px;
    align-items: start;
    width: min(1500px, calc(100% - 40px));
  }

  .workspace > .main {
    min-width: 0;
  }

  .promo-rail {
    display: flex;
    position: sticky;
    top: 18px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
  }

  .focus-btn {
    display: inline-flex;
  }

  .desktop-only {
    display: inline;
  }

  .mobile-only {
    display: none !important;
  }

  .mobile-promo {
    display: none !important;
  }

  .topbar,
  .footer {
    width: min(1500px, calc(100% - 40px));
  }

  .device {
    width: min(900px, 100%);
  }
}

@media (min-width: 1280px) and (max-height: 920px) {
  .device {
    width: min(790px, 100%);
  }

  .word-strip {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .deck {
    margin-top: 20px;
  }
}

@media (max-width: 720px) {
  .focus-btn {
    display: none !important;
  }

  .mobile-promo {
    width: calc(100% - 20px);
  }
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* =========================================================
   Blending slider
   ========================================================= */

.blend-deck {
  margin-top: 9px;
  padding: 8px 18px 6px;
  border-radius: 22px;
}

.blend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.speed-readout {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 1px;
  flex: none;
  min-width: 82px;
  padding: 5px 10px;
  border: 1px solid #d9e7f7;
  border-radius: 12px;
  background: #edf6ff;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.speed-readout span {
  color: var(--blue);
  font-family: var(--font-round);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.speed-readout small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.blend-deck.is-playing .speed-readout {
  border-color: #bcd9f2;
  background: #e1f1ff;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 5px;
}

.slider-end {
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
  flex: none;
}

.speed-slider {
  width: 100%;
  height: 38px;
  flex: 1;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: grab;
}

.speed-slider:active {
  cursor: grabbing;
}

.speed-slider:focus-visible {
  outline: 2px solid #2b72ff;
  outline-offset: 3px;
  border-radius: 8px;
}

.speed-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b8cdeb 0%, #2874d4 38%, #6750dd 70%, #1a9e61 100%);
  box-shadow: inset 0 1px 2px rgba(33, 49, 74, 0.12);
}

.speed-slider::-webkit-slider-thumb {
  width: 34px;
  height: 34px;
  margin-top: -12px;
  border: 2px solid #fff;
  border-radius: 7px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(8, 22, 52, 0.28) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #4d78e9 0%, #1d3ba5 100%);
  box-shadow:
    0 3px 0 #152b66,
    0 5px 12px -4px rgba(33, 49, 74, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  -webkit-appearance: none;
  appearance: none;
}

.speed-slider::-moz-range-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b8cdeb 0%, #2874d4 38%, #6750dd 70%, #1a9e61 100%);
}

.speed-slider::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: #2874d4;
}

.speed-slider::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 7px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.3) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(8, 22, 52, 0.28) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #4d78e9 0%, #1d3ba5 100%);
  box-shadow:
    0 3px 0 #152b66,
    0 5px 12px -4px rgba(33, 49, 74, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.slider-stops {
  position: relative;
  height: 33px;
  margin: 1px 15px 0;
}

.slider-stop {
  position: absolute;
  top: 0;
  min-height: 31px;
  padding: 5px 8px;
  border: 1px solid #d5dfeb;
  border-radius: 9px;
  color: #53627a;
  background: linear-gradient(180deg, #ffffff 0%, #edf2f9 100%);
  box-shadow:
    0 2px 0 #c6d2e0,
    0 4px 8px -5px rgba(33, 49, 74, 0.28),
    inset 0 1px 0 #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transform: translateX(-50%);
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.slider-stop:nth-child(1) {
  left: 0;
  transform: none;
}

.slider-stop:nth-child(2) {
  left: 33.333%;
}

.slider-stop:nth-child(3) {
  left: 66.666%;
}

.slider-stop:nth-child(4) {
  left: 100%;
  transform: translateX(-100%);
}

.slider-stop:hover {
  color: var(--ink);
  border-color: #c3d4e6;
  background: linear-gradient(180deg, #ffffff 0%, #e3edf8 100%);
  box-shadow:
    0 3px 0 #b9c9da,
    0 7px 12px -6px rgba(33, 49, 74, 0.3),
    inset 0 1px 0 #ffffff;
  transform: translate(-50%, -1px);
}

.slider-stop:nth-child(1):hover {
  transform: translateY(-1px);
}

.slider-stop:nth-child(4):hover {
  transform: translate(-100%, -1px);
}

.slider-stop.is-active {
  color: #fff;
  border-color: #1a2940;
  background: linear-gradient(180deg, #354b6b 0%, #1e2e46 100%);
  box-shadow:
    0 1px 0 #101b2b,
    inset 0 2px 4px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, 1px);
}

.slider-stop:nth-child(1).is-active {
  transform: translateY(1px);
}

.slider-stop:nth-child(4).is-active {
  transform: translate(-100%, 1px);
}

.blend-deck.is-irregular .speed-readout span {
  color: #a14e1c;
}

.blend-deck.is-irregular .speed-readout {
  border-color: #f0d2bd;
  background: #fff3ea;
}

.blend-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.blend-footer .status-bar {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.blend-footer .icon-btn-transport {
  width: 35px;
  height: 35px;
  flex: none;
  font-size: 14px;
}

.blend-footer .status-bar {
  font-size: 9.5px;
}

@media (max-width: 720px) {
  .blend-deck {
    padding: 11px 12px 9px;
    border-radius: 18px;
  }

  .speed-readout {
    min-width: 72px;
    padding: 4px 8px;
  }

  .speed-readout span {
    font-size: 12.5px;
  }

  .slider-row {
    gap: 6px;
    margin-top: 5px;
  }

  .speed-slider {
    height: 36px;
  }

  .speed-slider::-webkit-slider-thumb {
    width: 30px;
    height: 30px;
    margin-top: -10px;
  }

  .speed-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }

  .slider-stop {
    min-height: 29px;
    padding: 4px 6px;
    font-size: 11.5px;
  }

  .slider-stops {
    height: 31px;
  }

  .blend-footer .icon-btn-transport {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .blend-footer .status-bar {
    font-size: 9px;
  }
}

@media (max-width: 380px) {
  .slider-stop {
    padding: 4px 3px;
    font-size: 10.5px;
  }

  .speed-readout {
    min-width: 66px;
  }

  .speed-readout span {
    font-size: 11.5px;
  }

  .blend-footer .status-bar {
    font-size: 8.5px;
  }
}

/* =========================================================
   English interface fit
   ========================================================= */

html[lang="en"] .brand h1 {
  font-size: clamp(17px, 1.9vw, 24px);
  letter-spacing: -0.04em;
}

@media (max-width: 720px) {
  html[lang="en"] .brand {
    gap: 9px;
  }

  html[lang="en"] .brand-mark {
    width: 48px;
    height: 48px;
  }

  html[lang="en"] .brand h1 {
    font-size: 17px;
  }
}

@media (max-width: 460px) {
  html[lang="en"] .eyebrow {
    display: none;
  }

  html[lang="en"] .brand-mark {
    width: 42px;
    height: 42px;
  }

  html[lang="en"] .brand h1 {
    font-size: 15px;
  }

  html[lang="en"] .top-actions {
    gap: 5px;
  }
}

@media (max-width: 380px) {
  html[lang="en"] .brand {
    gap: 6px;
  }

  html[lang="en"] .brand h1 {
    font-size: 14px;
  }

  /* 320px: keep the language button, brand and help on one row. */
  html:not([lang="en"]) .brand h1 {
    font-size: 18px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .lang-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    font-size: 11px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .top-actions {
    gap: 4px;
  }

  .topbar {
    gap: 8px;
  }
}
