/* Hobby Harem: a high-fantasy tavern. Plank walls in firelight, a carved sign on chains, and a
   cork quest board where every notice is parchment pinned up with a brass tack. */

:root {
  color-scheme: light;
  --wall: #3f2513;
  --wood: #5a3519;
  --wood-light: #8a5a30;
  --wood-dark: #24130a;
  --parch: #f2e4c2;
  --parch-2: #e3cd98;
  --ink: #2b1a0e;
  --ink-soft: #4c3622;
  --ink-faint: #7a6247;
  --rule: rgba(90, 58, 26, 0.38);
  --wax: #8e1b1b;                /* headings, numbers, whoever stays behind */
  --gold: #d9ab45;
  --gold-hi: #f6dc8d;
  --open: #2f5d1e;               /* "open" stamp */
  --wall-text: #f0dcb0;
  --sign: 'MedievalSharp', Georgia, serif;
  --display: 'Almendra', Georgia, serif;
  --sc: 'Almendra SC', 'IM Fell English SC', Georgia, serif;
  --body: 'IM Fell English', Georgia, 'Times New Roman', serif;
  --hand: 'Caveat', 'Bradley Hand', cursive;
  --ribbon: polygon(0 0, 100% 0, 96.5% 50%, 100% 100%, 0 100%, 3.5% 50%);
}

* { box-sizing: border-box; }
html { background: var(--wall); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 400 18px/1.45 var(--body);
  background: transparent;
}

/* The tavern wall: vertical planks with grain, lit from the hearth below. Its own fixed layer,
   since background-attachment: fixed is ignored on iPhones. */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 80% 45% at 50% 108%, rgba(255, 140, 50, 0.34), transparent 70%),
    radial-gradient(ellipse 85% 75% at 50% 40%, transparent 45%, rgba(12, 5, 1, 0.72) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='400'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.5 .012' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .04 0 0 0 0 .01 0 0 0 .9 -.3'/%3E%3C/filter%3E%3Crect width='240' height='400' filter='url(%23g)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(90deg, rgba(10, 4, 1, 0.55) 0 2px, rgba(255, 220, 170, 0.06) 2px 3px, transparent 3px 120px),
    repeating-linear-gradient(90deg, #4a2b15 0 120px, #432611 120px 240px, #50301a 240px 360px, #3d2210 360px 480px);
}
/* Firelight, flickering. */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 75% 60% at 50% 90%, rgba(255, 170, 70, 0.2), transparent 70%);
  animation: firelight 6s linear infinite;
}

.frame {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px calc(84px + env(safe-area-inset-bottom));
}

button, input, select { font: inherit; color: inherit; }
a { color: var(--wax); }
:focus-visible { outline: 2px dashed var(--gold); outline-offset: 3px; }

/* ---------- the hanging sign ---------- */

.sign-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto 20px;
  padding-top: max(36px, calc(env(safe-area-inset-top) + 24px));
  text-align: center;
  transform-origin: 50% 0;
  animation: sway 8s ease-in-out infinite;
}
/* chains */
.sign-wrap::before, .sign-wrap::after {
  content: '';
  position: absolute; top: 0; width: 8px;
  height: max(44px, calc(env(safe-area-inset-top) + 32px));
  background: radial-gradient(ellipse 3px 4.5px at 50% 50%, transparent 1.6px, #9a9184 2.1px, #4a433b 3.2px, transparent 3.6px) 0 0 / 8px 9px repeat-y;
  filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.5));
}
.sign-wrap::before { left: calc(18% - 4px); }
.sign-wrap::after { right: calc(18% - 4px); }

.sign {
  position: relative;
  padding: 16px 18px 16px;
  border-radius: 16px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.008 .45' numOctaves='3' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .06 0 0 0 0 .02 0 0 0 .8 -.25'/%3E%3C/filter%3E%3Crect width='400' height='120' filter='url(%23g)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #93623a, #744a27 55%, #5f3b1d);
  box-shadow:
    inset 0 0 0 3px #3a2110,
    inset 0 0 0 6px #a5753f,
    inset 0 0 0 7px #3a2110,
    inset 0 10px 18px rgba(255, 220, 160, 0.16),
    inset 0 -12px 22px rgba(0, 0, 0, 0.35),
    0 16px 30px rgba(0, 0, 0, 0.6);
}
/* iron rings where the chains hook on */
.sign::before, .sign::after {
  content: '';
  position: absolute; top: -9px; width: 14px; height: 14px;
  border: 3px solid #4f463d; border-radius: 50%;
  background: transparent;
}
.sign::before { left: calc(18% - 7px); }
.sign::after { right: calc(18% - 7px); }

