:root {
  --bg: #f7f3ec;
  --card: #fffdf9;
  --ink: #1f2a24;
  --muted: #6b716c;
  --line: #e6dfd3;
  --pine: #1d4a3a;
  --pine-deep: #123126;
  --berry: #b3263b;
  --gold: #c9973a;
  --up: #2e7d4f;
  --down: #b3263b;
  --chip: #efe8dc;
  --warn-bg: #fbeee2;
  --warn-ink: #8a4a12;
  --shadow: 0 1px 2px rgb(31 42 36 / 0.06), 0 8px 24px rgb(31 42 36 / 0.06);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111814;
    --card: #18211c;
    --ink: #ece7de;
    --muted: #9aa39d;
    --line: #2a352f;
    --pine: #1a3d30;
    --pine-deep: #0c1a14;
    --berry: #e0566a;
    --gold: #e0b45e;
    --up: #5cc488;
    --down: #ef6b7d;
    --chip: #232e28;
    --warn-bg: #3a2a1a;
    --warn-ink: #f2b98a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.dot { color: var(--muted); margin: 0 0.45em; }

button { font: inherit; color: inherit; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  opacity: 0.85;
}
.link-btn:hover { opacity: 1; }

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

.masthead {
  background:
    radial-gradient(circle at 12% 20%, rgb(255 255 255 / 0.07) 0 2px, transparent 3px) 0 0 / 46px 46px,
    radial-gradient(circle at 70% 60%, rgb(255 255 255 / 0.05) 0 1.5px, transparent 2.5px) 0 0 / 31px 31px,
    linear-gradient(160deg, var(--pine), var(--pine-deep));
  color: #f4efe6;
  padding: 48px 0 36px;
  border-bottom: 4px solid var(--berry);
}
.logo { margin: 0 0 18px -1%; line-height: 0; }
.logo img { display: block; width: min(100%, 760px); height: auto; filter: drop-shadow(0 6px 18px rgb(0 0 0 / 0.35)); }
.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.lede { max-width: 620px; margin: 12px 0 0; color: rgb(244 239 230 / 0.82); font-size: 16px; }
.whoami {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin-top: 20px;
  font-size: 14px;
  color: rgb(244 239 230 / 0.9);
}
.whoami .dot { color: rgb(244 239 230 / 0.5); }
.whoami .link-btn { margin-left: 14px; }

/* ---------- gate ---------- */

.gate { padding: 48px 20px; display: grid; place-items: center; }
.gate-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.gate-card h2 { margin: 0 0 6px; font: 700 24px/1.2 Fraunces, Georgia, serif; }
.gate-card p { margin: 0 0 16px; color: var(--muted); }
.gate-card code { background: var(--chip); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.gate-card input {
  width: 100%;
  padding: 12px 14px;
  font: 500 17px/1.2 ui-monospace, Consolas, monospace;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}
.gate-card input:focus { outline: 2px solid var(--pine); outline-offset: 1px; }
.gate-card button[type='submit'] {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--berry);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.gate-card button[type='submit']:disabled { opacity: 0.6; cursor: wait; }
.error { min-height: 1.4em; margin: 12px 0 0 !important; color: var(--berry) !important; font-size: 14px; }

/* ---------- toolbar ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 12px 24px;
  margin: 28px 0 16px;
}
.count { margin: 0; font-size: 14px; color: var(--muted); }
.notes p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.stats .pp { font-weight: 400; color: var(--muted); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sort select {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}

/* ---------- listing card ---------- */

.listings { list-style: none; margin: 0 0 64px; padding: 0; display: grid; gap: 20px; }

.listing {
  display: grid;
  grid-template-columns: 64px minmax(0, 5fr) minmax(0, 6fr);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: clip;
}

.vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 0;
  border-right: 1px solid var(--line);
}
.vote-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}
.vote-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.vote-btn:hover { background: var(--chip); }
.vote-btn:active { transform: scale(0.92); }
.vote-btn.up[aria-pressed='true'] { color: var(--up); }
.vote-btn.down[aria-pressed='true'] { color: var(--down); }
.vote-btn[aria-pressed='true'] svg { fill: currentColor; }
.score { font: 700 20px/1 Fraunces, Georgia, serif; padding: 2px 0; font-variant-numeric: tabular-nums; }
.score.pos { color: var(--up); }
.score.neg { color: var(--down); }
.breakdown { margin-top: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }

