.story-quiz-game {
  display: grid;
  gap: 1rem;
}

.story-quiz-shell {
  display: grid;
  gap: .9rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(30,32,48,.94), rgba(14,15,20,.94));
  padding: 1rem;
}

.story-quiz-story-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: .9rem;
  align-items: center;
}

.story-quiz-story-card img {
  width: 118px;
  aspect-ratio: 1.12;
  border-radius: 10px;
  object-fit: cover;
}

.story-quiz-story-card span,
.story-quiz-listen-panel p {
  color: var(--accent3);
  font-size: .76rem;
  font-weight: 800;
}

.story-quiz-story-card h3 {
  margin: .2rem 0 .25rem;
  color: #ffffff;
  font-family: 'DM Serif Display', serif;
  font-size: 1.65rem;
  font-weight: 400;
}

.story-quiz-story-card p,
.story-quiz-reading-panel p {
  color: rgba(255,255,255,.72);
  line-height: 1.55;
}

.story-quiz-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
}

.story-quiz-tabs button,
.story-quiz-options label {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.84);
}

.story-quiz-tabs button {
  padding: .72rem .8rem;
  cursor: pointer;
  font-weight: 900;
}

.story-quiz-tabs button.active {
  border-color: rgba(78,205,196,.5);
  background: rgba(78,205,196,.16);
  color: #ffffff;
}
.story-quiz-tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.story-quiz-listen-panel,
.story-quiz-reading-panel {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  padding: .9rem;
}

.story-quiz-form {
  display: grid;
  gap: .75rem;
}

.story-quiz-question {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  padding: .85rem;
}

.story-quiz-question-title {
  display: block;
  width: 100%;
  margin: 0 0 0.65rem;
  padding: 0;
  color: #ffffff;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.story-quiz-options {
  display: grid;
  gap: .5rem;
  margin-top: .65rem;
}

.story-quiz-options label {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .68rem .72rem;
  cursor: pointer;
}

.story-quiz-options input {
  accent-color: var(--accent3);
}

.story-quiz-question.is-correct {
  border-color: rgba(78,205,196,.55);
  background: rgba(78,205,196,.1);
}

.story-quiz-question.is-wrong {
  border-color: rgba(255,107,157,.55);
  background: rgba(255,107,157,.1);
}

.story-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

:root[data-theme="light"] .story-quiz-shell,
:root[data-theme="light"] .story-quiz-listen-panel,
:root[data-theme="light"] .story-quiz-reading-panel,
:root[data-theme="light"] .story-quiz-question {
  border-color: rgba(79,142,247,.16);
  background: rgba(255,255,255,.82);
}

:root[data-theme="light"] .story-quiz-story-card h3,
:root[data-theme="light"] .story-quiz-question-title {
  color: #0e0f14;
}

:root[data-theme="light"] .story-quiz-story-card p,
:root[data-theme="light"] .story-quiz-reading-panel p {
  color: #566079;
}

:root[data-theme="light"] .story-quiz-tabs button,
:root[data-theme="light"] .story-quiz-options label {
  border-color: rgba(79,142,247,.16);
  background: #ffffff;
  color: #0e0f14;
}

@media (max-width: 760px) {
  .story-quiz-story-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .story-quiz-story-card img {
    width: 76px;
  }

  .story-quiz-story-card h3 {
    font-size: 1.25rem;
  }

  .story-quiz-tabs {
    grid-template-columns: 1fr;
  }
}
.story-quiz-cta {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.story-quiz-cta span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  font-weight: 700;
}

.story-quiz-cta strong {
  color: #fff;
  font-size: 1.15rem;
}

.story-quiz-cta-btn {
  justify-self: start;
}

:root[data-theme="light"] .story-quiz-cta {
  border-top-color: rgba(18, 24, 42, 0.12);
}

:root[data-theme="light"] .story-quiz-cta span {
  color: rgba(18, 24, 42, 0.62);
}

