:root {
  --mint: #7be2d0;
  --deep-mint: #16a889;
  --ink: #333a42;
  --soft-ink: #6e7780;
  --page: #f7f9fb;
  --panel: #ffffff;
  --line: #edf0f2;
  --shadow: 0 10px 26px rgba(37, 52, 66, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

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

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

.phone-app {
  width: min(100%, 480px);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 82px;
  background: #fff;
}

.reader-hero {
  position: relative;
  padding: 18px 18px 20px;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.7) 0 48px, transparent 49px),
    linear-gradient(145deg, #c7f4ea 0%, #e8fbf7 72%);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  overflow: hidden;
}

.reader-hero::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 86px;
  width: 112px;
  height: 72px;
  border-bottom: 16px solid rgba(111, 214, 195, 0.26);
  border-radius: 0 0 42px 42px;
  transform: rotate(21deg);
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: #078c72;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.change-book {
  color: #078c72;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 800;
}

.change-book::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 999px;
  vertical-align: -1px;
}

.book-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 182px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.64);
  border: 4px solid rgba(110, 217, 197, 0.45);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.book-card img {
  width: 112px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 7px;
  background: #e9f3f1;
  box-shadow: 0 10px 18px rgba(17, 84, 76, 0.12);
}

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

#bookVersion {
  color: #3d4248;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 900;
}

#bookTitle {
  margin-top: 12px;
  color: #7b8288;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  min-width: 148px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  color: #795f00;
  background: linear-gradient(180deg, #fff865 0%, #ffd018 58%, #f6b907 100%);
  box-shadow: 0 10px 18px rgba(249, 192, 15, 0.36);
  font-size: 18px;
  font-weight: 900;
}

.start-btn span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  position: relative;
}

.start-btn span::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  border-left: 10px solid #ffc400;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.book-switcher {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(107, 215, 196, 0.58);
  border-radius: 12px;
}

.book-switcher[hidden] {
  display: none;
}

label {
  display: grid;
  gap: 5px;
  color: #768087;
  font-size: 12px;
  font-weight: 800;
}

select,
input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dfe8e6;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 9px 11px;
}

textarea {
  resize: vertical;
}

#readLink {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  background: #15aa8a;
  text-decoration: none;
  font-weight: 900;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 18px 10px;
  background: #fff;
}

.quick-actions button {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  background: #fff;
  color: #535a61;
  box-shadow: var(--shadow);
  font-size: 16px;
}

.round-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
}

.headphones::before {
  content: "";
  width: 28px;
  height: 22px;
  border: 7px solid #ffbf16;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
}

.headphones::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 28px;
  height: 18px;
  border-left: 8px solid #ffbf16;
  border-right: 8px solid #ffbf16;
  border-radius: 6px;
}

