/* US History page: parchment-and-ink look layered over ../style.css */
body.history {
  --bg: #f3ead6;
  --panel: #fbf7ec;
  --panel-2: #efe4c8;
  --line: #dccba3;
  --text: #2a2118;
  --dim: #6e5f49;
  --accent: #1f3a5f;      /* ink navy */
  --accent-2: #9b2c2c;    /* barn red */
  --bad: #b3261e;
  --good: #2f6b3a;
  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  color-scheme: light;
  background: var(--bg);
  background-image:
    radial-gradient(1000px 500px at 85% -5%, #fff8e6 0%, transparent 60%),
    radial-gradient(800px 600px at -10% 100%, #eadbb8 0%, transparent 60%);
  background-attachment: fixed;
}
.history h1, .history h2 { font-family: var(--serif); letter-spacing: 0; }
.history h1 { font-weight: 700; }
.history h2 { font-size: 20px; }
.history .top { background: color-mix(in srgb, var(--bg) 88%, transparent); }
.history .brand { font-family: var(--serif); font-size: 18px; color: var(--text); }
.brand-sub { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--accent-2); padding: 3px 7px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; }
.history .card { box-shadow: 0 1px 0 rgba(80, 60, 20, .06), 0 10px 30px -18px rgba(80, 60, 20, .35); }
.history .btn { background: var(--accent); color: #fff; }
.history .btn.ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.history .btn.ghost:disabled { color: var(--dim); }
.history .tries i.good { background: var(--good); }
.history .guesses li.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.history .combo input { background: #fff; }
.history .combo input:focus { border-color: var(--accent); }
.history dialog::backdrop { background: rgba(42, 33, 24, .45); }
.history .close { background: var(--panel-2); color: var(--text); }
.history .toast { background: var(--accent); color: #fff; }
.history .dist i.hi { background: var(--accent); color: #fff; }
.history .reveal { background: var(--panel-2); }
.history .reveal b { font-family: var(--serif); font-size: 17px; }

.puzzles.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }

.clue { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.45; }
.tag { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px; vertical-align: 2px; margin-right: 4px; }

/* scrambled letter pool */
.tiles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 4px 0; }
.tile {
  width: 34px; height: 38px; display: grid; place-items: center;
  font: 800 17px var(--mono); color: var(--panel);
  background: var(--accent); border-radius: 6px;
  box-shadow: 0 3px 0 #13263f;
}

/* answer slots */
.slots { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; }
.word { display: flex; gap: 4px; }
.slot {
  width: 24px; height: 30px; display: grid; place-items: center;
  border-bottom: 2px solid var(--dim);
  font: 800 16px var(--mono); color: var(--text);
}
.slot.on { border-bottom-color: var(--accent); }
.slots.big .slot { width: 26px; height: 36px; font-size: 19px; }

/* letter keyboard */
.keyboard { display: grid; gap: 6px; }
.keyboard div { display: flex; gap: 5px; justify-content: center; }
.keyboard button {
  flex: 1; max-width: 38px; height: 44px; padding: 0;
  font: 700 14px var(--mono); color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.keyboard button:hover:not(:disabled) { border-color: var(--accent); }
.keyboard button.hit { background: var(--good); color: #fff; border-color: var(--good); }
.keyboard button.miss { background: transparent; color: color-mix(in srgb, var(--dim) 55%, transparent); text-decoration: line-through; }
.keyboard button:disabled { cursor: default; }

/* quote */
.quote {
  margin: 0; padding: 16px 18px; border-left: 4px solid var(--accent-2);
  background: var(--panel-2); border-radius: 0 8px 8px 0;
  font: italic 19px/1.5 var(--serif);
}
.quote .blank { font: 700 17px var(--mono); font-style: normal; color: var(--accent); letter-spacing: .08em; white-space: nowrap; }
.quote mark { background: none; font-style: normal; font-weight: 700; }
.quote mark.good { color: var(--good); }
.quote mark.bad { color: var(--bad); }
.quote footer { margin-top: 10px; font: 13px var(--sans); font-style: normal; color: var(--dim); }

@media (max-width: 560px) {
  .history .brand { font-size: 16px; }
  .wide-only, .brand-sub { display: none; }
  .history nav { flex-wrap: nowrap; }
  .keyboard div { gap: 4px; }
  .keyboard button { height: 42px; font-size: 13px; }
  .tile { width: 30px; height: 34px; font-size: 15px; }
  .slot { width: 20px; }
}
