:root {
  --bg-0: #040814;
  --bg-1: #081226;
  --ink: #eaf1ff;
  --muted: #8fa3c9;
  --muted-2: #6d81a8;
  --line: rgba(146, 176, 235, .14);
  --line-strong: rgba(152, 184, 245, .24);
  --glass: rgba(17, 30, 55, .62);
  --glass-deep: rgba(9, 17, 33, .85);
  --brand: #6aa8ff;
  --brand-deep: #3f6fff;
  --accent: #5df2c3;
  --violet: #a78bfa;
  --gold: #ffc46b;
  --bad: #ff6f85;
  --good: #5df2c3;
  --my-font: "Myanmar Text", "Noto Sans Myanmar", "Pyidaungsu", "Padauk", sans-serif;
  --ui-font: "Segoe UI Variable", "Segoe UI", "Myanmar Text", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", "Consolas", monospace;
  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow-card:
    0 36px 80px -36px rgba(0, 0, 0, .85),
    0 14px 32px -20px rgba(0, 0, 0, .6),
    inset 0 1px 0 rgba(255, 255, 255, .07);
  --shadow-float:
    0 20px 44px -20px rgba(0, 0, 0, .75),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

* { box-sizing: border-box; }

html { scrollbar-color: #2a3f6b #070e1c; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ui-font);
  color: var(--ink);
  background:
    radial-gradient(1200px 720px at 78% -12%, rgba(74, 118, 255, .20), transparent 62%),
    radial-gradient(1000px 640px at -12% 108%, rgba(34, 211, 168, .13), transparent 60%),
    radial-gradient(760px 520px at 52% 118%, rgba(139, 92, 246, .10), transparent 65%),
    linear-gradient(180deg, #050a16 0%, #071022 45%, #040813 100%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(126, 165, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 165, 255, .045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 72%);
}

::selection { background: rgba(106, 168, 255, .35); color: #fff; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---------- Ambient scene ---------- */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  animation: orbFloat 18s ease-in-out infinite alternate;
}
.bg-aurora i:nth-child(1) {
  width: 420px; height: 420px; top: -120px; right: -80px;
  background: radial-gradient(circle at 30% 30%, rgba(93, 140, 255, .8), rgba(63, 111, 255, 0) 68%);
}
.bg-aurora i:nth-child(2) {
  width: 360px; height: 360px; bottom: -140px; left: -100px;
  background: radial-gradient(circle at 40% 40%, rgba(46, 224, 174, .55), rgba(46, 224, 174, 0) 70%);
  animation-delay: -6s;
}
.bg-aurora i:nth-child(3) {
  width: 300px; height: 300px; top: 42%; left: 58%;
  background: radial-gradient(circle at 40% 40%, rgba(167, 139, 250, .42), rgba(167, 139, 250, 0) 70%);
  animation-delay: -11s;
}
@keyframes orbFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-30px, 26px, 0) scale(1.08); }
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(14px, 3vw, 34px);
  background: linear-gradient(180deg, rgba(8, 15, 30, .88), rgba(8, 15, 30, .62));
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(150, 180, 240, .12);
  box-shadow: 0 18px 40px -30px rgba(0, 0, 0, .9);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #030303;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(160, 225, 255, .38),
    0 10px 24px -12px rgba(0, 0, 0, .95),
    0 0 16px -4px rgba(0, 215, 255, .38),
    0 0 24px -8px rgba(255, 60, 200, .32);
}
.brand-logo img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.1); }
.brand-logo .logo-light { display: none; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.02rem; letter-spacing: .2px; }
.brand-text small { color: var(--muted); font-size: .74rem; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(150, 182, 240, .16);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
  color: var(--ink);
  font-family: inherit;
  font-size: 1.02rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.icon-btn:hover { border-color: var(--brand); background: rgba(255, 255, 255, .07); transform: translateY(-1px); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.student-badge {
  padding: 7px 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(52, 84, 149, .55), rgba(24, 40, 72, .6));
  border: 1px solid rgba(124, 166, 255, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 4px 12px -6px rgba(0, 0, 0, .7);
  font-size: .84rem;
  color: #d8e6ff;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Compact live stats in the header (practice only) */
.header-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  margin: 0 auto;
  border-radius: 14px;
  background: rgba(5, 11, 23, .55);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 24px -20px rgba(0, 0, 0, .9);
}
.hstat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 3px 9px 4px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(38, 58, 96, .5), rgba(12, 22, 40, .6));
  border: 1px solid rgba(150, 182, 240, .12);
}
.hstat-value {
  font-family: var(--mono);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.15;
  background: linear-gradient(180deg, #ffffff, #9cc0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.hstat-label {
  font-size: .54rem;
  line-height: 1.3;
  letter-spacing: .8px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-size: .9rem;
  padding: 9px 17px;
  border-radius: 12px;
  border: 1px solid rgba(150, 182, 240, .2);
  background: linear-gradient(180deg, rgba(53, 76, 124, .65) 0%, rgba(25, 40, 70, .9) 100%);
  color: var(--ink);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -1px 0 rgba(0, 0, 0, .25),
    0 3px 0 rgba(4, 9, 20, .9),
    0 10px 20px -12px rgba(0, 0, 0, .8);
  transition: transform .1s ease, box-shadow .12s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    0 1px 0 rgba(4, 9, 20, .9),
    0 4px 10px -8px rgba(0, 0, 0, .8);
}
.btn.primary {
  background: linear-gradient(180deg, #7db2ff 0%, #4f7dff 55%, #3a5df0 100%);
  border-color: rgba(170, 205, 255, .55);
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(20, 40, 100, .35);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .38),
    inset 0 -2px 6px rgba(20, 40, 110, .35),
    0 4px 0 #233a86,
    0 16px 30px -12px rgba(80, 130, 255, .7);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost {
  background: rgba(255, 255, 255, .035);
  border-color: rgba(150, 182, 240, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(6px);
}
.btn.danger {
  border-color: rgba(255, 111, 133, .4);
  color: #ffc0c9;
  background: linear-gradient(180deg, rgba(120, 40, 55, .55), rgba(70, 22, 34, .8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 rgba(50, 8, 16, .9);
}
.btn.small-btn { padding: 6px 11px; font-size: .78rem; border-radius: 9px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; filter: none; }

.back-link {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: .8rem;
  line-height: 1.5;
  cursor: pointer;
  padding: 0;
  margin-bottom: 2px;
  transition: color .15s;
}
.back-link:hover { color: var(--ink); }

/* ---------- Layout ---------- */
.app-main {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px clamp(14px, 2.2vw, 38px) 72px;
}

.screen { animation: fadeUp .26s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.hero { margin: 0 0 18px; }
#screen-home .hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
#screen-home .hero-copy { flex: 1 1 460px; min-width: 0; }
#screen-home .hero-actions { margin-top: 0; }
.hero h1 {
  margin: 0 0 4px;
  font-size: clamp(1.5rem, 2.9vw, 2rem);
  letter-spacing: -.4px;
  background: linear-gradient(96deg, #f2f7ff 8%, #a9c9ff 52%, #7ef2d3 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 22px rgba(90, 140, 255, .25));
}
.hero p { margin: 0; color: var(--muted); max-width: 720px; font-size: .88rem; line-height: 1.4; }
.hero.small h1 { font-size: clamp(1.2rem, 2.1vw, 1.5rem); }

.screen-head { margin-bottom: 12px; }
.screen-head h1 {
  margin: 0 0 2px;
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  letter-spacing: -.3px;
}
.screen-head p { margin: 0; font-size: .85rem; line-height: 1.35; }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(25, 41, 72, .66) 0%, rgba(10, 19, 37, .88) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18) 30%, rgba(255, 255, 255, .08) 70%, transparent);
  pointer-events: none;
}
.card h2 { margin: 0 0 14px; font-size: 1.12rem; }
.card h3 { margin: 0 0 8px; font-size: 1rem; }
.card p:last-child { margin-bottom: 0; }

.note-card { border-left: 0; }
.note-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), rgba(255, 196, 107, 0));
  box-shadow: 0 0 18px rgba(255, 196, 107, .45);
}

/* ---------- About / FAQ (crawlable SEO content) ---------- */
.about-card { overflow: visible; }
.about-lead {
  margin: 0;
  max-width: 1040px;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.7;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 30px;
  margin-top: 16px;
}
.about-col h3 { margin: 0 0 10px; font-size: .95rem; }
.faq-item { margin-bottom: 12px; }
.faq-item h4 {
  margin: 0 0 3px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--ink);
}
.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.6;
}
.faq-item p a { color: var(--brand); }
.about-meta {
  margin: 8px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: .76rem;
  line-height: 1.7;
}
.about-meta a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.about-meta a:hover { color: var(--brand); }

/* ---------- Sponsor ---------- */
.sponsor-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px 20px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background:
    radial-gradient(480px 170px at 6% 0%, rgba(106, 168, 255, .2), transparent 70%),
    linear-gradient(180deg, rgba(25, 42, 74, .92), rgba(11, 20, 38, .96));
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.sponsor-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  opacity: .9;
}
.sponsor-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.sponsor-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sponsor-brand-text { min-width: 0; }
.sponsor-logo {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  filter: saturate(1.1);
  box-shadow:
    0 0 0 1px rgba(160, 225, 255, .36),
    0 8px 18px -10px rgba(0, 0, 0, .9),
    0 0 14px -6px rgba(255, 60, 200, .3);
}
.sponsor-logo.logo-light { display: none; }
.sponsor-guide .sponsor-logo { width: 64px; height: 64px; }
.sponsor-tag {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 196, 107, .45);
  background: linear-gradient(180deg, rgba(255, 196, 107, .28), rgba(255, 196, 107, .12));
  color: var(--gold);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.sponsor-free { font-size: .7rem; font-weight: 600; letter-spacing: .3px; color: var(--accent); }
