:root {
  color-scheme: light;
  --ink: #20264a;
  --muted: #66728d;
  --paper: #fff7df;
  --page: #fffdf7;
  --gold: #ffd447;
  --coral: #ff6b6f;
  --mint: #2fc7b5;
  --blue: #4f82ff;
  --lavender: #9574ff;
  --leaf: #70d66b;
  --rose: #ff89c2;
  --orange: #ffad3d;
  --sky: #7fdcff;
  --shadow: 0 22px 60px rgba(34, 43, 82, 0.15);
  --soft-shadow: 0 10px 26px rgba(34, 43, 82, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-rounded, "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='rgba(32,38,74,.08)' stroke-width='8' stroke-linecap='round'%3E%3Cpath d='M28 34h28M42 20v28M124 43l21 21M145 43l-21 21M42 133c11-15 25-15 36 0s25 15 36 0'/%3E%3C/g%3E%3Cpath fill='rgba(255,107,111,.1)' d='M128 118h28v28h-28z'/%3E%3Cpath fill='rgba(47,199,181,.12)' d='M25 105h38v22H25z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, #ffe6aa 0%, #c9f5ff 33%, #f1e5ff 68%, #ddffd7 100%);
  background-attachment: fixed;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease, opacity 180ms ease;
}

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

button:focus-visible {
  outline: 4px solid rgba(79, 124, 255, 0.35);
  outline-offset: 3px;
}

.book-app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  width: min(1280px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 420ms ease, transform 420ms ease;
}

.app-loading .book-app {
  opacity: 0;
  transform: translateY(10px);
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 212, 71, 0.92), rgba(127, 220, 255, 0.88) 45%, rgba(255, 137, 194, 0.86)),
    #fff7df;
  transition: opacity 360ms ease, visibility 360ms ease, transform 360ms ease;
}

.splash-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.015);
}

.splash-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(340px, 100%);
  padding: 28px 22px;
  border: 5px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  text-align: center;
}

.splash-card h1 {
  font-size: 2.15rem;
}

.loading-book {
  position: relative;
  width: 86px;
  height: 70px;
  perspective: 500px;
}

.loading-book span {
  position: absolute;
  bottom: 0;
  width: 44px;
  height: 62px;
  border-radius: 8px 8px 4px 4px;
  background: var(--coral);
  box-shadow: inset 0 -8px 0 rgba(32, 38, 74, 0.12);
  transform-origin: bottom center;
  animation: pageFlip 1100ms ease-in-out infinite;
}

.loading-book span:first-child {
  left: 4px;
  transform: rotate(-9deg);
}

.loading-book span:last-child {
  right: 4px;
  background: var(--blue);
  animation-delay: 160ms;
  transform: rotate(9deg);
}

.loading-dots {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.loading-dots span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--coral);
  animation: dotPulse 900ms ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  background: var(--blue);
  animation-delay: 120ms;
}

.loading-dots span:nth-child(3) {
  background: var(--mint);
  animation-delay: 240ms;
}

@keyframes pageFlip {
  50% {
    transform: translateY(-4px) rotate(0deg);
  }
}

@keyframes dotPulse {
  50% {
    transform: translateY(-5px);
    opacity: 0.65;
  }
}

.library-panel,
.reader,
.story-page,
.word-card {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.content-changing .reader-top,
.content-changing .story-page,
.content-changing .word-card {
  opacity: 0.58;
  transform: translateY(6px);
}

.library-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 44px);
  padding: 18px;
  overflow: hidden;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent),
    #fff2c9;
  overflow: hidden;
}

.brand::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--mint), var(--blue));
}

.brand > * {
  position: relative;
  z-index: 1;
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 48px;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 6px;
  width: 16px;
  height: 22px;
  border-radius: 6px 6px 3px 3px;
  background: var(--gold);
  box-shadow: inset 0 -5px 0 rgba(23, 32, 58, 0.1);
  transform: rotate(4deg);
}

.brand-mark span {
  position: absolute;
  bottom: 0;
  width: 28px;
  height: 44px;
  border-radius: 8px 8px 3px 3px;
  background: var(--coral);
  box-shadow: inset 0 -7px 0 rgba(23, 32, 58, 0.12);
}

.brand-mark span:first-child {
  left: 2px;
  transform: rotate(-8deg);
}

.brand-mark span:last-child {
  right: 2px;
  background: var(--blue);
  transform: rotate(8deg);
}

.eyebrow {
  margin: 0 0 4px;
  color: #db5b56;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 1.55rem;
}