.emblem { width: 104px; height: 66px; overflow: visible; filter: drop-shadow(0 2px 0 #2a160a); }
.emblem .gold { fill: url(#goldFill); stroke: #3a2110; stroke-width: 1.6; stroke-linejoin: round; }
.emblem .line { fill: none; stroke: #3a2110; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.emblem .foam { fill: #fff6df; stroke: #3a2110; stroke-width: 1.4; stroke-linejoin: round; }

h1 {
  margin: 2px 0 4px;
  font: 400 clamp(36px, 10.5vw, 58px)/1.05 var(--sign);
  letter-spacing: 0.01em;
  color: var(--gold);
  background: linear-gradient(180deg, #fff3c8 0%, #f0c96a 45%, #b9842d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #2a160a) drop-shadow(0 0 12px rgba(255, 190, 90, 0.25));
}
.sub {
  margin: 0;
  font: 400 15px/1.35 var(--sc);
  letter-spacing: 0.08em;
  color: #f6e3b4;
  text-shadow: 0 1px 0 #2a160a;
}
.sub .sep { color: var(--gold); padding: 0 6px; }

/* ---------- the quest board ---------- */

.board {
  position: relative;
  margin: 0 0 22px;
  padding: 26px 16px 4px;
  border: 14px solid var(--wood);
  border-image: linear-gradient(160deg, #8a5a30, #5a3519 35%, #6e4422 65%, #3d2311) 1;
  background:
    radial-gradient(ellipse at 30% 15%, rgba(255, 230, 180, 0.2), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .17 0 0 0 0 .06 0 0 0 2.6 -1.35'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23c)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='21' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95 0 0 0 0 .84 0 0 0 0 .62 0 0 0 2.4 -1.3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23c)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #ba8f5c, #a77a47);
  box-shadow: inset 0 0 26px rgba(40, 20, 5, 0.55), 0 0 0 2px #2a160a, 0 22px 40px rgba(0, 0, 0, 0.6);
}

/* ---------- notices ---------- */

.plate {
  position: relative;
  margin: 0 0 24px;
  padding: 24px 18px 20px;
  color: var(--ink);
  border-radius: 2px 3px 2px 4px;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(150, 100, 40, 0.15), transparent 45%),
    radial-gradient(ellipse at 90% 92%, rgba(130, 80, 30, 0.22), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .28 0 0 0 0 .1 0 0 0 .7 -.28'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23p)'/%3E%3C/svg%3E"),
    linear-gradient(178deg, #f8edd4, var(--parch) 40%, var(--parch-2));
  box-shadow: inset 0 0 26px rgba(120, 72, 22, 0.3), 0 1px 1px rgba(0, 0, 0, 0.25), 3px 9px 14px rgba(40, 18, 4, 0.45);
  transform: rotate(var(--tilt, 0deg));
}
/* the brass tack */
.plate::before {
  content: '';
  position: absolute; top: 7px; left: 50%;
  width: 15px; height: 15px; margin-left: -7.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4 0 2px, #e2b44e 3px, #9a6a1c 7px, #6b4510 8px);
  box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.45);
}
#night { --tilt: -0.25deg; }
#phalanx { --tilt: 0.45deg; }
.plate.edicts { --tilt: -0.6deg; }
#records { --tilt: 0.35deg; }

.plate-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap;
  margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 3px double var(--rule);
}
.h2 { font: 700 27px/1.1 var(--display); color: var(--wax); }
.h3 { font: 700 21px/1.15 var(--display); color: var(--wax); }
.hint { color: var(--ink-faint); font: italic 400 16px/1.3 var(--body); }
.loading { color: var(--ink-faint); margin: 0; font-style: italic; }
.loading::after { content: '…'; animation: blink 1.2s steps(1) infinite; }

/* ---------- the quest ---------- */

.phase-pill {
  font: 400 13px/1 var(--sc); letter-spacing: 0.12em;
  padding: 6px 10px 4px;
  border: 2px solid currentColor; border-radius: 4px 6px 3px 5px;
  color: var(--wax);
  transform: rotate(-5deg);
  opacity: 0.88;
  mix-blend-mode: multiply;
}
.phase-pill.open { color: var(--open); }
.phase-pill.locked { color: var(--ink); }

.when { margin: 2px 0 10px; }
.when-day { font: 700 clamp(28px, 8vw, 38px)/1.08 var(--display); color: var(--ink); }
.when-time { font: 400 21px/1.3 var(--sc); color: var(--wax); margin-top: 2px; letter-spacing: 0.04em; }
.when-time .tz { font-size: 14px; color: var(--ink-faint); margin-left: 6px; }

.phase-line { margin: 0 0 14px; color: var(--ink-soft); }
.phase-line strong { color: var(--ink); font: 700 1.05em/1.3 var(--display); }

.cd-title { font: 400 14px/1 var(--sc); letter-spacing: 0.16em; color: var(--ink-faint); margin: 0 0 8px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 16px; }
.cd-cell { text-align: center; padding: 8px 0 7px; border: 2px solid rgba(43, 26, 14, 0.7); border-radius: 4px; background: rgba(255, 250, 235, 0.35); }
.cd-num { display: block; font: 700 clamp(30px, 9vw, 40px)/1 var(--display); color: var(--ink); }
.cd-lbl { display: block; margin-top: 3px; font: 400 12px/1 var(--sc); letter-spacing: 0.12em; color: var(--wax); }

.headcount {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 16px; padding: 8px 12px;
  border-left: 3px solid var(--ink);
  background: rgba(120, 78, 30, 0.08);
}
.headcount .big { font: 700 46px/1 var(--display); color: var(--ink); min-width: 1.2em; text-align: center; }
.headcount .what { display: flex; flex-direction: column; }
.headcount .what b { font: 400 17px/1.2 var(--sc); letter-spacing: 0.06em; color: var(--ink); }
.headcount .what span { color: var(--ink-faint); font-size: 16px; font-style: italic; }
.headcount.odd { border-left-color: var(--wax); }
.headcount.odd .big, .headcount.odd .what b { color: var(--wax); }

/* ---------- buttons: a wax-red ribbon, a parchment one, wooden plaques ---------- */

.btn-wrap { filter: drop-shadow(0 3px 0 rgba(60, 10, 10, 0.55)) drop-shadow(0 8px 12px rgba(40, 10, 5, 0.3)); margin: 0 0 6px; }
.btn {
  display: block; width: 100%;
  padding: 15px 26px 13px;
  border: 0; cursor: pointer;
  font: 700 26px/1 var(--display); letter-spacing: 0.02em;
  color: var(--gold-hi);
  text-shadow: 0 1px 0 #3a0808, 0 0 10px rgba(255, 200, 100, 0.25);
  background:
    radial-gradient(ellipse at 30% 15%, rgba(255, 130, 130, 0.35), transparent 55%),
    linear-gradient(180deg, #ad2626, #8e1b1b 50%, #6a1111);
  clip-path: var(--ribbon);
  transition: transform 0.12s ease, filter 0.2s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.985); }
.btn[disabled] { cursor: not-allowed; color: rgba(43, 26, 14, 0.55); text-shadow: none; background: linear-gradient(180deg, #b9a586, #9a8667); }
.btn-wrap:has(.btn[disabled]) { filter: drop-shadow(0 3px 0 rgba(43, 26, 14, 0.3)); }

/* "Abandon Quest": parchment ribbon edged in ink (outer ink, inner parchment, same shape). */
.btn.ghost { padding: 2px; background: var(--ink); color: var(--wax); text-shadow: none; }
.btn.ghost > span { display: block; padding: 13px 26px 11px; background: linear-gradient(176deg, #fbf2dd, #ead6a6); clip-path: inherit; }
.btn.ghost:hover > span { background: linear-gradient(176deg, #fff8e8, #f0dfb6); }
.btn-wrap.ghost { filter: drop-shadow(0 3px 0 rgba(43, 26, 14, 0.35)); }

.btn-hint { text-align: center; margin: 0 0 14px; color: var(--ink-faint); font-style: italic; }

.btn-small {
  flex: none; padding: 10px 16px 8px; cursor: pointer;
  font: 400 15px/1 var(--sc); letter-spacing: 0.08em;
  color: var(--gold-hi);
  background: linear-gradient(180deg, #74482a, #4e2e17);
  border: 0; border-radius: 4px;
  box-shadow: inset 0 0 0 1px #2e180b, inset 0 0 0 2px rgba(200, 150, 90, 0.45), 0 2px 0 rgba(43, 26, 14, 0.35);
}
.btn-small:hover { filter: brightness(1.12); }
.btn-small.quiet { background: rgba(90, 58, 26, 0.14); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(90, 58, 26, 0.35); }
.btn-small.warn { background: linear-gradient(180deg, #a42424, #7a1515); color: var(--gold-hi); }
.btn-small.quiet.danger { color: var(--wax); }
.btn-small[disabled] { opacity: 0.5; cursor: not-allowed; }

.me-status {
  margin: 4px 0 0; padding: 10px 14px;
  border-left: 3px solid var(--ink);
  background: rgba(255, 250, 235, 0.45);
}
.me-status b { color: var(--ink); font: 700 1.02em/1.3 var(--display); }
.me-status.out { border-left-color: var(--wax); background: rgba(142, 27, 27, 0.08); }
.me-status.out b { color: var(--wax); }
.me-status small { display: block; color: var(--ink-faint); font-size: 16px; font-style: italic; margin-top: 2px; }

/* ---------- who goes there ---------- */

.picker { padding: 12px 14px 14px; border: 2px dashed rgba(43, 26, 14, 0.35); border-radius: 4px; margin-bottom: 4px; background: rgba(255, 250, 235, 0.3); }
.picker-head { display: flex; flex-direction: column; gap: 0; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px 6px 9px; cursor: pointer;
  font: 700 18px/1 var(--display);
  color: var(--ink);
  background: #fbf3dc;
  border: 1px solid rgba(90, 58, 26, 0.45);
  border-radius: 3px;
  box-shadow: 1px 2px 0 rgba(90, 58, 26, 0.25);
}
.chip:nth-child(3n) { transform: rotate(-1.5deg); }
.chip:nth-child(3n+1) { transform: rotate(1deg); }
.chip:hover { background: #fff8e6; border-color: var(--wax); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--wax); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chip .icon { width: 16px; height: 16px; }
.newname label { display: block; margin-bottom: 4px; }
.newname > .field { display: block; width: 100%; margin-bottom: 14px; }
.nudge { margin-top: 14px; padding: 10px 14px 12px; border: 2px dashed rgba(43, 26, 14, 0.3); border-radius: 4px; }
.row-input { display: flex; gap: 10px; align-items: flex-end; }
.field {
  flex: 1; min-width: 0;
  padding: 8px 4px 5px;
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font: italic 400 20px/1.2 var(--body);
}
.field::placeholder { color: rgba(90, 58, 26, 0.45); }
.field:focus { outline: none; border-bottom-color: var(--wax); background: rgba(255, 250, 235, 0.45); }
.linkish { background: none; border: 0; padding: 0; color: var(--wax); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font: italic 400 16px/1.3 var(--body); }

/* ---------- the party ---------- */

.line { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 6px 7px 0;
  border-bottom: 1px dashed var(--rule);
}
.row:last-child { border-bottom: 0; }
.row.new { animation: ink-in 0.4s ease both; }
.pos { font: 700 27px/1 var(--display); color: var(--wax); text-align: center; }
.who { display: flex; flex-direction: column; min-width: 0; }
.who .name { display: flex; align-items: center; gap: 7px; font: 700 21px/1.15 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .stamp { font: italic 400 14px/1.3 var(--body); color: var(--ink-faint); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tag {
  font: 400 13px/1 var(--sc); letter-spacing: 0.07em;
  padding: 5px 7px 3px;
  border: 2px solid currentColor; border-radius: 3px 5px 2px 6px;
  white-space: nowrap;
  transform: rotate(-3deg);
  mix-blend-mode: multiply;
}
.tag.you { color: var(--ink); transform: rotate(2deg); }
.tag.out { color: var(--wax); }
.row.is-me { background: linear-gradient(90deg, rgba(255, 210, 100, 0.4), rgba(255, 210, 100, 0.12) 70%, transparent); }
.row.is-out { background: linear-gradient(90deg, rgba(142, 27, 27, 0.13), rgba(142, 27, 27, 0.03) 70%, transparent); }
.row.is-out .name { color: var(--wax); }
.empty { margin: 0; color: var(--ink-faint); font-style: italic; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0 0; padding-top: 10px; border-top: 3px double var(--rule); color: var(--ink-faint); font-size: 16px; font-style: italic; }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }
.legend .tag { font-style: normal; }

/* ---------- when can you ride out ---------- */

#availability { --tilt: -0.35deg; }
.week-tabs { display: flex; gap: 8px; margin: 0 0 12px; }
.week-tab {
  flex: 1; padding: 8px 10px 6px; cursor: pointer; text-align: center;
  font: 700 17px/1.1 var(--display); color: var(--ink-soft);
  background: rgba(255, 250, 235, 0.4);
  border: 2px solid var(--rule); border-radius: 4px;
}
.week-tab small { display: block; margin-top: 2px; font: italic 400 14px/1.2 var(--body); color: var(--ink-faint); }
.week-tab[aria-selected="true"] { color: var(--wax); border-color: var(--wax); background: #fbf3dc; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0 0 12px; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 0; padding: 8px 0 6px; cursor: pointer;
  font: 400 13px/1 var(--sc); color: var(--ink-soft);
  background: #fbf3dc;
  border: 2px solid rgba(90, 58, 26, 0.35); border-radius: 4px;
}
.day b { font: 700 21px/1 var(--display); color: var(--ink); }
.day .mark { height: 13px; font: 400 12px/1 var(--sc); letter-spacing: 0.04em; color: var(--open); }
.day[aria-pressed="true"] { background: linear-gradient(180deg, #edf3dc, #d5e6b8); border-color: var(--open); box-shadow: inset 0 0 0 1px rgba(47, 93, 30, 0.35); }
.day[aria-pressed="true"] b { color: var(--open); }
.day:disabled { cursor: not-allowed; }
.day:disabled:not([aria-pressed="true"]) { opacity: 0.4; }
.avail-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* admin: who's free when */
.avail-wrap { overflow-x: auto; margin: 0 0 12px; }
.avail { width: 100%; border-collapse: collapse; }
.avail th, .avail td { padding: 6px 3px; text-align: center; border-bottom: 1px dashed var(--rule); }
.avail thead th { font: 400 12px/1.1 var(--sc); color: var(--ink-faint); }
.avail thead th b { display: block; font: 700 18px/1 var(--display); color: var(--ink); }
.avail td.name { text-align: left; padding-right: 8px; font: 700 16px/1.2 var(--display); white-space: nowrap; }
.avail td.yes { font: 700 18px/1 var(--display); color: var(--open); }
.avail td.no { color: rgba(90, 58, 26, 0.35); }
.avail td.none { text-align: left; font: italic 400 15px/1.2 var(--body); color: var(--ink-faint); }
.avail .past { opacity: 0.45; }
.avail .all { background: rgba(47, 93, 30, 0.13); }
.avail tfoot td { border-bottom: 0; font: 700 17px/1 var(--display); color: var(--wax); }
.avail tfoot td.name { color: var(--ink-faint); font: italic 400 15px/1.2 var(--body); }
.picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }

/* ---------- house rules ---------- */

.edicts summary { cursor: pointer; list-style: none; margin-bottom: 0; border-bottom: 0; padding-bottom: 0; }
.edicts summary::-webkit-details-marker { display: none; }
.edicts summary::after { content: '+'; font: 700 28px/1 var(--display); color: var(--wax); margin-left: auto; }
.edicts[open] summary { margin-bottom: 14px; padding-bottom: 8px; border-bottom: 3px double var(--rule); }
.edicts[open] summary::after { content: '−'; }
.edict-list { margin: 0; padding: 0; list-style: none; counter-reset: edict; display: flex; flex-direction: column; gap: 12px; }
.edict-list li { counter-increment: edict; position: relative; padding-left: 40px; color: var(--ink-soft); }
.edict-list li::before {
  content: counter(edict, upper-roman) '.';
  position: absolute; left: 0; top: -2px; width: 32px;
  font: 700 24px/1.2 var(--display); color: var(--wax); text-align: right;
}
.edict-list strong { color: var(--ink); font-weight: 400; font-style: italic; }

/* ---------- quest log ---------- */

.hist { list-style: none; margin: 0 0 18px; padding: 0; }
.hist li { display: grid; grid-template-columns: 100px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--rule); }
.hist li:last-child { border-bottom: 0; }
.hist .d { font: 400 16px/1.4 var(--sc); color: var(--wax); }
.hist .r { color: var(--ink-soft); }
.hist .r b { color: var(--wax); font: 700 1em/1.3 var(--display); }
.hist .r.cx { color: var(--ink-faint); font-style: italic; }
.tally { display: flex; flex-direction: column; gap: 8px; }
.tally-row { display: grid; grid-template-columns: minmax(70px, 30%) 1fr 26px; gap: 10px; align-items: center; font: 700 18px/1.2 var(--display); }
.tally-row .n { font: 700 22px/1 var(--display); color: var(--wax); text-align: right; }
.bar { height: 12px; border: 1.5px solid var(--ink); border-radius: 2px; }
.bar i { display: block; height: 100%; background: repeating-linear-gradient(-55deg, var(--wax) 0 2px, transparent 2px 5px); }
.sub-head { margin: 4px 0 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* ---------- other notices on the board (flavor) ---------- */

.flavor { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; }
.note {
  position: relative;
  flex: 1 1 240px;
  margin: 0 0 22px;
  padding: 24px 16px 22px;
  color: var(--ink);
  background: linear-gradient(176deg, #f5e8c8, #e6d09e);
  box-shadow: inset 0 0 18px rgba(120, 72, 22, 0.28), 2px 7px 10px rgba(40, 18, 4, 0.4);
  transform: rotate(var(--tilt, 1deg));
  /* torn bottom edge */
  clip-path: polygon(0 0, 100% 0, 100% 94%, 92% 97%, 84% 93%, 75% 98%, 66% 94%, 57% 99%, 48% 94%, 38% 98%, 29% 93%, 20% 97%, 11% 93%, 4% 97%, 0 94%);
}
.note::before {
  content: '';
  position: absolute; top: 7px; left: 50%;
  width: 13px; height: 13px; margin-left: -6.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd9d9 0 2px, #c43c3c 3px, #7a1515 6px);
}
.note:nth-child(2) { --tilt: -1.4deg; }
.note:nth-child(3) { --tilt: 0.6deg; flex-basis: 100%; }
.note h3 { margin: 0 0 4px; text-align: center; font: 400 26px/1 var(--sign); color: var(--wax); letter-spacing: 0.06em; }
.note p { margin: 0 0 6px; font: 500 21px/1.2 var(--hand); color: var(--ink-soft); text-align: center; }
.note .sig { display: block; text-align: right; font: 700 19px/1 var(--hand); color: var(--ink-faint); }

/* ---------- under the board ---------- */

.foot { position: relative; text-align: center; color: var(--wall-text); font-size: 17px; padding-top: 4px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.foot b { font: 700 1em/1.3 var(--display); }
.foot .linkish { color: var(--gold-hi); }
.foot .divider { display: block; margin: 14px auto; width: 160px; height: 10px; background: radial-gradient(circle, var(--gold) 0 3px, transparent 3.5px) center / 10px 10px no-repeat, linear-gradient(var(--gold), var(--gold)) left center / 70px 1px no-repeat, linear-gradient(var(--gold), var(--gold)) right center / 70px 1px no-repeat; opacity: 0.7; }
.sanctum { font: 700 20px/1 var(--display); color: var(--gold-hi); text-decoration: none; }
.sanctum:hover { color: #fff; }

/* ---------- tavern sounds button ---------- */

.sound-btn {
  position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 55;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px 8px 11px;
  border: 0; border-radius: 999px; cursor: pointer;
  font: 400 15px/1 var(--sc); letter-spacing: 0.04em;
  color: var(--gold-hi);
  background: linear-gradient(180deg, #7a4d28, #4f2e17);
  box-shadow: inset 0 0 0 1px #2e180b, inset 0 0 0 2.5px rgba(200, 150, 90, 0.5), 0 6px 16px rgba(0, 0, 0, 0.55);
}
.sound-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sound-btn[aria-pressed="true"] { color: #fff6d8; background: linear-gradient(180deg, #a1652e, #6b3f1c); box-shadow: inset 0 0 0 1px #2e180b, inset 0 0 0 2.5px rgba(255, 200, 120, 0.7), 0 0 18px rgba(255, 170, 70, 0.45), 0 6px 16px rgba(0, 0, 0, 0.55); }
.sound-btn[aria-pressed="true"] .waves { animation: blink 1.6s ease-in-out infinite; }
.sound-btn[aria-pressed="false"] .waves { opacity: 0.25; }

.toast {
  position: fixed; left: 50%; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 30px) rotate(-1deg); opacity: 0; pointer-events: none;
  width: min(92vw, 520px); padding: 12px 16px 10px;
  font: italic 400 18px/1.3 var(--body); text-align: center;
  color: var(--ink);
  background: linear-gradient(176deg, #f8edd4, #e4cd98);
  border: 2px solid var(--wood);
  border-radius: 3px;
  box-shadow: 0 10px 26px rgba(20, 8, 2, 0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-1deg); }
.toast.bad { border-color: var(--wax); }

/* ---------- admin (behind the bar) ---------- */

.sign-wrap.compact h1 { font-size: clamp(30px, 9vw, 46px); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.sched { display: flex; flex-direction: column; gap: 14px; }
.sched label { display: flex; flex-direction: column; gap: 4px; }
.pair { display: flex; gap: 12px; }
.pair > * { flex: 1; }
select.field {
  appearance: none; font-style: normal; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input[type="time"].field, input[type="date"].field { font-style: normal; }
.roster { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.roster li { display: grid; grid-template-columns: 1fr 1.4fr; gap: 6px 12px; align-items: end; padding-bottom: 12px; border-bottom: 1px dashed var(--rule); }
.roster li:last-child { border-bottom: 0; }
.roster .acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.roster .acts .hint { margin-right: auto; }
.roster li.hidden-person .field { opacity: 0.45; text-decoration: line-through; }
.row .btn-small { margin-left: 4px; }
@media (max-width: 460px) { .roster li { grid-template-columns: 1fr; } }
.rule { border: 0; border-top: 3px double var(--rule); margin: 18px 0 14px; }
.sched .check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-style: italic; color: var(--ink-soft); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--wax); }
.me-status.banner { margin: 0 0 22px; background: linear-gradient(176deg, #f8edd4, #e4cd98); box-shadow: 0 8px 20px rgba(20, 8, 2, 0.45); }
.sched .btn-wrap { margin-top: 6px; }

/* ---------- motion ---------- */

@keyframes sway { 0%, 100% { transform: rotate(-0.6deg); } 50% { transform: rotate(0.6deg); } }
@keyframes firelight {
  0%, 100% { opacity: 0.85; } 12% { opacity: 1; } 20% { opacity: 0.7; } 33% { opacity: 0.95; }
  47% { opacity: 0.75; } 58% { opacity: 1; } 71% { opacity: 0.8; } 85% { opacity: 0.95; }
}
@keyframes blink { 50% { opacity: 0.3; } }
@keyframes ink-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* The sounds button only shows its words when there's room beside the board. */
@media (max-width: 899px) {
  .sound-btn .label { display: none; }
  .sound-btn { padding: 11px; }
}
@media (max-width: 480px) {
  .frame { padding-left: 10px; padding-right: 10px; }
  .board { border-width: 9px; padding: 22px 9px 2px; }
  .plate { padding: 24px 14px 18px; }
}
@media (max-width: 380px) {
  .row { grid-template-columns: 34px 1fr auto; }
  .tag { font-size: 12px; padding: 4px 5px 2px; }
}