:root[data-theme="light"] .story-quiz-cta strong {
  color: #12182a;
}
.story-quiz-dictation-panel p,
.story-quiz-dictation-answer {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.story-quiz-dictation-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.story-quiz-word-speak {
  min-height: 42px;
  white-space: nowrap;
}

.story-quiz-dictation-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.story-quiz-dictation-row input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.story-quiz-dictation-answer {
  display: block;
  margin-top: 10px;
  font-weight: 800;
}

:root[data-theme="light"] .story-quiz-dictation-panel p,
:root[data-theme="light"] .story-quiz-dictation-answer {
  color: #566079;
}

:root[data-theme="light"] .story-quiz-dictation-row input {
  border-color: rgba(79, 142, 247, 0.16);
  background: #ffffff;
  color: #0e0f14;
}

:root[data-theme="light"] .story-quiz-dictation-row input::placeholder {
  color: rgba(18, 24, 42, 0.42);
}

@media (max-width: 560px) {
  .story-quiz-dictation-row {
    grid-template-columns: 1fr;
  }
}
.story-quiz-complete-card #storyQuizCompleteText {
  display: grid;
  gap: 8px;
}

.story-quiz-result-line,
.story-quiz-result-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.story-quiz-result-line b,
.story-quiz-result-total b {
  white-space: nowrap;
}

.story-quiz-result-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.story-quiz-complete-card #storyQuizCompleteText em {
  color: #4ecdc4;
  font-style: normal;
  font-weight: 900;
}

:root[data-theme="light"] .story-quiz-result-total {
  border-top-color: rgba(18, 24, 42, 0.12);
}
.sankru-games-section,
.story-quiz-overview {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.sankru-games-section-head {
  display: grid;
  gap: 4px;
}

.sankru-games-section-head span {
  color: #4ecdc4;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sankru-games-section-head h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.story-quiz-section-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.story-quiz-section-stats div {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
}

.story-quiz-section-stats span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
  font-weight: 800;
}

.story-quiz-section-stats strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 1.25rem;
}

.story-quiz-level-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.story-quiz-level-tabs button {
  min-width: 58px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.76);
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 900;
}

.story-quiz-level-tabs button.active {
  border-color: rgba(78, 205, 196, 0.55);
  background: rgba(78, 205, 196, 0.18);
  color: #fff;
}

.story-quiz-level-tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.story-quiz-card-grid {
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 12px;
}

.story-quiz-card-grid > .story-quiz-mini-card[hidden] {
  display: none !important;
}

.story-quiz-card-grid > .story-quiz-mini-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-content: stretch;
  align-items: stretch;
  gap: 12px;
  min-height: 112px;
  padding: 10px;
}

.story-quiz-card-grid > .story-quiz-mini-card .sankru-game-card-media {
  align-self: stretch;
  width: 86px;
  height: 92px;
  min-height: 0;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 8px;
}

.story-quiz-card-grid > .story-quiz-mini-card .sankru-game-card-media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  transform: none;
}

.story-quiz-mini-card-body {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.story-quiz-mini-card h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.12;
}

.story-quiz-mini-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.32;
}

.story-quiz-mini-card strong {
  margin-top: 2px;
  font-size: 0.84rem;
}

.story-quiz-overview.is-active-quiz {
  margin-bottom: 18px;
}

:root[data-theme="light"] .sankru-games-section-head h2,
:root[data-theme="light"] .story-quiz-section-stats strong {
  color: #12182a;
}

:root[data-theme="light"] .story-quiz-section-stats div {
  border-color: rgba(79, 142, 247, 0.16);
  background: #ffffff;
}

:root[data-theme="light"] .story-quiz-section-stats span {
  color: rgba(18, 24, 42, 0.62);
}

:root[data-theme="light"] .story-quiz-level-tabs button {
  border-color: rgba(79, 142, 247, 0.16);
  background: #ffffff;
  color: rgba(18, 24, 42, 0.68);
}

:root[data-theme="light"] .story-quiz-level-tabs button.active {
  border-color: rgba(78, 205, 196, 0.55);
  background: rgba(78, 205, 196, 0.14);
  color: #12182a;
}

@media (max-width: 720px) {
  .story-quiz-section-stats {
    grid-template-columns: 1fr;
  }

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

  .story-quiz-card-grid > .story-quiz-mini-card,
  .story-quiz-card-grid > a.story-quiz-mini-card.sankru-game-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .story-quiz-card-grid > .story-quiz-mini-card .sankru-game-card-media,
  .story-quiz-card-grid > a.story-quiz-mini-card.sankru-game-card > .sankru-game-card-media {
    width: 76px;
    height: 82px;
  }
}
.sankru-game-quiz-summary {
  gap: 10px;
}

.sankru-game-quiz-summary .sankru-game-total-score strong {
  font-size: 1.65rem;
}

.sankru-game-quiz-results ul {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.sankru-game-quiz-results li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.sankru-game-quiz-results small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  font-weight: 800;
}

