:root {
  --page: #f6f1e6;
  --paper-card: #fffaef;
  --ink: #181410;
  --ink-soft: rgba(24, 20, 16, .55);
  --spine: #5a1a14;
  --spine-deep: #3a0f0b;
  --spine-ink: #f6f1e6;
  --gold: #c8a14a;
  --red: #c8412e;
  --green: #1f6b3a;
  --film: #141110;
  --radius: 4px;
}

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

body {
  font-family: "Archivo", system-ui, sans-serif;
  color: var(--ink);
  background: #d9d0be;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ─── Album shell (shared look with ICONED) ─── */
.album {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  background-color: var(--page);
  background-image: radial-gradient(rgba(0,0,0,.04) 1px, transparent 1px);
  background-size: 10px 10px;
}

.spine {
  position: sticky;
  top: 0;
  width: 22px;
  height: 100dvh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  color: var(--spine-ink);
  background: linear-gradient(90deg, var(--spine) 0%, var(--spine-deep) 60%, var(--spine) 100%);
  border-right: 1px solid rgba(0,0,0,.3);
}

.spine-top, .spine-bottom {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: .25em;
}

.spine-rules { display: flex; flex-direction: column; gap: 4px; }
.spine-rules span { width: 10px; height: 1px; background: var(--gold); opacity: .7; }

.album-content {
  flex: 1;
  min-width: 0;
  padding: 18px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ─── Header ─── */
.album-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.wordmark { display: flex; flex-direction: column; gap: 2px; }
.wordmark-title {
  font-family: "Archivo Black", sans-serif;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
}
.wordmark-page, .kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.kicker { color: var(--spine); }

.album-nav { display: flex; gap: 6px; }
.nav-link {
  font: 600 12px "Archivo", sans-serif;
  background: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--ink);
  cursor: pointer;
}

.page-title h1 {
  font-family: "Archivo Black", sans-serif;
  font-size: 22px;
  line-height: 1.1;
  margin: 4px 0 6px;
}
.page-desc { color: var(--ink-soft); font-size: 14px; }

/* ─── Film strip + stage ─── */
.filmstrip {
  position: relative;
  background: var(--film);
  padding: 18px 10px;
  border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.filmstrip::before, .filmstrip::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 8px;
  background: repeating-linear-gradient(90deg, #e9e1cf 0 10px, transparent 10px 20px);
  border-radius: 2px;
  opacity: .85;
}
.filmstrip::before { top: 5px; }
.filmstrip::after { bottom: 5px; }

.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stage video, .stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.stage-msg {
  color: #e9e1cf;
  font-size: 14px;
  text-align: center;
  padding: 20px;
  line-height: 1.5;
}

.reel-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.tab {
  font: 600 14px "JetBrains Mono", monospace;
  padding: 8px 0;
  border: 1px solid var(--ink);
  background: var(--paper-card);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--ink);
}
.tab:disabled { opacity: .3; cursor: default; }
.tab.active { outline: 2px solid var(--gold); outline-offset: 1px; }
.tab.miss { background: var(--red); color: #fff; border-color: var(--red); }
.tab.skip { background: #4a443d; color: #fff; border-color: #4a443d; }
.tab.win { background: var(--green); color: #fff; border-color: var(--green); }

.giphy-credit {
  display: inline-block;
  margin-top: 8px;
  font: 600 11px "Archivo", sans-serif;
  letter-spacing: .04em;
  color: var(--ink);
  text-decoration: none;
  opacity: .8;
}

/* ─── Guessing ─── */
.guess-form { display: flex; flex-direction: column; gap: 8px; }
.guess-input-wrap { position: relative; }
#guessInput {
  width: 100%;
  font: 16px "Archivo", sans-serif;
  padding: 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-card);
  color: var(--ink);
}
.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 4px);
  list-style: none;
  background: var(--paper-card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  max-height: 260px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
}
.suggestions li { padding: 10px 12px; font-size: 15px; cursor: pointer; border-bottom: 1px solid rgba(0,0,0,.08); }
.suggestions li:last-child { border-bottom: 0; }
.suggestions li:hover, .suggestions li.active { background: #efe5cf; }

.guess-buttons { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.btn {
  font: 700 14px "Archivo", sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--page);
  cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 6px 12px; font-size: 12px; margin-top: 10px; background: var(--page); color: var(--ink); }

.guess-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.guess-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--paper-card);
  border: 1px solid rgba(0,0,0,.12);
  font-size: 14px;
}
.guess-list .mark { font-family: "JetBrains Mono", monospace; font-weight: 700; width: 14px; }
.guess-list .miss .mark { color: var(--red); }
.guess-list .skip { color: var(--ink-soft); }
.guess-list .win .mark { color: var(--green); }

/* ─── Result ─── */
.result {
  background: var(--paper-card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result-title { font-family: "Archivo Black", sans-serif; font-size: 24px; line-height: 1.1; }
.result-line { color: var(--ink-soft); }
.share-preview {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  background: var(--page);
  padding: 10px;
  border-radius: var(--radius);
}
.next-in { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--ink-soft); }
.credits { font-size: 11px; color: var(--ink-soft); line-height: 1.5; }
.credits a { color: inherit; }

.foot { margin-top: auto; font-size: 11px; color: var(--ink-soft); line-height: 1.5; }
.foot a { color: inherit; }

/* ─── Modals ─── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(20,16,12,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--page);
  border-radius: 6px;
  padding: 22px 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,.3);
}
.modal-card h2 { font-family: "Archivo Black", sans-serif; font-size: 20px; margin-bottom: 12px; }
.modal-card h3 { font-size: 13px; margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .08em; }
.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 24px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
}
.rules { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.4; }
.fine { margin-top: 12px; font-size: 12px; color: var(--ink-soft); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.stat b { display: block; font-family: "Archivo Black", sans-serif; font-size: 24px; }
.stat span { font-size: 11px; color: var(--ink-soft); }
.dist { display: flex; flex-direction: column; gap: 4px; }
.dist-row { display: flex; align-items: center; gap: 6px; font: 12px "JetBrains Mono", monospace; }
.dist-row .bar { background: #4a443d; color: #fff; padding: 2px 6px; text-align: right; border-radius: 2px; }
.dist-row .bar.today { background: var(--green); }