.book-stack {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.story-tab {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 10px;
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--soft-shadow);
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
  overflow: hidden;
}

.story-tab::after {
  content: "";
  position: absolute;
  right: -14px;
  top: -14px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.36);
  transform: rotate(18deg);
}

.story-tab:hover {
  transform: translateY(-2px);
}

.story-tab[aria-selected="true"] {
  color: #ffffff;
  background: var(--story-color, var(--blue));
  box-shadow: 0 14px 28px rgba(34, 43, 82, 0.18), inset 0 -5px 0 rgba(23, 32, 58, 0.16);
}

.story-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 900;
}

.story-tab[aria-selected="true"] .story-number {
  color: var(--story-color, var(--blue));
}

.story-tab strong,
.story-tab span:last-child {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-tab strong {
  font-size: 0.98rem;
  font-weight: 900;
}

.story-tab span:last-child {
  color: inherit;
  opacity: 0.78;
  font-size: 0.86rem;
  font-weight: 800;
}

.reader {
  min-height: calc(100vh - 44px);
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

.reader-top {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 224, 0.9)),
    #ffffff;
  box-shadow: var(--soft-shadow);
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
  overflow: hidden;
}

.reader-top::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--mint), var(--blue), var(--rose));
  pointer-events: none;
}

.round-button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(135deg, var(--ink), #33406d);
  box-shadow: inset 0 -5px 0 rgba(255, 255, 255, 0.12), var(--soft-shadow);
  font-size: 2rem;
  font-weight: 900;
}

.title-block {
  min-width: 0;
  text-align: center;
}

.title-block h2 {
  font-size: 2.35rem;
  overflow-wrap: anywhere;
}

.title-block p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 900;
}

.language-picker {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 128px;
}

.language-picker label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.language-picker select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff1c8;
  box-shadow: inset 0 -4px 0 rgba(23, 32, 58, 0.08), var(--soft-shadow);
  font: inherit;
  font-weight: 900;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 16px;
  align-items: start;
}

.story-page {
  overflow: hidden;
  background: var(--page);
}

.scene {
  position: relative;
  min-height: 250px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #8fdcff, #fff1a8);
}

.scene img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 -42px 60px rgba(23, 32, 58, 0.12);
}

.story-copy {
  display: grid;
  gap: 18px;
  padding: 24px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.story-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.listen-story-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(135deg, var(--coral), var(--blue));
  box-shadow: inset 0 -5px 0 rgba(23, 32, 58, 0.13), var(--soft-shadow);
  font-weight: 900;
}

.english-story {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 7px;
  align-items: baseline;
  font-size: 1.72rem;
  font-weight: 900;
  line-height: 1.45;
}

.word {
  position: relative;
  padding: 3px 5px;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font-weight: 900;
  line-height: 1.1;
  transition: background 180ms ease, transform 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.word:hover,
.word.active {
  color: #ffffff;
  background: var(--active-color, var(--blue));
  box-shadow: 0 8px 18px rgba(34, 43, 82, 0.14);
  transform: translateY(-1px);
}

.punctuation {
  margin-left: -5px;
  font-weight: 900;
}

.turkish-story {
  padding: 16px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent),
    #fff1c8;
  box-shadow: inset 0 0 0 2px rgba(23, 32, 58, 0.05);
}

.turkish-story p:last-child {
  margin-bottom: 0;
  color: #3f4961;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.45;
}

.word-card {
  position: sticky;
  top: 22px;
  padding: 18px;
}

.word-display {
  display: grid;
  gap: 6px;
  min-height: 150px;
  margin: 12px 0;
  padding: 18px;
  border-radius: var(--radius);
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 58%),
    linear-gradient(135deg, var(--blue), var(--mint));
  box-shadow: inset 0 -8px 0 rgba(23, 32, 58, 0.13);
  transition: transform 180ms ease, opacity 180ms ease;
}

.word-display.word-updated {
  animation: wordSwap 220ms ease;
}

@keyframes wordSwap {
  0% {
    opacity: 0.72;
    transform: translateY(4px) scale(0.99);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.word-display span {
  font-size: 2.25rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.word-display em {
  color: #fff7ce;
  font-size: 1.05rem;
  font-style: normal;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.word-display strong {
  align-self: end;
  color: #fff7ce;
  font-size: 1.45rem;
  overflow-wrap: anywhere;
}

.word-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 10px;
}

.sound-button,
.star-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(135deg, var(--ink), #33406d);
  box-shadow: inset 0 -5px 0 rgba(255, 255, 255, 0.12);
  font-weight: 900;
}

.star-button {
  width: 54px;
  color: var(--ink);
  background: #fff1c8;
  font-size: 1.45rem;
  box-shadow: inset 0 -5px 0 rgba(23, 32, 58, 0.08), var(--soft-shadow);
}

.star-button[aria-pressed="true"] {
  color: #ffffff;
  background: linear-gradient(135deg, var(--gold), var(--coral));
}

.voice-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.54), transparent),
    rgba(255, 241, 200, 0.78);
}

