:root {
  --night: #0e1424;
  --night-2: #16203a;
  --panel: #1b2644;
  --line: #2c3a63;
  --text: #eef1f8;
  --muted: #9aa6c4;
  --red: #e2504c;
  --green: #3fae7a;
  --gold: #f2c14e;
  --blue: #6da7ff;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff8 50%, transparent 51%) 0 0 / 180px 180px,
    radial-gradient(1px 1px at 70% 80%, #fff6 50%, transparent 51%) 0 0 / 140px 140px,
    radial-gradient(2px 2px at 40% 60%, #fff4 50%, transparent 51%) 0 0 / 240px 240px,
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%) fixed;
  min-height: 100vh;
  line-height: 1.5;
}

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

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--line);
  background: #0e1424cc; backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5;
}
.brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--text); text-decoration: none; }
.brand::before { content: "✦ "; color: var(--gold); }
.top nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--text); }
.me { display: inline-flex; align-items: center; gap: 0.4rem; }
.me img { border-radius: 50%; }

main { max-width: 960px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 2rem 1rem; }

h1, h2 { font-family: var(--serif); line-height: 1.2; }
h1 { font-size: 2.2rem; margin: 0.2rem 0 0.8rem; }
h2 { font-size: 1.4rem; margin: 0 0 0.8rem; }

.hero { text-align: center; margin-bottom: 2rem; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4rem); margin-bottom: 0.2rem; }
.tagline { color: var(--gold); font-family: var(--serif); font-style: italic; font-size: 1.2rem; margin: 0 0 1rem; }
.lede { max-width: 40rem; margin: 0 auto 1rem; color: var(--muted); }
.next { color: var(--text); }

/* ---------- calendar ---------- */
.calendar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.8rem; }
@media (max-width: 720px) { .calendar { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 440px) { .calendar { grid-template-columns: repeat(3, 1fr); } }

.door {
  aspect-ratio: 3 / 4; border-radius: var(--radius); position: relative;
  display: flex; flex-direction: column; justify-content: space-between; padding: 0.7rem;
  text-decoration: none; color: var(--text); border: 1px solid var(--line); overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.door .num { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; line-height: 1; }
.door.locked {
  background: repeating-linear-gradient(135deg, #a8322f 0 14px, #b93a36 14px 28px);
  border-color: #7e2321; color: #ffe9e6;
}
.door.locked::after {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 10px; transform: translateX(-50%);
  background: var(--gold); opacity: 0.85;
}
.door.locked .num { position: relative; z-index: 1; text-shadow: 0 1px 2px #0006; }
.door.open { background: linear-gradient(160deg, #22325a, #182444); }
.door.open:hover { transform: translateY(-3px); box-shadow: 0 8px 20px #0007; }
.door.build { border-color: var(--green); box-shadow: 0 0 0 2px #3fae7a55, 0 0 24px #3fae7a33; }
.door.vote { border-color: var(--gold); box-shadow: 0 0 0 2px #f2c14e55, 0 0 24px #f2c14e33; }
.dtitle { font-family: var(--serif); font-size: 0.95rem; line-height: 1.2; }

.badge {
  display: inline-block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem; border-radius: 999px; background: #ffffff1a; color: var(--muted); width: fit-content;
}
.badge.build { background: #3fae7a2a; color: #7fe0b0; }
.badge.vote { background: #f2c14e2a; color: var(--gold); }

/* ---------- panels & forms ---------- */
.panel { background: #1b2644e6; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; }
.center { text-align: center; }
.eyebrow { margin: 0; color: var(--muted); font-size: 0.9rem; }
.prompt { font-size: 1.3rem; font-family: var(--serif); margin: 0 0 0.8rem; }
.twist { color: var(--muted); margin: 0 0 0.6rem; }
.twist strong { color: var(--gold); }
.times { color: var(--muted); font-size: 0.9rem; margin: 0; }
.muted { color: var(--muted); font-size: 0.9rem; }

.stack { display: grid; gap: 0.9rem; margin-bottom: 0.8rem; }
label { display: grid; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
input {
  font: inherit; color: var(--text); background: var(--night); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.6rem 0.75rem;
}
input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--red); color: #fff; border: 0; border-radius: 10px; padding: 0.6rem 1.1rem;
}
.btn:hover { filter: brightness(1.08); }
.btn.small { padding: 0.35rem 0.75rem; font-size: 0.9rem; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.chosen { background: var(--green); cursor: default; }
.top .btn.small { color: #fff; }
.linkish { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.linkish.danger { color: #f19a97; font-size: 0.9rem; }
form.inline { display: inline; }

.flash { background: #3fae7a26; border: 1px solid #3fae7a66; border-radius: 10px; padding: 0.7rem 1rem; }
.flash.error { background: #e2504c26; border-color: #e2504c66; }

/* ---------- entries ---------- */
.entries { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.entry {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--night); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem;
}
.entry.voted { border-color: var(--green); }
.entry.winner { border-color: var(--gold); box-shadow: 0 0 18px #f2c14e33; }
.entry.hidden { opacity: 0.5; }
.entry-title { font-weight: 600; font-size: 1.05rem; text-decoration: none; }
.entry-title:hover { text-decoration: underline; }
.by { display: block; color: var(--muted); font-size: 0.85rem; }
.desc { margin: 0.35rem 0 0; font-size: 0.95rem; }
.entry-side { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.votes { font-weight: 700; color: var(--gold); white-space: nowrap; }
.tag { font-style: normal; font-size: 0.75rem; margin-left: 0.4rem; padding: 0.05rem 0.4rem; border-radius: 6px; background: #ffffff1a; }
.tag.warn { background: #e2504c40; }

.daynav { display: flex; justify-content: center; gap: 1.5rem; }

.board { width: 100%; border-collapse: collapse; }
.board th, .board td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
.board th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.board tbody tr:first-child td { color: var(--gold); font-weight: 700; }

.prose li { margin-bottom: 0.6rem; }