.film::before {
  content: "";
  width: 33px;
  height: 33px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 4px, transparent 5px),
    radial-gradient(circle at 28% 28%, #fff 0 4px, transparent 5px),
    radial-gradient(circle at 72% 28%, #fff 0 4px, transparent 5px),
    radial-gradient(circle at 30% 72%, #fff 0 4px, transparent 5px),
    #2aaeee;
}

.mic::before {
  content: "";
  width: 18px;
  height: 33px;
  border-radius: 12px;
  background: #30cfb0;
  transform: rotate(28deg);
  box-shadow: 8px -6px 0 rgba(48, 207, 176, 0.52);
}

.feature-section {
  padding: 16px 18px 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title-row h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #343b42;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0;
}

.section-title-row h3::before {
  content: "";
  width: 6px;
  height: 30px;
  border-radius: 999px;
  background: #2bc4af;
}

.section-title-row p {
  color: #626a72;
  font-size: 14px;
  white-space: nowrap;
}

.section-title-row strong {
  color: #0ca889;
  font-weight: 900;
}

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

.feature-card {
  position: relative;
  min-height: 106px;
  overflow: hidden;
  border-radius: 14px;
  padding: 18px 14px;
  color: #fff;
  text-align: left;
  box-shadow: 0 12px 18px rgba(35, 45, 55, 0.1);
}

.feature-card span,
.feature-card small {
  position: relative;
  z-index: 1;
  display: block;
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.28),
    0 2px 4px rgba(0, 0, 0, 0.12);
}

.feature-card span {
  font-size: 22px;
  line-height: 1.12;
  font-weight: 900;
}

.feature-card small {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 800;
  opacity: 0.92;
}

.purple { background: linear-gradient(135deg, #a276ff, #b589ff); }
.teal { background: linear-gradient(135deg, #19cdbf, #33d8c7); }
.coral { background: linear-gradient(135deg, #ff746d, #ff9b84); }
.yellow { background: linear-gradient(135deg, #ffc82d, #ffe36c); }
.orange { background: linear-gradient(135deg, #ffb44b, #ffd06f); }
.green { background: linear-gradient(135deg, #62cf5c, #8fe06e); }
.blue { background: linear-gradient(135deg, #20b5ff, #57d6ff); }

.card-art {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 16px rgba(51, 58, 66, 0.14);
  transform: rotate(8deg);
}

.paper::after,
.checklist::after,
.book::after {
  content: "";
  position: absolute;
  inset: 10px 9px;
  border-top: 4px solid rgba(80, 90, 100, 0.24);
  border-bottom: 4px solid rgba(80, 90, 100, 0.24);
}

.medal {
  border-radius: 999px;
  background: radial-gradient(circle, #ffd744 0 10px, #23cbbf 11px 24px, rgba(255, 255, 255, 0.64) 25px);
}

.gloves::before,
.gloves::after,
.cubes::before,
.cubes::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 28px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
}

.gloves::before,
.cubes::before {
  left: 5px;
  top: 8px;
  transform: rotate(-18deg);
}

.gloves::after,
.cubes::after {
  right: 5px;
  top: 7px;
  transform: rotate(18deg);
}

.reading-section {
  padding-bottom: 0;
}

.recite-banner {
  width: 100%;
  min-height: 56px;
  margin-bottom: 14px;
  border-radius: 28px;
  color: #2f2f2f;
  background: linear-gradient(90deg, #ffe2ad, #ffc27f);
  font-size: 18px;
  font-weight: 800;
}

.recite-banner b {
  float: right;
  margin-right: 4px;
  border-radius: 999px;
  padding: 9px 16px;
  color: #fff;
  background: linear-gradient(180deg, #ff8d74, #ff564f);
}

.compact .feature-card {
  min-height: 92px;
}

.detail-panel {
  display: none;
  margin: 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-panel.is-open {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: block;
  width: min(100%, 480px);
  height: 100vh;
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
  overflow: auto;
  padding: 18px 18px 96px;
  border: 0;
  border-radius: 0;
  background: #f7f9fb;
}

.detail-panel.is-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #ddfaf4 0%, #f7f9fb 190px);
}

.back-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 999px;
  padding: 8px 14px;
  color: #078c72;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 18px rgba(37, 52, 66, 0.08);
  font-size: 14px;
  font-weight: 900;
}

.back-btn::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reader-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reader-head p {
  color: #71808b;
  font-size: 12px;
  font-weight: 900;
}

.reader-head h3 {
  margin-top: 4px;
  font-size: 21px;
  font-weight: 900;
}

.reader-head small {
  display: block;
  margin-top: 5px;
  color: #6f7c86;
  font-size: 13px;
  font-weight: 800;
}

.reader-head span {
  border-radius: 999px;
  padding: 7px 10px;
  color: #0f8d77;
  background: #eaf7f4;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 88px 1fr 0.8fr 0.8fr;
  gap: 8px;
  margin: 0 -2px 12px;
  padding: 8px 2px;
  background: rgba(247, 249, 251, 0.92);
  backdrop-filter: blur(10px);
}

.reader-toolbar button,
.reader-toolbar label {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  background: #159d83;
  font-size: 13px;
  font-weight: 900;
}

.reader-toolbar label {
  display: grid;
  gap: 2px;
  padding: 4px 6px;
  color: #65737d;
  background: #fff;
  border: 1px solid #e1e9e8;
}

.reader-toolbar label span {
  font-size: 10px;
  line-height: 1;
}

.reader-toolbar input {
  min-height: 20px;
  border: 0;
  padding: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
}

.reader-pointread {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #dbe8e5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 16px rgba(35, 45, 55, 0.04);
}

.reader-pointread-title {
  display: grid;
  gap: 3px;
}

.reader-pointread-title strong {
  color: #1f2933;
  font-size: 15px;
  font-weight: 900;
}

.reader-pointread-title span,
#readerAudioStatus {
  color: #6f7c86;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

#readerReadBtn {
  min-height: 38px;
  border-radius: 10px;
  color: #fff;
  background: #159d83;
  font-size: 14px;
  font-weight: 900;
}

#readerAudio {
  margin-top: 0;
}

.reader-audio-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.reader-audio-chips::-webkit-scrollbar {
  display: none;
}

.reader-audio-chips button {
  flex: 0 0 auto;
  max-width: 260px;
  min-height: 34px;
  border-radius: 999px;
  padding: 7px 11px;
  color: #4f5d66;
  background: #f4fbf9;
  border: 1px solid #dbece8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.reader-pages {
  --reader-zoom: 1;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding-bottom: 20px;
  overflow-x: auto;
}

.textbook-page {
  width: calc(100% * var(--reader-zoom));
  max-width: calc(430px * var(--reader-zoom));
  min-width: min(100%, calc(360px * var(--reader-zoom)));
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dce7e5;
  box-shadow: 0 12px 24px rgba(35, 45, 55, 0.1);
}

.reader-page-canvas {
  position: relative;
}

.textbook-page img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.sentence-layer {
  position: absolute;
  inset: 0;
}

.sentence-hotspot {
  position: absolute;
  border: 1px solid rgba(255, 176, 0, 0.46);
  border-radius: 5px;
  background: rgba(255, 224, 90, 0.18);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.sentence-hotspot.active,
.sentence-hotspot:focus-visible {
  outline: 0;
  border-color: rgba(22, 168, 137, 0.9);
  background: rgba(22, 168, 137, 0.22);
}

.textbook-page figcaption {
  padding: 8px;
  color: #7b8790;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.detail-head p {
  color: #71808b;
  font-size: 12px;
  font-weight: 900;
}

.detail-head h3 {
  margin-top: 4px;
  font-size: 21px;
  font-weight: 900;
}

.word-context {
  display: block;
  margin-top: 5px;
  color: #6f7c86;
  font-size: 13px;
  font-weight: 800;
}

.detail-head span {
  border-radius: 999px;
  padding: 7px 10px;
  color: #0f8d77;
  background: #eaf7f4;
  font-size: 12px;
  font-weight: 900;
}

.audio-list,
.word-list {
  display: grid;
  gap: 10px;
}

.audio-card,
.word-card,
.empty {
  border: 1px solid #e1e9e8;
  border-radius: 10px;
  background: #fbfdfd;
  padding: 12px;
}

.audio-title,
.word-title {
  font-weight: 900;
  line-height: 1.3;
}

.audio-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.audio-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  color: #0f8d77;
  background: #e4f7f2;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.word-title {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  max-width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: #1f2933;
  background: transparent;
  text-align: left;
  font-size: 18px;
}

.word-title::after {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0 8px, #fff 8px 15px, transparent 15px),
    #16a889;
  clip-path: polygon(0 0, 100% 50%, 0 100%, 0 0);
  flex: 0 0 auto;
}

.audio-meta,
.word-meta,
.example {
  color: #737f88;
  font-size: 13px;
  line-height: 1.48;
}

.source-badge {
  display: inline-flex;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}

.source-badge.builtin {
  color: #0d8f76;
  background: #e4f7f2;
}

.source-badge.user {
  color: #8c6410;
  background: #fff1c7;
}

audio {
  width: 100%;
  height: 36px;
  margin-top: 8px;
}

.word-tools {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 9px;
  margin-bottom: 12px;
}

.unit-strip {
  display: flex;
  gap: 9px;
  margin: 2px -2px 12px;
  padding: 2px 2px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.unit-strip::-webkit-scrollbar {
  display: none;
}

.unit-strip button {
  flex: 0 0 auto;
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 13px;
  color: #64727d;
  background: #ffffff;
  border: 1px solid #e2ebe9;
  box-shadow: 0 6px 14px rgba(35, 45, 55, 0.05);
  font-size: 13px;
  font-weight: 900;
}

.unit-strip button.active {
  color: #fff;
  background: #16a889;
  border-color: #16a889;
}

.unit-empty {
  width: 100%;
  border-radius: 10px;
  padding: 12px;
  color: #78838c;
  background: #fff;
  border: 1px solid #e1e9e8;
  text-align: center;
  font-size: 13px;
}

.search-box {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e1e9e8;
}

.audio-search-box {
  margin-bottom: 8px;
}

.audio-filter {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  padding: 5px;
  border: 1px solid #e1e9e8;
  border-radius: 12px;
  background: #fff;
}

.audio-filter button {
  min-height: 34px;
  border-radius: 9px;
  color: #63717b;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}

.audio-filter button.active {
  color: #fff;
  background: #16a889;
}

.module-book-switcher {
  display: grid;
  grid-template-columns: 0.8fr 1.1fr 0.9fr;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #e1e9e8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 16px rgba(35, 45, 55, 0.04);
}

.module-book-switcher label {
  min-width: 0;
  font-size: 11px;
}

.module-book-switcher select {
  min-height: 38px;
  border-radius: 9px;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 800;
}

.challenge-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid #e1e9e8;
  border-radius: 12px;
  background: #fff;
}

.mode-tabs button {
  min-height: 34px;
  border-radius: 9px;
  color: #63717b;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}

.mode-tabs button.active {
  color: #fff;
  background: #16a889;
}

#startChallengeBtn,
#retryChallengeBtn,
#nextQuestionBtn,
#speakQuestionBtn {
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 16px;
  color: #fff;
  background: #159d83;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(22, 168, 137, 0.18);
}

#startChallengeBtn {
  white-space: nowrap;
}

.quiz-board {
  display: grid;
  gap: 12px;
}

.quiz-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quiz-stats span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid #e1e9e8;
  border-radius: 999px;
  color: #0f8d77;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.quiz-card {
  display: grid;
  gap: 12px;
  padding: 20px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #eefbf8 100%);
  border: 1px solid #d9efeb;
  box-shadow: 0 12px 24px rgba(35, 45, 55, 0.08);
  text-align: center;
}

.quiz-card p {
  color: #71808b;
  font-size: 13px;
  font-weight: 900;
}

.quiz-card h2 {
  color: #232b32;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 900;
  word-break: break-word;
}

#speakQuestionBtn {
  justify-self: center;
  min-height: 38px;
  padding: 8px 14px;
  background: #2aaeee;
  box-shadow: none;
  font-size: 14px;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-options button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid #e1e9e8;
  border-radius: 12px;
  color: #2f3942;
  background: #fff;
  text-align: left;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(35, 45, 55, 0.05);
}

.quiz-options button span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #9aa6ae;
  font-size: 14px;
}

.quiz-options button.correct {
  border-color: #21bf78;
  color: #0d7f55;
  background: #e9fbf2;
}

.quiz-options button.correct span {
  background: #21bf78;
}

.quiz-options button.wrong {
  border-color: #ff6d64;
  color: #c43d35;
  background: #fff0ef;
}

.quiz-options button.wrong span {
  background: #ff6d64;
}

.quiz-feedback,
.quiz-result {
  border-radius: 12px;
  padding: 13px;
  border: 1px solid #e1e9e8;
  background: #fff;
  color: #5d6973;
  font-weight: 900;
  line-height: 1.55;
}

.quiz-feedback.right {
  color: #0d7f55;
  background: #e9fbf2;
  border-color: #bfead5;
}

.quiz-feedback.miss {
  color: #bd4038;
  background: #fff0ef;
  border-color: #ffc7c2;
}

.quiz-result {
  display: grid;
  gap: 12px;
  text-align: center;
}

.quiz-result h3 {
  font-size: 24px;
  font-weight: 900;
}

.quiz-result p {
  color: #68747d;
  line-height: 1.7;
}

.pk-arena {
  display: grid;
  gap: 12px;
}

.pk-scoreboard {
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  gap: 10px;
  align-items: center;
}

.pk-scoreboard div,
.pk-scoreboard span {
  display: grid;
  min-height: 72px;
  place-items: center;
  align-content: center;
  border: 1px solid #e1e9e8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 16px rgba(35, 45, 55, 0.05);
}

.pk-scoreboard small {
  color: #6e7d87;
  font-size: 13px;
  font-weight: 900;
}

.pk-scoreboard strong {
  margin-top: 4px;
  color: #111827;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

#pkTimer {
  color: #0d8f76;
  background: #e9fbf6;
  font-size: 22px;
  font-weight: 900;
}

.pk-progress {
  display: grid;
  gap: 8px;
}

.pk-progress i {
  display: block;
  height: 12px;
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.18s ease;
}

#pkPlayerBar {
  background: linear-gradient(90deg, #16a889, #2aaeee);
}

#pkRivalBar {
  background: linear-gradient(90deg, #ffb44b, #ff655e);
}

#startPkBtn,
#retryPkBtn {
  min-height: 46px;
  border-radius: 12px;
  padding: 10px 16px;
  color: #fff;
  background: #159d83;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(22, 168, 137, 0.18);
}

.pk-board {
  display: grid;
  gap: 12px;
}

#pkSpeakBtn {
  justify-self: center;
  min-height: 38px;
  border-radius: 12px;
  padding: 8px 14px;
  color: #fff;
  background: #2aaeee;
  font-size: 14px;
  font-weight: 900;
}

.match-arena {
  display: grid;
  gap: 12px;
}

.match-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.match-stats span {
  display: grid;
  min-height: 54px;
  place-items: center;
  align-content: center;
  border: 1px solid #e1e9e8;
  border-radius: 14px;
  color: #65737d;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(35, 45, 55, 0.05);
}

.match-stats b {
  margin-top: 2px;
  color: #111827;
  font-size: 20px;
  line-height: 1;
}

#startMatchBtn,
#retryMatchBtn {
  min-height: 46px;
  border-radius: 12px;
  padding: 10px 16px;
  color: #fff;
  background: #159d83;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(22, 168, 137, 0.18);
}

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

.match-card {
  display: grid;
  min-height: 92px;
  align-content: center;
  gap: 7px;
  border: 1px solid #e1e9e8;
  border-radius: 12px;
  padding: 10px;
  color: #26313a;
  background: #fff;
  text-align: center;
  box-shadow: 0 8px 16px rgba(35, 45, 55, 0.06);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.match-card small {
  color: #77848d;
  font-size: 11px;
  font-weight: 900;
}

.match-card span {
  display: block;
  min-width: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.match-card.word span {
  color: #0f8d77;
  font-size: 20px;
}

.match-card.selected {
  transform: translateY(-2px);
  border-color: #16a889;
  background: #e9fbf6;
}

.match-card.wrong {
  border-color: #ff7a70;
  background: #fff0ef;
}

.match-card.matched {
  pointer-events: none;
  border-color: #bfead5;
  color: #8aa39a;
  background: #f0fbf6;
  opacity: 0.46;
  transform: scale(0.96);
}

.dictation-arena {
  display: grid;
  gap: 12px;
}

.dictation-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dictation-stats span {
  display: grid;
  min-height: 48px;
  place-items: center;
  align-content: center;
  border: 1px solid #e1e9e8;
  border-radius: 14px;
  color: #65737d;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(35, 45, 55, 0.05);
}

.dictation-stats b {
  color: #111827;
  font-size: 20px;
}

#startDictationBtn,
#retryDictationBtn,
#playDictationBtn,
#checkDictationBtn,
#revealDictationBtn,
#nextDictationBtn,
.dictation-self-check button {
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  background: #159d83;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(22, 168, 137, 0.16);
}

.dictation-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dcebe7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(35, 45, 55, 0.08);
}

.dictation-target {
  display: grid;
  gap: 8px;
  min-height: 118px;
  place-items: center;
  align-content: center;
  border-radius: 14px;
  background: linear-gradient(180deg, #eefbf8 0%, #ffffff 100%);
  border: 1px solid #d9efeb;
  text-align: center;
}

.dictation-target small {
  color: #71808b;
  font-size: 13px;
  font-weight: 900;
}

.dictation-target h2 {
  color: #202a32;
  font-size: 36px;
  line-height: 1.12;
  font-weight: 900;
  overflow-wrap: anywhere;
}

#playDictationBtn {
  background: #2aaeee;
}

.dictation-answer {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #e1e9e8;
  border-radius: 12px;
  background: #fbfdfd;
}

.dictation-answer span {
  color: #68747d;
  font-size: 13px;
  font-weight: 900;
}

.dictation-answer input {
  min-height: 44px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 900;
}

.dictation-actions,
.dictation-self-check {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

#nextDictationBtn {
  grid-column: 1 / -1;
  background: #ffad2f;
}

#revealDictationBtn {
  color: #6d520b;
  background: #ffe196;
  box-shadow: none;
}

.dictation-feedback {
  display: grid;
  gap: 12px;
  border: 1px solid #d9efeb;
  border-radius: 12px;
  padding: 13px;
  background: #f4fbf9;
}

.dictation-feedback small {
  color: #71808b;
  font-size: 12px;
  font-weight: 900;
}

.dictation-feedback strong {
  display: block;
  margin-top: 4px;
  color: #17212a;
  font-size: 28px;
  line-height: 1.16;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.dictation-feedback p {
  margin-top: 5px;
  color: #65737d;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.dictation-feedback.right {
  border-color: #bfead5;
  background: #e9fbf2;
}

.dictation-feedback.miss {
  border-color: #ffc7c2;
  background: #fff0ef;
}

.dictation-self-check button:first-child {
  background: #21bf78;
}

.dictation-self-check button:last-child {
  background: #ff6d64;
}

.pronounce-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dcebe7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(35, 45, 55, 0.08);
}

.pronounce-score {
  justify-self: center;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  align-content: center;
  border-radius: 999px;
  color: #0d8f76;
  background:
    radial-gradient(circle at center, #fff 0 56%, transparent 57%),
    conic-gradient(#16a889 0 72%, #e5f3f0 73% 100%);
  box-shadow: 0 12px 24px rgba(22, 168, 137, 0.14);
}

.pronounce-score strong {
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.pronounce-score span {
  margin-top: 6px;
  color: #65737d;
  font-size: 12px;
  font-weight: 900;
}

.pronounce-target {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 16px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7fffd 0%, #edf9f6 100%);
  border: 1px solid #d9efeb;
  text-align: center;
}

.pronounce-target small {
  color: #72808a;
  font-size: 13px;
  font-weight: 900;
}

.pronounce-target h2 {
  color: #1f2933;
  font-size: 32px;
  line-height: 1.16;
  font-weight: 900;
  word-break: break-word;
}

.pronounce-target p {
  min-height: 20px;
  color: #70808c;
  font-size: 16px;
  font-weight: 800;
}

.pronounce-target b {
  color: #3d4852;
  font-size: 18px;
  line-height: 1.45;
}

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

.pronounce-actions button,
.pronounce-nav button {
  min-height: 46px;
  border-radius: 12px;
  padding: 10px;
  color: #fff;
  background: #159d83;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(22, 168, 137, 0.16);
}

#modelPronounceBtn {
  background: #2aaeee;
}

#recordPronounceBtn.recording {
  background: #ff655e;
  box-shadow: 0 10px 18px rgba(255, 101, 94, 0.18);
}

.pronounce-timer,
.voice-meter {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #cfeee7;
  border-radius: 12px;
  background: #f0fffb;
}

.voice-meter {
  border-color: #cfe7f4;
  background: #f1fbff;
}

.pronounce-timer div,
.voice-meter div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pronounce-timer span,
.voice-meter span {
  color: #60707c;
  font-size: 13px;
  font-weight: 900;
}

.pronounce-timer strong,
.voice-meter strong {
  color: #0d8f76;
  font-size: 18px;
  font-weight: 900;
}

.voice-meter strong {
  color: #1787b8;
}

.pronounce-timer i,
.voice-meter i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a889, #2aaeee);
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.12s linear;
}

.voice-meter i {
  background: linear-gradient(90deg, #2aaeee, #7b62ff);
  transform: scaleX(0.03);
}

.pronounce-nav button {
  color: #60717c;
  background: #f0f5f4;
  box-shadow: none;
}

.pronounce-nav button:disabled {
  opacity: 0.45;
  cursor: default;
}

.pronounce-status,
.pronounce-transcript {
  border-radius: 12px;
  padding: 12px;
  color: #60707c;
  background: #f7faf9;
  border: 1px solid #e1e9e8;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.65;
}

.pronounce-transcript {
  color: #36434d;
  background: #fff;
}

.pronounce-transcript b {
  color: #0d8f76;
}

#pronouncePlayback {
  margin-top: 0;
}

.word-tools button,
.word-tools label,
.dialog-actions button {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  background: #159d83;
  font-size: 15px;
  font-weight: 900;
}

.word-tools input {
  display: none;
}

.word-card {
  display: grid;
  gap: 8px;
}

.word-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.word-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.small-btn {
  min-height: 32px;
  border-radius: 8px;
  padding: 6px 9px;
  color: #fff;
  background: #13a98c;
  font-size: 13px;
  font-weight: 900;
}

.speak-btn {
  background: #2aaeee;
}

.danger {
  background: #ff655e;
}

.empty {
  color: #78838c;
  text-align: center;
  line-height: 1.6;
}

.feature-empty {
  display: grid;
  min-height: 62vh;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
  padding: 28px 18px;
}

.feature-empty-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, #23cbbf, #9a76ff);
  box-shadow: 0 16px 26px rgba(35, 45, 55, 0.14);
  font-size: 34px;
  font-weight: 900;
}

.feature-empty h3 {
  font-size: 26px;
  font-weight: 900;
}

.feature-empty p {
  max-width: 330px;
  color: #6c7780;
  line-height: 1.7;
}

.feature-empty button {
  min-height: 44px;
  border-radius: 999px;
  padding: 10px 22px;
  color: #fff;
  background: #16a889;
  font-weight: 900;
}

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(100%, 480px);
  height: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #edf0f2;
  box-shadow: 0 -8px 22px rgba(42, 56, 68, 0.08);
}

.bottom-tabs button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #a5b0b3;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

.bottom-tabs button.active {
  color: #25c9af;
}

.tab-home,
.tab-word,
.tab-user {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: currentColor;
  position: relative;
  font-weight: 900;
}

.tab-home::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 14px;
  bottom: 5px;
  border-radius: 3px;
  background: #fff;
}

.tab-home::after {
  content: "";
  position: absolute;
  top: 5px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 11px solid #fff;
}

.tab-user::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
}

.tab-user::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 18px;
  height: 9px;
  border-radius: 999px 999px 4px 4px;
  background: #fff;
}

dialog {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  border: 1px solid #e2ebe9;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 18px 42px rgba(35, 45, 55, 0.2);
}

dialog::backdrop {
  background: rgba(28, 42, 52, 0.42);
}

form {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dialog-head h3 {
  font-size: 22px;
  font-weight: 900;
}

#closeDialogBtn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #5c6670;
  background: #eef3f2;
}

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

.dialog-actions .muted-btn {
  color: #51616d;
  background: #edf3f2;
}

@media (max-width: 390px) {
  .book-card {
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 14px;
  }

  .book-card img {
    width: 94px;
  }

  #bookVersion {
    font-size: 22px;
  }

  #bookTitle {
    font-size: 19px;
  }

  .feature-card span {
    font-size: 20px;
  }
}

/* Game-style practice screens */
.challenge-panel.is-open,
.match-panel.is-open,
.dictation-panel.is-open {
  color: #17324a;
}

.challenge-panel.is-open::before {
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.95) 0 40px, transparent 42px),
    radial-gradient(circle at 84% 18%, rgba(255, 255, 255, 0.92) 0 50px, transparent 52px),
    linear-gradient(180deg, #0b7cec 0%, #39b9ff 42%, #8ed96c 100%);
}

