/* Layout: a rink-side noticeboard. Big condensed masthead, a "next up" strip, then twelve small month grids
   (year view) or a dated list. Event days are discs, like markers on a rink floor: solid = helpers needed, ring = covered. */
:root {
  --bg: #E9EEF1;
  --surface: #FFFFFF;
  --surface2: #F2F5F7;
  --ink: #0F1B27;
  --muted: #55656F;
  --line: #CBD5DB;
  --accent: #D8322A;
  --on-accent: #FFFFFF;
  --c-disco: #6B3AE0;
  --c-cover: #0A7C77;
  --c-fund: #A85F00;
  --c-summer: #26803A;
  --c-other: #2F5FCC;
  --on-c: #FFFFFF;
  --scrim: rgba(10, 20, 30, .55);
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C141C; --surface: #15212C; --surface2: #1B2937; --ink: #E8EEF2; --muted: #9BAAB5; --line: #2B3B49;
    --accent: #FF6A5E; --on-accent: #0C141C;
    --c-disco: #A98BFF; --c-cover: #3CC9C1; --c-fund: #F2B04C; --c-summer: #6FD085; --c-other: #86A9FF; --on-c: #0C141C;
    --scrim: rgba(0, 0, 0, .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C141C; --surface: #15212C; --surface2: #1B2937; --ink: #E8EEF2; --muted: #9BAAB5; --line: #2B3B49;
  --accent: #FF6A5E; --on-accent: #0C141C;
  --c-disco: #A98BFF; --c-cover: #3CC9C1; --c-fund: #F2B04C; --c-summer: #6FD085; --c-other: #86A9FF; --on-c: #0C141C;
  --scrim: rgba(0, 0, 0, .65);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 56px;
}
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); }

/* Masthead */
.masthead { position: relative; display: flex; flex-direction: column; gap: 14px; padding-block: 8px 4px; overflow: hidden; }
.deco { position: absolute; right: -40px; top: -10px; width: min(520px, 70vw); color: var(--ink); opacity: .07; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 12px; position: relative; }
.mark { width: 52px; height: auto; color: var(--accent); flex: none; }
.club { font: 500 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
h1 { font: 800 clamp(48px, 10vw, 96px)/.9 var(--display); text-transform: uppercase; letter-spacing: .01em; position: relative; }
.lede { max-width: 56ch; margin: 0; color: var(--muted); font-size: 17px; position: relative; }
.mast-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }

.btn { border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--surface2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.danger { border-color: var(--accent); color: var(--accent); }
.btn.danger.armed { background: var(--accent); color: var(--on-accent); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }


/* Next up */
.sec-title { font: 700 26px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sec-note { color: var(--muted); font-size: 13px; }
.next { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.ncard { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ncard:hover { border-color: var(--c); }
.ncard .nd { font: 800 34px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.ncard .nd small { font: 500 12px var(--mono); color: var(--muted); letter-spacing: .06em; margin-left: 6px; }
.ncard .nt { font-weight: 600; }
.ncard .ns { font: 500 12px var(--mono); color: var(--c); }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

/* Controls */
.controls { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg-ctl { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg-ctl button { border: 0; background: transparent; padding: 7px 16px; font-weight: 600; font-size: 14px; }
.seg-ctl button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.filter { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; font-weight: 500; }
.filter .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.filter[aria-pressed="false"] { opacity: .5; }
.filter[aria-pressed="false"] .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.filter.need[aria-pressed="true"] { border-color: var(--accent); }
.spacer { flex: 1; }
.range { display: inline-flex; gap: 8px; align-items: center; font: 500 13px var(--mono); }
.summary { color: var(--muted); font-size: 13.5px; }

/* Year view */
.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.month { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 16px; min-width: 0; }
.month h3 { font: 700 22px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.month h3 span { font: 500 12px var(--mono); color: var(--muted); letter-spacing: .06em; margin-left: 4px; }
.grid7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 2px; }
.dow { text-align: center; font: 500 10.5px var(--mono); color: var(--muted); padding-bottom: 4px; }
.day { aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; font: 500 12px var(--mono); border-radius: 50%;
  border: 2px solid transparent; color: var(--muted); background: transparent; padding: 0; position: relative; }
button.day { cursor: pointer; color: var(--ink); }
.day.past { opacity: .5; }
.day.sat { border-style: dotted; border-color: var(--line); border-color: color-mix(in srgb, var(--muted) 60%, var(--surface)); }
.day.need { background: var(--c); color: var(--on-c); font-weight: 600; border-color: var(--c); border-style: solid; }
.day.full { background: transparent; background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--ink); font-weight: 600; border-color: var(--c); border-style: solid; }
.day .tick { position: absolute; right: -4px; bottom: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--c); color: var(--on-c);
  font: 700 9px/14px var(--mono); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.day.pick:hover { background: var(--surface2); }
.day.closed { background: transparent; color: var(--muted); border-color: var(--line); border-style: solid; font-weight: 500; }
.day.closed::before, .day.closed::after { content: ""; position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; margin-top: -1px;
  background: var(--accent); border-radius: 2px; transform: rotate(45deg); pointer-events: none; }
.day.closed::after { transform: rotate(-45deg); }
.day .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; pointer-events: none;
  width: max-content; max-width: 190px; background: var(--ink); color: var(--bg); font: 500 11.5px/1.35 var(--mono); padding: 5px 8px; border-radius: 6px; text-align: left; }
.day.tip-r .tip { left: auto; right: -4px; transform: none; }
.day.tip-l .tip { left: -4px; transform: none; }
.day:hover .tip, .day:focus-visible .tip { display: block; }
.day.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.day .more { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; border-radius: 8px; background: var(--ink); color: var(--bg);
  font: 600 9.5px/15px var(--mono); text-align: center; padding: 0 3px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 6px; }
.legend .l-need { background: var(--ink); }
.legend .l-full { background: color-mix(in srgb, var(--ink) 15%, var(--surface)); box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); font: 700 9px/14px var(--mono); text-align: center; }
.legend .l-sat { border: 2px dotted var(--muted); }
.legend .l-today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); width: 8px; height: 8px; margin-right: 10px; margin-left: 3px; }

/* List view */
.list { display: flex; flex-direction: column; gap: 22px; }
.lmonth h3 { font: 700 22px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 8px; border-bottom: 2px solid var(--ink); margin-bottom: 8px; }
.lrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; width: 100%; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 12px 4px; }
.lrow:hover { background: var(--surface); }
.lrow.past { opacity: .5; }
.ldate { text-align: center; line-height: 1; }
.ldate b { display: block; font: 800 36px/1 var(--display); }
.ldate span { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lmain { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lmain strong { font-size: 16px; }
.lmain .when { font: 400 12.5px var(--mono); color: var(--muted); }
.lside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.meter { display: flex; gap: 3px; flex-wrap: wrap; }
.meter i { width: 10px; height: 16px; border-radius: 3px; background: var(--line); }
.meter i.on { background: var(--c); }
.mtext { font: 500 12px var(--mono); color: var(--muted); }
.mtext.need { color: var(--ink); }
.empty { padding: 28px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; color: var(--muted); background: var(--surface); }

.xmark { position: relative; width: 22px; height: 22px; display: inline-block; }
.xmark::before, .xmark::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2.5px; margin-top: -1px; background: var(--accent); border-radius: 2px; transform: rotate(45deg); }
.xmark::after { transform: rotate(-45deg); }
.lrow.closed-row .ldate b { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }

/* Admin login */
.login { background: var(--surface); border: 2px solid var(--ink); border-radius: 16px; padding: 18px; max-width: 460px; }
.login form { display: flex; flex-direction: column; gap: 8px; }
.login h2 { font: 800 28px/1 var(--display); text-transform: uppercase; }
.lbl { font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.loginmsg { margin: 0; min-height: 1.4em; color: var(--accent); font-weight: 600; font-size: 13.5px; }

/* Files, toast, quiet admin row */
.quiet { margin: 0; text-align: right; font: 400 11.5px var(--mono); color: var(--muted); }
.linklike { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline dotted; }
.linklike:hover { color: var(--ink); }

/* Detail sheet */
.overlay { position: fixed; inset: 0; background: var(--scrim); display: flex; justify-content: flex-end; z-index: 20; }
.sheet { background: var(--bg); width: min(500px, 100%); height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
  padding: 20px max(20px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) 20px; padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-head h2 { font: 800 40px/.95 var(--display); text-transform: uppercase; }
.ev { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ev h3 { font: 700 26px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.ev .when { margin: 0; font: 500 13px var(--mono); }
.ev .notes { margin: 0; color: var(--muted); }
.ev-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.status { font: 500 11.5px var(--mono); padding: 4px 9px; border-radius: 999px; letter-spacing: .04em; }
.status.need { background: var(--c); color: var(--on-c); }
.status.full { box-shadow: inset 0 0 0 1.5px var(--c); }
.status.closedtag { background: var(--accent); color: var(--on-accent); }
.ev.closedcard { border: 2px dashed var(--accent); }
.admin-date { background: var(--surface2); }
.admin-date h3 { font-size: 20px; }
.closeform { display: flex; flex-direction: column; gap: 6px; }
.names { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.names li { background: var(--surface2); border-radius: 999px; padding: 3px 11px; font-size: 13px; }
.names li.sample { color: var(--muted); font-style: italic; }
.signup { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.signup label, .field label { font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
.thanks { margin: 0; font-size: 13.5px; color: var(--c); font-weight: 600; }
.admin-actions { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }

/* Admin */
.admin { background: var(--surface); border: 2px solid var(--accent); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.admin h2 { font: 800 30px/1 var(--display); text-transform: uppercase; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.tablebox { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 340px; overflow-y: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); position: sticky; top: 0; background: var(--surface2); }
td.t { white-space: normal; min-width: 180px; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Ideas */

@media (max-width: 640px) {
  .lrow { grid-template-columns: 52px minmax(0, 1fr); }
  .lside { grid-column: 2; align-items: flex-start; }
  .ldate b { font-size: 30px; }
}
@media (prefers-reduced-motion: no-preference) {
}

/* Live site additions */
a.btn { display: inline-block; text-decoration: none; text-align: center; color: var(--ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.thanks.err { color: var(--accent); }
a.linklike { color: var(--muted); }
.names li .rm { margin-left: 6px; border: 0; background: transparent; color: var(--muted); font: 600 12px var(--mono); padding: 0 2px; cursor: pointer; }
.names li .rm:hover, .names li .rm.armed { color: var(--accent); }
.note { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 16px; color: var(--muted); background: var(--surface); }
.note.bad { border-color: var(--accent); color: var(--ink); }
.foot { color: var(--muted); font: 400 12px var(--mono); }
