:root {
  --bg: #fff8ef;
  --card: #ffffff;
  --text: #2b2233;
  --muted: #6d6474;
  --accent: #e2557a;
  --accent-text: #ffffff;
  --border: #eadfd3;
  --ok-bg: #e8f7ec;
  --ok-text: #1d6b35;
  --err: #b3261e;
  --note-bg: #fff3cd;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1a21;
    --card: #2a2530;
    --text: #f2eef5;
    --muted: #b3a9bb;
    --accent: #ff7a9c;
    --accent-text: #1d1a21;
    --border: #3d3644;
    --ok-bg: #1f3a28;
    --ok-text: #9be0ad;
    --err: #ff8a80;
    --note-bg: #3d3420;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { padding: 24px 16px 48px; }
a { color: var(--accent); }
h1 { margin: 0 0 8px; font-size: 1.8rem; line-height: 1.2; }
h2 { margin: 24px 0 8px; font-size: 1.25rem; }

.card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.card.narrow { max-width: 380px; }
.card.wide { max-width: 1100px; }
.center { text-align: center; }

.party-header { margin-bottom: 20px; }
.party-header p { margin: 4px 0; }
.description { margin: 12px 0; }
.deadline, .hint { color: var(--muted); font-size: 0.9em; }

form label { display: block; margin: 14px 0 4px; font-weight: 600; }
.hint { font-weight: 400; }
input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[readonly] { font-size: 0.9em; }
.row { display: flex; gap: 12px; }
.row label { flex: 1; }

fieldset.choices { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.choices legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
label.choice { margin: 0; flex: 1 1 140px; font-weight: 500; }
label.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.choice span {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
label.choice input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
label.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
label.checkbox { display: flex; align-items: center; gap: 8px; }
label.checkbox input { width: auto; margin: 0; }

button, .button {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}
.button.secondary { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.title-row .button { margin-top: 0; }
button.link { background: none; color: var(--accent); padding: 0; margin: 0; font-weight: 400; text-decoration: underline; }
button.danger { color: var(--err); }
form.inline { display: inline; }
.actions { display: flex; align-items: center; gap: 20px; }

.error { color: var(--err); margin: 4px 0 0; font-size: 0.95em; }
.success { background: var(--ok-bg); color: var(--ok-text); padding: 12px 14px; border-radius: 10px; }
.notice { background: var(--note-bg); padding: 12px 14px; border-radius: 10px; }
.closed { color: var(--muted); font-style: italic; }
.summary h2 { margin-top: 8px; }
.edit-link { margin: 16px 0; }
.edit-link p { margin: 0; color: var(--muted); font-size: 0.95em; }
details { margin-top: 16px; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.inline-confirm { display: inline-block; margin: 0 0 0 8px; }
.inline-confirm > summary { color: var(--err); font-weight: 400; text-decoration: underline; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.topbar a { font-weight: 700; text-decoration: none; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tag { font-size: 0.75em; padding: 2px 8px; border-radius: 999px; background: var(--border); color: var(--muted); vertical-align: middle; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 20px 0; }
.stats div { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.stats strong { display: block; font-size: 1.6rem; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95em; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; }
td.notes { max-width: 280px; }
.nowrap { white-space: nowrap; }
tr.status-no td { color: var(--muted); }

@media (max-width: 480px) {
  .card { padding: 18px; border-radius: 12px; }
  h1 { font-size: 1.5rem; }
}

/* ===================================================================
   Construction crew theme (party pages with theme = construction)
   =================================================================== */
@font-face {
  font-family: "Titan One";
  src: url("/fonts/TitanOne-Regular.ttf") format("truetype");
  font-display: swap;
}

.theme-construction {
  --hat: #ffd21f;
  --hat-dark: #e8a800;
  --orange: #f47a20;
  --orange-dark: #c4560f;
  --crew-blue: #2a5db0;
  --crew-blue-dark: #1b3f80;
  --steel: #c5ced8;
  --steel-dark: #8e9aa6;
  --ink: #1d1d1d;
  --text: #24282e;
  --muted: #5b6470;
  --card: #ffffff;
  --border: #d5dbe2;
  --accent: var(--crew-blue);
  --err: #c62828;
  --ok-bg: #fff4c2;
  --ok-text: #4a3500;
  --note-bg: #fff4c2;
  --hazard: repeating-linear-gradient(-45deg, var(--ink) 0 14px, var(--hat) 14px 28px);
  color-scheme: light;
  background: #5fb2ef;
  color: var(--text);
}
.theme-construction::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #5fb2ef url("/themes/construction/scene.svg") center bottom / cover no-repeat;
}
.theme-construction main { padding-top: 32px; }

/* Card: silver rim like a badge, crew-blue inner edge */
.theme-construction .card {
  position: relative;
  overflow: hidden;
  padding-top: 0;
  border: 6px solid var(--steel);
  box-shadow:
    inset 0 0 0 3px var(--crew-blue),
    0 3px 0 6px var(--steel-dark),
    0 18px 40px rgba(20, 40, 70, 0.35);
  border-radius: 22px;
}

/* Orange bolted banner across the top */
.theme-construction .banner {
  margin: 0 -24px 18px;
  padding: 12px 52px 10px;
  text-align: center;
  background:
    radial-gradient(circle at 22px 50%, var(--orange-dark) 0 6px, #ffb27a 6px 7px, transparent 8px),
    radial-gradient(circle at calc(100% - 22px) 50%, var(--orange-dark) 0 6px, #ffb27a 6px 7px, transparent 8px),
    var(--orange);
  border-bottom: 4px solid var(--orange-dark);
}
.theme-construction .banner span {
  font: 1.15rem/1.1 "Titan One", "Arial Black", Impact, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 0 var(--orange-dark);
}

.theme-construction .kicker {
  margin: 0 0 10px;
  text-align: center;
  font-weight: 800;
  color: var(--crew-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
}

/* Yellow road-sign panel with hazard-stripe edges */
.theme-construction .sign {
  position: relative;
  margin: 0 0 18px;
  padding: 26px 16px;
  background: var(--hat);
  border: 3px solid var(--ink);
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 5px 0 var(--hat-dark);
}
.theme-construction .sign::before,
.theme-construction .sign::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  background: var(--hazard);
}
.theme-construction .sign::before { top: 0; border-bottom: 2px solid var(--ink); }
.theme-construction .sign::after { bottom: 0; border-top: 2px solid var(--ink); }
.theme-construction .sign h1 {
  margin: 0;
  font: 2.3rem/1.05 "Titan One", "Arial Black", Impact, sans-serif;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

/* Date / place / deadline as chips */
.theme-construction .party-header .when,
.theme-construction .party-header .where,
.theme-construction .party-header .deadline {
  display: block;
  margin: 8px 0;
  padding: 8px 12px;
  background: #eef4fb;
  border-left: 6px solid var(--crew-blue);
  border-radius: 8px;
  font-weight: 700;
  color: var(--text);
}
.theme-construction .party-header .deadline { border-left-color: var(--orange); background: #fff1e6; }
.theme-construction .description { font-size: 1.05rem; }

/* Form */
.theme-construction input,
.theme-construction textarea {
  background: #fff;
  border: 3px solid var(--border);
  border-radius: 12px;
}
.theme-construction input:focus,
.theme-construction textarea:focus { outline: 3px solid var(--orange); outline-offset: 0; border-color: var(--orange); }
.theme-construction label.choice span {
  border: 3px solid var(--border);
  background: #fff;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--border);
}
.theme-construction label.choice input:checked + span { transform: translateY(2px); box-shadow: 0 2px 0 var(--sel-edge); }
.theme-construction label.choice input[value="yes"]:checked + span { --sel-edge: var(--hat-dark); background: var(--hat); border-color: var(--hat-dark); color: var(--ink); }
.theme-construction label.choice input[value="maybe"]:checked + span { --sel-edge: var(--crew-blue-dark); background: var(--crew-blue); border-color: var(--crew-blue-dark); color: #fff; }
.theme-construction label.choice input[value="no"]:checked + span { --sel-edge: var(--steel-dark); background: var(--steel); border-color: var(--steel-dark); color: var(--ink); }
.theme-construction label.choice input:focus-visible + span { outline: 3px solid var(--orange); }

/* Hard-hat yellow button with a chunky pressable edge */
.theme-construction button[type="submit"] {
  font-family: "Titan One", "Arial Black", Impact, sans-serif;
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--hat);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 12px 28px;
  box-shadow: 0 6px 0 var(--orange);
  transition: transform 0.05s, box-shadow 0.05s;
}
.theme-construction button[type="submit"]:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--orange); }
.theme-construction button[type="submit"]:focus-visible { outline: 3px solid var(--crew-blue); outline-offset: 3px; }

.theme-construction details > summary { color: var(--crew-blue); }
.theme-construction .success {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 3px solid var(--hat-dark);
  font-weight: 700;
}
.theme-construction .paw { width: 28px; height: 28px; flex: none; color: var(--orange); }
.theme-construction .summary h2 { font-family: "Titan One", "Arial Black", Impact, sans-serif; font-weight: 400; color: var(--crew-blue); }

/* Row of cones along the bottom of the card, over a hazard strip */
.theme-construction .cones {
  margin: 28px -24px 0;
  height: 52px;
  background:
    url("/themes/construction/cone.svg") left 12px bottom 10px / 46px 40px space no-repeat,
    var(--hazard) left bottom / 100% 10px no-repeat;
}

@media (max-width: 480px) {
  .theme-construction main { padding-top: 16px; }
  .theme-construction .banner, .theme-construction .cones { margin-left: -18px; margin-right: -18px; }
  .theme-construction .sign { padding: 22px 10px; }
  .theme-construction .sign h1 { font-size: 1.75rem; }
  .theme-construction .banner span { font-size: 1rem; }
}
