/* =========================================================================
   All Around Outdoors :: Waffle Board
   One stylesheet, hand written, no framework.
   ========================================================================= */

:root {
  --accent: #f0a02c;
  --accent-ink: #1b1305;
  --accent-soft: rgba(240, 160, 44, 0.14);
  --accent-line: rgba(240, 160, 44, 0.38);

  --bg: #0d110f;
  --bg-deep: #080b0a;
  --surface: #151b18;
  --surface-2: #1c2421;
  --surface-3: #242e2a;
  --line: #2a3531;
  --line-soft: #202926;

  --ink: #eef3f0;
  --ink-2: #b8c5bf;
  --ink-3: #7f8f88;

  --good: #4bbd68;
  --good-soft: rgba(75, 189, 104, 0.14);
  --warn: #e0a33a;
  --warn-soft: rgba(224, 163, 58, 0.14);
  --bad: #e8614c;
  --bad-soft: rgba(232, 97, 76, 0.14);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1080px;
  --gutter: clamp(16px, 4vw, 32px);

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f6f4;
  --bg-deep: #e9ede9;
  --surface: #ffffff;
  --surface-2: #f4f6f4;
  --surface-3: #e7ebe8;
  --line: #d6ded9;
  --line-soft: #e5eae7;
  --ink: #15201b;
  --ink-2: #46564e;
  --ink-3: #6e7f77;
  --shadow: 0 1px 2px rgba(16, 32, 24, 0.08), 0 8px 24px rgba(16, 32, 24, 0.08);
  --shadow-sm: 0 1px 2px rgba(16, 32, 24, 0.08);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 50% -12%, rgba(240, 160, 44, 0.07), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 { margin: 0 0 0.4em; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.65rem, 5vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 3.4vw, 1.5rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 0.82rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.stack > * + * { margin-top: 16px; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; }
.hidden { display: none !important; }
/* The hidden attribute has to beat every component display rule below
   (.hero is a grid, .split is a flex row, and so on). */
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  display: flex; align-items: center; gap: 14px;
  min-height: 62px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 62%, #8a4b12));
  color: var(--accent-ink); font-weight: 800; font-size: 0.82rem; letter-spacing: -0.02em;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.brand__text { min-width: 0; }
.brand__name {
  display: block; font-weight: 700; font-size: 0.98rem; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand__tag { display: block; font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.09em; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.site-nav a {
  color: var(--ink-2); font-size: 0.88rem; font-weight: 600;
  padding: 7px 11px; border-radius: 8px;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav-short { display: none; }
@media (max-width: 560px) {
  .site-header__inner { gap: 8px; min-height: 56px; }
  .site-nav { gap: 2px; }
  .site-nav a { font-size: 0.83rem; padding: 6px 9px; white-space: nowrap; }
  .nav-full { display: none; }
  .nav-short { display: inline; }
  .brand__tag { display: none; }
  .brand__mark { width: 32px; height: 32px; }
}
@media (max-width: 430px) {
  .site-nav a { font-size: 0.79rem; padding: 6px 7px; }
  .brand__name { font-size: 0.88rem; }
  .brand { gap: 8px; }
}

/* ------------------------------------------------------------------ hero */
main { padding-block: clamp(20px, 4vw, 36px) 64px; }

.hero { display: grid; gap: 22px; margin-bottom: 26px; }
@media (min-width: 780px) {
  .hero { grid-template-columns: 1.05fr 0.95fr; align-items: start; gap: 32px; }
}
.hero__media {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  aspect-ratio: 4 / 3; max-width: 100%;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero__media--empty { display: grid; place-items: center; color: var(--ink-3); font-size: 0.9rem; }
.hero--noimage { grid-template-columns: 1fr; }
.hero--noimage .hero__media { display: none; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.73rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.hero__title { margin-bottom: 8px; }
.hero__blurb { color: var(--ink-2); font-size: 1.02rem; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); gap: 10px; margin: 18px 0; }
.fact {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px;
}
.fact__label {
  display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px;
}
.fact__value { display: block; font-size: 1.28rem; font-weight: 700; letter-spacing: -0.02em; }
.fact__value--accent { color: var(--accent); }

/* -------------------------------------------------------------- progress */
.progress { margin: 18px 0; }
.progress__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 0.86rem; margin-bottom: 7px;
}
.progress__track {
  height: 10px; border-radius: 999px; background: var(--surface-3);
  overflow: hidden; border: 1px solid var(--line-soft);
}
.progress__fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 72%, #b3651a), var(--accent));
  border-radius: 999px; transition: width 420ms cubic-bezier(0.3, 0.9, 0.3, 1);
}

/* ------------------------------------------------------------------ card */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(16px, 3.4vw, 24px);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card__head h2, .card__head h3 { margin: 0; }
.card__head .spacer { flex: 1 1 auto; }

.section-title {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 30px 0 14px;
}
.section-title h2 { margin: 0; }

/* ----------------------------------------------------------------- board */
.board-legend {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  font-size: 0.82rem; color: var(--ink-2); margin-bottom: 14px;
}
.legend-chip { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; border: 1px solid var(--line); }
.legend-dot--open { background: var(--surface-2); }
.legend-dot--held { background: var(--warn-soft); border-color: var(--warn); }
.legend-dot--paid { background: var(--good-soft); border-color: var(--good); }
.legend-dot--win  { background: var(--accent); border-color: var(--accent); }

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 8px;
}
@media (min-width: 640px) { .board { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; } }

.sq {
  position: relative; aspect-ratio: 1; max-width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
  font: inherit; padding: 4px; text-align: center; cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.sq__n { font-size: clamp(1rem, 3.4vw, 1.24rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.sq__name {
  font-size: 0.6rem; line-height: 1.15; color: var(--ink-3);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sq[data-status="open"]:not([aria-pressed="true"]):hover {
  border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px);
}
.sq[data-status="held"] { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 55%, transparent); cursor: not-allowed; }
.sq[data-status="held"] .sq__n { color: var(--warn); }
.sq[data-status="paid"] { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 45%, transparent); cursor: not-allowed; }
.sq[data-status="paid"] .sq__n { color: var(--good); }
.sq[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  transform: translateY(-1px); box-shadow: 0 0 0 3px var(--accent-soft);
}
.sq[aria-pressed="true"] .sq__n, .sq[aria-pressed="true"] .sq__name { color: var(--accent-ink); }
.sq--winner {
  background: var(--accent) !important; border-color: var(--accent) !important; color: var(--accent-ink) !important;
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}
.sq--winner .sq__n, .sq--winner .sq__name { color: var(--accent-ink) !important; }
.sq:disabled { opacity: 1; }

/* selection tray sticks to the bottom on phones */
.tray {
  position: sticky; bottom: 0; z-index: 30; margin-top: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.tray__info { flex: 1 1 180px; min-width: 0; }
.tray__picks { font-weight: 700; letter-spacing: -0.01em; }
.tray__total { color: var(--ink-3); font-size: 0.86rem; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: 0.94rem;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--surface-3); color: var(--ink); cursor: pointer;
  transition: filter 120ms ease, background 120ms ease, border-color 120ms ease;
  text-decoration: none; min-height: 44px; line-height: 1.2;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { color: var(--ink); border-color: var(--ink-3); }
.btn--danger { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }
.btn--sm { padding: 7px 12px; font-size: 0.84rem; min-height: 36px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- forms */
.field { display: block; margin-bottom: 14px; }
.field__label { display: block; font-size: 0.84rem; font-weight: 650; margin-bottom: 6px; color: var(--ink-2); }
.field__hint { display: block; font-size: 0.78rem; color: var(--ink-3); margin-top: 5px; }
.req { color: var(--accent); }

input[type="text"], input[type="tel"], input[type="email"], input[type="number"],
input[type="password"], input[type="url"], input[type="search"], input[type="datetime-local"],
select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; min-height: 44px;
  transition: border-color 120ms ease, background 120ms ease;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[type="color"] { padding: 4px; height: 44px; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 6px; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.grid-2 { display: grid; gap: 0 14px; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 0 14px; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.check {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
  cursor: pointer; margin-bottom: 10px;
}
.check:hover { border-color: var(--ink-3); }
.check input { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.check__body { min-width: 0; display: block; }
.check__title { display: block; font-weight: 650; font-size: 0.92rem; }
.check__hint { display: block; font-size: 0.79rem; color: var(--ink-3); margin-top: 2px; }

/* --------------------------------------------------------------- notices */
.notice {
  border-radius: var(--radius); padding: 13px 15px; font-size: 0.9rem;
  border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 16px;
}
.notice--error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: color-mix(in srgb, var(--bad) 85%, var(--ink)); }
.notice--good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 45%, transparent); color: color-mix(in srgb, var(--good) 85%, var(--ink)); }
.notice--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: color-mix(in srgb, var(--warn) 88%, var(--ink)); }
.notice strong { font-weight: 700; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.71rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line);
}
.badge--open { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.badge--draft { background: var(--surface-3); color: var(--ink-3); }
.badge--closed { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.badge--drawn { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge--cancelled { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

/* ----------------------------------------------------------------- misc */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 0.9rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.9rem; }
.list li:last-child { border-bottom: 0; }

.activity { font-size: 0.86rem; }
.activity li { display: flex; gap: 10px; align-items: baseline; }
.activity time { color: var(--ink-3); font-size: 0.78rem; flex: none; }

.table-scroll { overflow-x: auto; margin-inline: calc(var(--gutter) * -0.5); padding-inline: calc(var(--gutter) * 0.5); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); font-weight: 700; }
tbody tr:hover { background: var(--surface-2); }
td.wrap-cell { white-space: normal; min-width: 160px; }

.code-block {
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.6;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
  color: var(--ink-2); margin: 0;
}

.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row input { flex: 1 1 auto; font-family: var(--mono); font-size: 0.85rem; }

.toast-host {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px;
  z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 11px 15px; font-size: 0.88rem; box-shadow: var(--shadow);
  animation: rise 200ms ease both;
}
.toast--error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.toast--good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.site-footer {
  border-top: 1px solid var(--line-soft); margin-top: 56px; padding-block: 26px 40px;
  color: var(--ink-3); font-size: 0.84rem;
}
.site-footer__inner { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.site-footer .spacer { flex: 1 1 auto; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab {
  font: inherit; font-weight: 650; font-size: 0.9rem; color: var(--ink-3);
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 14px; cursor: pointer; white-space: nowrap; min-height: 44px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.split { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.split .spacer { flex: 1 1 auto; }

.repeater-item {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  background: var(--surface-2); margin-bottom: 12px;
}

@media print {
  .site-header, .site-footer, .tray, .btn, .toast-host { display: none !important; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------- layout utilities
   Kept as classes rather than style="" attributes so the page can run under a
   strict Content-Security-Policy with no inline styles at all. */
.u-mt-xs  { margin-top: 6px; }
.u-mt-sm  { margin-top: 10px; }
.u-mt-md  { margin-top: 12px; }
.u-mt     { margin-top: 14px; }
.u-mt-lg  { margin-top: 16px; }
.u-mt-xl  { margin-top: 18px; }
.u-mb-md  { margin-bottom: 12px; }
.u-mb-xl  { margin-bottom: 18px; }
.u-steps  { padding-left: 20px; margin: 0; }
.u-narrow { max-width: 720px; }
.u-mid    { max-width: 820px; }
.u-tight  { max-width: 420px; margin-inline: auto; }
.u-picker { max-width: 340px; }
.u-filter { max-width: 170px; }
.u-offline { max-width: 480px; text-align: center; padding-top: 12vh; }
.board--compact { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
