/* SnuggleSMP: 7 Days
   Painted steel plates on a sooty backdrop. One loud element per page: the day counter. */

:root {
  --soot: #262320;
  --soot-deep: #1c1a17;
  --drab: #4a5230;
  --drab-deep: #3a4026;
  --drab-edge: #5d6640;
  --bone: #ece4d0;
  --dust: #b3a990;
  --hazard: #e0a419;
  --hazard-deep: #b98512;
  --horde: #a3241a;
  --live: #8fbf45;

  --display: 'Saira Stencil One', 'Arial Narrow', sans-serif;
  --label: 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', 'Segoe UI', sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.375rem;

  --space: 1.5rem;
  --radius-plate: 3px;
  --radius-control: 2px;
  --grit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--soot);
  background-image: var(--grit);
  color: var(--bone);
  font: 400 var(--step-0)/1.6 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; padding-bottom: 4rem; }

a { color: var(--hazard); text-underline-offset: 0.18em; }
a:hover { color: #f2bd3c; }

:focus-visible { outline: 3px solid var(--hazard); outline-offset: 3px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; }
h2 { font: 600 var(--step-2)/1.15 var(--label); letter-spacing: 0.01em; }
h3 { font: 600 var(--step-1)/1.2 var(--label); }
p { margin: 0 0 1em; }
code { font-family: Consolas, 'Courier New', monospace; font-size: 0.92em; background: rgba(0, 0, 0, 0.25); padding: 0.1em 0.35em; border-radius: 2px; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2.5rem); }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--hazard); color: var(--soot); padding: 0.5rem 1rem; }

.muted { color: var(--dust); }
.small { font-size: var(--step--1); }
.right { text-align: right; }

/* --- top bar ---------------------------------------------------------------------------- */

.topbar { border-bottom: 1px solid rgba(236, 228, 208, 0.12); background: rgba(0, 0, 0, 0.22); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--bone); }
.brand:hover { color: var(--bone); }
.brand-mark {
  display: grid; place-items: center;
  width: 2.4rem; height: 2.4rem;
  font: 1.7rem/1 var(--display);
  color: var(--soot);
  background: var(--hazard);
  border-radius: var(--radius-control);
  transform: rotate(-4deg);
}
.brand-text { font: 700 1.2rem/1 var(--label); display: flex; flex-direction: column; }
.brand-sub { font: 1rem/1.1 var(--display); color: var(--hazard); }

.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font: 600 1.05rem/1 var(--label); }
.nav a { color: var(--dust); text-decoration: none; padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--bone); }
.nav a[aria-current='page'] { color: var(--bone); border-bottom-color: var(--hazard); }

/* --- flash ------------------------------------------------------------------------------ */

.flash { margin: 1.25rem 0 0; padding: 0.8rem 1rem; border-left: 4px solid; background: rgba(0, 0, 0, 0.3); }
.flash-ok { border-color: var(--live); }
.flash-error { border-color: var(--horde); }

/* --- hazard tape (only shown near horde night) ------------------------------------------ */

.tape {
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 22px, var(--soot-deep) 22px 44px);
  padding: 0.55rem 0;
}
.tape p {
  margin-block: 0;
  font: 700 1.1rem/1.3 var(--label);
}
.tape p::before { content: none; }
.tape .wrap { background: var(--soot-deep); color: var(--hazard); padding: 0.5rem 1rem; width: fit-content; max-width: calc(100% - 2.5rem); }

/* --- the plate (hero) ------------------------------------------------------------------- */

.plate {
  position: relative;
  background-color: var(--drab);
  background-image: var(--grit), linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.12));
  border: 1px solid var(--drab-edge);
  border-radius: var(--radius-plate);
  box-shadow: inset 0 0 0 4px var(--drab-deep), 0 10px 28px rgba(0, 0, 0, 0.45);
}

.rivet {
  position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #8b9168, #3a4026 70%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}
.rivet-tl { top: 14px; left: 14px; } .rivet-tr { top: 14px; right: 14px; }
.rivet-bl { bottom: 14px; left: 14px; } .rivet-br { bottom: 14px; right: 14px; }

.hero {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 2.5rem;
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.25rem);
}

.hero-server { font: 600 var(--step-1)/1.2 var(--label); color: var(--bone); margin-bottom: 0.25rem; opacity: 0.85; }

