:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #17211d;
  --muted: #66716c;
  --paper: #fffdfa;
  --green: #174f3b;
  --green-soft: #e7f1eb;
  --line: #dfe5e1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, #e5f0e8 0, transparent 32rem),
    #f3f1eb;
}

button, select { font: inherit; }
button { cursor: pointer; }

.app { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 56px; }

header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
h1 { margin: 2px 0 0; font-family: Georgia, serif; font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 500; letter-spacing: -.04em; }
.eyebrow, .card-topline, .field > span { margin: 0; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }

.controls { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; margin-bottom: 16px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: .8rem; font-weight: 700; }
select, .secondary { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(255,255,255,.74); padding: 0 12px; }
.counter { min-height: 42px; display: grid; place-items: center; color: var(--muted); font-size: .85rem; padding: 0 4px; }

.card { min-height: 390px; border: 1px solid rgba(23,79,59,.13); border-radius: 22px; background: var(--paper); box-shadow: 0 20px 55px rgba(34,51,44,.09); padding: clamp(24px, 6vw, 46px); }
.card-topline { display: flex; justify-content: space-between; }
.badge { color: var(--muted); background: #f0f2ef; border-radius: 999px; padding: 6px 9px; letter-spacing: .07em; }
.badge.forgot { color: #9c322c; background: #fbe9e6; }
.badge.almost { color: #815b08; background: #fff1c9; }
.badge.knew { color: var(--green); background: var(--green-soft); }
.prompt { display: flex; align-items: center; min-height: 260px; font-family: Georgia, serif; font-size: clamp(1.75rem, 5vw, 2.8rem); line-height: 1.2; }
.answer .divider { height: 1px; background: var(--line); margin: 8px 0 30px; }
.field { margin-top: 22px; }
.field p { margin: 7px 0 0; font-size: 1.08rem; line-height: 1.55; }
.field:first-of-type p { font-family: Georgia, serif; font-size: 1.7rem; }
.note { color: var(--muted); }

.reveal { width: 100%; min-height: 54px; margin-top: 16px; border: 0; border-radius: 13px; color: white; background: var(--green); font-weight: 800; }
.ratings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.ratings button { min-height: 52px; border-radius: 13px; font-weight: 800; }
.forgot { border: 1px solid #e9b7b2; color: #8d2b25; background: #fff2f0; }
.almost { border: 1px solid #ecd288; color: #765306; background: #fff8df; }
.knew { border: 1px solid #a9ceb9; color: #174f3b; background: #edf8f1; }
.navigation { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.message { min-height: 24px; margin: 14px 0 0; color: var(--muted); text-align: center; font-size: .85rem; }
.empty { text-align: center; border: 1px dashed #b8c2bc; border-radius: 20px; padding: 70px 20px; background: rgba(255,255,255,.5); }
.empty h2 { font-family: Georgia, serif; font-size: 2rem; margin: 0 0 8px; }
.empty p { color: var(--muted); }

@media (max-width: 600px) {
  .app { width: min(100% - 20px, 760px); padding-top: 22px; }
  header { align-items: flex-start; }
  header .secondary { white-space: nowrap; }
  .controls { grid-template-columns: 1fr 1fr; }
  .counter { grid-column: 1 / -1; min-height: 24px; }
  .card { min-height: 330px; }
  .prompt { min-height: 210px; }
  .navigation { grid-template-columns: 1fr 1fr; }
  #shuffle { grid-column: 1 / -1; grid-row: 2; }
}