.sponsor-name { margin: 0; font-size: 1.05rem; letter-spacing: .2px; }
.sponsor-tagline { margin: 0; color: var(--muted); font-size: .85rem; }
.sponsor-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.sponsor-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 22, 42, .55);
  color: var(--ink);
  font-size: .78rem;
  line-height: 1.5;
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease;
}
a.sponsor-chip:hover { border-color: var(--brand); transform: translateY(-1px); }
.sponsor-more {
  justify-self: start;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.sponsor-more:hover { color: var(--accent); }
.sponsor-sub { margin: 4px 0 0; font-size: .7rem; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted-2); }
.sponsor-guide { margin-top: 18px; }
.sponsor-line {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 10px;
  font-size: .76rem;
  color: var(--muted);
}
.sponsor-line strong { color: var(--ink); font-weight: 600; }
.sponsor-line-links { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.sponsor-line .sponsor-chip { padding: 1px 8px; font-size: .72rem; background: transparent; }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.shop-tile {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(140, 175, 240, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
a.shop-tile:hover {
  border-color: var(--brand);
  background: rgba(255, 255, 255, .08);
  transform: translateY(-1px);
}
.shop-tile.wide { grid-column: span 2; }
.shop-tile-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(106, 168, 255, .22);
  background: linear-gradient(180deg, rgba(106, 168, 255, .22), rgba(106, 168, 255, .08));
  font-size: .92rem;
  line-height: 1;
}
.shop-tile-body { display: grid; gap: 1px; min-width: 0; }
.shop-tile-label {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.shop-tile-value {
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.shop-tile-arrow { margin-left: auto; color: var(--brand); font-size: .78rem; }

/* ---------- Profiles ---------- */
.profile-list { display: flex; flex-wrap: wrap; gap: 11px; margin-bottom: 18px; }

.profile-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(34, 54, 92, .55), rgba(14, 24, 44, .85));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 3px 0 rgba(4, 9, 20, .8), 0 12px 24px -14px rgba(0, 0, 0, .8);
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  transition: transform .12s, border-color .15s, filter .15s;
}
.profile-chip:hover { transform: translateY(-2px); border-color: rgba(124, 166, 255, .5); filter: brightness(1.08); }
.profile-chip:active { transform: translateY(1px); }
.profile-chip .avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(160deg, #8dbcff, #4f7dff 55%, #6c4dff);
  font-weight: 700;
  font-size: .88rem;
  color: #071022;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 10px -4px rgba(80, 130, 255, .8);
}
.profile-chip .meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.profile-chip .meta small { color: var(--muted); font-size: .72rem; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input {
  flex: 1 1 240px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 12, 24, .75);
  color: var(--ink);
  font-family: inherit;
  font-size: .95rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .45);
  transition: border-color .15s, box-shadow .15s;
}
.inline-form input::placeholder { color: var(--muted-2); }
.inline-form input:focus {
  outline: none;
  border-color: rgba(124, 166, 255, .65);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .45), 0 0 0 3px rgba(79, 125, 255, .22);
}

.student-card h2 { margin-bottom: 10px; }
.student-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: 12px 16px;
  align-items: start;
}
.student-body .profile-list { margin-bottom: 0; }
@media (min-width: 901px) {
  .student-body .inline-form { flex-wrap: nowrap; }
  .student-body .inline-form input { flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 900px) {
  .student-body { grid-template-columns: 1fr; }
}

/* ---------- Tracks ---------- */
.track-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 20px; }

.track-card {
  --track-accent: #6aa8ff;
  position: relative;
  text-align: left;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid rgba(150, 182, 240, .18);
  background:
    radial-gradient(420px 200px at 88% -10%, rgba(106, 168, 255, .22), transparent 65%),
    linear-gradient(165deg, rgba(28, 46, 82, .9) 0%, rgba(9, 17, 33, .95) 68%);
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.track-card:nth-child(2) {
  --track-accent: #ffc46b;
  background:
    radial-gradient(420px 200px at 88% -10%, rgba(255, 196, 107, .18), transparent 65%),
    linear-gradient(165deg, rgba(46, 40, 60, .9) 0%, rgba(12, 16, 30, .95) 68%);
}
.track-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--track-accent) 55%, transparent);
  box-shadow: 0 34px 60px -26px rgba(0, 0, 0, .9), 0 0 40px -16px color-mix(in srgb, var(--track-accent) 45%, transparent);
}
.track-emoji {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  font-size: 26px;
  font-weight: 700;
  font-family: var(--my-font);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(41, 62, 100, .8), rgba(16, 27, 48, .9));
  border: 1px solid rgba(170, 200, 255, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 4px 0 rgba(4, 9, 20, .85), 0 14px 22px -14px rgba(0, 0, 0, .9);
  color: #dfeaff;
  text-shadow: 0 0 18px rgba(106, 168, 255, .5);
}
.track-card h2 { margin: 14px 0 5px; font-size: 1.4rem; letter-spacing: -.2px; }
.track-card p { margin: 0; color: var(--muted); font-size: .9rem; min-height: 2.6em; }
.track-card .track-progress {
  margin-top: 18px;
  height: 9px;
  border-radius: 999px;
  background: rgba(4, 9, 19, .9);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.track-card .track-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--track-accent), #5df2c3);
  border-radius: inherit;
  box-shadow: 0 0 14px color-mix(in srgb, var(--track-accent) 70%, transparent);
}
.track-card .track-meta { display: flex; justify-content: space-between; margin-top: 9px; font-size: .8rem; color: var(--muted); }

/* ---------- Lessons ---------- */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 15px; }

.lesson-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
  padding: 17px;
  border-radius: 17px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(27, 44, 76, .55), rgba(10, 19, 36, .9));
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 3px 0 rgba(4, 9, 20, .65), 0 16px 30px -22px rgba(0, 0, 0, .9);
  transition: transform .14s, border-color .15s, box-shadow .15s;
}
.lesson-card:hover:not(.locked) {
  transform: translateY(-3px);
  border-color: rgba(124, 166, 255, .5);
  box-shadow: 0 0 0 1px rgba(124, 166, 255, .18), 0 22px 40px -22px rgba(0, 0, 0, .95);
}
.lesson-card:active:not(.locked) { transform: translateY(1px); }
.lesson-card.locked { opacity: .42; cursor: not-allowed; filter: saturate(.4); }
.lesson-card .lesson-top { display: flex; align-items: center; gap: 9px; }
.lesson-card .lesson-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(60, 88, 140, .8), rgba(24, 40, 70, .9));
  color: #d5e4ff;
  font-size: .82rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 0 rgba(4, 9, 20, .8);
}
.lesson-card h3 { margin: 0; font-size: 1rem; flex: 1; line-height: 1.35; }
.lesson-card .lesson-desc { color: var(--muted); font-size: .82rem; margin: 0; }
.lesson-card .lesson-foot { display: flex; align-items: center; gap: 10px; font-size: .76rem; color: var(--muted); flex-wrap: wrap; }
.badge-done { color: #8ef7cf; text-shadow: 0 0 12px rgba(93, 242, 195, .35); }
.badge-new { color: #ffd98f; }

/* ---------- Practice ---------- */
.practice-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.practice-title-wrap h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.2px; }
.practice-clock {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .5px;
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(30, 48, 84, .7), rgba(12, 22, 42, .9));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 3px 0 rgba(4, 9, 20, .8);
  color: #cfe0ff;
  min-width: 76px;
  text-align: center;
}

.progress-wrap {
  height: 9px;
  border-radius: 999px;
  background: rgba(4, 9, 19, .9);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .65);
  overflow: hidden;
  margin-bottom: 18px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5df2c3 0%, #6aa8ff 55%, #a78bfa 100%);
  box-shadow: 0 0 16px rgba(93, 242, 195, .55);
  transition: width .14s linear;
}

.text-display {
  font-family: var(--my-font);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 2.15;
  letter-spacing: .2px;
  padding: 26px 28px;
  min-height: 158px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 220px at 18% 0%, rgba(70, 116, 220, .10), transparent 70%),
    linear-gradient(180deg, rgba(9, 17, 32, .96), rgba(5, 10, 20, .98));
  box-shadow:
    inset 0 2px 14px rgba(0, 0, 0, .55),
    0 26px 50px -34px rgba(0, 0, 0, .95);
  word-break: break-word;
  white-space: pre-wrap;
  cursor: text;
  user-select: none;
}

.text-display .ch { border-radius: 5px; padding: 1px 0; transition: background .12s, color .12s; }
.text-display .ch.correct { color: #8ef7cf; text-shadow: 0 0 14px rgba(93, 242, 195, .28); }
.text-display .ch.wrong {
  color: #ff9aa8;
  background: rgba(255, 93, 108, .15);
  box-shadow: inset 0 -2px 0 rgba(255, 93, 108, .85);
  text-decoration: underline wavy rgba(255, 111, 133, .65) 1px;
}
.text-display .ch.current {
  background: linear-gradient(180deg, rgba(106, 168, 255, .55), rgba(63, 111, 255, .35));
  box-shadow:
    inset 0 0 0 1px rgba(170, 205, 255, .65),
    0 0 20px rgba(90, 150, 255, .5);
  color: #fff;
  border-radius: 5px;
  animation: caretGlow 1.6s ease-in-out infinite;
}
.text-display .ch.space.current {
  background: rgba(93, 242, 195, .35);
  box-shadow: inset 0 0 0 1px rgba(93, 242, 195, .6), 0 0 18px rgba(93, 242, 195, .4);
}
@keyframes caretGlow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(170, 205, 255, .65), 0 0 14px rgba(90, 150, 255, .4); }
  50% { box-shadow: inset 0 0 0 1px rgba(190, 220, 255, .9), 0 0 26px rgba(90, 150, 255, .65); }
}
.text-display.en { font-family: var(--mono); font-size: clamp(1.15rem, 2.3vw, 1.5rem); line-height: 2.05; letter-spacing: .2px; }

