/* Shellacked — gilt lettering on shellac black.
   Palette: shellac #191310, groove #221a14, gilt #c8a256,
            cream #ece2cf, muted #9c8d78, plum-pink #d78ea0 */

:root {
  --shellac: #191310;
  --groove: #221a14;
  --gilt: #c8a256;
  --cream: #ece2cf;
  --muted: #9c8d78;
  --want: #d78ea0;
  --want-line: #8d4356;
  --ok: #8fae84;
  --bad: #c05f52;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--shellac);
  color: var(--cream);
  font-family: var(--sans);
  min-height: 100dvh;
}

/* ---------------- masthead ---------------- */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px clamp(16px, 4vw, 32px) 10px;
  border-bottom: 1px solid rgba(200, 162, 86, 0.25);
}

.wordmark {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gilt);
  text-decoration: none;
}

/* flex so the logout form sits on the line with the links rather than
   breaking below them as a block would */
.masthead nav { display: flex; align-items: baseline; }

.masthead nav a,
.masthead nav button {
  color: var(--muted);
  text-decoration: none;
  font: 13px/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: 18px;
}
.masthead nav a.here { color: var(--cream); border-bottom: 1px solid var(--gilt); }
.masthead nav button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* ---------------- login ---------------- */

.login {
  max-width: 22rem;
  margin: 14vh auto 0;
  padding: 0 16px;
  text-align: center;
}
.login h1 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--gilt);
}
.login .lede { color: var(--muted); font-size: 14px; margin-top: 10px; }

.login-row { display: flex; gap: 8px; margin-top: 22px; }
.login-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #574a3b;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--cream);
  /* 16px or iOS zooms the whole page in when the field takes focus */
  font: 16px var(--sans);
}
.login-row button {
  min-height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  background: var(--gilt);
  color: #1a130c;
  font: 700 15px/1 var(--sans);
  cursor: pointer;
}
.login-error { color: var(--bad); font-size: 14px; margin-top: 16px; }

/* ---------------- quiz layout ---------------- */

.quiz {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 54px);
}

.hud {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  min-height: 1.2em;
  margin-bottom: 10px;
}
.hud b { color: var(--gilt); font-weight: 600; }

/* ---------------- the label photo ---------------- */

.label-shot {
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.label-shot img {
  max-width: 100%;
  /* as large as the viewport allows while keeping the buttons on screen */
  max-height: min(66dvh, 620px);
  border-radius: 6px;
  object-fit: contain;
  background: #000;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.55),
              0 0 0 1px rgba(200, 162, 86, 0.18);
}

.label-shot.drop-in { animation: dropin 0.35s ease-out; }
@keyframes dropin {
  from { transform: scale(0.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.prompt {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  margin: 14px 0 6px;
  min-height: 1.4em;
}

/* ---------------- answers ---------------- */

.answers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 14px 0 max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--shellac) 35%);
}

.answers button {
  min-height: 62px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  font: 600 15px/1.25 var(--sans);
  cursor: pointer;
  padding: 6px;
  transition: transform 0.08s ease;
}
.answers button:active { transform: scale(0.97); }
.answers button:disabled { opacity: 0.35; cursor: default; }
.answers button.own     { color: var(--gilt);  border: 1px solid var(--gilt); }
.answers button.not-own { color: var(--muted); border: 1px solid #574a3b; }

/* ---------------- reveal ---------------- */

.reveal {
  text-align: center;
  padding: 14px 4px 4px;
}

.verdict {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.04em;
}
.verdict.correct { color: var(--ok); }
.verdict.almost  { color: var(--gilt); }
.verdict.wrong   { color: var(--bad); }

.verdict-note {
  color: var(--cream);
  font-size: 15px;
  margin: 6px auto 0;
  max-width: 44ch;
}
.verdict-note:empty { display: none; }

.meta { margin-top: 12px; }
.meta-artist {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  margin-top: 2px;
}
.meta-title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(200, 162, 86, 0.65);
}
.meta-title a:hover { border-bottom-style: solid; }
.meta-issue { font-size: 13px; color: var(--muted); margin-top: 4px; }

.thumbs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.thumbs img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid rgba(200, 162, 86, 0.35);
  opacity: 0.75;
}
.thumbs img.current { opacity: 1; border-color: var(--gilt); }

/* Occupies the same sticky bottom bar as .answers, so the thumb never
   travels: answer, read the reveal, press Next in the same spot. */
.reveal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 10px 0 max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--shellac) 35%);
}
.reveal-actions[hidden] { display: none; }

button.next {
  width: 100%;
  min-height: 62px;
  background: var(--gilt);
  color: #1a130c;
  border: none;
  border-radius: 10px;
  font: 700 15px/1 var(--sans);
  cursor: pointer;
}

button.flag {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 14px;
}

/* ---------------- empty state ---------------- */

.empty { text-align: center; padding: 40px 12px; }
.empty h2 { font-family: var(--serif); color: var(--gilt); margin-bottom: 10px; }
.empty pre {
  display: inline-block;
  text-align: left;
  background: var(--groove);
  padding: 12px 18px;
  border-radius: 8px;
  margin: 12px 0;
  color: var(--cream);
}

/* ---------------- stats ---------------- */

.stats {
  max-width: 640px;
  margin: 0 auto;
  padding: 22px 16px 48px;
}
.stats h1 {
  font-family: var(--serif);
  font-size: 26px;
  margin-bottom: 18px;
}
.stats h2 {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--gilt);
  margin: 26px 0 8px;
}
.stats .hint { font-size: 12px; color: var(--muted); font-family: var(--sans); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.stat {
  background: var(--groove);
  border: 1px solid rgba(200, 162, 86, 0.2);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}
.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  color: var(--gilt);
}
.stat-num.up   { color: var(--ok); }
.stat-num.down { color: var(--bad); }
.stat-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.stats table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.stats th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 8px;
}
.stats td {
  padding: 7px 8px;
  border-top: 1px solid rgba(236, 226, 207, 0.09);
}

/* ---------------- a11y ---------------- */

:focus-visible { outline: 2px solid var(--gilt); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .label-shot.drop-in { animation: none; }
}
