:root {
  color-scheme: dark;
  --ink: #f5efe3;
  --muted: #b9ad99;
  --paper: #171411;
  --panel: #211c17;
  --panel-2: #2a231d;
  --line: #42372d;
  --gold: #e5ad52;
  --ember: #d86d45;
  --shadow: 0 18px 55px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 78% -10%, rgba(216, 109, 69, .16), transparent 35rem),
    linear-gradient(135deg, rgba(229, 173, 82, .035) 25%, transparent 25%) 0 0 / 28px 28px,
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a { color: var(--gold); }

.masthead {
  position: relative;
  min-height: 220px;
  padding: 48px clamp(22px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 24px;
  text-align: center;
  background: linear-gradient(110deg, rgba(12, 10, 8, .95), rgba(39, 28, 20, .7));
}
.masthead > div { width: min(100%, 1100px); }

.eyebrow, .lede { margin: 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: .75rem; }
h1 { max-width: 1000px; margin: 8px 0 10px; font: 700 clamp(3.2rem, 8.5vw, 7rem)/.88 Georgia, serif; color: var(--gold); }
.source-link { text-decoration: none; white-space: nowrap; }
.archive-links { position: absolute; right: clamp(22px, 5vw, 72px); bottom: 48px; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }

.shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  max-width: 1500px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 28px 20px 60px;
  border-right: 1px solid var(--line);
  background: rgba(23, 20, 17, .9);
  backdrop-filter: blur(10px);
}

.search-label { display: block; margin: 0 0 6px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
input, select {
  width: 100%;
  margin: 0 0 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
}

.thread-button {
  width: 100%;
  padding: 12px 10px;
  border: 0;
  border-bottom: 1px solid rgba(66, 55, 45, .65);
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.home-nav { margin: 0 0 22px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.home-button { color: var(--ink); font-weight: 800; border-bottom: 0; }
.home-button small { font-weight: 400; }
.thread-button:hover, .thread-button.active { color: var(--ink); background: var(--panel-2); }
.thread-button.active { box-shadow: inset 3px 0 var(--gold); }
.thread-button small { display: block; color: #887b69; }
.thread-button .list-winner { color: var(--gold); font-weight: 700; }
.writer-record { margin: -3px 0 18px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--muted); }
.writer-record strong { color: var(--gold); font-size: 1.15rem; }

.reader { min-width: 0; padding: clamp(28px, 5vw, 72px); }
.home-view { max-width: 1080px; margin: 0 auto; }
.home-toast { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.home-toast img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.home-toast figcaption { position: absolute; right: 1rem; bottom: .8rem; color: #fff; font-size: clamp(.75rem, 1.5vw, 1rem); font-weight: 800; letter-spacing: .1em; text-shadow: 0 0 3px #000, 0 0 8px #000, 0 0 16px #000, 0 4px 18px rgba(0,0,0,1); text-transform: uppercase; }
.home-quote { margin: 24px 0 0; padding: 18px 22px; border-left: 4px solid var(--gold); background: rgba(229, 173, 82, .07); color: #ded2c0; font: italic clamp(1rem, 2vw, 1.22rem)/1.7 Georgia, serif; text-align: center; }
.fight-head { max-width: 920px; margin: 0 auto 34px; }
.fight-head h2 { margin: 0 0 12px; font: 700 clamp(2rem, 4.5vw, 4.3rem)/1.05 Georgia, serif; }
.winner { margin: -2px 0 15px; color: var(--muted); }
.winner strong { color: var(--gold); font-size: 1.12rem; }
.fight-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.participant { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel); }
.participant strong { color: var(--gold); }

.posts { max-width: 920px; margin: 0 auto; }
.post { margin: 0 0 24px; border: 1px solid var(--line); border-radius: 12px; background: rgba(33, 28, 23, .94); box-shadow: var(--shadow); overflow: hidden; }
.post-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.byline { font-weight: 750; color: var(--gold); }
.character { margin-left: 8px; color: var(--muted); font-size: .86rem; font-weight: 400; }
.post time { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.message { padding: clamp(18px, 3.5vw, 34px); overflow-wrap: anywhere; }
.message > :first-child { margin-top: 0; }
.message > :last-child { margin-bottom: 0; }
.message img { max-width: 100%; height: auto; }
.message blockquote { margin-left: 0; padding-left: 18px; border-left: 3px solid var(--line); color: var(--muted); }
.message .discord-quote { margin: 10px 0; padding: 9px 14px; border-left-color: var(--gold); background: rgba(229, 173, 82, .07); color: #d9cebd; }
.message .quote { padding: 12px; border: 1px solid var(--line); background: #17130f; }
.post-source { display: inline-block; margin: 0 0 16px 18px; color: #948774; font-size: .78rem; text-decoration: none; }
.empty-state { max-width: 620px; margin: 15vh auto; color: var(--muted); font: 1.5rem Georgia, serif; text-align: center; }

@media (max-width: 760px) {
  .masthead { min-height: 170px; padding-top: 30px; padding-bottom: 94px; }
  .archive-links { right: 50%; bottom: 22px; transform: translateX(50%); align-items: center; }
  .shell { display: block; }
  .sidebar { position: static; height: auto; max-height: 48vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .reader { padding: 28px 16px 60px; }
  .post-head { display: block; }
  .post time { display: block; margin-top: 3px; }
}
