:root {
  --bg: #f3f6fb;
  --bg-gradient: linear-gradient(140deg, #eef3ff 0%, #f8fbff 48%, #f3f8ff 100%);
  --panel: #ffffff;
  --panel-soft: #f7f9fe;
  --line: #dde5f4;
  --text: #1b2b4a;
  --text-soft: #617393;
  --brand: #2f6df6;
  --brand-dark: #1f52c2;
  --accent: #2dc59a;
  --danger: #f35e74;
  --warning: #f6a53c;
  --ok: #2dc59a;
  --radius: 16px;
  --shadow: 0 16px 38px rgba(44, 72, 141, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text);
  font-family: "Barlow", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

input,
textarea,
select,
button {
  font: inherit;
}

.page-wrap {
  width: min(1240px, 96vw);
  margin: 0 auto;
  padding: 20px 0 36px;
}

.topbar {
  min-height: 66px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  gap: 10px;
  flex-wrap: wrap;
  border-radius: 18px;
  background: linear-gradient(90deg, #ffffff 0%, #f6f9ff 100%);
  border: 1px solid #e3e9f6;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 4px 8px 4px 4px;
  transition: transform 0.16s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover {
  transform: translateY(-1px);
  border-color: #d8e5fb;
  background: linear-gradient(180deg, #f7faff 0%, #edf3ff 100%);
  box-shadow: 0 10px 22px rgba(44, 78, 155, 0.14);
}

.brand:focus-visible {
  outline: none;
  border-color: #89aceb;
  box-shadow: 0 0 0 3px rgba(50, 104, 219, 0.18);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(148deg, #63a7ff 0%, #2f6df6 46%, #1e4fc6 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 7px 18px rgba(28, 73, 174, 0.34);
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.2s ease;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 1px 1px 18px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.brand:hover .brand-mark {
  transform: scale(1.04);
  box-shadow: 0 10px 22px rgba(28, 73, 174, 0.42);
}

.brand-text {
  line-height: 1.2;
}

.brand-text strong {
  display: block;
  font-size: 18px;
}

.brand-text span {
  font-size: 13px;
  color: var(--text-soft);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-actions .nav-dropdown {
  position: relative;
}

.topbar-actions .nav-dropdown > summary {
  list-style: none;
}

.topbar-actions .nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.topbar-actions .nav-dropdown-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-actions .nav-dropdown-summary::after {
  content: "▾";
  font-size: 11px;
  opacity: 0.82;
  transition: transform 0.15s ease;
}

.topbar-actions .nav-dropdown[open] .nav-dropdown-summary::after {
  transform: rotate(180deg);
}

.topbar-actions .nav-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  min-width: 156px;
  border-radius: 12px;
  border: 1px solid #d4e0f4;
  background: #fff;
  box-shadow: 0 14px 28px rgba(24, 48, 79, 0.16);
  padding: 6px;
  display: grid;
  gap: 6px;
  z-index: 100;
}

.topbar-actions .nav-dropdown-menu a {
  width: 100%;
  justify-content: flex-start;
}

.topbar-actions .nav-dropdown-menu a.is-active {
  border-color: #8cb1e8;
  background: #eaf3ff;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d4def1;
  border-radius: 10px;
  background: #f4f8ff;
  color: #4c6998;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1;
}

.lang-switch label {
  white-space: nowrap;
  font-weight: 600;
}

.lang-switch select {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  padding: 0;
  cursor: pointer;
}

.legacy-settings-hidden {
  display: none !important;
}

.has-user-settings-menu .topbar-actions > a[href$="social.html"],
.has-user-settings-menu .header-actions > a[href$="social.html"],
.has-user-settings-menu .tp-mini-nav > a[href$="social.html"] {
  display: none !important;
}

.user-settings-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 120;
}

.user-settings-trigger {
  border: 1px solid #d5dff0;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
  color: #425f8f;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.user-settings-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #4f8fe7 0%, #396fca 100%);
  overflow: hidden;
}

.user-settings-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-settings-meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.user-settings-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
}

.user-settings-status {
  font-size: 11px;
  line-height: 1.05;
  color: #7088af;
  white-space: nowrap;
}

.user-settings-caret {
  font-size: 11px;
  color: #7c94bb;
}

.user-settings-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(250px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  border-radius: 14px;
  border: 1px solid #d8e2f4;
  background: #fff;
  box-shadow: 0 16px 30px rgba(30, 60, 117, 0.2);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.user-settings-popover.hidden {
  display: none;
}

.user-settings-section {
  border-radius: 10px;
  padding: 8px;
}

.user-settings-heading {
  font-size: 12px;
  font-weight: 700;
  color: #5f789f;
  background: #f6f9ff;
}

.user-settings-links {
  display: grid;
  gap: 4px;
}

.user-settings-link {
  display: block;
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid #d7e1f3;
  background: #f8fbff;
  color: #41679e;
  font-size: 12px;
  font-weight: 600;
}

.user-settings-link:hover {
  border-color: #a8c3ea;
  background: #eef4ff;
}

.user-settings-language {
  border: 1px solid #dbe5f6;
  background: #fafcff;
  display: grid;
  gap: 6px;
}

.user-settings-language label {
  font-size: 12px;
  color: #647fa7;
}

.user-settings-language select {
  width: 100%;
  border: 1px solid #d6e1f4;
  border-radius: 8px;
  padding: 7px 8px;
  background: #fff;
  color: #456493;
  font-size: 12px;
}

.user-settings-notifications {
  border: 1px solid #dbe5f6;
  background: #fafcff;
  display: grid;
  gap: 8px;
}

.user-settings-notifications.is-highlight {
  border-color: #94b8ea;
  box-shadow: 0 0 0 2px rgba(89, 142, 222, 0.16);
}

.user-settings-notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #5e79a1;
}

.user-settings-notice-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(145deg, #4f90e8 0%, #3c72c8 100%);
}

.user-settings-notice-list {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 7px;
}

.user-settings-notice-empty {
  border-radius: 8px;
  border: 1px dashed #d4e1f5;
  background: #f7faff;
  color: #6f87ad;
  font-size: 12px;
  padding: 8px;
  text-align: center;
}

.user-settings-notice-item {
  border-radius: 10px;
  border: 1px solid #d8e3f6;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 5px;
}

.user-settings-notice-title {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  color: #355f9c;
}

.user-settings-notice-meta {
  font-size: 12px;
  color: #5f7aa1;
}

.user-settings-notice-msg {
  font-size: 12px;
  color: #4d6690;
  line-height: 1.35;
  background: #f6faff;
  border: 1px solid #dce7f8;
  border-radius: 7px;
  padding: 5px 6px;
}

.user-settings-notice-actions {
  display: flex;
  gap: 6px;
}

.user-settings-notice-btn {
  border: 1px solid #d4def1;
  border-radius: 8px;
  background: #f6f9ff;
  color: #48679b;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 9px;
  cursor: pointer;
}

.user-settings-notice-btn.primary {
  border-color: #9fc0ee;
  background: linear-gradient(145deg, #4f90e8 0%, #3f78cb 100%);
  color: #fff;
}

.user-settings-notice-btn:disabled {
  opacity: 0.72;
  cursor: default;
}

.user-settings-action {
  width: 100%;
  border: 1px solid #d4dff2;
  border-radius: 9px;
  background: linear-gradient(145deg, #ecf3ff 0%, #e3ecff 100%);
  color: #335fba;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 10px;
  cursor: pointer;
}

.user-settings-action:hover {
  border-color: #adc5ea;
  background: linear-gradient(145deg, #e5f0ff 0%, #dbe9ff 100%);
}

.page-nav {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #dbe4f5;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 22px rgba(49, 86, 152, 0.1);
}

.page-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid #d8e2f4;
  background: #f5f8ff;
  color: #4d6896;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.page-nav-link:hover {
  border-color: #a7c2ee;
  background: #edf4ff;
}

.page-nav-link.is-active {
  border-color: #5d8fe5;
  background: linear-gradient(145deg, #4f8ee7 0%, #3d74ca 100%);
  color: #fff;
}

.page-nav-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.badge-user {
  border-radius: 999px;
  background: #ebf1ff;
  color: #315db5;
  padding: 7px 14px;
  font-size: 14px;
  border: 1px solid #d4e1ff;
}

.layout-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
}

.panel {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid #e1e8f6;
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel-title {
  margin: 0;
  font-size: 20px;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 14px;
}

.field {
  margin-top: 10px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfcff;
  color: var(--text);
}

.button-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(33, 76, 168, 0.2);
}

.btn-primary {
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
}

.btn-ghost {
  background: #eff4ff;
  color: #315db5;
}

.topbar-actions a.btn.is-active {
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 10px 18px rgba(43, 97, 212, 0.24);
}

.btn-warning {
  background: #fff1de;
  color: #af6a00;
}

.notice {
  margin-top: 10px;
  border-radius: 10px;
  padding: 10px 12px;
  background: #eef3ff;
  color: #3055a7;
  font-size: 14px;
}

.notice.error {
  background: #ffecee;
  color: #a0384c;
}

.cards-stage {
  margin-top: 16px;
}

.stage-title {
  font-size: 18px;
  margin: 0 0 10px;
}

.stage-sub {
  margin: -2px 0 12px;
  color: var(--text-soft);
  font-size: 13px;
}

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

.lesson-card {
  border: 1px solid #dfe7f6;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.lesson-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.lesson-name {
  font-size: 15px;
  font-weight: 700;
}

.lesson-meta {
  font-size: 12px;
  color: var(--text-soft);
}

.lesson-desc {
  font-size: 13px;
  color: var(--text-soft);
  min-height: 36px;
}

.lesson-recent {
  padding: 8px;
  background: #edf3ff;
  border-radius: 10px;
  font-size: 12px;
  color: #3b5eaa;
}

.lesson-actions {
  display: flex;
  justify-content: flex-end;
}

.lobby-head {
  border: 1px solid #dde6f7;
  border-radius: 14px;
  background: linear-gradient(120deg, #f7faff 0%, #eef4ff 100%);
  padding: 14px;
}

.filter-tabs {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid #d7e1f4;
  border-radius: 999px;
  background: #f8fbff;
  color: #355a9f;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip span {
  margin-left: 6px;
  color: #6f86b3;
  font-size: 12px;
}

.filter-chip:hover {
  border-color: #9fbae7;
  background: #edf4ff;
}

.filter-chip.active {
  border-color: #336fd9;
  background: linear-gradient(135deg, #3a7dff 0%, #2d5fd4 100%);
  color: #fff;
}

.filter-chip.active span {
  color: #e8f1ff;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(21, 33, 58, 0.44);
  backdrop-filter: blur(2px);
}

.auth-modal-panel {
  position: relative;
  width: min(900px, 92vw);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid #dfe8f7;
  background: #fff;
  box-shadow: 0 24px 64px rgba(31, 64, 128, 0.24);
  padding: 18px;
}

.auth-modal-panel h2 {
  margin: 0;
  font-size: 24px;
}

.auth-modal-panel p {
  margin: 6px 0 0;
  color: #60749d;
  font-size: 14px;
}

.auth-grid {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.auth-grid section {
  border: 1px solid #dce6f8;
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
}

.auth-grid h3 {
  margin: 0;
  font-size: 18px;
}

.auth-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid #d7e2f6;
  border-radius: 50%;
  background: #f6f9ff;
  color: #4f6696;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.auth-flow-tips {
  margin-top: 12px;
  border: 1px solid #d7e3fb;
  border-radius: 10px;
  background: #f1f6ff;
  padding: 10px 12px;
}

.auth-flow-tips p {
  margin: 6px 0 0;
  color: #4d6594;
  font-size: 13px;
  line-height: 1.45;
}

.auth-flow-tips p:first-child {
  margin-top: 0;
}

.main-single {
  margin-top: 16px;
}

.sound-controls {
  margin-top: 14px;
  border: 1px solid #dbe4f6;
  border-radius: 12px;
  background: #f8faff;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2a4c96;
  font-weight: 600;
}

.sound-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.sound-volume-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.sound-volume-wrap label {
  color: #516b9e;
  font-size: 13px;
}

.sound-volume-wrap input[type="range"] {
  width: 100%;
}

.sound-volume-value {
  min-width: 40px;
  text-align: right;
  color: #3b5d9f;
  font-size: 13px;
}

.sound-status {
  color: #4f6590;
  font-size: 13px;
  white-space: nowrap;
}

.sound-status.error {
  color: #ad3452;
}

.play-shell {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  background: #f7f9ff;
  border: 1px solid #dfe6f5;
  border-radius: 12px;
  padding: 10px;
}

.metric .label {
  font-size: 12px;
  color: var(--text-soft);
}

.metric .value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
}

.progress {
  margin-top: 8px;
  width: 100%;
  height: 10px;
  background: #e7eeff;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2fc9a2 0%, #2a98df 100%);
}

.target-panel {
  border: 1px solid #dae2f4;
  border-radius: 14px;
  background: #f9fbff;
  padding: 14px;
  min-height: 170px;
}

.target-text {
  white-space: pre-wrap;
  line-height: 1.9;
  font-family: "JetBrains Mono", "Menlo", monospace;
  font-size: 21px;
  letter-spacing: 0.35px;
}

.target-char {
  border-radius: 4px;
  padding: 1px 1px;
}

.target-char.pending {
  background: transparent;
  color: #7f8fae;
}

.target-char.current {
  background: #d9e7ff;
  color: #1b4cb4;
}

.target-char.correct {
  color: #139169;
  background: #d7f8ed;
}

.target-char.wrong {
  color: #ca2e4f;
  background: #ffe1e8;
}

.typing-input {
  width: 100%;
  min-height: 150px;
  border: 1px solid #dbe3f5;
  border-radius: 12px;
  padding: 12px;
  font-family: "JetBrains Mono", "Menlo", monospace;
  font-size: 18px;
  line-height: 1.55;
  resize: vertical;
}

.play-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.result-shell {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.score-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}

.score-main {
  background: linear-gradient(145deg, #f5f9ff 0%, #eaf1ff 100%);
  border: 1px solid #d6e1f6;
  border-radius: 14px;
  padding: 16px;
}

.result-next-panel {
  padding: 14px;
  border: 1px solid #d8e3f7;
  background: linear-gradient(145deg, #f8fbff 0%, #f1f6ff 100%);
}

.promotion-chip {
  background: #4d78be;
}

.promotion-chip.pass {
  background: #1c8f67;
}

.promotion-chip.hold {
  background: #cc7d2c;
}

.result-next-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-next-actions .btn[disabled] {
  opacity: 0.58;
  cursor: not-allowed;
}

.retry-nudge {
  margin-top: 12px;
  border: 1px solid #f1cf86;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff9eb 0%, #fff2d6 100%);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  position: sticky;
  bottom: 12px;
  z-index: 4;
  box-shadow: 0 10px 20px rgba(181, 132, 48, 0.18);
}

.retry-nudge-text {
  color: #9a6322;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.retry-nudge-btn {
  white-space: nowrap;
  animation: retry-nudge-pulse 1.6s ease-in-out infinite;
}

@keyframes retry-nudge-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(59, 111, 215, 0.2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(59, 111, 215, 0);
  }
}

.rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 12px;
  background: #2c5fce;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.rating-star {
  --fill: 0%;
  display: inline-block;
  font-size: 24px;
  line-height: 1;
  color: transparent;
  background: linear-gradient(90deg, #f8c63b var(--fill), #d3dae8 var(--fill));
  -webkit-background-clip: text;
  background-clip: text;
}

.score-rating-meta {
  margin-top: 8px;
  color: #5a7299;
  font-weight: 600;
}

.stats-rating-star {
  font-size: 16px;
  line-height: 1;
}

.stats-star-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.stats-star-text {
  margin-left: 6px;
  font-size: 13px;
  color: #5a7198;
  font-weight: 700;
}

.stats-star-value {
  display: inline-flex;
  align-items: center;
}

.stats-star-cell {
  white-space: nowrap;
}

.today-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stats-session-link {
  color: #2f65c7;
  border-bottom: 1px dashed #86a6de;
}

.stats-session-link:hover {
  color: #204f9f;
  border-bottom-style: solid;
}

.score-value {
  margin-top: 8px;
  font-size: 44px;
  font-weight: 700;
  color: #1f52bf;
}

.score-desc {
  margin-top: 6px;
  color: #4a618f;
}

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

.stat-box {
  border-radius: 12px;
  border: 1px solid #deE6f6;
  background: #fff;
  padding: 10px;
}

.stat-box .k {
  color: var(--text-soft);
  font-size: 12px;
}

.stat-box .v {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid #e4eaf8;
  padding: 8px;
  text-align: left;
  font-size: 13px;
}

.compare-table .ok {
  color: #0f8d64;
}

.compare-table .bad,
.compare-table .missing,
.compare-table .extra {
  color: #bb2f4f;
}

.bucket-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 130px;
  margin-top: 8px;
}

.bucket-bar {
  flex: 1;
  background: linear-gradient(180deg, #4b88ff 0%, #285dce 100%);
  border-radius: 8px 8px 4px 4px;
  min-height: 6px;
  position: relative;
}

.bucket-bar span {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  color: #435986;
  font-size: 11px;
}

.inline-list {
  margin: 0;
  padding-left: 16px;
  color: #3f5685;
  font-size: 14px;
}

.toolbar-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.toolbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.summary-grid {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.chart-grid {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.line-chart {
  margin-top: 10px;
  min-height: 240px;
  border: 1px solid #dee7f7;
  border-radius: 12px;
  background: #f9fbff;
  padding: 8px;
}

.line-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.axis-label {
  fill: #6c7fa3;
  font-size: 11px;
}

.chart-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.chart-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 8px;
  color: #5f769f;
  font-size: 12px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4f6595;
  font-size: 12px;
}

.chart-legend-item i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.chart-grid-line {
  stroke: #dde7f8;
  stroke-dasharray: 4 4;
}

.chart-hint {
  margin-top: 8px;
  color: #6177a1;
  font-size: 12px;
}

.growth-momentum {
  margin-top: 12px;
  border: 1px solid #d9e4f7;
  background: linear-gradient(150deg, #f7fbff 0%, #edf4ff 100%);
}

.growth-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.momentum-card {
  border-radius: 12px;
  border: 1px solid #dbe5f7;
  background: #fff;
  padding: 10px;
}

.momentum-card .k {
  color: #60759f;
  font-size: 12px;
}

.momentum-card .v {
  margin-top: 4px;
  color: #1c4fae;
  font-size: 21px;
  font-weight: 700;
}

.momentum-card .s {
  margin-top: 6px;
  color: #62779f;
  font-size: 12px;
  line-height: 1.45;
}

.momentum-card.up .v {
  color: #0e8f65;
}

.momentum-card.down .v {
  color: #b43a57;
}

.growth-ladder-wrap {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid #dce5f6;
  background: #fff;
  padding: 12px;
}

.growth-ladder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.growth-ladder-track {
  margin-top: 8px;
}

.ladder-progress-shell {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e7efff;
  overflow: hidden;
}

.ladder-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #3e86ff 0%, #29bf9c 100%);
  transition: width 0.25s ease;
}

.ladder-steps {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ladder-step {
  border-radius: 10px;
  border: 1px solid #dbe6f7;
  background: #f9fbff;
  padding: 8px 6px;
  text-align: center;
}

.ladder-node {
  margin: 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid #c9d8f4;
  color: #5572a3;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
}

.ladder-label {
  margin-top: 6px;
  color: #2d4f89;
  font-size: 12px;
  font-weight: 700;
}

.ladder-target {
  margin-top: 3px;
  color: #667da8;
  font-size: 11px;
}

.ladder-step.done {
  border-color: #bfe2d7;
  background: #ecfbf6;
}

.ladder-step.done .ladder-node {
  border-color: #7dcfb8;
  color: #1b916c;
  background: #dff8ef;
}

.ladder-step.current {
  border-color: #8eb6f3;
  background: #ebf3ff;
  box-shadow: inset 0 0 0 1px rgba(79, 129, 219, 0.16);
}

.ladder-step.current .ladder-node {
  border-color: #5f8fdd;
  color: #ffffff;
  background: linear-gradient(145deg, #4b87ea 0%, #3a6fca 100%);
}

.ladder-step.next {
  border-color: #c9dbf7;
  background: #f6faff;
}

.ladder-step.locked {
  opacity: 0.72;
}

.leaderboard-list {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.leaderboard-toolbar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.leaderboard-toolbar-note {
  font-size: 12px;
  color: #5f7399;
}

.leaderboard-card {
  border: 1px solid #dfe7f6;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  display: grid;
  gap: 10px;
}

.leaderboard-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entity-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #d5e1f6;
  object-fit: cover;
  display: block;
  background: #eff4ff;
}

.leaderboard-user-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard-rank {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #ecf3ff;
  color: #2a5cc5;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.leaderboard-user {
  font-size: 18px;
  font-weight: 700;
}

.leaderboard-meta {
  margin-top: 4px;
  color: #60749d;
  font-size: 13px;
}

.leaderboard-star-tag {
  color: #da8a11;
  font-weight: 700;
}

.leaderboard-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: auto auto 1fr;
  align-items: center;
}

.inline-comment-form {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  grid-column: 1 / -1;
}

.inline-comment-input {
  width: 100%;
  border: 1px solid #d9e3f7;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fcfdff;
}

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

.social-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

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

.settings-two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.friend-search-grid {
  grid-template-columns: 1fr 180px auto;
}

.settings-shell {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.settings-sidebar {
  position: sticky;
  top: 10px;
}

.settings-nav-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.settings-nav-link {
  justify-content: flex-start;
}

.settings-detail {
  min-width: 0;
}

.settings-fold {
  margin-top: 10px;
  border: 1px solid #dce5f7;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  overflow: hidden;
}

.settings-fold-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #eef4ff;
}

.settings-fold-summary::-webkit-details-marker {
  display: none;
}

.settings-fold-title {
  font-size: 16px;
  font-weight: 700;
  color: #284f95;
}

.settings-fold-sub {
  font-size: 12px;
  color: #5d739a;
}

.settings-fold-body {
  padding: 12px;
}

.homepage-header {
  display: grid;
  gap: 10px;
}

.share-link-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

.social-card,
.social-user-search-card {
  border: 1px solid #dbe5f7;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 12px;
  display: grid;
  gap: 10px;
}

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

.social-card-main {
  min-width: 0;
}

.social-user-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.social-user-title {
  font-size: 16px;
  font-weight: 700;
  color: #294f95;
}

.social-user-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #5f7399;
}

.social-role-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #d6e1f4;
  background: #eef4ff;
  color: #2c5abb;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
}

.social-card-message {
  margin-top: 8px;
  color: #4f6591;
  font-size: 13px;
  line-height: 1.45;
}

.social-card-actions {
  display: flex;
  gap: 8px;
}

.social-user-main {
  min-width: 0;
}

.social-user-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
}

.social-user-actions-apply {
  grid-template-columns: 1fr auto auto;
}

.social-relation-type,
.social-message-input {
  width: 100%;
  border: 1px solid #d9e3f7;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fcfdff;
}

.social-link {
  color: #2f67c6;
  text-decoration: none;
  border-bottom: 1px dashed rgba(47, 103, 198, 0.45);
}

.social-link:hover {
  color: #1e4e9e;
  border-bottom-color: rgba(30, 78, 158, 0.75);
}

.title-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(47, 103, 198, 0.35);
}

.title-link:hover {
  color: #1e4e9e;
  border-bottom-color: rgba(30, 78, 158, 0.75);
}

.social-bulk-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4f6695;
  font-size: 13px;
}

.check-row {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #465f8e;
  font-size: 14px;
}

.stack-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.generated-card {
  border: 1px solid #dfe6f6;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

.generated-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.generated-meta {
  margin-top: 8px;
  color: #60749d;
  font-size: 13px;
}

.panel-soft {
  border: 1px solid #d9e3f7;
  border-radius: 12px;
  background: #f9fbff;
  padding: 12px;
}

.prompt-preview {
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #dce5f7;
  background: #f4f8ff;
  color: #294a85;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", "Menlo", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.drill-card {
  border: 1px solid #dde5f6;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.drill-title {
  font-weight: 700;
  color: #2d4f94;
}

.drill-tip {
  margin-top: 6px;
  color: #5f7298;
  font-size: 13px;
}

.subject-play-shell {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1.2fr 1fr;
}

.subject-progress {
  margin-top: 12px;
  border: 1px solid #d8e3f6;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  padding: 10px 12px;
}

.subject-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #5873a2;
  font-size: 13px;
  font-weight: 600;
}

.subject-progress-head strong {
  color: #2d5cb3;
  font-size: 16px;
  font-family: "JetBrains Mono", "Menlo", monospace;
}

.subject-progress-track {
  margin-top: 8px;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #dfe9fb;
  overflow: hidden;
}

.subject-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #56beff 0%, #3c8cf0 55%, #2a66ce 100%);
  box-shadow: 0 2px 8px rgba(62, 121, 216, 0.35);
  transition: width 0.22s ease;
}

.question-card {
  border: 1px solid #dbe4f6;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  padding: 14px;
}

.question-index {
  font-size: 13px;
  color: #5c74a1;
  margin-bottom: 8px;
}

.question-prompt {
  font-size: clamp(32px, 3.3vw, 42px);
  font-weight: 700;
  color: #20498f;
  line-height: 1.3;
  min-height: 92px;
}

.question-hint {
  margin-top: 8px;
  color: #6b7fa7;
  font-size: 13px;
  min-height: 20px;
}

.answer-row {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
}

.answer-input {
  width: 100%;
  border: 1px solid #d8e3f7;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fcfdff;
  font-family: "JetBrains Mono", "Menlo", monospace;
  font-size: 16px;
  color: #20498f;
}

.math-extra-controls {
  margin-top: 10px;
}

.math-keypad-wrap {
  margin-top: 12px;
  border: 1px solid #dbe4f6;
  border-radius: 12px;
  background: #f7faff;
  padding: 10px;
}

.math-keypad-title {
  font-size: 12px;
  color: #5d76a3;
  margin-bottom: 8px;
}

.math-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.math-key {
  border: 1px solid #d6e1f5;
  border-radius: 10px;
  background: #fff;
  color: #2f5798;
  font-weight: 700;
  min-height: 56px;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.math-key:hover {
  border-color: #8db2ec;
  background: #eef5ff;
}

.math-key:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.math-key-wide {
  grid-column: span 2;
}

.math-key-danger {
  color: #a13c52;
  background: #fff3f6;
  border-color: #efc9d3;
  font-size: 18px;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .layout-grid {
    grid-template-columns: 1fr !important;
  }

  .page-nav {
    flex-wrap: wrap;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-hero {
    grid-template-columns: 1fr;
  }

  .sound-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .sound-status {
    white-space: normal;
  }

  .toolbar-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .toolbar-actions {
    align-items: stretch;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .growth-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ladder-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-actions {
    grid-template-columns: 1fr;
  }

  .inline-comment-form {
    grid-template-columns: 1fr;
  }

  .social-card {
    grid-template-columns: 1fr;
  }

  .social-user-actions {
    grid-template-columns: 1fr;
  }

  .social-user-actions-apply {
    grid-template-columns: 1fr;
  }

  .social-filter-grid {
    grid-template-columns: 1fr;
  }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    position: static;
  }

  .settings-fold-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .share-link-row {
    grid-template-columns: 1fr;
  }

  .generated-card-head {
    flex-direction: column;
  }

  .subject-play-shell {
    grid-template-columns: 1fr;
  }

  .answer-row {
    grid-template-columns: 1fr;
  }

  .growth-metrics {
    grid-template-columns: 1fr;
  }

  .today-summary-grid {
    grid-template-columns: 1fr;
  }

  .ladder-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .math-key {
    min-height: 52px;
    font-size: 21px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-actions .user-settings-menu {
    margin-left: auto;
  }

  .user-settings-popover {
    right: 0;
    left: auto;
  }

  .auth-modal {
    padding: 8px;
    place-items: start center;
  }

  .auth-modal-panel {
    width: min(100%, 560px);
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
    padding: 14px 12px;
  }

  .auth-modal-panel h2 {
    font-size: 20px;
    line-height: 1.25;
    padding-right: 34px;
  }

  .auth-modal-panel p {
    font-size: 13px;
    line-height: 1.45;
  }

  .auth-modal-panel .auth-grid section {
    padding: 10px;
  }

  .auth-modal-panel .field input,
  .auth-modal-panel .field select {
    min-height: 44px;
    font-size: 16px;
    padding: 11px 12px;
  }

  .auth-modal-panel .button-row {
    margin-top: 12px;
  }

  .auth-modal-panel .button-row .btn {
    width: 100%;
    min-height: 44px;
  }

  .auth-flow-tips {
    padding: 9px 10px;
  }

  .auth-flow-tips p {
    font-size: 12px;
  }

  .auth-close {
    width: 36px;
    height: 36px;
  }
}

/* Play page (edclub-like) */
body.tp-play-page {
  margin: 0;
  min-height: 100vh;
  background: #f2f4f7;
  color: #4b4b4b;
  font-family: "Roboto", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
  --tp-main-bottom-padding: 198px;
  --tp-keyboard-bottom: clamp(104px, 14vh, 150px);
}

.tp-play-page .tp-app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(96, 170, 255, 0.18) 0, rgba(96, 170, 255, 0) 42%),
    radial-gradient(circle at 88% 0%, rgba(116, 196, 233, 0.18) 0, rgba(116, 196, 233, 0) 38%),
    linear-gradient(180deg, #f6f8fb 0%, #edf1f7 100%);
}

.tp-play-page .tp-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  height: 45px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid #d9dde4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.tp-play-page .tp-header-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tp-play-page .tp-menu-btn {
  border: none;
  background: transparent;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  padding: 7px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s ease;
}

.tp-play-page .tp-menu-btn span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: #4f89dc;
  transition: transform 0.2s ease;
}

.tp-play-page .tp-menu-btn:hover {
  background: #eef4ff;
}

.tp-play-page .tp-menu-btn:hover span:nth-child(1) {
  transform: translateX(3px) rotate(6deg);
}

.tp-play-page .tp-menu-btn:hover span:nth-child(2) {
  transform: rotate(18deg);
}

.tp-play-page .tp-menu-btn:hover span:nth-child(3) {
  transform: translateX(-2px) rotate(-8deg);
}

.tp-play-page .tp-header-title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tp-play-page .tp-header-sub {
  color: #7f93ae;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.tp-play-page .tp-header-title {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1;
  color: #476589;
  font-family: "Montserrat", "Roboto", sans-serif;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 360px;
}

.tp-play-page .tp-mini-nav {
  margin-left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tp-play-page .tp-mini-nav .nav-dropdown {
  position: relative;
}

.tp-play-page .tp-mini-nav .nav-dropdown > summary {
  list-style: none;
}

.tp-play-page .tp-mini-nav .nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.tp-play-page .tp-mini-nav .nav-dropdown-summary {
  gap: 4px;
}

.tp-play-page .tp-mini-nav .nav-dropdown-summary::after {
  content: "▾";
  font-size: 10px;
  opacity: 0.86;
  transition: transform 0.15s ease;
}

.tp-play-page .tp-mini-nav .nav-dropdown[open] .nav-dropdown-summary::after {
  transform: rotate(180deg);
}

.tp-play-page .tp-mini-nav .nav-dropdown-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 132px;
  border-radius: 10px;
  border: 1px solid #d5dfef;
  background: #fff;
  box-shadow: 0 12px 24px rgba(22, 43, 71, 0.16);
  padding: 6px;
  display: grid;
  gap: 5px;
  z-index: 105;
}

.tp-play-page .tp-mini-nav .nav-dropdown-menu .tp-mini-nav-link {
  width: 100%;
  justify-content: flex-start;
}

.tp-play-page .tp-mini-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #d5dfef;
  background: rgba(247, 251, 255, 0.95);
  color: #58749c;
  font-size: 12px;
  transition: all 0.2s ease;
}

.tp-play-page .tp-mini-nav-link:hover {
  border-color: #a7c2ee;
  background: #edf4ff;
}

.tp-play-page .tp-mini-nav-link.is-active {
  border-color: #578be3;
  background: linear-gradient(145deg, #4f8ee7 0%, #3d74ca 100%);
  color: #fff;
}

.tp-play-page .tp-mini-nav-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.tp-play-page .tp-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tp-play-page .user-settings-trigger {
  min-height: 34px;
  padding: 3px 8px 3px 3px;
}

.tp-play-page .user-settings-avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.tp-play-page .user-settings-name {
  font-size: 11px;
}

.tp-play-page .user-settings-status {
  font-size: 10px;
}

.tp-play-page .lang-switch {
  border-radius: 8px;
  padding: 4px 6px;
  background: #f7fbff;
}

.tp-play-page .lang-switch label,
.tp-play-page .lang-switch select {
  font-size: 11px;
}

.tp-play-page .tp-sound-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #637da2;
  font-size: 12px;
}

.tp-play-page .tp-sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.tp-play-page .tp-sound-toggle input {
  margin: 0;
  width: 14px;
  height: 14px;
}

.tp-play-page .tp-sound-inline input[type="range"] {
  width: 104px;
  accent-color: #4f90e8;
}

.tp-play-page .tp-volume-value {
  font-family: "Roboto Mono", monospace;
  min-width: 36px;
  text-align: right;
}

.tp-play-page .tp-header-btn {
  border: 1px solid #d8dde8;
  background: #fff;
  color: #5f7495;
  border-radius: 7px;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-play-page .tp-header-btn:hover {
  border-color: #94b3e2;
  color: #2d5d9c;
  background: #eff6ff;
}

.tp-play-page .tp-main {
  max-width: 930px;
  margin: 0 auto;
  padding: 78px 18px var(--tp-main-bottom-padding);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 206px;
  align-items: start;
}

.tp-play-page .tp-stage {
  min-width: 0;
}

.tp-play-page .tp-stage-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.tp-play-page .tp-lesson-desc {
  margin: 0;
  color: #667f9f;
  font-size: 13px;
}

.tp-play-page .tp-sound-status {
  white-space: nowrap;
  font-size: 12px;
  color: #5f7ba1;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid #d8e3f3;
  background: #f6faff;
}

.tp-play-page .tp-sound-status.error {
  color: #a23d54;
  border-color: #f4c7d2;
  background: #fff1f4;
}

.tp-play-page .tp-typing-panel {
  position: relative;
  border-radius: 15px;
  background: #fff;
  border: 1px solid #d8dee8;
  box-shadow: 0 16px 30px rgba(34, 76, 138, 0.1);
  min-height: 330px;
  padding: 26px 24px 30px;
  overflow: auto;
  cursor: text;
}

.tp-play-page .tp-typing-panel:focus-within {
  border-color: #8ab0ea;
  box-shadow: 0 18px 34px rgba(40, 94, 171, 0.14);
}

.tp-play-page .tp-target-text {
  min-height: 250px;
  font-family: "Roboto Mono", "Menlo", monospace;
  font-size: clamp(30px, 2.6vw, 40px);
  line-height: 1.42;
  letter-spacing: 0;
  color: #7d8795;
  font-variant-ligatures: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.tp-play-page .tp-char {
  border-top: 2px solid transparent;
  border-radius: 4px;
  transition: background 0.08s linear, color 0.08s linear;
}

.tp-play-page .tp-char.pending {
  color: #7a818d;
}

.tp-play-page .tp-char.current {
  border-top-color: #d5dce8;
  background: #f5f6f9;
}

.tp-play-page .tp-char.correct {
  color: #0e630e;
  background: #e7fbd3;
  outline: 1px solid #fff;
}

.tp-play-page .tp-char.wrong {
  color: #7a1111;
  background: #ffd0dd;
  outline: 1px solid #fff;
}

.tp-play-page .tp-char.break-char,
.tp-play-page .tp-char.tab-char {
  color: #9da5b3;
  padding: 0 2px;
}

.tp-play-page .tp-hidden-input {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 1px;
  height: 1px;
  border: none;
  background: transparent;
  color: transparent;
  opacity: 0;
  resize: none;
  ime-mode: disabled;
}

.tp-play-page .tp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.tp-play-page .tp-progress-track {
  flex: 1;
  height: 11px;
  border-radius: 999px;
  background: #dce7f8;
  overflow: hidden;
}

.tp-play-page .tp-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #6eb6ff 0%, #4f90e8 60%, #4075c8 100%);
  transition: width 0.18s ease;
}

.tp-play-page .tp-progress-meta {
  min-width: 128px;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  color: #6b83a3;
  font-size: 13px;
}

.tp-play-page .tp-progress-meta span:first-child {
  font-family: "Roboto Mono", monospace;
  color: #446f9f;
  font-weight: 500;
}

.tp-play-page .tp-stats-panel {
  background: #fff;
  border: 1px solid #d9dfe9;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(43, 86, 150, 0.1);
  padding: 10px 14px;
}

.tp-play-page .tp-stat-block {
  padding: 10px 0 12px;
  border-bottom: 1px dashed #dce2ed;
}

.tp-play-page .tp-stat-block:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}

.tp-play-page .tp-stat-label {
  color: #8b9eb8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tp-play-page .tp-stat-value {
  margin-top: 3px;
  font-family: "Roboto Mono", monospace;
  font-size: 30px;
  line-height: 1.1;
  color: #4f5a69;
}

.tp-play-page .tp-stat-unit {
  margin-top: 1px;
  color: #93a4bb;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tp-play-page .tp-stat-mini {
  padding-top: 8px;
}

.tp-play-page .tp-stat-mini-value {
  margin-top: 3px;
  font-family: "Roboto Mono", monospace;
  color: #5c789e;
  font-size: 15px;
}

.tp-play-page .tp-vkeyboard {
  position: fixed;
  left: 50%;
  bottom: var(--tp-keyboard-bottom);
  transform: translateX(-50%) scale(var(--tp-kbd-scale, 1));
  transform-origin: center bottom;
  z-index: 95;
  width: min(1120px, calc(100vw - 8px));
  border: 1px solid #d6deeb;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 25px rgba(42, 79, 133, 0.18);
  padding: 14px 14px 12px;
  overflow: hidden;
  backdrop-filter: blur(3px);
}

.tp-play-page .tp-vkeyboard.hidden {
  display: none;
}

.tp-play-page .tp-hand-overlay {
  position: absolute;
  inset: 0 8px 40px;
  pointer-events: none;
  z-index: 0;
}

.tp-play-page .tp-hand {
  position: absolute;
  bottom: 5px;
  width: 268px;
  height: 98px;
  border-radius: 58px 58px 40px 40px;
  background: linear-gradient(180deg, rgba(156, 177, 214, 0.24) 0%, rgba(117, 143, 184, 0.38) 100%);
  border: 1px solid rgba(101, 124, 166, 0.33);
  box-shadow: inset 0 6px 12px rgba(255, 255, 255, 0.24);
  opacity: 0.56;
}

.tp-play-page .tp-hand::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 8px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.tp-play-page .tp-hand::after {
  content: "";
  position: absolute;
  left: 72px;
  right: 72px;
  bottom: -10px;
  height: 14px;
  border-radius: 999px;
  background: rgba(95, 122, 165, 0.2);
}

.tp-play-page .tp-hand-left {
  left: 56px;
  transform: rotate(-3deg);
}

.tp-play-page .tp-hand-right {
  right: 56px;
  transform: rotate(3deg);
}

.tp-play-page .tp-hand-finger {
  position: absolute;
  bottom: 62px;
  width: 26px;
  height: 56px;
  border-radius: 18px;
  background: rgba(129, 150, 186, 0.46);
  border: 1px solid rgba(92, 116, 158, 0.34);
  box-shadow: 0 5px 10px rgba(74, 99, 142, 0.2);
  transition: all 0.12s ease;
}

.tp-play-page .tp-hand-left .tp-hand-finger:nth-child(1) { left: 10px; height: 48px; }
.tp-play-page .tp-hand-left .tp-hand-finger:nth-child(2) { left: 48px; height: 54px; }
.tp-play-page .tp-hand-left .tp-hand-finger:nth-child(3) { left: 86px; height: 60px; }
.tp-play-page .tp-hand-left .tp-hand-finger:nth-child(4) { left: 126px; height: 66px; }
.tp-play-page .tp-hand-left .tp-hand-finger:nth-child(5) { left: 172px; bottom: 34px; width: 40px; height: 30px; transform: rotate(-34deg); }

.tp-play-page .tp-hand-right .tp-hand-finger:nth-child(1) { right: 172px; bottom: 34px; width: 40px; height: 30px; transform: rotate(34deg); }
.tp-play-page .tp-hand-right .tp-hand-finger:nth-child(2) { right: 126px; height: 66px; }
.tp-play-page .tp-hand-right .tp-hand-finger:nth-child(3) { right: 86px; height: 60px; }
.tp-play-page .tp-hand-right .tp-hand-finger:nth-child(4) { right: 48px; height: 54px; }
.tp-play-page .tp-hand-right .tp-hand-finger:nth-child(5) { right: 10px; height: 48px; }

.tp-play-page .tp-hand-finger[data-finger="L5"],
.tp-play-page .tp-hand-finger[data-finger="R5"] { background: rgba(166, 140, 226, 0.5); border-color: rgba(122, 97, 184, 0.38); }
.tp-play-page .tp-hand-finger[data-finger="L4"],
.tp-play-page .tp-hand-finger[data-finger="R4"] { background: rgba(132, 178, 236, 0.48); border-color: rgba(92, 141, 204, 0.38); }
.tp-play-page .tp-hand-finger[data-finger="L3"],
.tp-play-page .tp-hand-finger[data-finger="R3"] { background: rgba(128, 208, 184, 0.46); border-color: rgba(75, 164, 135, 0.36); }
.tp-play-page .tp-hand-finger[data-finger="L2"],
.tp-play-page .tp-hand-finger[data-finger="R2"] { background: rgba(243, 196, 125, 0.5); border-color: rgba(186, 133, 56, 0.38); }
.tp-play-page .tp-hand-finger[data-finger="L1"],
.tp-play-page .tp-hand-finger[data-finger="R1"] { background: rgba(231, 150, 166, 0.48); border-color: rgba(176, 88, 108, 0.36); }

.tp-play-page .tp-key-row {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  margin: 6px 0;
}

.tp-play-page .tp-key {
  height: 46px;
  min-width: 50px;
  border-radius: 10px;
  border: 1px solid #d5dce9;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fd 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #536883;
  font-size: 16px;
  font-weight: 700;
  font-family: "Roboto Mono", monospace;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.tp-play-page .tp-key-wide {
  min-width: 118px;
}

.tp-play-page .tp-key-medium {
  min-width: 82px;
}

.tp-play-page .tp-key-large {
  min-width: 108px;
}

.tp-play-page .tp-key-space {
  flex: 1;
}

.tp-play-page .tp-key[data-finger-label]::after {
  content: attr(data-finger-label);
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  line-height: 1;
  color: rgba(68, 95, 133, 0.7);
  letter-spacing: 0.02em;
  pointer-events: none;
}

.tp-play-page .tp-key.home-key::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(57, 86, 124, 0.65);
}

.tp-play-page .tp-key.finger-l5,
.tp-play-page .tp-key.finger-r5 {
  border-color: #dbcaf7;
  background: linear-gradient(180deg, #fbf7ff 0%, #efe6ff 100%);
}

.tp-play-page .tp-key.finger-l4,
.tp-play-page .tp-key.finger-r4 {
  border-color: #c5ddf6;
  background: linear-gradient(180deg, #f2f8ff 0%, #e6f1ff 100%);
}

.tp-play-page .tp-key.finger-l3,
.tp-play-page .tp-key.finger-r3 {
  border-color: #c8e7df;
  background: linear-gradient(180deg, #f1fbf8 0%, #e4f5ef 100%);
}

.tp-play-page .tp-key.finger-l2,
.tp-play-page .tp-key.finger-r2 {
  border-color: #f5dfc2;
  background: linear-gradient(180deg, #fff8ee 0%, #fff2dc 100%);
}

.tp-play-page .tp-key.finger-l1,
.tp-play-page .tp-key.finger-r1 {
  border-color: #f2cad0;
  background: linear-gradient(180deg, #fff3f6 0%, #fee6ec 100%);
}

.tp-play-page .tp-key.finger-dual {
  border-color: #d7d8ef;
  background: linear-gradient(90deg, #fff0f4 0%, #fff0f4 50%, #eef4ff 50%, #eef4ff 100%);
}

.tp-play-page .tp-key.expected {
  border-color: #79a7ea;
  background: linear-gradient(180deg, #eff6ff 0%, #dae9ff 100%);
  color: #2f6fc5;
  box-shadow: 0 0 0 2px rgba(98, 151, 230, 0.2), 0 6px 14px rgba(73, 121, 196, 0.18);
  transform: translateY(-2px);
}

.tp-play-page .tp-key.press-correct {
  border-color: #63b08f;
  background: linear-gradient(180deg, #e7f7ee 0%, #d4f0e1 100%);
  color: #246f4e;
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(62, 143, 102, 0.2);
}

.tp-play-page .tp-key.press-error {
  border-color: #d992a3;
  background: linear-gradient(180deg, #ffe9ef 0%, #ffd8e2 100%);
  color: #9e314e;
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(196, 84, 117, 0.22);
}

.tp-play-page .tp-finger-feedback {
  position: relative;
  z-index: 3;
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.tp-play-page .tp-finger-legend {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tp-play-page .tp-finger-chip {
  border-radius: 999px;
  border: 1px solid #d7e0ef;
  background: rgba(245, 248, 254, 0.9);
  color: #667f9f;
  font-size: 10px;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tp-play-page .tp-finger-hint {
  border-radius: 999px;
  border: 1px solid #d8e2f2;
  background: #f7faff;
  color: #4c6d97;
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  line-height: 1;
  padding: 6px 10px;
}

.tp-play-page .tp-vkeyboard.compact-mode {
  padding: 8px 8px 7px;
  border-radius: 12px;
}

.tp-play-page .tp-vkeyboard.compact-mode .tp-hand-overlay {
  display: none;
}

.tp-play-page .tp-vkeyboard.compact-mode .tp-key-row {
  gap: 4px;
  margin: 3px 0;
}

.tp-play-page .tp-vkeyboard.compact-mode .tp-key {
  min-width: 30px;
  height: 33px;
  border-radius: 8px;
  font-size: 11.5px;
}

.tp-play-page .tp-vkeyboard.compact-mode .tp-key-wide {
  min-width: 72px;
}

.tp-play-page .tp-vkeyboard.compact-mode .tp-key-medium {
  min-width: 52px;
}

.tp-play-page .tp-vkeyboard.compact-mode .tp-key-large {
  min-width: 64px;
}

.tp-play-page .tp-vkeyboard.compact-mode .tp-key[data-finger-label]::after {
  font-size: 7px;
  top: 2px;
  right: 2px;
}

.tp-play-page .tp-vkeyboard.compact-mode .tp-finger-feedback {
  margin-top: 6px;
  gap: 6px;
}

.tp-play-page .tp-vkeyboard.compact-mode .tp-finger-chip {
  font-size: 9px;
  padding: 4px 6px;
}

.tp-play-page .tp-vkeyboard.compact-mode .tp-finger-hint {
  font-size: 10px;
  padding: 5px 8px;
}

.tp-play-page .tp-vkeyboard.ultra-compact-mode .tp-finger-legend {
  display: none;
}

.tp-play-page .tp-vkeyboard.ultra-compact-mode .tp-finger-feedback {
  justify-content: flex-end;
}

.tp-play-page .tp-finger-chip[data-finger="L5"],
.tp-play-page .tp-finger-chip[data-finger="R5"] { border-color: #d8c8f5; background: #f7f1ff; color: #6f57a4; }
.tp-play-page .tp-finger-chip[data-finger="L4"],
.tp-play-page .tp-finger-chip[data-finger="R4"] { border-color: #c3ddf6; background: #edf6ff; color: #4a74a5; }
.tp-play-page .tp-finger-chip[data-finger="L3"],
.tp-play-page .tp-finger-chip[data-finger="R3"] { border-color: #c6e7de; background: #eefaf6; color: #3b7b68; }
.tp-play-page .tp-finger-chip[data-finger="L2"],
.tp-play-page .tp-finger-chip[data-finger="R2"] { border-color: #f6dfbf; background: #fff7ea; color: #9a6d35; }
.tp-play-page .tp-finger-chip[data-finger="L1"],
.tp-play-page .tp-finger-chip[data-finger="R1"] { border-color: #f2c6cd; background: #fff0f3; color: #9a4f60; }

.tp-play-page .tp-hand-finger.expected,
.tp-play-page .tp-finger-chip.expected {
  box-shadow: 0 0 0 2px rgba(96, 146, 224, 0.18);
  animation: tp-finger-pulse 0.9s ease-in-out infinite;
}

.tp-play-page .tp-hand-finger.expected {
  opacity: 0.92;
  transform: translateY(-2px) scale(1.02);
}

.tp-play-page .tp-finger-chip.expected {
  transform: translateY(-2px);
  border-color: #6fa3ea;
  background: #eaf2ff;
  color: #2f68b8;
}

.tp-play-page .tp-hand-finger.press-correct,
.tp-play-page .tp-finger-chip.press-correct {
  box-shadow: 0 0 0 2px rgba(88, 176, 131, 0.18);
  border-color: #68af8f;
  background: #dbf2e6;
  animation: none;
}

.tp-play-page .tp-hand-finger.press-correct {
  transform: translateY(8px) scaleY(0.94);
}

.tp-play-page .tp-hand-finger.press-error,
.tp-play-page .tp-finger-chip.press-error {
  box-shadow: 0 0 0 2px rgba(206, 101, 130, 0.18);
  border-color: #cf7992;
  background: #ffe2ea;
  animation: none;
}

.tp-play-page .tp-hand-finger.press-error {
  transform: translateY(8px) scaleY(0.94);
}

@keyframes tp-finger-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(96, 146, 224, 0.18);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(96, 146, 224, 0.28);
  }
}

.tp-play-page .tp-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  height: 58px;
  border-top: 1px solid #d5dbe7;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -4px 14px rgba(31, 54, 89, 0.08);
}

.tp-play-page .tp-bottom-content {
  height: 100%;
  max-width: 930px;
  margin: 0 auto;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 108px 1fr 158px;
  gap: 10px;
  align-items: center;
}

.tp-play-page .tp-bottom-btn {
  height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.tp-play-page .tp-bottom-btn-ghost {
  border-color: #d8deea;
  background: #f7f9fd;
  color: #58719a;
}

.tp-play-page .tp-bottom-btn-ghost:hover {
  background: #eef4ff;
  border-color: #b9cdea;
}

.tp-play-page .tp-bottom-btn-primary {
  background: linear-gradient(145deg, #4f90e8 0%, #3f78ca 100%);
  color: #fff;
  border-color: #3f78ca;
}

.tp-play-page .tp-bottom-btn-primary:hover {
  filter: brightness(1.04);
}

.tp-play-page .tp-bottom-center {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.tp-play-page .tp-notice {
  margin: 0;
  color: #5977a0;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.tp-play-page .tp-notice.error {
  color: #a03d55;
}

.tp-play-page .tp-keyboard-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #687f9f;
  font-size: 12px;
  white-space: nowrap;
}

.tp-play-page .tp-keyboard-toggle input {
  margin: 0;
}

@media (max-width: 1180px) {
  .tp-play-page .tp-main {
    grid-template-columns: 1fr;
    padding-bottom: 232px;
  }

  .tp-play-page .tp-stats-panel {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .tp-play-page .tp-stat-block {
    border-bottom: none;
    border-right: 1px dashed #dce2ed;
    padding: 4px 0 6px;
  }

  .tp-play-page .tp-stat-block:last-child {
    border-right: none;
  }

  .tp-play-page .tp-stat-value {
    font-size: 24px;
  }
}

@media (max-width: 900px) {
  .tp-play-page .tp-header-title {
    max-width: 220px;
  }

  .tp-play-page .tp-mini-nav {
    display: none;
  }

  .tp-play-page .tp-main {
    padding-top: 74px;
    padding-bottom: 204px;
  }

  .tp-play-page .tp-typing-panel {
    min-height: 260px;
    padding: 20px 16px 24px;
  }

  .tp-play-page .tp-target-text {
    font-size: clamp(24px, 5vw, 32px);
    min-height: 200px;
  }

  .tp-play-page .tp-vkeyboard {
    width: calc(100vw - 16px);
    bottom: 100px;
  }

  .tp-play-page .tp-key {
    min-width: 33px;
    font-size: 13px;
    height: 36px;
  }

  .tp-play-page .tp-key-wide {
    min-width: 84px;
  }

  .tp-play-page .tp-key-medium {
    min-width: 60px;
  }

  .tp-play-page .tp-key-large {
    min-width: 72px;
  }

  .tp-play-page .tp-hand {
    width: 210px;
    height: 76px;
    bottom: 10px;
  }

  .tp-play-page .tp-hand-left {
    left: 20px;
  }

  .tp-play-page .tp-hand-right {
    right: 20px;
  }

  .tp-play-page .tp-finger-chip {
    font-size: 9px;
    padding: 4px 6px;
  }
}

@media (max-width: 760px) {
  .tp-play-page .tp-header {
    height: auto;
    min-height: 45px;
    padding: 6px 8px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .tp-play-page .tp-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .tp-play-page .tp-sound-inline {
    flex-wrap: wrap;
  }

  .tp-play-page .tp-sound-inline input[type="range"] {
    width: 88px;
  }

  .tp-play-page .tp-main {
    padding-top: 96px;
  }

  .tp-play-page .tp-stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tp-play-page .tp-stat-block {
    border-right: none;
    border-bottom: 1px dashed #dce2ed;
    padding-bottom: 8px;
  }

  .tp-play-page .tp-stat-block:nth-last-child(1),
  .tp-play-page .tp-stat-block:nth-last-child(2) {
    border-bottom: none;
  }
}

@media (max-width: 640px) {
  .tp-play-page .tp-bottom-bar {
    height: auto;
    padding: 8px 0;
  }

  .tp-play-page .tp-bottom-content {
    height: auto;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .tp-play-page .tp-bottom-center {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .tp-play-page .tp-notice {
    max-width: 64vw;
    white-space: normal;
    line-height: 1.3;
  }

  .tp-play-page .tp-vkeyboard {
    bottom: 148px;
    padding: 6px;
  }

  .tp-play-page .tp-key-row {
    gap: 4px;
    margin: 3px 0;
  }

  .tp-play-page .tp-key {
    min-width: 30px;
    font-size: 11.5px;
    height: 33px;
  }

  .tp-play-page .tp-hand-overlay {
    display: none;
  }

  .tp-play-page .tp-finger-hint {
    font-size: 10px;
    padding: 5px 8px;
  }

  .retry-nudge {
    grid-template-columns: 1fr;
    bottom: 6px;
    padding: 9px 10px;
  }

  .retry-nudge-btn {
    width: 100%;
  }
}