.match-panel.is-open::before {
  background:
    radial-gradient(circle at 8% 94%, #7dd24d 0 56px, transparent 58px),
    radial-gradient(circle at 92% 92%, #55b842 0 64px, transparent 66px),
    linear-gradient(180deg, #85d6ff 0%, #d7f5ff 35%, #8ad46b 100%);
}

.dictation-panel.is-open::before {
  background:
    radial-gradient(circle at 78% 18%, rgba(77, 132, 240, 0.1) 0 72px, transparent 74px),
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 42%, #eef4ff 100%);
}

.challenge-panel .detail-head,
.match-panel .detail-head,
.dictation-panel .detail-head {
  align-items: flex-start;
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 24px rgba(30, 79, 112, 0.1);
}

.challenge-panel .detail-head h3,
.match-panel .detail-head h3,
.dictation-panel .detail-head h3 {
  color: #073c2c;
  font-size: 24px;
}

.challenge-hero {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 280px;
  margin: 0 0 14px;
  padding: 18px 12px 16px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 55%, #d5f1ff 0 46px, transparent 48px),
    radial-gradient(circle at 86% 48%, #f2edff 0 38px, transparent 40px),
    linear-gradient(180deg, #1ca0ff 0%, #73d1ff 48%, #73c85a 49%, #43ad43 100%);
  box-shadow: 0 16px 34px rgba(28, 94, 126, 0.18);
}

.challenge-hero::before,
.challenge-hero::after {
  content: "";
  position: absolute;
  bottom: 80px;
  width: 82px;
  height: 86px;
  border-radius: 18px 18px 8px 8px;
  background:
    linear-gradient(90deg, transparent 0 24%, rgba(255,255,255,0.55) 25% 34%, transparent 35% 64%, rgba(255,255,255,0.55) 65% 74%, transparent 75%),
    #f0e4c8;
  box-shadow: inset 0 -10px 0 rgba(85, 83, 94, 0.12);
}

.challenge-hero::before {
  left: 10px;
}

.challenge-hero::after {
  right: 10px;
  filter: brightness(0.78);
}

.challenge-title-art {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  color: #fff;
  text-align: center;
  text-shadow: 0 5px 0 #0f5aad, 0 9px 12px rgba(0, 0, 0, 0.22);
}

.challenge-title-art strong {
  max-width: 260px;
  font-size: 32px;
  line-height: 1.08;
  font-weight: 900;
}

.challenge-title-art span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(180deg, #ffbc34, #ff7d21);
  border: 3px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 0 rgba(138, 72, 16, 0.24);
  font-size: 22px;
  font-weight: 900;
  transform: rotate(-12deg);
}

.challenge-title-art span:last-child {
  background: linear-gradient(180deg, #78d65a, #26a64b);
  transform: rotate(12deg);
}

.challenge-hero p {
  position: relative;
  z-index: 1;
  justify-self: center;
  border-radius: 999px;
  padding: 8px 18px;
  color: #fff;
  background: linear-gradient(180deg, #2c74e8, #1553c5);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 0 rgba(9, 49, 128, 0.22);
  font-size: 16px;
  font-weight: 900;
}

.challenge-panel .challenge-setup {
  grid-template-columns: 1fr;
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.84);
}

.challenge-panel #startChallengeBtn {
  min-height: 58px;
  border-radius: 999px;
  color: #884a00;
  background: linear-gradient(180deg, #ffd954, #ffad22);
  border: 4px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 9px 0 #cc7619, 0 18px 24px rgba(120, 70, 20, 0.2);
  font-size: 22px;
}

.challenge-panel .quiz-card {
  border-radius: 20px;
  background: linear-gradient(180deg, #fffdf5, #e9f8ff);
  border: 3px solid rgba(255, 255, 255, 0.9);
}

.match-hero {
  display: flex;
  min-height: 108px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-radius: 22px;
  padding: 16px;
  color: #743d12;
  background:
    radial-gradient(circle at 14% 85%, rgba(255, 255, 255, 0.7) 0 28px, transparent 29px),
    linear-gradient(180deg, #ffe69b, #ffbd4d);
  border: 4px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 0 rgba(176, 103, 28, 0.23);
}

.match-hero small {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 11px;
  color: #fff;
  background: #d78222;
  font-weight: 900;
}

.match-hero h3 {
  margin-top: 7px;
  color: #fff8df;
  text-shadow: 0 4px 0 #b86a20;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.match-star-score {
  display: grid;
  min-width: 92px;
  min-height: 70px;
  place-items: center;
  align-content: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 3px solid rgba(255, 255, 255, 0.8);
}

.match-star-score b {
  color: #c67b17;
  font-size: 12px;
}

.match-star-score strong {
  color: #7b4318;
  font-size: 24px;
  font-weight: 900;
}

.match-panel .match-stats {
  grid-template-columns: 0.8fr 0.8fr 0.8fr;
  border-radius: 20px;
  padding: 9px;
  background: rgba(255, 245, 202, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.match-panel .match-stats span {
  min-height: 48px;
  border-radius: 15px;
  color: #774719;
  background: #fff5c6;
  border: 2px solid #f2c366;
}

.match-panel #startMatchBtn,
.match-panel #retryMatchBtn {
  min-height: 54px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #62d66b, #1aa64c);
  border: 4px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 0 #167f3c;
}

.match-panel .match-board {
  gap: 8px;
  border-radius: 18px;
  padding: 8px;
  background: rgba(71, 166, 81, 0.38);
}

.match-panel .match-card {
  min-height: 82px;
  border-radius: 16px;
  border: 3px solid rgba(255, 255, 255, 0.68);
  color: #5c361c;
  background: linear-gradient(180deg, #fff2a8, #ffd06b);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.32), 0 6px 0 rgba(118, 74, 32, 0.18);
}

.match-panel .match-card:nth-child(4n+2) {
  background: linear-gradient(180deg, #d9f6ff, #90d9f7);
}

.match-panel .match-card:nth-child(4n+3) {
  background: linear-gradient(180deg, #ffd8ee, #f7a4cc);
}

.match-panel .match-card:nth-child(4n+4) {
  background: linear-gradient(180deg, #e3ffb9, #a9e873);
}

.match-panel .match-card small {
  color: rgba(91, 53, 28, 0.72);
}

.match-panel .match-card.word span {
  color: #5b321c;
}

.match-panel .match-card.selected {
  border-color: #fff;
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.05);
}

.match-panel .match-card.matched {
  opacity: 0.28;
}

.dictation-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 128px;
  margin-bottom: 12px;
  border-radius: 18px;
  padding: 18px;
  color: #17243a;
  background:
    radial-gradient(circle at 76% 26%, rgba(255, 255, 255, 0.9) 0 38px, transparent 40px),
    linear-gradient(135deg, #eaf3ff, #d9e9ff);
  box-shadow: 0 12px 26px rgba(40, 90, 170, 0.12);
}

.dictation-hero h3 {
  font-size: 23px;
  line-height: 1.2;
  font-weight: 900;
}

.dictation-hero p {
  margin-top: 8px;
  color: #526276;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.dictation-hero i {
  position: relative;
  flex: 0 0 auto;
  width: 88px;
  height: 82px;
  border-radius: 22px;
  background:
    linear-gradient(90deg, transparent 0 44%, #2e6be8 45% 55%, transparent 56%),
    linear-gradient(180deg, #5b8fff, #2b67e8);
  box-shadow: 0 12px 22px rgba(43, 103, 232, 0.24);
}

.dictation-hero i::before,
.dictation-hero i::after {
  content: "";
  position: absolute;
}

.dictation-hero i::before {
  left: 20px;
  top: 15px;
  width: 48px;
  height: 34px;
  border-radius: 999px 999px 8px 8px;
  border: 9px solid #e9f2ff;
  border-bottom: 0;
}

.dictation-hero i::after {
  left: 30px;
  bottom: 16px;
  width: 30px;
  height: 24px;
  border-radius: 6px;
  background:
    linear-gradient(#2b67e8 0 4px, transparent 5px 9px, #2b67e8 10px 14px, transparent 15px),
    #fff;
}

.dictation-band-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px;
  border-radius: 14px;
  background: #eef4ff;
  border: 1px solid #dae7ff;
}

.dictation-band-tabs button {
  min-height: 38px;
  border-radius: 10px;
  color: #526276;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}

.dictation-band-tabs button.active {
  color: #fff;
  background: linear-gradient(180deg, #4f83ff, #2f68e8);
  box-shadow: 0 8px 14px rgba(47, 104, 232, 0.2);
}

.dictation-panel .module-book-switcher,
.dictation-panel .unit-strip button,
.dictation-panel .dictation-card,
.dictation-panel .dictation-stats span,
.dictation-panel .dictation-feedback {
  border-color: #dde8fb;
}

.dictation-panel #startDictationBtn,
.dictation-panel #retryDictationBtn,
.dictation-panel #checkDictationBtn,
.dictation-panel #nextDictationBtn {
  background: linear-gradient(180deg, #4f83ff, #2f68e8);
  box-shadow: 0 10px 18px rgba(47, 104, 232, 0.2);
}

.dictation-panel #playDictationBtn {
  min-height: 76px;
  border-radius: 999px;
  justify-self: center;
  width: 76px;
  padding: 0;
  color: transparent;
  background: linear-gradient(180deg, #3f7dff, #215ddd);
  box-shadow: 0 14px 24px rgba(47, 104, 232, 0.26);
}

.dictation-panel #playDictationBtn::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: auto;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 20px solid #fff;
  transform: translateX(3px);
}

.dictation-panel .dictation-target {
  background: #fff;
  border-color: #e0e8f8;
}

.dictation-panel .dictation-answer input {
  border-color: #4f83ff;
}

@media (min-width: 430px) {
  .match-panel .match-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Page-like routing and closer screenshot-inspired practice UI */
.phone-app {
  position: relative;
  overflow: hidden;
}

body.page-open .bottom-tabs {
  transform: translateY(120%);
}

.bottom-tabs {
  transition: transform 0.24s ease;
}

.detail-panel.is-open {
  animation: pageSlideIn 0.28s ease both;
  box-shadow: 0 18px 50px rgba(20, 44, 70, 0.22);
}

@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.challenge-panel.is-open,
.match-panel.is-open,
.dictation-panel.is-open {
  padding-top: 12px;
}

.match-panel.is-open::before {
  background:
    radial-gradient(circle at 2% 14%, rgba(38, 143, 73, 0.95) 0 74px, transparent 76px),
    radial-gradient(circle at 99% 13%, rgba(49, 153, 78, 0.92) 0 82px, transparent 84px),
    radial-gradient(circle at 8% 97%, #78cb44 0 70px, transparent 72px),
    radial-gradient(circle at 92% 97%, #54b83d 0 82px, transparent 84px),
    linear-gradient(180deg, #86d9ff 0%, #cfefff 35%, #9ce071 70%, #53b842 100%);
}

.match-panel .detail-head,
.challenge-panel .detail-head {
  color: #7a4517;
  background: rgba(255, 250, 229, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.78);
}

.match-hero {
  position: relative;
  min-height: 184px;
  align-items: flex-start;
  padding: 16px 14px 54px;
  overflow: hidden;
  border-radius: 8px;
  color: #713a12;
  background:
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.9) 0 38px, transparent 40px),
    linear-gradient(180deg, #fff0a8 0%, #ffc45a 100%);
  box-shadow: 0 12px 0 rgba(157, 99, 33, 0.24), 0 22px 32px rgba(89, 139, 65, 0.24);
}

.match-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 20px;
  width: min(78%, 320px);
  height: 62px;
  transform: translateX(-50%);
}

.match-hero > div:not(.match-level-badge):not(.match-star-score) {
  position: absolute;
  left: 0;
  right: 0;
  top: 50px;
  align-self: end;
  width: auto;
  padding: 0 20px;
  text-align: center;
}

.match-hero h3 {
  color: #fff8df;
  text-align: center;
  text-shadow:
    0 4px 0 #b86b21,
    0 8px 0 #8a4816,
    0 12px 18px rgba(88, 45, 8, 0.24);
  font-size: clamp(38px, 11vw, 52px);
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.match-hero small,
.match-hero p {
  display: inline-block;
  border-radius: 999px;
  padding: 7px 14px;
  color: #fff;
  background: rgba(182, 101, 27, 0.78);
  font-size: 14px;
  font-weight: 900;
}

.match-hero p {
  margin-top: 8px;
  color: #693916;
  background: rgba(255, 255, 255, 0.82);
}

.match-level-badge,
.match-star-score {
  position: relative;
  z-index: 2;
  min-width: 72px;
  min-height: 66px;
  border-radius: 18px;
  color: #fff8df;
  background: linear-gradient(180deg, #c67b28, #9b551b);
  border: 4px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.24), 0 8px 0 rgba(112, 62, 20, 0.28);
}

.match-star-score {
  background: linear-gradient(180deg, #fff4b3, #ffc95e);
  color: #794014;
}

.match-level-badge b,
.match-star-score b {
  color: inherit;
  font-size: 13px;
}

.match-level-badge strong,
.match-star-score strong {
  font-size: 24px;
  font-weight: 900;
}

.match-play-tip {
  margin: -30px auto 12px;
  position: relative;
  z-index: 3;
  max-width: 92%;
  border-radius: 999px;
  padding: 11px 16px;
  color: #6b3c1b;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid rgba(208, 157, 91, 0.34);
  text-align: center;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(90, 126, 70, 0.14);
}

.match-panel .match-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(41, 151, 74, 0.34);
}

.match-panel .match-card {
  min-height: 88px;
  border-radius: 8px;
  border: 3px solid rgba(255, 255, 255, 0.68);
  color: #5b351c;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.3),
    0 7px 0 rgba(105, 67, 35, 0.2);
}

.match-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 238, 179, 0.9);
  border: 3px solid rgba(255, 255, 255, 0.75);
}

.match-tools button {
  display: grid;
  place-items: center;
  grid-template-columns: 28px 1fr auto;
  gap: 5px;
  min-height: 42px;
  border-radius: 999px;
  color: #704119;
  background: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 900;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.match-tools button:active {
  transform: translateY(3px) scale(0.98);
  filter: brightness(0.96);
}

.match-tools b {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #62caff, #188dd9);
}

.match-tools button:nth-child(2) b {
  background: linear-gradient(180deg, #75dc5a, #28a53d);
}

.match-tools button:nth-child(3) b {
  background: linear-gradient(180deg, #5c5a5a, #222);
}

.match-tools strong {
  display: grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #995c14;
  background: #ffd76a;
}

.match-panel .match-card {
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    opacity 0.18s ease,
    box-shadow 0.16s ease;
}

.match-panel .match-card:active {
  transform: translateY(3px) scale(0.98);
}

.match-panel .match-card.hinted {
  animation: hintPulse 0.42s ease-in-out 3;
  border-color: #fff;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.42),
    0 0 0 4px rgba(255, 219, 89, 0.72),
    0 7px 0 rgba(105, 67, 35, 0.2);
}

.match-panel .match-card.popped {
  animation: matchPop 0.42s ease both;
}

.match-board.shuffling .match-card:not(.matched) {
  animation: shuffleWiggle 0.5s ease both;
}

@keyframes hintPulse {
  50% {
    transform: translateY(-4px) scale(1.04);
    filter: brightness(1.08);
  }
}

@keyframes matchPop {
  50% {
    transform: scale(1.08) rotate(-1deg);
    filter: brightness(1.12);
  }

  100% {
    transform: scale(0.96);
  }
}

@keyframes shuffleWiggle {
  20% {
    transform: translateX(-5px) rotate(-1deg);
  }

  50% {
    transform: translateX(5px) rotate(1deg);
  }

  100% {
    transform: translateX(0) rotate(0);
  }
}

.challenge-panel.is-open::before {
  background:
    radial-gradient(circle at 0 18%, rgba(255, 255, 255, 0.94) 0 50px, transparent 52px),
    radial-gradient(circle at 100% 22%, rgba(255, 255, 255, 0.9) 0 62px, transparent 64px),
    linear-gradient(180deg, #0576ee 0%, #20a9ff 46%, #7cce5a 47%, #2f9b44 100%);
}

.challenge-hero {
  min-height: 330px;
  border-radius: 8px;
  padding: 18px 10px 20px;
  background:
    radial-gradient(circle at 13% 78%, #dff5ff 0 36px, transparent 38px),
    radial-gradient(circle at 88% 28%, rgba(95, 65, 172, 0.42) 0 54px, transparent 56px),
    linear-gradient(180deg, #1aa3ff 0%, #75d3ff 45%, #8fdc64 46%, #3ba647 100%);
}

.challenge-title-art {
  margin-top: 18px;
}

.challenge-title-art strong {
  max-width: 290px;
  color: #fff8ff;
  text-shadow:
    0 5px 0 #0d61be,
    0 10px 0 #074996,
    0 16px 24px rgba(0, 45, 105, 0.35);
  font-size: clamp(42px, 15vw, 66px);
}

.challenge-title-art span {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.challenge-summary {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.challenge-summary span {
  display: grid;
  min-height: 76px;
  place-items: center;
  align-content: center;
  border-radius: 18px;
  color: #0c4f86;
  background: rgba(255, 255, 255, 0.86);
  border: 3px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 0 rgba(37, 119, 72, 0.18);
}

.challenge-summary b {
  color: #0a74d9;
  font-size: 23px;
  font-weight: 900;
}

.challenge-summary small {
  color: #476473;
  font-size: 12px;
  font-weight: 900;
}

.challenge-panel #startChallengeBtn {
  min-height: 62px;
  font-size: 26px;
}

.dictation-panel.is-open {
  color: #17243a;
  background: #f7f9ff;
}

.dictation-panel.is-open::before {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 55%, #eef4ff 100%);
}

.dictation-panel .detail-head {
  border-radius: 0;
  margin: -12px -18px 16px;
  padding: 14px 18px;
  background: #fff;
  border: 0;
  box-shadow: 0 8px 18px rgba(24, 36, 58, 0.06);
}

.dictation-hero {
  border-radius: 8px;
  min-height: 154px;
  background:
    radial-gradient(circle at 74% 45%, rgba(72, 125, 242, 0.18) 0 58px, transparent 60px),
    linear-gradient(135deg, #ecf4ff, #dceaff);
}

.dictation-hero h3 {
  max-width: 190px;
  font-size: 25px;
}

.dictation-hero p {
  max-width: 190px;
}

#dictationHeroStartBtn {
  margin-top: 14px;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(180deg, #4f83ff, #2f68e8);
  box-shadow: 0 10px 18px rgba(47, 104, 232, 0.22);
  font-size: 15px;
  font-weight: 900;
}

.dictation-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dictation-mode-grid span {
  display: grid;
  gap: 6px;
  min-height: 118px;
  place-items: center;
  align-content: center;
  border-radius: 8px;
  padding: 10px 6px;
  color: #1b2738;
  background: #fff;
  border: 1px solid #edf1f7;
  box-shadow: 0 10px 20px rgba(20, 42, 80, 0.07);
}

.dictation-mode-grid b {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(180deg, #dce8ff, #8cadff);
}

.dictation-mode-grid span:nth-child(2) b {
  background: linear-gradient(180deg, #dff8e8, #6fd18c);
}

.dictation-mode-grid span:nth-child(3) b {
  background: linear-gradient(180deg, #eee7ff, #a889f2);
}

.dictation-mode-grid strong {
  font-size: 14px;
  font-weight: 900;
}

.dictation-mode-grid small {
  color: #768396;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
}

.dictation-panel .dictation-card {
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(21, 42, 82, 0.09);
}

@media (min-width: 700px) {
  .detail-panel.is-open {
    width: min(100%, 720px);
  }

  .match-panel .match-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .dictation-mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .detail-panel.is-open {
    width: 100%;
    max-width: none;
  }

  .module-book-switcher {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .module-book-switcher select {
    width: 100%;
    min-height: 42px;
    font-size: 15px;
  }

  .module-page .unit-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 2px 0 12px;
    padding: 0;
    overflow: visible;
  }

  .module-page .unit-strip button {
    min-width: 0;
    width: 100%;
    padding: 8px 6px;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.15;
  }

  .module-page .unit-strip button:nth-last-child(1):nth-child(4n + 1) {
    grid-column: auto;
  }

  .match-hero {
    display: grid;
    grid-template-columns: 84px 1fr 84px;
    grid-template-areas:
      "level . score"
      "title title title";
    min-height: auto;
    gap: 12px;
    padding: 14px 12px 22px;
  }

  .match-level-badge {
    grid-area: level;
  }

  .match-star-score {
    grid-area: score;
    justify-self: end;
  }

  .match-hero > div:not(.match-level-badge):not(.match-star-score) {
    position: static;
    grid-area: title;
    padding: 0;
  }

  .match-hero h3 {
    font-size: clamp(34px, 12vw, 44px);
    white-space: nowrap;
  }

  .match-hero p {
    max-width: 260px;
    line-height: 1.35;
  }

  .match-play-tip {
    margin-top: 8px;
    border-radius: 14px;
    line-height: 1.4;
  }

  .match-panel .match-stats,
  .dictation-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .match-panel .match-stats span,
  .dictation-stats span {
    min-width: 0;
    padding: 8px 4px;
    font-size: 12px;
  }

  .match-tools {
    grid-template-columns: 1fr;
  }

  .match-tools button {
    grid-template-columns: 30px minmax(0, 1fr) 28px;
    min-height: 46px;
  }

  .challenge-hero {
    min-height: auto;
    padding: 14px 10px 18px;
  }

  .challenge-title-art {
    margin-top: 0;
    gap: 6px;
  }

  .challenge-title-art strong {
    max-width: 230px;
    font-size: clamp(34px, 12vw, 46px);
  }

  .challenge-title-art span {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .challenge-summary {
    gap: 8px;
    margin-top: 20px;
  }

  .challenge-summary span {
    min-height: 68px;
    border-radius: 14px;
  }

  .challenge-summary b {
    font-size: 19px;
  }

  .challenge-summary small {
    font-size: 11px;
  }

  .challenge-panel #startChallengeBtn {
    width: 100%;
  }

  .challenge-setup {
    grid-template-columns: 1fr;
  }

  .dictation-mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .dictation-mode-grid span {
    min-height: 92px;
    padding: 8px 4px;
  }

  .dictation-mode-grid b {
    width: 34px;
    height: 34px;
  }

  .dictation-mode-grid strong {
    font-size: 12px;
  }

  .dictation-mode-grid small {
    font-size: 11px;
  }
}