.gallery { display: grid; grid-template-rows: auto auto; align-self: start; gap: 4px; padding: 4px; position: sticky; top: 0; }
.hero { aspect-ratio: 4 / 3; }
.gallery button { padding: 0; border: 0; cursor: zoom-in; position: relative; background: var(--chip); border-radius: 10px; overflow: hidden; }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.gallery button:hover img { transform: scale(1.03); }
.hero.empty { background: var(--chip); border-radius: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.thumbs button { aspect-ratio: 4 / 3; }
.more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 0.5);
  color: #fff;
  font-weight: 600;
}

.body { padding: 20px 24px 22px; min-width: 0; }
.title-row { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.title-row h2 { margin: 0; font: 700 22px/1.2 Fraunces, Georgia, serif; }
.airbnb {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--berry);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.airbnb:hover { filter: brightness(1.08); }
.meta { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }

.stats { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.stats li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.stats li.perk { display: inline-flex; align-items: center; gap: 5px; }
.stats .icon { width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stats li.price { background: var(--chip); border-color: transparent; font-weight: 600; }
.stats li.warn { border-color: var(--warn-ink); color: var(--warn-ink); }
.flag { margin: 8px 0 0; font-size: 13px; color: var(--warn-ink); }

.table-score {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--chip);
  border-left: 4px solid var(--muted);
}
.table-score.s5, .table-score.s4 { border-left-color: var(--up); }
.table-score.s3 { border-left-color: var(--gold); }
.table-score.s2, .table-score.s1 { border-left-color: var(--down); }
.ts-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.d20 { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.s5 .d20, .s4 .d20 { color: var(--up); }
.s3 .d20 { color: var(--gold); }
.s2 .d20, .s1 .d20 { color: var(--down); }
.ts-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ts-head .link-btn { margin-left: auto; font-size: 13px; }
.table-score p { margin: 6px 0 0; font-size: 14px; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 10px; height: 10px; border-radius: 3px; background: var(--line); }
.s5 .pips i.on, .s4 .pips i.on { background: var(--up); }
.s3 .pips i.on { background: var(--gold); }
.s2 .pips i.on, .s1 .pips i.on { background: var(--down); }

.tables { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; }
.tables li + li { margin-top: 1px; }
.table-score .extras { font-size: 13px; color: var(--muted); }
.extras span, .sleeping span { font-weight: 600; color: var(--ink); }
.sleeping { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.new { padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--gold); font-weight: 600; font-size: 12.5px; }

.summary { margin: 14px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 14px 0 0; padding: 0; }
.chips li { padding: 3px 10px; border-radius: 999px; background: var(--chip); font-size: 12.5px; }

.watch { margin: 14px 0 0; padding: 10px 14px 10px 30px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; }
.watch li + li { margin-top: 2px; }

/* ---------- lightbox ---------- */

.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(10 14 12 / 0.94);
  color: #fff;
}
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px 0; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { margin-top: 12px; font-size: 14px; opacity: 0.85; text-align: center; }
.lb-nav, .lb-close { background: none; border: 0; color: #fff; cursor: pointer; opacity: 0.75; }
.lb-nav:hover, .lb-close:hover { opacity: 1; }
.lb-nav { font-size: 48px; height: 100%; }
.lb-close { position: absolute; top: 10px; right: 16px; font-size: 36px; z-index: 1; }

.fatal { max-width: 600px; margin: 40px auto; padding: 0 20px; color: var(--berry); }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .listing { grid-template-columns: 56px minmax(0, 1fr); }
  .vote { grid-row: span 2; }
  .gallery { position: static; }
  .hero { aspect-ratio: 16 / 10; }
  .body { padding: 16px 16px 20px; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .masthead { padding: 36px 0 28px; }
  .listing { grid-template-columns: 48px minmax(0, 1fr); }
  .vote-btn { width: 36px; height: 36px; }
  .title-row { flex-direction: column; }
  .lightbox[open] { grid-template-columns: 40px 1fr 40px; }
  .lb-nav { font-size: 36px; }
}
