/* HitYear styles. Matches design/game-mockup.html (approved 2026-10-23). */
@font-face { font-family: Fraunces; src: url("fonts/Fraunces.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Inter; src: url("fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #2B2B28; --soft: #6B675F; --line: #D9D3C7; --wash: #F4F1EA;
  --sage: #6F8466; --terra: #B5654A; --mustard: #C9A04A; --near-bg: #F6EBD3;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--wash); color: var(--ink); font-family: Inter, Arial, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.app {
  max-width: 440px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: 28px 22px; display: flex; flex-direction: column; gap: 14px;
}
@media (max-width: 370px) { .app { padding-left: 16px; padding-right: 16px; } }
.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; }

/* Header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.logo { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 30px; line-height: 1; }
.logo span { color: var(--terra); }
.tools { display: flex; gap: 6px; }
.icon-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: transparent;
  color: var(--soft); font-size: 13px; font-weight: 600; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn svg { fill: currentColor; }
.icon-btn:hover { border-color: var(--soft); color: var(--ink); }
.text-btn {
  height: 26px; border-radius: 13px; border: 1px solid var(--line); padding: 0 10px;
  color: var(--soft); font-size: 12px; font-weight: 600; line-height: 1; text-decoration: none;
  display: inline-flex; align-items: center;
}
.text-btn:hover, .text-btn[aria-current] { border-color: var(--soft); color: var(--ink); }
.meta { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); line-height: 1.3; min-height: 1.3em; }
.meta .lc { text-transform: none; }
.stripe { display: flex; height: 4px; }
.stripe i { flex: 1; }
.stripe i:nth-child(1) { background: var(--terra); }
.stripe i:nth-child(2) { background: var(--mustard); }
.stripe i:nth-child(3) { background: var(--sage); }

.note { font-size: 13px; line-height: 1.45; color: var(--soft); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }

/* Question and clues */
.q { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 19px; margin-top: 4px; }
.clues { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.clue { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.clue b { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 18px; color: var(--terra); width: 16px; flex: none; }
.clue small { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin-bottom: 3px; }
.clue p { font-size: 14px; line-height: 1.35; }
.clue.locked { background: transparent; border-style: dashed; color: var(--soft); }
.clue.locked p { font-size: 13px; }
.clue.fresh { animation: reveal .35s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Guess chips */
.guesses { list-style: none; display: flex; gap: 8px; }
.g { flex: 1; min-width: 0; border-radius: 10px; padding: 8px 0; text-align: center; font-weight: 600; font-size: 15px; border: 1px solid var(--line); background: #fff; }
.g em { display: block; font-style: normal; font-size: 10px; font-weight: 500; letter-spacing: .1em; color: var(--soft); text-transform: uppercase; }
.g.far { border-color: var(--terra); }
.g.near { background: var(--near-bg); border-color: var(--mustard); }
.g.hit { background: var(--sage); color: #fff; border-color: var(--sage); }
.g.hit em { color: #E9F0E6; }
.g.empty { background: transparent; border-style: dashed; color: var(--line); }

/* Input row */
.input { display: flex; gap: 10px; margin-top: auto; }
.year {
  flex: 1; min-width: 0; width: 100%; background: #fff; border: 1.5px solid var(--ink); border-radius: 12px;
  font-family: Fraunces, Georgia, serif; font-size: 28px; font-weight: 600; line-height: 1.2; text-align: center; padding: 10px;
  appearance: none; -webkit-appearance: none;
}
.year::placeholder { color: var(--soft); opacity: .55; font-weight: 500; }
.year:focus { outline: none; box-shadow: 0 0 0 3px rgba(181, 101, 74, .35); }
.year[aria-invalid="true"] { border-color: var(--terra); }
.btn {
  background: var(--ink); color: #fff; border: 0; border-radius: 12px; padding: 0 22px;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px;
}
.btn:hover { background: #000; }
.btn.wide { flex: 1; width: 100%; padding: 16px; }
a.btn { text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.ghost:hover { background: #fff; }
.input.stack { flex-direction: column; }
.hint { font-size: 12px; color: var(--soft); text-align: center; line-height: 1.5; }
.hint.warn { color: var(--terra); }

/* Finished screen */
.big { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 64px; text-align: center; color: var(--sage); line-height: 1; margin-top: 10px; }
.center { text-align: center; }
.song { font-size: 13px; color: var(--soft); line-height: 1.5; }
.share { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 15px; line-height: 1.6; text-align: center; }
.next { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); text-align: center; }
#end.failed .big { color: var(--ink); margin-top: 0; }
#end.failed #end-title { order: -1; margin-top: 10px; }

/* Decade picker */
.decade-grid { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.decade {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 18px;
  color: var(--ink); text-decoration: none;
}
a.decade:hover { border-color: var(--soft); }
.decade-name { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 30px; line-height: 1; }
.decade-status { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.decade-status.done { color: var(--sage); font-weight: 600; }
.decade.soon { background: transparent; border-style: dashed; color: var(--soft); }
.card-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.back { margin-top: auto; text-align: center; font-size: 13px; padding-top: 6px; }
.back a { color: var(--ink); text-underline-offset: 3px; }

/* Dialogs */
.panel {
  width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto;
  border: 1px solid var(--line); border-radius: 16px; background: var(--wash); color: var(--ink); padding: 0;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .15);
}
.panel::backdrop { background: rgba(43, 43, 40, .45); }
.panel form { padding: 24px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.panel p { font-size: 14px; line-height: 1.5; }
.panel-title { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 22px; }
.panel .btn.wide { margin-top: 6px; }
.panel p.tip { font-size: 12px; }
.examples { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.examples li { display: flex; align-items: center; gap: 12px; font-size: 13px; line-height: 1.4; color: var(--soft); }
.examples .g { flex: none; width: 76px; }
.label { font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stat-grid div { display: flex; flex-direction: column; gap: 4px; }
.stat-grid dd { order: -1; }
.stat-grid dd { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 28px; line-height: 1; }
.stat-grid dt { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); line-height: 1.3; }
.dist { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.dist li { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.dist .n { width: 10px; text-align: right; color: var(--soft); }
.dist .track { flex: 1; }
.dist .bar { display: block; min-width: 26px; background: var(--sage); color: #fff; border-radius: 6px; padding: 3px 8px; text-align: right; }
.dist .bar.zero { background: var(--line); color: var(--ink); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 12px;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
