main {
  width: min(96vw, 920px);
  margin: 1.1rem auto 2rem;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 1rem + 1.2vw, 2rem);
}

h2 {
  margin: 0;
  font-size: clamp(1.4rem, 1.2rem + 1.4vw, 2.2rem);
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.55rem 0.45rem;
  text-align: center;
  background: linear-gradient(180deg, #fffefb 0%, #f9f5ed 100%);
}

.stat .k {
  color: var(--muted);
  font-size: 0.72rem;
  display: block;
  letter-spacing: 0.03em;
}

.stat .v {
  font-weight: 800;
  font-size: 1.08rem;
}

.strikes {
  display: inline-flex;
  gap: 0.2rem;
  margin-right: 0.25rem;
}

.strike-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 1px solid #c8ba9f;
  color: #7f7464;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3ece0;
}

.strike-dot.is-on {
  border-color: #8f2d2d;
  background: #c84f4f;
  color: #fff5f5;
}

.progress-track {
  margin-top: 0.5rem;
  height: 0.8rem;
  border-radius: 999px;
  background: #efe7d8;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2f674a 0%, #d7a949 100%);
  transition: width 140ms ease;
}

.play-area {
  position: relative;
  text-align: center;
  transition: background-color 160ms ease;
  overflow: hidden;
}

.actions-quiz {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

button {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.8rem;
  min-height: 2.85rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

#bible-btn {
  border-color: #8bb5de;
  background: linear-gradient(180deg, #eef7ff 0%, #d8e9fb 100%);
  color: #1e476d;
}

#not-btn {
  border-color: #c8a071;
  background: linear-gradient(180deg, #fff2e4 0%, #f2dfc7 100%);
  color: #5c3c18;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.actions button {
  white-space: nowrap;
  border: 1px solid #ccbca2;
  border-radius: 10px;
  padding: 0.62rem 0.8rem;
  min-height: 2.85rem;
  font-weight: 700;
  background: linear-gradient(180deg, #fff7ea 0%, #f1e6d2 100%);
  color: #47351f;
  box-shadow: 0 0.2rem 0.45rem rgba(53, 37, 20, 0.08);
}

.actions .start-action {
  margin-left: 0;
  order: -1;
}

.feedback {
  min-height: 1.35rem;
  margin: 0.75rem 0 0;
  font-weight: 700;
}

.feedback.good {
  color: var(--accent);
}

.feedback.bad {
  color: #b13f3f;
}

.miss-x {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(5rem, 22vw, 10rem);
  font-weight: 900;
  color: rgba(196, 37, 37, 0.96);
  text-shadow: 0 0 1.5rem rgba(128, 14, 14, 0.45);
  opacity: 0;
  pointer-events: none;
}

.miss-x.show {
  animation: miss-x-burst 420ms ease-out;
}

.play-area.flash-good {
  animation: flash-good 240ms ease;
}

.play-area.flash-bad {
  animation: flash-bad 240ms ease;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(26, 21, 14, 0.68);
  display: grid;
  place-items: center;
  padding: 1rem;
}

[hidden] {
  display: none !important;
}

.settings-card {
  width: min(92vw, 520px);
  max-height: min(86vh, 700px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  box-shadow: var(--shadow-deep);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-close {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f0e4;
  color: #47351f;
  font: inherit;
  font-weight: 800;
  width: 1.9rem;
  height: 1.9rem;
}

.settings-grid {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.6rem;
}

.setting {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  color: #4f4538;
}

.setting input[type="range"],
.setting select {
  width: 100%;
}

.settings-subpanel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  background: linear-gradient(180deg, #fffdf7 0%, #f8f3e8 100%);
}

.settings-subpanel h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: #5f5446;
}

#daily-status,
#daily-score,
#daily-best,
#daily-streak {
  margin: 0 0 0.35rem;
}

#review-empty {
  margin: 0 0 0.4rem;
}

.missed-list {
  margin: 0;
  padding-left: 1.2rem;
}

.missed-list li {
  margin-bottom: 0.25rem;
}

.summary-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(26, 21, 14, 0.62);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.summary-card {
  width: min(92vw, 460px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-deep);
}

.summary-card h2 {
  margin: 0 0 0.45rem;
}

.summary-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.summary-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.summary-actions button {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-weight: 700;
  background: #f6f0e4;
  color: #47351f;
}

#summary-play-again-btn {
  background: var(--start-bg);
  color: #f8fffb;
  border-color: var(--start-border);
}

@keyframes flash-good {
  0% { background-color: rgba(64, 158, 97, 0.22); }
  100% { background-color: transparent; }
}

@keyframes flash-bad {
  0% { background-color: rgba(191, 72, 72, 0.2); }
  100% { background-color: transparent; }
}

@keyframes miss-x-burst {
  0% { opacity: 0; transform: scale(0.65); }
  22% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(1); }
}

@media (max-width: 760px) {
  main {
    width: 100%;
    padding: 0 0.45rem 1rem;
  }

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

  .summary-actions {
    flex-direction: column;
  }
}