/* ---------- Hand placement guide ---------- */
.hand-guide {
  display: grid;
  grid-template-columns: minmax(170px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 4px 14px;
  margin: 0 0 12px;
  padding: 8px 14px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    radial-gradient(420px 160px at 12% 0%, rgba(80, 125, 235, .13), transparent 70%),
    linear-gradient(180deg, rgba(20, 34, 60, .72), rgba(7, 14, 28, .9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 18px 34px -28px rgba(0, 0, 0, .95);
}
.hand-head { display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; }
.hand-kicker {
  font-size: .7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.hand-svg-slot { flex: none; width: min(220px, 100%); }
.hand-svg-slot svg { display: block; width: 100%; height: auto; }
.finger-tip {
  font-size: 1rem;
  font-weight: 600;
  color: #cfe0ff;
  transition: color .15s;
}
.finger-tip.live { color: #7ef2d3; text-shadow: 0 0 16px rgba(93, 242, 195, .3); }
.hand-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.hand-note {
  --note-accent: #6aa8ff;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px 8px;
  border-radius: 11px;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--note-accent) 34%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--note-accent) 9%, transparent), rgba(6, 12, 24, .55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.hand-note:nth-child(2) { --note-accent: #5df2c3; }
.hand-note:nth-child(3) { --note-accent: #ffc46b; }
.hand-note strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .88rem;
  letter-spacing: .2px;
  color: var(--note-accent);
}
.hand-note p { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--muted); }
.hand-note b { color: #dce9ff; font-weight: 600; }

.hands-svg { overflow: visible; }
.hands-svg .palm,
.hands-svg .wrist {
  fill: rgba(140, 170, 235, .13);
  stroke: rgba(160, 195, 255, .32);
  stroke-width: 1.2;
}
.hands-svg .finger-group .skin {
  fill: var(--finger);
  fill-opacity: .26;
  stroke: var(--finger);
  stroke-opacity: .55;
  stroke-width: 1.2;
  transition: fill-opacity .18s, stroke-opacity .18s, filter .18s;
}
.hands-svg .finger-group.active .skin {
  fill-opacity: .95;
  stroke-opacity: 1;
  filter: drop-shadow(0 0 7px var(--finger));
  animation: fingerPulse 1.6s ease-in-out infinite;
}
@keyframes fingerPulse {
  0%, 100% { fill-opacity: .82; }
  50% { fill-opacity: 1; }
}
.hands-svg .hand-name {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--my-font);
  letter-spacing: .5px;
}

/* ---------- Keyboard ---------- */
.keyboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 12px;
}
.kb-switch { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  font-family: inherit;
  font-size: .8rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.active {
  background: linear-gradient(180deg, rgba(66, 102, 175, .55), rgba(28, 45, 82, .7));
  border-color: rgba(140, 180, 255, .5);
  color: #e6f0ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 18px -4px rgba(90, 150, 255, .5);
}
.chip.sound-chip { margin-left: 4px; }
.chip.sound-chip.active {
  background: linear-gradient(180deg, rgba(46, 170, 140, .5), rgba(14, 76, 66, .68));
  border-color: rgba(94, 242, 195, .55);
  color: #d9fff5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 18px -4px rgba(93, 242, 195, .55);
}

.keyboard {
  position: relative;
  padding: 18px 16px 22px;
  border-radius: 26px;
  border: 1px solid rgba(150, 182, 240, .18);
  background:
    radial-gradient(700px 240px at 50% -10%, rgba(80, 125, 235, .16), transparent 70%),
    linear-gradient(180deg, rgba(24, 39, 68, .92), rgba(7, 13, 26, .98));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .07),
    inset 0 -40px 70px -50px rgba(0, 0, 0, .95),
    0 40px 80px -46px rgba(0, 0, 0, 1);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.keyboard::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(170, 205, 255, .35), transparent);
  pointer-events: none;
}

/* Hands flanking the on-screen keyboard (wide screens only) */
.keyboard-zone {
  position: relative;
  /* one key unit; the five rows are each 15 units wide like a real ANSI keyboard */
  --kb-u: clamp(30px, 3.85vw, 59px);
  --kb-gap: clamp(4px, .55vw, 8px);
  --kb-vgap: 6px;
  --kb-h: 56px;
}
.hand-side {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  --hw: clamp(120px, 10.5vw, 172px);
  width: var(--hw);
  pointer-events: none;
  z-index: 2;
  opacity: .96;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .45));
}
.hand-side-left {
  left: max(10px, calc(50% - 7.5 * var(--kb-u) - 7 * var(--kb-gap) - 20px - var(--hw)));
}
.hand-side-right {
  right: max(10px, calc(50% - 7.5 * var(--kb-u) - 7 * var(--kb-gap) - 20px - var(--hw)));
}
.hand-side-slot svg { display: block; width: 100%; height: auto; }
.kb-row {
  display: flex;
  justify-content: center;
  gap: var(--kb-gap);
  width: 100%;
  min-width: calc(15 * var(--kb-u) + 14 * var(--kb-gap));
  max-width: calc(15 * var(--kb-u) + 14 * var(--kb-gap));
  margin: 0 auto var(--kb-vgap);
}
.kb-row:last-child { margin-bottom: 0; }

.kb-key {
  --finger: #8fa3c9;
  position: relative;
  flex: var(--units, 1) 1 0;
  min-width: 0;
  height: var(--kb-h);
  padding: 2px 5px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  border: 1px solid rgba(168, 198, 250, .18);
  background: linear-gradient(180deg, #33496c 0%, #243757 52%, #1a2a46 100%);
  color: #dbe8ff;
  font-family: var(--ui-font);
  font-size: .8rem;
  user-select: none;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    inset 0 -1px 0 rgba(0, 0, 0, .35),
    0 6px 0 #0a1526,
    0 10px 16px -5px rgba(0, 0, 0, .75);
  transition: transform .07s ease, box-shadow .07s ease, background .15s ease, border-color .15s ease;
}
.kb-key::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 45%;
  border-radius: 11px 11px 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.kb-key::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 15px;
  height: 3px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: var(--finger);
  opacity: .8;
  box-shadow: 0 0 8px var(--finger);
  pointer-events: none;
}
.kb-key .main {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  font-family: var(--my-font);
  line-height: 1.1;
  color: #eef5ff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .55);
}
.kb-key .shift {
  position: absolute;
  z-index: 1;
  top: 4px;
  right: 6px;
  padding: 0;
  font-size: .6rem;
  line-height: 1.2;
  color: rgba(200, 220, 255, .7);
  font-family: var(--my-font);
}
.kb-key .latin {
  position: relative;
  z-index: 1;
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(3, 9, 20, .42);
  box-shadow: inset 0 0 0 1px rgba(160, 196, 255, .16);
  font-size: .58rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .5px;
  color: rgba(205, 226, 255, .92);
  font-family: var(--ui-font);
  text-transform: uppercase;
}
/* Bilingual keys: centred main legend with the Latin + shifted legends pinned
   to the bottom corners, clear of the finger-colour bar */