.voice-panel label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.voice-panel select {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  box-shadow: inset 0 -3px 0 rgba(23, 32, 58, 0.07);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
}

.saved-words {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid rgba(23, 32, 58, 0.08);
}

.saved-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.saved-heading .eyebrow {
  margin: 0;
}

.saved-heading span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--coral);
  font-size: 0.85rem;
  font-weight: 900;
}

.starred-list {
  display: grid;
  gap: 8px;
  max-height: 238px;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.starred-word {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--soft-shadow);
  text-align: left;
  font-weight: 900;
}

.starred-word span:first-child {
  color: var(--gold);
}

.starred-word strong,
.starred-word em,
.starred-word small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starred-word em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.starred-word small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.quiz-zone {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), transparent),
    rgba(222, 251, 244, 0.82);
  box-shadow: inset 0 0 0 2px rgba(23, 32, 58, 0.05);
}

.story-page .quiz-zone {
  margin-top: 0;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent),
    linear-gradient(120deg, rgba(255, 212, 71, 0.35), rgba(127, 220, 255, 0.28), rgba(255, 137, 194, 0.24));
}

.quiz-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quiz-heading .eyebrow,
.quiz-prompt {
  margin: 0;
}

.quiz-refresh {
  min-height: 30px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--mint);
  box-shadow: inset 0 -3px 0 rgba(23, 32, 58, 0.1);
  font-size: 0.82rem;
  font-weight: 900;
}

.quiz-refresh:disabled {
  cursor: default;
  opacity: 0.55;
}

.quiz-prompt {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.35;
}

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

.story-page .quiz-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quiz-option {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--soft-shadow);
  text-align: left;
  font-weight: 900;
}

.quiz-option:disabled {
  cursor: default;
  opacity: 0.94;
}

.quiz-option.correct {
  color: #ffffff;
  background: linear-gradient(135deg, var(--leaf), var(--mint));
}

.quiz-option.wrong {
  color: #ffffff;
  background: linear-gradient(135deg, var(--coral), var(--rose));
}

.empty-stars {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 241, 200, 0.72);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.35;
}

.translation-pop {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 22px;
  min-width: 190px;
  max-width: min(420px, calc(100% - 32px));
  padding: 13px 16px;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--ink);
  box-shadow: var(--shadow);
  text-align: center;
  font-weight: 900;
  transform: translate(-50%, 150%);
  transition: transform 180ms ease;
}

