.book-study-menu,
.weak-review-screen {
  color: #fff3df;
  border: 1px solid #d5bf8645;
  box-sizing: border-box;
  font-family: system-ui, sans-serif;
}
.book-study-menu::backdrop {
  background: #090e19b8;
}
.weak-review-screen::backdrop {
  background: #0f172a;
}
.book-study-menu {
  width: min(280px, 90vw);
  border-radius: 20px;
  padding: 20px;
  background: #111b2bf5;
}
.book-study-menu h2 {
  font-size: 16px;
  margin: 0 0 16px;
}
.book-study-menu button {
  width: 100%;
  min-height: 48px;
  margin: 4px 0;
  border-radius: 12px;
  border: 1px solid #d5bf8650;
  background: #142137c9;
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.book-study-menu button:active {
  background: #354459;
}
.weak-review-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  border: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(#0b132777, #0b132777),
    var(--app-background-image, url("assets/background-night.webp"))
      var(--app-background-position, center) / cover;
}
.weak-review-screen[open] {
  display: flex;
  flex-direction: column;
}
.weak-review-screen header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 640px);
  margin: 0 auto;
  gap: 12px;
}
.weak-review-screen h2 {
  font-size: 16px;
  margin: 0;
  letter-spacing: 0.04em;
}
.weak-review-screen button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.12s ease-out,
    background-color 0.12s ease-out;
}
.weak-review-screen button:active:not(:disabled) {
  transform: scale(0.97);
}
.review-content {
  width: min(100%, 640px);
  margin: 16px auto 0;
}
.weak-review-screen[data-state="playing"] {
  overflow: hidden;
}
.weak-review-screen[data-state="playing"] .review-content {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 4px minmax(90px, 18dvh) minmax(0, 1fr) 78px;
  gap: 8px;
  margin-top: 12px;
}
.weak-review-screen header,
.review-progress {
  text-shadow: 0 1px 3px #000c;
}
.review-progress {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #eee6d5;
  font-variant-numeric: tabular-nums;
}
.review-content progress {
  display: block;
  width: 100%;
  height: 4px;
  margin: 0;
  border: 0;
  accent-color: #d5bf86;
}
.review-content progress::-webkit-progress-bar {
  background: #ffffff24;
  border-radius: 4px;
}
.review-content progress::-webkit-progress-value {
  background: #d5bf86;
  border-radius: 4px;
}
.review-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 12px;
  border: 1px solid #d5bf8640;
  border-radius: 18px;
  background: #142137c9;
  text-align: center;
}
.review-question-label {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #d4c9b4;
}
.review-prompt {
  min-height: 0;
  max-width: 100%;
  font-size: clamp(24px, 7vw, 38px);
  line-height: 1.3;
  font-weight: 750;
  overflow-wrap: anywhere;
  margin: 6px 0 0;
  overflow: auto;
}
.review-choices {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(var(--review-answer-rows, 3), minmax(0, 1fr)) 44px;
  gap: 7px;
}
.weak-review-screen .review-choices button {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  border: 1px solid #d5bf865c;
  background: #142137d9;
  border-radius: 14px;
  padding: 9px 6px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-align: center;
}
.review-choices .review-none {
  grid-column: 1/-1;
}
.review-choices button:active:not(:disabled),
.review-choices button.is-selected {
  box-shadow: inset 0 0 0 1px #f5f9ff;
}
.review-choices button.is-correct {
  border-color: #82f0c7;
  background: #185044;
  color: #effff8;
}
.review-choices button.is-wrong {
  border-color: #ff9b9b;
  background: #66323a;
}
.review-choices button:disabled {
  opacity: 1;
  cursor: default;
}
.review-feedback {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 0;
  font-size: 14px;
  line-height: 1.45;
}
.review-response {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}
.review-feedback p {
  margin: 0;
  font-weight: 650;
}
.review-feedback small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #e1d4c2;
}
.review-primary,
.review-subtle {
  box-sizing: border-box;
  border-radius: 12px;
  padding: 11px 18px;
  min-height: 44px;
  border: 1px solid #d5bf8666;
  background: #142137d9;
}
.review-primary {
  display: block;
  width: 100%;
  margin: 12px 0;
  font-weight: 650 !important;
}
.review-subtle {
  background: #1421379c;
}
.review-feedback .review-primary {
  width: auto;
  min-width: 90px;
  margin: 0;
  border-color: #e5cf91;
  background: #d5bf86;
  color: #142137;
}
.review-description,
.review-save-state {
  font-size: 13px;
  color: #e1d4c2;
  line-height: 1.7;
}
.review-result {
  font-size: 36px;
  font-weight: 750;
  margin: 22px 0;
}
.weak-review-screen[data-state="result"] .review-content,
.weak-review-screen[data-state="message"] .review-content {
  align-self: center;
  margin: auto;
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid #d5bf8645;
  border-radius: 20px;
  background: #142137e8;
}
.weak-review-screen button:focus-visible,
.book-study-menu button:focus-visible {
  outline: 2px solid #ffdf8e;
  outline-offset: -4px;
}
@media (max-height: 650px) {
  .weak-review-screen {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .weak-review-screen[data-state="playing"] .review-content {
    grid-template-rows: auto 4px minmax(76px, 16dvh) minmax(0, 1fr) 70px;
    gap: 6px;
    margin-top: 8px;
  }
  .review-question {
    padding: 8px;
    border-radius: 14px;
  }
  .review-prompt {
    font-size: 26px;
    margin-top: 4px;
  }
  .review-choices {
    gap: 5px;
  }
  .weak-review-screen .review-choices button {
    padding: 6px 4px;
    font-size: 15px;
    border-radius: 12px;
  }
  .review-feedback {
    font-size: 13px;
    gap: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .weak-review-screen button {
    transition: none;
  }
}
.weak-review-screen[data-state="result"] .review-content {
  padding: 20px;
}
.weak-review-screen[data-state="result"] .review-content h3 {
  font-size: 18px;
  line-height: 1.4;
  margin: 0 0 12px;
}
.weak-review-screen[data-state="result"] .review-content p {
  margin: 8px 0;
}
.weak-review-screen[data-state="result"] .review-content .review-result {
  margin: 14px 0;
}
.weak-review-screen[data-state="result"] .review-description {
  font-size: 12px;
  line-height: 1.5;
}
.weak-review-screen[data-state="result"] .review-save-state {
  font-size: 11px;
  line-height: 1.5;
}
.weak-review-screen[data-state="result"] .review-primary,
.weak-review-screen[data-state="result"] .review-content > .review-subtle {
  width: 100%;
  margin: 8px 0 0;
}
