/* Past Questions: scoped styles, preserving the existing daily challenge. */
#past-questions[hidden], #archive-dialog [hidden] { display: none !important; }
#game-screen.archive-active .app-intro,
#game-screen.archive-active .stats-section,
#game-screen.archive-active .app-grid,
#game-screen.archive-active #leaderboard { display: none; }
.archive-heading { margin: 28px 0; }
.archive-heading h1 { color: var(--navy); font-size: clamp(30px,4vw,44px); line-height: 1.15; margin: 10px 0 12px; letter-spacing: -.035em; }
.archive-heading > p:last-child { color: var(--muted); line-height: 1.6; }
.archive-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.archive-toolbar label { font-weight: 700; color: var(--navy); }
.archive-toolbar input { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--navy); font: inherit; }
.archive-toolbar > span { margin-left: auto; color: var(--muted); font-size: 14px; }
#archive-clear { border: 0; background: transparent; text-decoration: underline; color: #087f83; padding: 10px; font: inherit; cursor: pointer; }
#archive-message { color: var(--muted); font-size: 14px; margin: 14px 0; min-height: 22px; }
.archive-list { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.archive-list h2 { padding: 22px 24px; font-size: 22px; color: var(--navy); }
.archive-row { width: 100%; display: grid; grid-template-columns: 125px minmax(0,1fr) 145px 15px; gap: 20px; align-items: center; padding: 24px; text-align: left; border: 0; border-top: 1px solid var(--line); background: white; color: var(--navy); font: inherit; cursor: pointer; }
.archive-row:hover { background: #f4faf9; }
.archive-row time { font-size: 14px; font-weight: 700; }
.archive-question { line-height: 1.5; overflow-wrap: anywhere; }
.archive-badge { justify-self: start; padding: 7px 12px; border-radius: 30px; font-size: 12px; white-space: nowrap; }
.archive-badge.correct { background: #e5f7eb; color: #14623d; }
.archive-badge.incorrect { background: #fff0f2; color: #a72f43; }
.archive-badge.neutral, .archive-badge.unknown { background: #edf0f4; color: #526174; }
.archive-footer { text-align: center; padding: 24px 0; }
.archive-footer button, #archive-dialog button:not(.archive-option) { border: 1px solid #087f83; padding: 11px 18px; border-radius: 9px; background: white; color: #087f83; cursor: pointer; font: inherit; font-weight: 600; }
.archive-footer p, .archive-practice-note { color: var(--muted); font-size: 13px; margin-top: 16px; line-height: 1.6; }
#archive-dialog { box-sizing: border-box; margin: auto; width: min(680px,calc(100% - 24px)); max-height: 90dvh; overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; padding: 28px; background: white; color: var(--navy); }
#archive-dialog::backdrop { background: rgb(16 42 67 / 50%); }
#archive-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#archive-detail-date { font-size: 14px; color: var(--muted); margin-top: 20px; }
#archive-title { font-size: clamp(21px,3vw,28px); line-height: 1.4; margin: 10px 0; overflow-wrap: anywhere; }
#archive-original { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 20px; overflow-wrap: anywhere; }
#archive-options { display: grid; gap: 10px; }
.archive-option { width: 100%; text-align: left; font: inherit; line-height: 1.5; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--navy); cursor: pointer; overflow-wrap: anywhere; }
.archive-option.selected { border-color: #087f83; background: #edf9f7; }
.archive-option.correct { border-color: #259b60; background: #e5f7eb; }
.archive-option.incorrect { border-color: #bd4b5c; background: #fff0f2; }
.archive-detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
#archive-check { background: #087f83 !important; color: white !important; }
#archive-dialog button:disabled { cursor: default; }
#archive-check:disabled, #archive-more:disabled { opacity: .5; }
#archive-feedback { line-height: 1.6; overflow-wrap: anywhere; }
#archive-feedback p { margin-top: 10px; white-space: pre-line; }
#past-questions button:focus-visible, #past-questions input:focus-visible, #archive-dialog button:focus-visible { outline: 3px solid #48aaa8; outline-offset: -3px; }
@media (max-width: 600px) {
  .archive-toolbar { gap: 10px; padding: 16px; }
  .archive-toolbar > span { width: 100%; margin-left: 0; }
  .archive-row { grid-template-columns: minmax(0,1fr) auto 12px; gap: 12px; padding: 18px 16px; }
  .archive-row time { grid-column: 1; }
  .archive-question { grid-row: 2; grid-column: 1 / -1; }
  .archive-badge { grid-column: 2; grid-row: 1; }
  .archive-row > span:last-child { grid-column: 3; grid-row: 1; }
  #archive-dialog { padding: 20px; }
}