.translation-pop.show {
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  body {
    background-attachment: scroll;
  }

  .book-app {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 8px 8px 16px;
  }

  .library-panel {
    position: sticky;
    top: 0;
    z-index: 15;
    gap: 8px;
    min-height: auto;
    margin: 0 -8px;
    padding: 8px;
    border-radius: 0 0 var(--radius) var(--radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(34, 43, 82, 0.13);
    backdrop-filter: blur(14px);
  }

  .reader {
    min-height: auto;
    scroll-margin-top: 138px;
    padding: 10px;
    box-shadow: 0 14px 36px rgba(34, 43, 82, 0.11);
  }

  .brand {
    min-height: 76px;
    padding: 12px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.28)),
      linear-gradient(120deg, #fff2b8 0%, #d7f8ff 42%, #ffe0ef 100%);
    box-shadow: 0 10px 24px rgba(34, 43, 82, 0.12);
  }

  .brand-mark {
    width: 54px;
    height: 46px;
  }

  .brand-mark span {
    width: 27px;
    height: 42px;
  }

  .brand-mark::after {
    width: 17px;
    height: 24px;
  }

  .brand h1 {
    font-size: 1.34rem;
  }

  .book-stack {
    display: flex;
    gap: 7px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1px 2px 7px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .book-stack::-webkit-scrollbar {
    display: none;
  }

  .story-tab {
    flex: 0 0 210px;
    grid-template-columns: 32px minmax(0, 1fr);
    min-height: 54px;
    padding: 7px;
    scroll-snap-align: start;
  }

  .story-number {
    width: 32px;
    height: 32px;
  }

  .page-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .word-card {
    position: static;
    padding: 14px;
  }
}

@media (max-width: 640px) {
  .book-app {
    padding: 0 8px 16px;
  }

  .library-panel {
    padding-top: 7px;
  }

  .brand {
    gap: 12px;
    min-height: 78px;
    padding: 12px;
  }

  .brand .eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--coral), var(--orange));
    box-shadow: inset 0 -3px 0 rgba(23, 32, 58, 0.1);
    font-size: 0.68rem;
  }

  .brand h1 {
    font-size: 1.32rem;
    line-height: 1.06;
    overflow-wrap: anywhere;
  }

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

  .brand-mark span {
    width: 26px;
    height: 40px;
  }

  .brand-mark::after {
    right: 2px;
    top: 6px;
    width: 16px;
    height: 23px;
  }

  .book-stack {
    display: flex;
  }

  .story-tab {
    flex-basis: 174px;
    min-height: 48px;
    gap: 7px;
  }

  .story-tab strong {
    font-size: 0.82rem;
  }

  .story-tab span:last-child {
    font-size: 0.72rem;
  }

  .reader-top {
    grid-template-areas:
      "title title title"
      "prev language next";
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    gap: 12px;
    margin: 4px 0 12px;
    padding: 18px 12px 12px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.38)),
      linear-gradient(120deg, #fff4be 0%, #d9f7ff 36%, #ffe1ef 70%, #e7ffdf 100%);
    box-shadow: 0 16px 34px rgba(34, 43, 82, 0.14);
  }

  #prevStory {
    grid-area: prev;
    background: linear-gradient(135deg, var(--coral), var(--rose));
  }

  #nextStory {
    grid-area: next;
    background: linear-gradient(135deg, var(--blue), var(--mint));
  }

  .title-block {
    grid-area: title;
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 0 8px 2px;
  }

  .language-picker {
    grid-area: language;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    gap: 8px;
    min-width: 0;
    min-height: 54px;
    padding: 7px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.54), var(--soft-shadow);
  }

  .round-button {
    width: 54px;
    height: 54px;
    font-size: 2.25rem;
    box-shadow: inset 0 -5px 0 rgba(255, 255, 255, 0.14), var(--soft-shadow);
  }

  .title-block h2 {
    max-width: 100%;
    font-size: 1.68rem;
    line-height: 1.08;
  }

  .title-block .eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--coral), var(--orange));
    box-shadow: inset 0 -3px 0 rgba(23, 32, 58, 0.1);
    font-size: 0.72rem;
  }

  .title-block p:last-child {
    max-width: 100%;
    margin-top: 0;
    color: #4d5570;
    font-size: 0.96rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .language-picker label {
    padding-left: 2px;
    color: #4d5570;
    font-size: 0.76rem;
    white-space: nowrap;
  }

  .language-picker select {
    min-height: 40px;
    background: #ffffff;
    font-size: 0.92rem;
  }

  .scene {
    min-height: 205px;
    aspect-ratio: 1 / 1;
  }

  .story-copy {
    gap: 12px;
    padding: 14px;
  }

  .listen-story-button {
    width: 100%;
    min-height: 44px;
  }

  .english-story {
    gap: 5px 4px;
    font-size: 1.22rem;
    line-height: 1.52;
  }

  .word {
    padding: 3px 4px;
  }

  .turkish-story {
    padding: 13px;
  }

  .turkish-story p:last-child {
    font-size: 0.98rem;
  }

  .word-card {
    padding: 12px;
  }

  .word-display {
    min-height: 118px;
    margin: 9px 0;
    padding: 14px;
  }

  .word-display span {
    font-size: 1.72rem;
  }

  .word-display strong {
    font-size: 1.22rem;
  }

  .word-display em {
    font-size: 0.94rem;
  }

  .voice-panel {
    padding: 10px;
  }

  .saved-words {
    margin-top: 14px;
    padding-top: 12px;
  }

  .starred-list {
    max-height: 176px;
    padding-right: 3px;
  }

  .starred-word {
    min-height: 44px;
    padding: 7px 9px;
  }

  .quiz-zone {
    margin-top: 12px;
    padding: 10px;
  }

  .story-page .quiz-zone {
    margin-top: 0;
    padding: 12px;
  }

  .story-page .quiz-options {
    grid-template-columns: 1fr;
  }

  .quiz-option {
    min-height: 40px;
  }

  .translation-pop {
    bottom: 12px;
    padding: 11px 13px;
  }
}

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