.sankru-game-quiz-results li strong {
  font-size: 0.95rem;
}

:root[data-theme="light"] .sankru-game-quiz-results small {
  color: rgba(18, 24, 42, 0.62);
}

/* Compact story quiz cards must override the generic 430px game-card layout. */
.story-quiz-card-grid > a.story-quiz-mini-card.sankru-game-card {
  grid-template-columns: 86px minmax(0, 1fr);
  grid-template-rows: 1fr;
  min-height: 112px;
  max-height: none;
}

.story-quiz-card-grid > a.story-quiz-mini-card.sankru-game-card > .sankru-game-card-media {
  width: 86px;
  height: 92px;
  aspect-ratio: auto;
}

.story-quiz-card-grid > a.story-quiz-mini-card.sankru-game-card > .story-quiz-mini-card-body small,
.story-quiz-card-grid > a.story-quiz-mini-card.sankru-game-card > .story-quiz-mini-card-body h2,
.story-quiz-card-grid > a.story-quiz-mini-card.sankru-game-card > .story-quiz-mini-card-body p,
.story-quiz-card-grid > a.story-quiz-mini-card.sankru-game-card > .story-quiz-mini-card-body strong {
  min-width: 0;
}

.story-quiz-game,
.story-quiz-shell,
.story-quiz-form,
.story-quiz-question,
.story-quiz-options,
.story-quiz-options label,
.story-quiz-reading-panel,
.story-quiz-listen-panel,
.story-quiz-dictation-panel,
.story-quiz-dictation-row,
.story-quiz-clean-head {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.story-quiz-question-title,
.story-quiz-options label,
.story-quiz-reading-panel p,
.story-quiz-story-card p,
.story-quiz-dictation-panel p,
.word-match-status {
  overflow-wrap: anywhere;
  word-break: normal;
}

.story-quiz-options label {
  align-items: flex-start;
}

.story-quiz-options label input {
  flex: 0 0 auto;
  margin-top: 0.2rem;
}

@media (max-width: 640px) {
  .story-quiz-game {
    gap: 0.75rem;
    width: 100%;
    overflow-x: hidden;
  }

  .story-quiz-clean-head {
    gap: 0.45rem;
    padding: 0.85rem;
  }

  .story-quiz-clean-head h2 {
    font-size: 1.45rem;
    line-height: 1.05;
  }

  .story-quiz-shell {
    gap: 0.7rem;
    border-radius: 10px;
    padding: 0.72rem;
    overflow: hidden;
  }

  .story-quiz-story-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.65rem;
  }

  .story-quiz-story-card img {
    width: 64px;
    border-radius: 8px;
  }

  .story-quiz-story-card h3 {
    font-size: 1.12rem;
    line-height: 1.05;
  }

  .story-quiz-story-card p,
  .story-quiz-reading-panel p,
  .story-quiz-dictation-panel p,
  .story-quiz-listen-panel p {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .story-quiz-tabs {
    grid-template-columns: 1fr;
    gap: 0.42rem;
  }

  .story-quiz-tabs button {
    width: 100%;
    padding: 0.62rem 0.7rem;
    font-size: 0.88rem;
  }

  .story-quiz-listen-panel,
  .story-quiz-reading-panel,
  .story-quiz-question {
    border-radius: 9px;
    padding: 0.68rem;
  }

  .story-quiz-question {
    margin-inline: 0;
  }

  .story-quiz-question-title {
    max-width: 100%;
    margin-bottom: 0.58rem;
    font-size: 0.94rem;
    line-height: 1.3;
  }

  .story-quiz-options {
    gap: 0.42rem;
    margin-top: 0.55rem;
  }

  .story-quiz-options label {
    gap: 0.48rem;
    padding: 0.58rem 0.62rem;
    font-size: 0.88rem;
    line-height: 1.3;
  }

  .story-quiz-dictation-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .story-quiz-word-speak,
  .story-quiz-dictation-row input,
  .story-quiz-actions .word-match-next,
  #storyQuizSubmit {
    width: 100%;
  }

  .story-quiz-dictation-row input {
    min-width: 0;
    font-size: 0.95rem;
  }

  .story-quiz-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .story-quiz-result-line,
  .story-quiz-result-total {
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .story-quiz-shell {
    padding: 0.58rem;
  }

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

  .story-quiz-story-card img {
    width: 100%;
    max-height: 130px;
  }
}

