@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700;800&family=Noto+Serif+SC:wght@700;900&display=swap');

:root {
  --paper: #f4efe4;
  --paper-deep: #e8dfcd;
  --ink: #1e2a2b;
  --muted: #68706c;
  --accent: #d45136;
  --accent-dark: #a93625;
  --green: #1f7058;
  --line: #cfc5b2;
  --card: #fffdf7;
  --shadow: 0 18px 50px rgba(62, 49, 31, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 5%, rgba(255,255,255,.85), transparent 24rem),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(84,70,45,.025) 28px),
    var(--paper);
  font-family: "Noto Sans SC", sans-serif;
}
button, select { font: inherit; }
button { color: inherit; }
.shell { width: min(960px, calc(100% - 32px)); margin: auto; padding: 30px 0 42px; }
.masthead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: grid; place-items: center; width: 52px; height: 52px;
  color: var(--paper); background: var(--ink); border-radius: 50%;
  font: 900 20px/1 Georgia, serif; letter-spacing: -2px;
}
h1 { margin: 0; font: 900 clamp(24px, 4vw, 34px)/1.15 "Noto Serif SC", serif; letter-spacing: .05em; }
.brand p { margin: 5px 0 0; color: var(--muted); font-size: 13px; letter-spacing: .12em; }
.round-button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 9px 14px; cursor: pointer; font-size: 13px; }
.round-button:hover { background: rgba(255,255,255,.5); }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.mode-tab { position: relative; border: 0; background: transparent; padding: 16px; cursor: pointer; font-size: 17px; font-weight: 700; color: var(--muted); }
.mode-tab span { margin-left: 6px; font-size: 12px; font-weight: 600; opacity: .65; }
.mode-tab.active { color: var(--ink); }
.mode-tab.active::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -2px; height: 4px; background: var(--accent); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0 14px; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter { border: 1px solid var(--line); background: rgba(255,255,255,.35); border-radius: 7px; padding: 8px 13px; cursor: pointer; color: var(--muted); font-size: 13px; }
.filter.active { border-color: var(--ink); background: var(--ink); color: white; }
.sound-select-wrap { display: flex; align-items: center; gap: 7px; margin-left: 5px; color: var(--muted); font-size: 13px; }
.sound-select-wrap select { border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 7px 26px 7px 10px; }
.progress-label { margin: 0; white-space: nowrap; color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }
.quiz-card { min-height: 480px; padding: 25px 34px 30px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card-heading { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; letter-spacing: .08em; }
.category-tag { padding: 5px 9px; border: 1px solid var(--line); border-radius: 3px; font-size: 12px; }
.question-area { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.phoneme-symbol { margin: 8px 0 23px; font: 700 clamp(68px, 13vw, 116px)/1 Georgia, "Times New Roman", serif; letter-spacing: .02em; }
.word-prompt { text-align: center; margin: 12px 0 20px; }
.word-title { margin: 0; font: 700 clamp(48px, 9vw, 82px)/1.1 Georgia, serif; }
.word-ipa { margin: 13px 0 0; color: var(--accent-dark); font: 700 clamp(27px, 5vw, 40px)/1.25 Georgia, "Times New Roman", serif; }
.word-meaning { display: inline-block; margin: 15px 0 0; padding: 6px 16px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 17px; font-weight: 700; }
.word-prompt + .listen-button { margin-top: 2px; }
.listen-button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--accent-dark); cursor: pointer; padding: 10px 14px; font-weight: 700; }
.listen-button:hover { background: #f7e8df; }
.listen-button.playing .speaker { animation: pulse .65s infinite alternate; }
.speaker { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid currentColor; border-radius: 50%; font-size: 10px; padding-left: 2px; }
@keyframes pulse { to { transform: scale(1.12); } }
.answer-panel { position: relative; min-height: 115px; display: grid; place-items: center; border-top: 1px dashed var(--line); padding-top: 20px; }
.answer-blur { text-align: center; transition: filter .2s, opacity .2s; }
.answer-panel:not(.revealed) .answer-blur { filter: blur(8px); opacity: .3; user-select: none; }
.answer-kicker { margin: 0 0 4px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.answer-main { margin: 0; font: 700 23px/1.5 "Noto Serif SC", serif; }
.answer-example { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.reveal-button { position: absolute; border: 1px solid var(--ink); background: var(--card); padding: 9px 18px; cursor: pointer; font-weight: 700; }
.answer-panel.revealed .reveal-button { display: none; }
.actions { display: grid; grid-template-columns: 1fr 1.55fr; gap: 12px; margin-top: 14px; }
.action-button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 66px; border: 0; cursor: pointer; transition: transform .12s, filter .12s; }
.action-button:hover { filter: brightness(.96); transform: translateY(-1px); }
.action-button span { font-size: 18px; font-weight: 800; }
.action-button small { opacity: .72; }
.unsure { background: var(--paper-deep); }
.correct { background: var(--green); color: white; }
.session-bar { display: grid; grid-template-columns: repeat(3, 1fr) auto; align-items: center; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.session-bar div { display: flex; align-items: baseline; gap: 7px; }
.session-bar strong { font: 700 24px/1 Georgia, serif; }
.session-bar span { color: var(--muted); font-size: 12px; }
.session-bar button { border: 0; border-bottom: 1px solid currentColor; background: transparent; cursor: pointer; color: var(--muted); padding: 4px 0; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 10px 18px; opacity: 0; pointer-events: none; transition: .2s; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 660px) {
  .shell { width: min(100% - 20px, 960px); padding-top: 16px; }
  .masthead { margin-bottom: 15px; }
  .brand-mark { width: 44px; height: 44px; }
  .brand p { display: none; }
  .toolbar { align-items: flex-end; padding-top: 14px; }
  .progress-label { display: none; }
  .quiz-card { min-height: 425px; padding: 20px 18px 24px; }
  .question-area { min-height: 225px; }
  .phoneme-symbol { font-size: 78px; }
  .word-title { font-size: 51px; }
  .word-ipa { font-size: 29px; }
  .word-meaning { font-size: 15px; }
  .actions { grid-template-columns: 1fr 1.3fr; }
  .action-button { min-height: 62px; flex-direction: column; gap: 1px; }
  .action-button small { font-size: 10px; }
  .session-bar { grid-template-columns: repeat(3, 1fr); text-align: center; }
  .session-bar div { justify-content: center; flex-direction: column; gap: 3px; }
  .session-bar button { grid-column: 1 / -1; margin-top: 18px; justify-self: center; }
  .sound-select-wrap { width: 100%; margin: 3px 0 0; }
}