.kb-key.dual {
  padding: 1px 5px 9px 4px;
}
.kb-key.dual .main { font-size: 1.22rem; }
.kb-key.dual .latin {
  position: absolute;
  left: 4px;
  bottom: 9px;
  margin-top: 0;
  font-size: .56rem;
}
.kb-key.dual .shift {
  position: absolute;
  top: auto;
  right: 4px;
  bottom: 9px;
  font-size: .56rem;
  color: rgba(200, 220, 255, .68);
}
/* Footer legends would collide on very narrow keys: drop the shifted glyph */
.kb-key.dual.tight .shift { display: none; }
.kb-key.mod-key {
  font-size: .7rem;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(200, 218, 250, .72);
}
.kb-key.space-key {
  border-radius: 13px;
  font-size: .76rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(200, 218, 250, .7);
}
.kb-key.space-key::after { width: 60px; opacity: .5; }
.kb-key:hover { border-color: rgba(168, 198, 250, .38); background: linear-gradient(180deg, #3a527a 0%, #2a3f63 52%, #1e3050 100%); }
.kb-key.active {
  transform: translateY(4px);
  background: linear-gradient(180deg, #6b9bf0 0%, #3d63b5 55%, #2c4a8c 100%);
  border-color: rgba(190, 220, 255, .85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 1px 0 #0a1526,
    0 0 0 2px rgba(130, 180, 255, .5),
    0 0 34px rgba(90, 150, 255, .65);
}
.kb-key.hint {
  background: linear-gradient(180deg, #3ee5bb 0%, #16a98b 52%, #0c7a64 100%);
  border-color: #b3ffea;
  color: #052e25;
  animation: hintPulse 1.9s ease-in-out infinite;
}
.kb-key.hint .main { color: #04271f; text-shadow: 0 1px 0 rgba(255, 255, 255, .55); }
.kb-key.hint .shift { color: rgba(3, 45, 36, .8); }
.kb-key.hint::after { background: rgba(3, 52, 42, .7); box-shadow: none; opacity: 1; }
.kb-key.miss {
  background: linear-gradient(180deg, #ff6b81 0%, #d02a44 55%, #971a30 100%);
  border-color: #ffc0c9;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 6px 0 #500c17,
    0 0 0 2px rgba(255, 120, 140, .5),
    0 0 34px rgba(255, 80, 105, .7);
}
.kb-key.miss .main { color: #fff; text-shadow: 0 1px 2px rgba(80, 0, 12, .6); }
.kb-key.miss::after { background: rgba(255, 255, 255, .85); box-shadow: none; opacity: 1; }
@keyframes hintPulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .35),
      0 6px 0 #07352e,
      0 0 0 2px rgba(127, 255, 224, .45),
      0 0 26px rgba(93, 242, 195, .55);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .5),
      0 6px 0 #07352e,
      0 0 0 2px rgba(160, 255, 232, .75),
      0 0 46px rgba(93, 242, 195, .9);
  }
}

/* Finger accent colors */
.f-1 { --finger: #ff8b96; }
.f-2 { --finger: #ffb020; }
.f-3 { --finger: #35d07f; }
.f-4 { --finger: #4f8cff; }
.f-5 { --finger: #b07bff; }
.f-6 { --finger: #ff8b96; }
.f-7 { --finger: #ffb020; }
.f-8 { --finger: #35d07f; }
.f-9 { --finger: #4f8cff; }
.f-10 { --finger: #b07bff; }
.f-thumb { --finger: #9fb4dc; }

.practice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ---------- Result overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 16, .66);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}
.result-card {
  width: min(540px, 100%);
  padding: 32px 26px 26px;
  border-radius: 28px;
  border: 1px solid rgba(160, 192, 255, .24);
  background:
    radial-gradient(420px 220px at 50% -10%, rgba(106, 168, 255, .22), transparent 70%),
    linear-gradient(180deg, rgba(26, 44, 80, .96), rgba(8, 15, 30, .98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 50px 100px -40px rgba(0, 0, 0, 1),
    0 0 80px -30px rgba(90, 150, 255, .5);
  text-align: center;
  animation: pop .22s ease;
}
@keyframes pop {
  from { transform: scale(.95) translateY(6px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.result-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto;
  font-size: 38px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(66, 102, 175, .35), rgba(18, 32, 58, .6));
  border: 1px solid rgba(170, 205, 255, .28);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2), 0 8px 0 rgba(4, 9, 20, .7), 0 24px 44px -20px rgba(80, 130, 255, .5);
}
.result-card h2 { margin: 14px 0 4px; font-size: 1.35rem; }
.result-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  margin: 20px 0 10px;
}
.result-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 5px;
  border-radius: 13px;
  background: rgba(5, 11, 23, .55);
  border: 1px solid rgba(146, 176, 235, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.result-stats strong {
  font-family: var(--mono);
  font-size: 1.18rem;
  background: linear-gradient(180deg, #ffffff, #9cc0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result-stats span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.best-line { min-height: 1.4em; color: #ffd98f; font-size: .9rem; text-shadow: 0 0 16px rgba(255, 196, 107, .35); }
.result-actions { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Sound settings modal ---------- */
.sound-card {
  width: min(640px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid rgba(160, 192, 255, .24);
  background:
    radial-gradient(420px 220px at 88% -10%, rgba(93, 242, 195, .14), transparent 70%),
    linear-gradient(180deg, rgba(26, 44, 80, .97), rgba(8, 15, 30, .99));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 50px 100px -40px rgba(0, 0, 0, 1);
  animation: pop .22s ease;
}
.sound-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.sound-head h2 { margin: 0 0 4px; font-size: 1.2rem; }
.sound-head p { margin: 0; }
.master-row {
  margin: 16px 0;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(5, 11, 23, .5);
}
.sfx-list { display: flex; flex-direction: column; gap: 10px; }
.sfx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(33, 52, 88, .5), rgba(11, 21, 40, .82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  flex-wrap: wrap;
}
.sfx-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 18px;
  background: linear-gradient(180deg, rgba(41, 62, 100, .7), rgba(14, 25, 45, .9));
  border: 1px solid rgba(170, 200, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 rgba(4, 9, 20, .8);
}
.sfx-info { flex: 1 1 190px; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.sfx-info strong { font-size: .92rem; }
.sfx-info small { color: var(--muted); font-size: .74rem; }
.sfx-status {
  font-size: .73rem;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sfx-status.custom { color: #8ef7cf; }
.sfx-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.upload-btn { position: relative; overflow: hidden; cursor: pointer; display: inline-flex; align-items: center; }
.sound-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- Teacher ---------- */
.settings-card { padding: 15px 19px; }
.check-row { display: flex; align-items: center; gap: 11px; cursor: pointer; font-size: .92rem; }
.check-row input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(4, 10, 22, .8);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6);
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.check-row input:checked {
  background: linear-gradient(180deg, #7db2ff, #4f7dff);
  border-color: rgba(170, 205, 255, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 14px rgba(80, 130, 255, .45);
}
.check-row input:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; background: rgba(5, 11, 23, .35); }
.data-table th, .data-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid rgba(146, 176, 235, .1); white-space: nowrap; }
.data-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .7px;
  background: rgba(10, 19, 36, .6);
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: rgba(90, 140, 255, .06); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .row-actions { display: flex; gap: 7px; }

/* ---------- Guide ---------- */
.prose h2 { margin-top: 24px; font-size: 1.05rem; }
.prose h2:first-child { margin-top: 0; }
.prose ol, .prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose kbd {
  font-family: var(--mono);
  font-size: .78rem;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  background: linear-gradient(180deg, rgba(40, 62, 100, .8), rgba(14, 25, 45, .9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  color: #e8f0ff;
}
.hand-setup {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: 12px 16px;
  align-items: center;
  margin: 10px 0 6px;
}
.hand-visual { display: flex; flex-direction: column; gap: 6px; }
.guide-hands {
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  border-radius: 16px;
  background: rgba(5, 11, 23, .45);
  border: 1px solid var(--line);
}
.guide-hands svg { display: block; width: 100%; height: auto; }
.hand-caption {
  margin: 0;
  text-align: center;
  font-size: .84rem;
  line-height: 1.6;
  color: var(--muted);
}
.teacher-script {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(360px 160px at 50% 0%, rgba(93, 242, 195, .08), transparent 70%),
    rgba(5, 11, 23, .45);
}
.teacher-script h3 { margin: 0 0 8px; font-size: 1rem; color: #cfe0ff; text-align: center; }
.script-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  text-align: left;
}
.script-card {
  --c: #6aa8ff;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 8%, transparent), rgba(5, 11, 23, .4));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.script-card:nth-child(2) { --c: #5df2c3; }
.script-card:nth-child(3) { --c: #ffc46b; }
.script-card:nth-child(4) { --c: #a78bfa; }
.script-card:nth-child(5) { --c: #f472b6; }
.script-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: .74rem;
  font-weight: 700;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 18%, rgba(4, 9, 19, .9));
  border: 1px solid color-mix(in srgb, var(--c) 42%, transparent);
}
.script-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.script-card strong { color: #dce9ff; }
.finger-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 4px 22px;
  padding-left: 0;
  list-style: none;
  margin: 14px 0;
}
.finger-map li { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); line-height: 2; }
.finger-map kbd { font-size: .72rem; padding: 1px 5px; }
.finger-map .dot {
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--finger, #9fb4dc);
  box-shadow: 0 0 9px var(--finger, #9fb4dc);
}
.finger-map .dot.thumb { --finger: #9fb4dc; }
.prose .finger-map { padding-left: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 11px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(41, 64, 106, .92), rgba(14, 25, 46, .96));
  border: 1px solid rgba(150, 182, 240, .3);
  color: var(--ink);
  font-size: .88rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 18px 40px -18px rgba(0, 0, 0, .9);
  backdrop-filter: blur(10px);
  animation: toastIn .2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Responsive ---------- */
/* Laptop screens: shrink practice screen so the whole keyboard fits without scrolling */
@media (max-height: 940px) {
  .app-header { padding-top: 8px; padding-bottom: 8px; }
  .brand-logo { width: 38px; height: 38px; border-radius: 50%; }
  .header-stats { padding: 4px; }
  .hstat { padding: 2px 7px 3px; min-width: 54px; }
  .hstat-value { font-size: .86rem; }

  .app-main { padding-top: 12px; padding-bottom: 24px; }

  .practice-head { margin-bottom: 6px; gap: 10px; }
  .practice-clock { padding: 6px 12px; font-size: .95rem; min-width: 68px; }
  .progress-wrap { margin-bottom: 8px; }

  .text-display {
    min-height: 76px;
    padding: 10px 16px;
    line-height: 1.8;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    border-radius: 16px;
  }
  .text-display.en { line-height: 1.75; font-size: clamp(.98rem, 1.8vw, 1.18rem); }

  .hand-guide { gap: 2px 10px; padding: 5px 10px 7px; margin-bottom: 6px; border-radius: 13px; }
  .hand-svg-slot { width: min(110px, 100%); }
  .hands-svg .hand-name { display: none; }
  .hand-kicker { font-size: .64rem; letter-spacing: 1.2px; }
  .finger-tip { font-size: .88rem; }
  .hand-notes { gap: 6px; }
  .hand-note { padding: 5px 8px 6px; border-radius: 9px; }
  .hand-note strong { font-size: .84rem; }
  .hand-note p { font-size: .88rem; line-height: 1.45; }

  .keyboard-head { margin: 6px 0 4px; }
  .keyboard { padding: 8px 12px 10px; border-radius: 18px; }
  .keyboard-zone { --kb-h: 48px; --kb-vgap: 4px; }
  .kb-key .main { font-size: 1.02rem; }
  .kb-key .shift { font-size: .56rem; }

  .practice-actions { margin-top: 6px; }
  .practice-note { display: none; }
}

@media (max-height: 780px) {
  .hand-svg-slot { width: min(92px, 100%); }
  .finger-tip { font-size: .86rem; }
  .hand-kicker { display: none; }
  .hand-note { padding: 4px 7px 5px; }
  .hand-note strong { font-size: .82rem; }
  .hand-note p { font-size: .86rem; line-height: 1.42; }
  .text-display { min-height: 64px; padding: 8px 14px; }
  #practiceHint { display: none; }
  .practice-head { margin-bottom: 4px; }
  .progress-wrap { margin-bottom: 6px; }
  .keyboard-head { margin: 4px 0 3px; }
  .keyboard-zone { --kb-h: 45px; --kb-vgap: 3px; }
}

@media (min-width: 1180px) {
  .hand-side { display: block; }
  .hand-guide .hand-head .hand-svg-slot { display: none; }
  .hand-guide { grid-template-columns: minmax(150px, 240px) minmax(0, 1fr); }
  .kb-key .main { font-size: 1.12rem; }
  .kb-key.dual .main { font-size: 1.26rem; }
  .kb-key .latin { font-size: .64rem; }
}

@media (max-width: 880px) {
  .app-header { flex-wrap: wrap; }
  .header-stats { order: 10; width: 100%; justify-content: center; margin: 2px 0 0; }
}

@media (max-width: 900px) {
  .hand-setup { grid-template-columns: 1fr; }
  .guide-hands { max-width: 280px; }
  .keyboard { padding: 14px 12px 18px; border-radius: 20px; }
  .keyboard-zone { --kb-h: 50px; }
  .kb-key.dual .main { font-size: 1.07rem; }
}

@media (max-width: 720px) {
  .brand-text small { display: none; }
  .app-header { padding: 10px 14px; gap: 8px; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 6px 10px; font-size: .78rem; line-height: 1.25; }
  .header-actions .icon-btn { order: -1; }
  .icon-btn { width: 33px; height: 33px; border-radius: 10px; font-size: .95rem; }
  .student-badge { max-width: 120px; font-size: .74rem; padding: 4px 10px; line-height: 1.25; }
  .header-stats { gap: 4px; padding: 4px; }
  .hstat { min-width: 52px; padding: 3px 6px; }
  .hstat-value { font-size: .86rem; }
  .card { padding: 18px; border-radius: 20px; }
  .sponsor-card { padding: 14px 16px 15px; }
  .sponsor-name { font-size: .98rem; }
  .shop-grid { gap: 7px; }
  .shop-tile { padding: 8px 9px; gap: 8px; }
  .shop-tile-icon { width: 27px; height: 27px; font-size: .84rem; }
  .shop-tile-value { font-size: .8rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .text-display { padding: 18px; line-height: 2; border-radius: 16px; }
  .keyboard-zone { --kb-h: 46px; --kb-vgap: 4px; --kb-gap: 3px; }
  /* Fit all 15 key units into the phone width instead of scrolling sideways. */
  .kb-row { min-width: 0; max-width: 100%; }
  .kb-key { border-radius: 11px; padding: 1px 2px 6px; }
  .kb-key .main { font-size: clamp(.8rem, 3.4vw, 1rem); }
  .kb-key.mod-key { font-size: clamp(.52rem, 1.4vw, .72rem); letter-spacing: 0; }
  .kb-key.space-key { font-size: .62rem; }
  .kb-key.dual .main { font-size: clamp(.86rem, 3.6vw, 1.07rem); }
  .kb-key .shift { font-size: .58rem; top: 3px; right: 4px; }
  .keyboard { padding: 12px 8px 14px; }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
  .result-card { padding: 26px 18px 20px; border-radius: 22px; }
  .hero h1 { letter-spacing: -.2px; }
  .data-table th:nth-child(5), .data-table td:nth-child(5) { display: none; }
  .data-table th, .data-table td { padding: 10px 9px; }
  .hand-guide { grid-template-columns: 1fr; gap: 5px; padding: 8px 10px; }
  .hand-svg-slot { width: 100%; max-width: 180px; margin: 0 auto; }
  .hand-note { padding: 6px 9px 7px; }
  .hand-note strong { font-size: .86rem; }
  .hand-note p { font-size: .9rem; }
  .sound-card { padding: 18px; }
  .sfx-actions { width: 100%; }
  .sound-actions { flex-direction: column-reverse; align-items: stretch; }
}

@media (max-width: 1000px) {
  .kb-key.dual .shift { display: none; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 440px) {
  .app-header { padding: 8px 12px; }
  .brand-logo { width: 36px; height: 36px; border-radius: 50%; }
  .brand-text strong { font-size: .88rem; }
  .header-stats { gap: 3px; padding: 3px; }
  .hstat { min-width: 46px; padding: 2px 5px 3px; }
  .hstat-value { font-size: .78rem; }
  .hstat-label { font-size: .5rem; letter-spacing: .4px; }
  .app-main { padding: 20px 12px 60px; }
  .btn { padding: 8px 12px; }
  .keyboard-zone { --kb-h: 43px; --kb-vgap: 4px; }
  .kb-key.dual { padding: 1px 3px 8px; }
  .kb-key.dual .latin { padding: 0 2px; font-size: .54rem; }
  .kb-key .shift { display: none; }
  .hand-notes { grid-template-columns: 1fr; }
  .hand-guide .hand-head .hand-svg-slot { display: none; }
  .hand-head { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 2px 8px; }
  .hand-note { padding: 5px 8px 6px; }
  .hand-note p { font-size: .84rem; line-height: 1.35; }
  .hand-notes { gap: 5px; }
  .script-cards { grid-template-columns: 1fr; }
}

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

/* ================================================================
   v2 — light theme, home summary, drills, modals, detail, mobile
   ================================================================ */

/* ---------- Light theme ---------- */
:root[data-theme="light"] {
  --bg-0: #eef3ff;
  --bg-1: #f7faff;
  --ink: #13213d;
  --muted: #52648a;
  --muted-2: #7889a9;
  --line: rgba(30, 66, 130, .14);
  --line-strong: rgba(30, 66, 130, .26);
  --glass: rgba(255, 255, 255, .74);
  --glass-deep: rgba(255, 255, 255, .92);
  --brand: #2f6bff;
  --brand-deep: #2456d8;
  --accent: #0a9a7a;
  --violet: #7c5cf0;
  --gold: #9d6410;
  --bad: #d63c55;
  --good: #0a9a7a;
  --shadow-card:
    0 26px 60px -32px rgba(30, 60, 120, .30),
    0 10px 26px -18px rgba(30, 60, 120, .18),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  --shadow-float:
    0 16px 36px -20px rgba(30, 60, 120, .28),
    inset 0 1px 0 rgba(255, 255, 255, .9);
}

:root[data-theme="light"] html { scrollbar-color: #b7c8e6 #eef3ff; }
:root[data-theme="light"] body {
  background:
    radial-gradient(1200px 720px at 78% -12%, rgba(84, 130, 255, .16), transparent 62%),
    radial-gradient(1000px 640px at -12% 108%, rgba(34, 200, 160, .11), transparent 60%),
    radial-gradient(760px 520px at 52% 118%, rgba(139, 92, 246, .08), transparent 65%),
    linear-gradient(180deg, #f9fbff 0%, #eef4ff 48%, #e8effd 100%);
}
:root[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(40, 80, 160, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 80, 160, .05) 1px, transparent 1px);
}
:root[data-theme="light"] .bg-aurora i { opacity: .32; }
:root[data-theme="light"] .app-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .7));
  border-bottom-color: rgba(30, 66, 130, .12);
  box-shadow: 0 16px 38px -30px rgba(30, 60, 120, .45);
}
:root[data-theme="light"] .hero h1 {
  background: linear-gradient(96deg, #16357a 8%, #2f6bff 52%, #0a9a7a 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: none;
}
:root[data-theme="light"] .student-badge {
  background: linear-gradient(180deg, #ffffff, #e7efff);
  border-color: rgba(47, 107, 255, .35);
  color: #24406f;
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px -8px rgba(30, 60, 120, .4);
}
:root[data-theme="light"] .header-stats {
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px -22px rgba(30, 60, 120, .5);
}
:root[data-theme="light"] .hstat {
  background: linear-gradient(180deg, #ffffff, #edf3ff);
  border-color: rgba(30, 66, 130, .12);
}
:root[data-theme="light"] .hstat-value { background: none; color: #16357a; -webkit-text-fill-color: currentColor; }
:root[data-theme="light"] .btn {
  background: linear-gradient(180deg, #ffffff, #e9f0ff);
  border-color: rgba(30, 66, 130, .18);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 rgba(150, 176, 220, .55), 0 10px 20px -14px rgba(30, 60, 120, .4);
}
:root[data-theme="light"] .btn.ghost { background: rgba(255, 255, 255, .55); border-color: rgba(30, 66, 130, .16); }
:root[data-theme="light"] .icon-btn { background: rgba(255, 255, 255, .55); border-color: rgba(30, 66, 130, .16); }
:root[data-theme="light"] .brand-logo {
  background: #eef4ff;
  box-shadow:
    0 0 0 1px rgba(47, 107, 255, .16),
    0 8px 18px -10px rgba(30, 60, 120, .42),
    0 0 16px -8px rgba(70, 150, 255, .3);
}
:root[data-theme="light"] .sponsor-logo {
  box-shadow:
    0 0 0 1px rgba(47, 107, 255, .14),
    0 6px 14px -8px rgba(30, 60, 120, .38);
}
:root[data-theme="light"] .brand-logo .logo-dark,
:root[data-theme="light"] .sponsor-logo.logo-dark { display: none; }
:root[data-theme="light"] .brand-logo .logo-light,
:root[data-theme="light"] .sponsor-logo.logo-light { display: block; }
:root[data-theme="light"] .brand-logo img,
:root[data-theme="light"] .sponsor-logo { filter: saturate(1.06) contrast(1.02); }
:root[data-theme="light"] .btn.primary { background: linear-gradient(180deg, #6f9dff, #3f6fff 60%, #2f55e0); color: #fff; }
:root[data-theme="light"] .card,
:root[data-theme="light"] .summary-card,
:root[data-theme="light"] .modal-card,
:root[data-theme="light"] .sound-card,
:root[data-theme="light"] .result-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(244, 248, 255, .97));
  border-color: var(--line);
}
:root[data-theme="light"] .result-card {
  background:
    radial-gradient(420px 220px at 50% -10%, rgba(106, 168, 255, .22), transparent 70%),
    linear-gradient(180deg, #ffffff, #f2f7ff);
}
:root[data-theme="light"] .profile-chip,
:root[data-theme="light"] .track-card,
:root[data-theme="light"] .lesson-card {
  background: linear-gradient(180deg, #ffffff, #f1f6ff);
  border-color: var(--line);
}
:root[data-theme="light"] .sponsor-card {
  background:
    radial-gradient(420px 160px at 0% 0%, rgba(47, 107, 255, .12), transparent 70%),
    linear-gradient(180deg, #ffffff, #f2f7ff);
  border-color: var(--line-strong);
}
:root[data-theme="light"] .sponsor-chip {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(30, 66, 130, .18);
}
:root[data-theme="light"] .sponsor-tag {
  border-color: rgba(157, 100, 16, .3);
  background: rgba(255, 196, 107, .24);
  color: #8a5a08;
}
:root[data-theme="light"] .sponsor-free { color: #0a8a6c; }
:root[data-theme="light"] .sponsor-line .sponsor-chip { background: transparent; }
:root[data-theme="light"] .shop-tile {
  background: rgba(255, 255, 255, .8);
  border-color: rgba(30, 66, 130, .16);
}
:root[data-theme="light"] a.shop-tile:hover { background: #fff; }
:root[data-theme="light"] .shop-tile-icon {
  background: rgba(47, 107, 255, .1);
  border-color: rgba(47, 107, 255, .18);
}
:root[data-theme="light"] .text-display {
  background:
    radial-gradient(600px 220px at 18% 0%, rgba(70, 116, 220, .09), transparent 70%),
    linear-gradient(180deg, #ffffff, #f7faff);
  box-shadow: inset 0 2px 12px rgba(30, 60, 120, .08), 0 26px 50px -38px rgba(30, 60, 120, .4);
}
:root[data-theme="light"] .text-display .ch.correct { color: #0a8a6c; text-shadow: none; }
:root[data-theme="light"] .text-display .ch.wrong {
  color: #b3243c;
  background: rgba(214, 60, 85, .12);
  box-shadow: inset 0 -2px 0 rgba(214, 60, 85, .8);
}
:root[data-theme="light"] .text-display .ch.current {
  background: linear-gradient(180deg, rgba(47, 107, 255, .28), rgba(47, 107, 255, .16));
  box-shadow: inset 0 0 0 1px rgba(47, 107, 255, .55), 0 0 16px rgba(47, 107, 255, .3);
  color: #10254f;
}
:root[data-theme="light"] .practice-clock {
  background: linear-gradient(180deg, #ffffff, #edf3ff);
  color: #16357a;
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 rgba(150, 176, 220, .5);
}
:root[data-theme="light"] .progress-wrap { background: #dde7f8; box-shadow: inset 0 2px 5px rgba(30, 60, 120, .18); }
:root[data-theme="light"] .keyboard {
  background:
    radial-gradient(700px 240px at 50% -10%, rgba(80, 125, 235, .12), transparent 70%),
    linear-gradient(180deg, #f8fbff, #e9f0fd);
  border-color: rgba(30, 66, 130, .16);
  box-shadow: inset 0 2px 0 #fff, 0 30px 60px -46px rgba(30, 60, 120, .5);
}
:root[data-theme="light"] .kb-key {
  background: linear-gradient(180deg, #ffffff 0%, #f2f6ff 52%, #e2eaf9 100%);
  border-color: rgba(30, 66, 130, .18);
  color: #1b2f55;
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(30, 66, 130, .08), 0 5px 0 #aebfda, 0 9px 14px -6px rgba(30, 60, 120, .35);
}
:root[data-theme="light"] .kb-key::before { background: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0)); }
:root[data-theme="light"] .kb-key .main { color: #1b2f55; text-shadow: none; }
:root[data-theme="light"] .kb-key .latin {
  background: rgba(30, 66, 130, .08);
  box-shadow: inset 0 0 0 1px rgba(30, 66, 130, .14);
  color: #36507c;
}
:root[data-theme="light"] .kb-key .shift { color: rgba(43, 72, 120, .62); }
:root[data-theme="light"] .hand-guide { background: linear-gradient(180deg, #ffffff, #f1f6ff); }
:root[data-theme="light"] .hand-note { background: rgba(255, 255, 255, .8); }
:root[data-theme="light"] .hand-note b { color: #16357a; }
:root[data-theme="light"] .hands-svg .palm,
:root[data-theme="light"] .hands-svg .wrist {
  fill: rgba(70, 110, 180, .1);
  stroke: rgba(45, 85, 155, .38);
}
:root[data-theme="light"] .hands-svg .finger-group .skin { fill-opacity: .42; stroke-opacity: .85; }
:root[data-theme="light"] .teacher-script {
  background:
    radial-gradient(360px 160px at 50% 0%, rgba(34, 160, 120, .1), transparent 70%),
    #f5f9ff;
}
:root[data-theme="light"] .guide-hands {
  background: linear-gradient(180deg, #ffffff, #eef5ff);
}
:root[data-theme="light"] .teacher-script h3 { color: #16357a; }
:root[data-theme="light"] .script-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, #fff), #f8fbff);
  box-shadow: inset 0 1px 0 #fff;
}
:root[data-theme="light"] .script-card p { color: #45577a; }
:root[data-theme="light"] .script-card strong { color: #16357a; }
:root[data-theme="light"] .script-num { background: color-mix(in srgb, var(--c) 16%, #fff); }
:root[data-theme="light"] .sfx-row,
:root[data-theme="light"] .master-row,
:root[data-theme="light"] .result-stats div,
:root[data-theme="light"] .summary-stat,
:root[data-theme="light"] .detail-stat {
  background: #f4f8ff;
  border-color: var(--line);
  box-shadow: inset 0 1px 0 #fff;
}
:root[data-theme="light"] .sfx-icon {
  background: linear-gradient(180deg, #ffffff, #eaf1ff);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 rgba(150, 176, 220, .5);
}
:root[data-theme="light"] .result-stats strong { background: none; color: #16357a; -webkit-text-fill-color: currentColor; }
:root[data-theme="light"] .toast {
  background: linear-gradient(180deg, #26395f, #16233d);
  color: #f2f7ff;
}
:root[data-theme="light"] .streak-pill { background: rgba(255, 196, 107, .22); border-color: rgba(157, 100, 16, .3); color: #7d500c; }
:root[data-theme="light"] .badge-chip { background: rgba(47, 107, 255, .07); border-color: rgba(47, 107, 255, .2); color: #23406f; }
:root[data-theme="light"] .badge-chip.earned { background: rgba(10, 154, 122, .12); border-color: rgba(10, 154, 122, .32); color: #08604d; }
:root[data-theme="light"] .weak-chip { background: rgba(214, 60, 85, .08); border-color: rgba(214, 60, 85, .25); color: #8f1f33; }
:root[data-theme="light"] .segmented { background: #eaf1fd; border-color: var(--line); }
:root[data-theme="light"] .seg-btn { color: #4a5e83; }
:root[data-theme="light"] .seg-btn.active { background: #fff; color: #16357a; box-shadow: 0 2px 8px -4px rgba(30, 60, 120, .4); }
:root[data-theme="light"] .field-row input,
:root[data-theme="light"] .modal-card input[type="text"],
:root[data-theme="light"] .modal-card input[type="password"],
:root[data-theme="light"] .modal-card input[type="number"],
:root[data-theme="light"] .custom-textarea {
  background: #fff;
  border-color: rgba(30, 66, 130, .2);
  color: var(--ink);
}
:root[data-theme="light"] .detail-chart { background: #f4f8ff; border-color: var(--line); }
:root[data-theme="light"] .chart-bar { background: #e2eaf8; }
:root[data-theme="light"] .matrix-item { background: #f1f6ff; border-color: var(--line); color: #5a6d90; }
:root[data-theme="light"] .matrix-item.done { background: rgba(10, 154, 122, .12); border-color: rgba(10, 154, 122, .3); color: #08604d; }
:root[data-theme="light"] .data-table th { background: #eef4ff; }
:root[data-theme="light"] .data-table td { border-color: var(--line); }
:root[data-theme="light"] .chart-bar-fill { background: linear-gradient(180deg, #2f6bff, #0a9a7a); }
:root[data-theme="light"] .summary-stat strong,
:root[data-theme="light"] .detail-stat strong { color: #16357a; }
:root[data-theme="light"] .inline-form input,
:root[data-theme="light"] #newProfileName {
  background: #fff;
  border-color: rgba(30, 66, 130, .2);
  color: var(--ink);
}
:root[data-theme="light"] .overlay { background: rgba(221, 231, 248, .62); }
:root[data-theme="light"] .best-line { color: #8f5a10; text-shadow: none; }
:root[data-theme="light"] .result-icon {
  background: linear-gradient(180deg, #ffffff, #e9f1ff);
  border-color: rgba(47, 107, 255, .3);
  box-shadow: inset 0 2px 0 #fff, 0 8px 0 rgba(168, 190, 226, .55), 0 22px 42px -22px rgba(47, 107, 255, .35);
}
:root[data-theme="light"] .finger-tip { color: #24406f; }
:root[data-theme="light"] .finger-tip.live { color: #0a8a6c; text-shadow: none; }
:root[data-theme="light"] .hand-note:nth-child(2) strong { color: #0a8a6c; }
:root[data-theme="light"] .hand-note:nth-child(3) strong { color: #8f5a10; }
:root[data-theme="light"] .chip {
  background: rgba(255, 255, 255, .75);
  border-color: rgba(30, 66, 130, .16);
  color: #52648a;
}
:root[data-theme="light"] .chip.active {
  background: linear-gradient(180deg, #e8f0ff, #d8e6ff);
  border-color: rgba(47, 107, 255, .38);
  color: #1b3a7a;
  box-shadow: inset 0 1px 0 #fff, 0 6px 14px -10px rgba(30, 60, 120, .5);
}
:root[data-theme="light"] .chip.sound-chip.active {
  background: linear-gradient(180deg, #ddfaf0, #c8f4e5);
  border-color: rgba(10, 154, 122, .4);
  color: #08604d;
}

/* ---------- Home summary ---------- */
.summary-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr);
  column-gap: 18px;
  align-items: start;
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background:
    radial-gradient(520px 220px at 90% -20%, rgba(93, 242, 195, .13), transparent 70%),
    linear-gradient(180deg, rgba(25, 41, 72, .66), rgba(10, 19, 37, .88));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeUp .26s ease;
}
.summary-head { grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.summary-head h2 { margin: 1px 0 0; font-size: 1.15rem; letter-spacing: -.2px; }
.eyebrow {
  display: inline-block;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
}
.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  color: #ffd98f;
  background: rgba(255, 196, 107, .12);
  border: 1px solid rgba(255, 196, 107, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
  white-space: nowrap;
}
.summary-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0;
}
.summary-stat,
.detail-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 7px;
  border-radius: 12px;
  background: rgba(5, 11, 23, .5);
  border: 1px solid rgba(146, 176, 235, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  min-width: 0;
}
.summary-stat strong,
.detail-stat strong {
  font-family: var(--mono);
  font-size: .95rem;
  line-height: 1.2;
  color: #dfeaff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-stat span,
.detail-stat span {
  font-size: .66rem;
  color: var(--muted);
  line-height: 1.3;
}
.summary-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.summary-main { min-width: 0; }
.summary-side { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.summary-side .summary-block { margin-top: 0; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.summary-side .summary-block h3 { margin: 0; white-space: nowrap; }
.summary-side .badge-row,
.summary-side .weak-chips { min-width: 0; }
.summary-block { margin-top: 10px; }
.summary-block h3 { margin: 0 0 6px; font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .72rem;
  color: #c3d4f4;
  background: rgba(106, 168, 255, .08);
  border: 1px solid rgba(106, 168, 255, .2);
  white-space: nowrap;
}
.badge-chip.earned {
  color: #a9f7dc;
  background: rgba(93, 242, 195, .11);
  border-color: rgba(93, 242, 195, .32);
  box-shadow: 0 0 14px -6px rgba(93, 242, 195, .5);
}
.badge-chip.locked { opacity: .5; }
.weak-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.weak-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 9px;
  font-family: var(--my-font);
  font-size: .8rem;
  color: #ffc3cd;
  background: rgba(255, 111, 133, .09);
  border: 1px solid rgba(255, 111, 133, .28);
}
.weak-chip b { font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.weak-practice { margin-left: 2px; }

/* ---------- Quick practice tools ---------- */
.tools-card { padding: 16px 20px; }
.tools-head h3 { margin: 0 0 2px; }
.tools-head p { margin: 0 0 10px; }
.tool-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-lang { display: flex; align-items: center; gap: 10px; margin-top: 11px; flex-wrap: wrap; }

/* ---------- Segmented control ---------- */
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(5, 11, 23, .6);
  border: 1px solid var(--line);
}
.seg-btn {
  font-family: inherit;
  font-size: .82rem;
  padding: 6px 14px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active {
  color: #eaf1ff;
  background: linear-gradient(180deg, rgba(77, 116, 190, .55), rgba(38, 60, 100, .7));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 4px 12px -8px rgba(0, 0, 0, .8);
}
.segmented.mini .seg-btn { padding: 4px 10px; font-size: .74rem; }

/* ---------- Practice extras ---------- */
.practice-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.type-capture {
  position: fixed;
  left: 8px;
  bottom: 8px;
  width: 2px;
  height: 2px;
  padding: 0;
  border: 0;
  opacity: .01;
  resize: none;
  font-size: 16px;
  z-index: -1;
  pointer-events: none;
}
.mobile-type-btn { display: none; width: 100%; margin-top: 10px; }
.badge-test {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  color: #ffe0a8;
  background: rgba(255, 196, 107, .13);
  border: 1px solid rgba(255, 196, 107, .32);
}

/* ---------- Generic modals (settings / custom / pin / rename) ---------- */
.modal-card {
  width: min(560px, 100%);
  max-height: min(88vh, 780px);
  overflow: auto;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid rgba(160, 192, 255, .24);
  background:
    radial-gradient(420px 220px at 88% -10%, rgba(106, 168, 255, .14), transparent 70%),
    linear-gradient(180deg, rgba(26, 44, 80, .97), rgba(8, 15, 30, .99));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 50px 100px -40px rgba(0, 0, 0, 1);
  animation: pop .22s ease;
}
.modal-card.wide-card { width: min(880px, 100%); }
.modal-card.compact { width: min(420px, 100%); }
.modal-card.center-card { text-align: center; }
.modal-card.center-card .btn { margin-top: 14px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.modal-head h2 { margin: 0 0 4px; font-size: 1.2rem; }
.modal-head p { margin: 0; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.qr-modal { text-align: center; }
.qr-modal .modal-head { text-align: left; }
.qr-box {
  width: min(260px, 68vw);
  margin: 14px auto 10px;
  padding: 12px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .55);
}
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-url {
  margin: 0;
  font-size: .74rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}
.qr-modal .modal-actions { justify-content: center; }
.modal-card h3 { margin: 18px 0 8px; font-size: .95rem; }
.settings-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-section:first-of-type { border-top: 0; padding-top: 0; }
.settings-section h3 { margin: 0 0 8px; font-size: .92rem; }
.settings-section .check-row + .check-row { margin-top: 10px; }
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .92rem;
}
.field-row input {
  width: 92px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(150, 182, 240, .22);
  background: rgba(5, 11, 23, .6);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .95rem;
  text-align: center;
}
.pin-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pin-input {
  width: 128px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(150, 182, 240, .22);
  background: rgba(5, 11, 23, .6);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.1rem;
  letter-spacing: 9px;
  text-align: center;
}
.modal-card input[type="text"] {
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(150, 182, 240, .22);
  background: rgba(5, 11, 23, .6);
  color: var(--ink);
  font-family: inherit;
  font-size: .95rem;
}
.custom-textarea {
  width: 100%;
  min-height: 180px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(150, 182, 240, .22);
  background: rgba(5, 11, 23, .6);
  color: var(--ink);
  font-family: var(--my-font);
  font-size: .98rem;
  line-height: 1.7;
  resize: vertical;
}
.field-row input:focus,
.pin-input:focus,
.modal-card input[type="text"]:focus,
.custom-textarea:focus {
  outline: none;
  border-color: rgba(106, 168, 255, .6);
  box-shadow: 0 0 0 3px rgba(106, 168, 255, .18);
}
.error-line { min-height: 1.1em; margin: 7px 0 0; font-size: .79rem; color: var(--bad); }

/* ---------- Teacher / detail ---------- */
.data-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}
.detail-chart {
  margin: 8px 0 18px;
  padding: 14px 16px 10px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(5, 11, 23, .45);
}
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 118px; }
.chart-bar {
  flex: 1 1 0;
  display: flex;
  align-items: flex-end;
  height: 100%;
  border-radius: 5px 5px 2px 2px;
  background: rgba(146, 176, 235, .1);
  overflow: hidden;
  min-width: 3px;
}
.chart-bar-fill {
  display: block;
  width: 100%;
  height: var(--h, 0%);
  min-height: 4px;
  border-radius: inherit;
  background: linear-gradient(180deg, #7db2ff, #5df2c3);
  box-shadow: 0 0 12px -4px rgba(106, 168, 255, .6);
  transition: height .3s ease;
}
.chart-caption { margin: 6px 0 0; text-align: right; }
.detail-matrix { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.matrix-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 9px;
  font-size: .74rem;
  color: var(--muted);
  background: rgba(5, 11, 23, .45);
  border: 1px solid var(--line);
}
.matrix-item.done {
  color: #a9f7dc;
  background: rgba(93, 242, 195, .1);
  border-color: rgba(93, 242, 195, .3);
}
.achievement-line { color: var(--accent); }
.profile-chip.current {
  border-color: rgba(106, 168, 255, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 1px rgba(106, 168, 255, .35), 0 18px 34px -20px rgba(80, 130, 255, .6);
}

/* ---------- Confetti ---------- */
.confetti {
  position: fixed;
  top: -16px;
  z-index: 80;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  animation: confettiFall 1.7s cubic-bezier(.25, .6, .35, 1) forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translate3d(0, -10px, 0) rotate(0deg); }
  100% { opacity: .85; transform: translate3d(0, 106vh, 0) rotate(680deg); }
}

/* ---------- v2 responsive ---------- */
@media (max-width: 900px) {
  .summary-card { grid-template-columns: 1fr; }
  .summary-side { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; padding-top: 0; }
  .summary-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; gap: 4px; }
  .about-grid .about-col + .about-col { padding-top: 10px; border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .summary-card { padding: 16px; }
  .summary-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-stats .summary-stat:nth-child(5) { grid-column: 1 / -1; }
  .modal-card { padding: 18px; border-radius: 20px; }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-head-right { width: 100%; justify-content: space-between; }
  .modal-actions { justify-content: stretch; }
  .modal-actions .btn { flex: 1 1 auto; }
  .chart-bars { height: 96px; }
  .chip { padding: 5px 10px; font-size: .74rem; }
  .kb-switch { gap: 5px; }
}
@media (pointer: coarse) {
  .mobile-type-btn { display: inline-flex; }
  .text-display { cursor: default; }
}

/* ---------- Mouse trainer ---------- */
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

.mouse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.mouse-head h1 { margin: 0 0 3px; font-size: clamp(1.2rem, 1.9vw, 1.5rem); letter-spacing: -.3px; }
.mouse-head p { margin: 0; max-width: 860px; font-size: .85rem; line-height: 1.35; }
.mouse-head .btn { padding: 7px 15px; font-size: .85rem; }

.mouse-card { padding: 12px; }
.mouse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.mouse-modes { display: flex; flex-wrap: wrap; gap: 7px; }
.mouse-diff { display: flex; align-items: center; gap: 9px; }

.mouse-hud { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.mstat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 78px;
  padding: 7px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}
.mstat strong { font-size: 1.02rem; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.mstat span { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.mouse-best { margin-left: auto; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (min-width: 721px) {
  .mstat { flex-direction: row; align-items: baseline; gap: 6px; min-width: 0; padding: 2px 8px; border-radius: 8px; }
  .mstat strong { font-size: .9rem; }
  .mstat span { font-size: .6rem; letter-spacing: .4px; }
}

.mouse-progress {
  height: 6px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(4, 9, 19, .9);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.mouse-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5df2c3, #6aa8ff);
  box-shadow: 0 0 14px rgba(93, 242, 195, .5);
  transition: width .18s ease;
}

.mouse-field {
  position: relative;
  height: clamp(420px, 62vh, 680px);
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background:
    radial-gradient(620px 260px at 50% -20%, rgba(93, 242, 195, .10), transparent 70%),
    radial-gradient(circle, rgba(146, 176, 235, .10) 1px, transparent 1.4px) 0 0 / 22px 22px,
    linear-gradient(180deg, rgba(8, 17, 33, .78), rgba(4, 9, 20, .96));
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, .5);
}
.mouse-field.shake { animation: mouseShake .32s ease; }
@keyframes mouseShake {
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.mouse-idle {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
  pointer-events: none;
}
.mouse-idle-icon { font-size: 2.6rem; filter: drop-shadow(0 10px 22px rgba(93, 242, 195, .35)); }
.mouse-idle strong { font-size: 1.05rem; }
.mouse-idle p { margin: 0; max-width: 480px; }

.mouse-task-label {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 3;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(93, 242, 195, .35);
  background: rgba(9, 24, 32, .86);
  color: #dffdf5;
  font-size: .78rem;
  line-height: 1.35;
  max-width: calc(100% - 20px);
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
  box-shadow: 0 8px 22px -14px rgba(0, 0, 0, .9);
}

.mouse-target {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(93, 242, 195, .6);
  color: #04241e;
  font-family: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  outline: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .32), transparent 46%),
    radial-gradient(circle at 50% 62%, rgba(93, 242, 195, .88), rgba(28, 122, 106, .92) 62%, rgba(8, 40, 38, .97));
  box-shadow:
    0 0 0 6px rgba(93, 242, 195, .10),
    0 16px 30px -14px rgba(0, 0, 0, .85),
    0 0 26px -4px rgba(93, 242, 195, .5);
  transition: box-shadow .15s ease, filter .15s ease;
  will-change: transform;
}
.mouse-target::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: conic-gradient(#5df2c3 var(--hold, 0%), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  opacity: 0;
  transition: opacity .12s;
  pointer-events: none;
}
.mouse-target.holding::before { opacity: 1; }
.mouse-target-icon { pointer-events: none; }
.mouse-target-tag {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 999px;
  background: #a9ffe9;
  color: #04241e;
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(93, 242, 195, .8);
  pointer-events: none;
}
.mouse-target.hit { filter: brightness(1.3); box-shadow: 0 0 0 14px rgba(93, 242, 195, .22), 0 0 44px rgba(93, 242, 195, .85); }
.mouse-target.hit .mouse-target-icon { opacity: .12; }
.mouse-target.hit::after {
  content: "✓";
  position: absolute;
  font-size: 1.5em;
  font-weight: 700;
  color: #f2fffb;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
}

.mouse-dropzone {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 16px;
  border: 2px dashed rgba(106, 168, 255, .7);
  background: rgba(106, 168, 255, .10);
  color: #cfe4ff;
  font-size: .78rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
.mouse-drag-token {
  z-index: 4;
  border-radius: 16px;
  border-color: rgba(255, 196, 107, .65);
  cursor: grab;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .28), transparent 46%),
    radial-gradient(circle at 50% 62%, rgba(255, 196, 107, .92), rgba(150, 96, 18, .92) 64%, rgba(46, 28, 6, .97));
  box-shadow: 0 0 0 6px rgba(255, 196, 107, .10), 0 16px 30px -14px rgba(0, 0, 0, .85), 0 0 26px -4px rgba(255, 196, 107, .45);
}
.mouse-drag-token.dragging { cursor: grabbing; z-index: 6; }
.mouse-field.drag-mode { cursor: default; }

.mouse-result {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(93, 242, 195, .35);
  background: linear-gradient(180deg, rgba(16, 52, 48, .55), rgba(7, 24, 24, .75));
}
.mouse-result-icon { font-size: 1.9rem; }
.mouse-result-text { flex: 1; min-width: 0; }
.mouse-result-text strong { display: block; font-size: .98rem; }
.mouse-result-text p { margin: 2px 0 0; }
.mouse-note { margin: 12px 0 0; }

.track-card.mouse-track-card {
  --track-accent: #5df2c3;
  background:
    radial-gradient(420px 200px at 88% -10%, rgba(93, 242, 195, .18), transparent 65%),
    linear-gradient(165deg, rgba(20, 52, 54, .9) 0%, rgba(7, 20, 24, .95) 68%);
}

/* light theme */
:root[data-theme="light"] .mouse-field {
  background:
    radial-gradient(620px 260px at 50% -20%, rgba(93, 242, 195, .18), transparent 70%),
    radial-gradient(circle, rgba(47, 107, 255, .14) 1px, transparent 1.4px) 0 0 / 22px 22px,
    linear-gradient(180deg, #ffffff, #eef4ff);
  box-shadow: inset 0 2px 12px rgba(30, 60, 120, .12);
}
:root[data-theme="light"] .mouse-idle { color: #16357a; }
:root[data-theme="light"] .mstat { background: rgba(255, 255, 255, .78); border-color: rgba(30, 66, 130, .16); }
:root[data-theme="light"] .mouse-progress { background: rgba(30, 60, 120, .12); box-shadow: inset 0 2px 4px rgba(30, 60, 120, .18); }
:root[data-theme="light"] .mouse-task-label {
  background: rgba(255, 255, 255, .94);
  border-color: rgba(10, 138, 108, .4);
  color: #0a6a58;
}
:root[data-theme="light"] .mouse-dropzone { background: rgba(47, 107, 255, .08); color: #1c4a9c; border-color: rgba(47, 107, 255, .55); }
:root[data-theme="light"] .mouse-result {
  background: linear-gradient(180deg, #ffffff, #effbf7);
  border-color: rgba(10, 138, 108, .35);
}

@media (max-width: 720px) {
  .mouse-head { align-items: flex-start; }
  .mouse-head .btn { width: 100%; }
  .mouse-field { height: clamp(360px, 56vh, 500px); }
  .mouse-hud { gap: 7px; }
  .mstat { flex: 1 1 calc(50% - 7px); min-width: 0; padding: 6px 10px; }
  .mouse-best { flex-basis: 100%; margin-left: 0; }
  .mouse-result { flex-wrap: wrap; }
  .mouse-result .btn { width: 100%; }
}
@media (max-width: 440px) {
  .mouse-modes { gap: 5px; }
  .mouse-diff { width: 100%; justify-content: space-between; }
  .mouse-field { height: clamp(350px, 56vh, 450px); }
}
@media (max-width: 720px) {
  #screen-home .hero-actions { gap: 8px; }
  #screen-home .hero-actions .btn { padding: 9px 12px; font-size: .82rem; }
}