.day {
  font: clamp(4.5rem, 14vw, 10.5rem)/0.86 var(--display);
  margin: 0 0 1.1rem;
  color: var(--bone);
  letter-spacing: -0.01em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.day-word { font-size: 0.5em; margin-right: 0.08em; }
.day-short { font-size: clamp(4rem, 11vw, 8rem); }

.clock { font-size: var(--step-1); color: var(--bone); max-width: 32ch; }

.horde { margin-top: 1.75rem; }
.horde-line { font: 600 var(--step-1)/1.3 var(--label); margin-bottom: 0.7rem; }
.horde-now .horde-line, .horde-tonight .horde-line { color: #ffb4a8; }

.tally { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; max-width: 26rem; }
.tally li { flex: 1; height: 14px; background: rgba(0, 0, 0, 0.3); border-radius: 1px; }
.tally li.past { background: var(--bone); opacity: 0.55; }
.tally li.today { background: var(--bone); }
.tally li.horde-day { background: var(--horde); opacity: 0.6; }
.tally li.horde-day.today, .tally li.horde-day.past { opacity: 1; }

.hero-side {
  align-self: stretch;
  display: flex; flex-direction: column; gap: 1.1rem;
  padding-left: 2rem;
  border-left: 2px dashed rgba(236, 228, 208, 0.25);
}

.state { display: flex; align-items: center; gap: 0.6rem; font: 600 var(--step-1)/1.2 var(--label); margin: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot-on { background: var(--live); box-shadow: 0 0 0 3px rgba(143, 191, 69, 0.25); }
.dot-off { background: var(--horde); }

.who { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.who li { background: rgba(0, 0, 0, 0.25); padding: 0.15rem 0.55rem; border-radius: var(--radius-control); font-size: var(--step--1); }

.address-label { font: 600 var(--step--1)/1 var(--label); color: var(--dust); margin-bottom: 0.4rem; }

.copy { font: inherit; cursor: pointer; }
.address-value {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--soot-deep);
  color: var(--bone);
  border: 1px solid rgba(236, 228, 208, 0.18);
  border-radius: var(--radius-control);
  font: 600 1.25rem/1 var(--label);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.address-value:hover { border-color: var(--hazard); }
.copy-hint { font: 600 var(--step--1)/1 var(--label); color: var(--hazard); }
.copy[data-copied] .copy-hint { color: var(--live); }
.address-inline { width: auto; display: inline-flex; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: auto; }

/* --- buttons ---------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  font: 700 1.05rem/1 var(--label);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-control);
  border: 2px solid var(--bone);
  background: transparent;
  color: var(--bone);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: rgba(236, 228, 208, 0.1); color: var(--bone); }
.btn-primary { background: var(--hazard); border-color: var(--hazard); color: var(--soot-deep); }
.btn-primary:hover { background: #f0b72e; border-color: #f0b72e; color: var(--soot-deep); }
.btn-small { font-size: 0.95rem; padding: 0.5rem 0.8rem; }
.btn-danger { border-color: #d46b5f; color: #f0a79d; }
.btn-danger:hover { background: rgba(163, 36, 26, 0.3); color: #ffd2cc; }

/* --- home lower half -------------------------------------------------------------------- */

.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 3rem; margin-top: 3.5rem; }

.board h2, .notes h2 { padding-bottom: 0.4rem; border-bottom: 2px solid rgba(236, 228, 208, 0.15); }

.post { margin-bottom: 2rem; max-width: 68ch; }
.post h2, .post h3 { margin-bottom: 0.15rem; }
.post-date { color: var(--dust); font-size: var(--step--1); margin-bottom: 0.6rem; }

.notes { background: rgba(0, 0, 0, 0.22); padding: 1.5rem; border-top: 4px solid var(--hazard); align-self: start; }
.notes p { max-width: 60ch; }

.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose strong { color: #fff6e2; }

/* --- inner pages ------------------------------------------------------------------------ */

.page-title { font: clamp(2.4rem, 6vw, 3.6rem)/1 var(--display); margin: 2.5rem 0 0.6rem; }
.lede { font-size: var(--step-1); color: var(--dust); max-width: 54ch; margin-bottom: 2rem; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 2.5rem; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.75rem 4.25rem;
  border-left: 2px dashed rgba(236, 228, 208, 0.2);
  margin-left: 1.4rem;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0.5rem; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: -1.45rem; top: -0.2rem;
  width: 2.8rem; height: 2.8rem;
  display: grid; place-items: center;
  font: 1.6rem/1 var(--display);
  background: var(--hazard); color: var(--soot-deep);
  border-radius: 50%;
}
.steps h2 { font-size: var(--step-1); margin-bottom: 0.4rem; padding-top: 0.3rem; }
.steps p { max-width: 62ch; }

.mod-groups { columns: 2 320px; column-gap: 3rem; margin-bottom: 2rem; }
.mod-group { break-inside: avoid; margin-bottom: 2rem; }
.mod-group h2 { font-size: var(--step-1); border-bottom: 2px solid rgba(236, 228, 208, 0.15); padding-bottom: 0.35rem; }
.mod-group ul { list-style: none; padding: 0; margin: 0; }
.mod-group li { padding: 0.3rem 0; border-bottom: 1px solid rgba(236, 228, 208, 0.07); }
.mod-group-local { background: var(--drab); padding: 1.2rem 1.4rem 0.8rem; border-radius: var(--radius-plate); box-shadow: inset 0 0 0 3px var(--drab-deep); }
.mod-group-local h2 { border-bottom-color: rgba(236, 228, 208, 0.25); }

.rules ul { list-style: none; padding: 0; }
.rules li { padding: 0.9rem 0 0.9rem 1.2rem; border-left: 4px solid var(--drab-edge); background: rgba(0, 0, 0, 0.18); margin-bottom: 0.6rem; }

/* --- forms and admin -------------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 1.1rem; max-width: 720px; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font: 600 1.05rem/1.3 var(--label); }
.form label .small { font-family: var(--body); font-weight: 400; }
.form input:not([type='checkbox']), .form textarea {
  font: 400 1rem/1.5 var(--body);
  color: var(--bone);
  background: var(--soot-deep);
  border: 1px solid rgba(236, 228, 208, 0.2);
  border-radius: var(--radius-control);
  padding: 0.6rem 0.75rem;
}
.form input:focus, .form textarea:focus { border-color: var(--hazard); outline: none; box-shadow: 0 0 0 2px rgba(224, 164, 25, 0.4); }
.form .mono { font-family: Consolas, 'Courier New', monospace; font-size: 0.95rem; }
.form .check { flex-direction: row; align-items: center; gap: 0.6rem; font-weight: 500; }
.form button { align-self: flex-start; }
.plate-form { background: rgba(0, 0, 0, 0.22); padding: 1.5rem; border-top: 4px solid var(--hazard); }

.admin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin-block { padding: 1.5rem 0; border-top: 1px solid rgba(236, 228, 208, 0.12); }
.admin-block .upload { margin-top: 1rem; flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.admin-block .upload label { flex: 1 1 320px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem 2rem; margin: 0; }
.facts dt { color: var(--dust); font: 600 var(--step--1)/1.2 var(--label); }
.facts dd { margin: 0.15rem 0 0; }

.plain-list { padding-left: 1.2rem; }

.table { width: 100%; border-collapse: collapse; }
.table td { padding: 0.55rem 0.5rem; border-bottom: 1px solid rgba(236, 228, 208, 0.08); vertical-align: middle; }
.table form { margin: 0; }

/* --- footer ----------------------------------------------------------------------------- */

.footer { background: var(--soot-deep); border-top: 1px solid rgba(236, 228, 208, 0.08); color: var(--dust); font-size: var(--step--1); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.4rem 0; }
.footer p { margin: 0; }
.copy-quiet { background: none; border: 0; padding: 0; color: var(--bone); text-decoration: underline dotted; text-underline-offset: 0.2em; font-variant-numeric: tabular-nums; }

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

@media (max-width: 820px) {
  .hero, .split { grid-template-columns: 1fr; }
  .hero { gap: 1.75rem; }
  .hero-side { padding-left: 0; padding-top: 1.5rem; border-left: 0; border-top: 2px dashed rgba(236, 228, 208, 0.25); }
  .split { gap: 2rem; margin-top: 2.5rem; }
  .steps > li { padding-left: 2.6rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .tally li.today { animation: mark 0.9s ease-out 0.25s both; }
  @keyframes mark { from { transform: scaleY(0.2); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
}
