/* ==========================================================
   The Ducks Club: house style
   Rich blacks, cream, racing green, navy, oxblood, brass.
   ========================================================== */

:root {
  --ink:        #0d0c0a;
  --ink-2:      #15130f;
  --ink-3:      #1d1a15;
  --cream:      #ece3cf;
  --cream-dim:  #b9b09c;
  --parchment:  #e9dfc6;
  --paper-ink:  #231f19;
  --green:      #1d3a2a;
  --green-deep: #142a1e;
  --navy:       #1a2536;
  --oxblood:    #6a1d22;
  --oxblood-hi: #8a2a30;
  --brass:      #b8955a;
  --brass-dim:  #8a7046;
  --rule:       rgba(184, 149, 90, .28);

  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --caps:   "Playfair Display SC", "Playfair Display", Georgia, serif;
  --serif:  "Playfair Display", Georgia, serif;
  --body:   "EB Garamond", Garamond, Georgia, serif;
  --wire:   "Courier Prime", "Courier New", monospace;
  --flip:   "IBM Plex Mono", "Consolas", monospace;

  --wrap: 1080px;
}

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

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(184,149,90,.07), transparent 60%),
    var(--ink);
  color: var(--cream);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brass); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--cream); }

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

/* Hide member pages until the porter has checked the door */
html.locked body { visibility: hidden; }

/* ---------- The duck emblem, tinted to any colour ---------- */
.duck {
  display: inline-block;
  aspect-ratio: 736 / 952;
  position: relative;
  color: var(--brass);
}
.duck img { width: 100%; height: 100%; display: block; mix-blend-mode: screen; }
@supports (mask-mode: luminance) {
  .duck {
    background: currentColor;
    mask: url("duck.jpg") center / contain no-repeat;
    mask-mode: luminance;
  }
  .duck img { visibility: hidden; }
}

/* ---------- Shared type ---------- */
.script { font-family: var(--script); font-weight: 400; line-height: 1; }
.caps   { font-family: var(--caps); letter-spacing: .22em; text-transform: none; }
.kicker {
  font-family: var(--caps);
  font-size: .8rem;
  letter-spacing: .32em;
  color: var(--brass);
  margin: 0 0 .75rem;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.15; }

.rule {
  display: flex; align-items: center; gap: 14px;
  color: var(--brass); margin: 28px auto; max-width: 320px;
}
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.rule span { font-size: .7rem; }

/* ==========================================================
   THE DOOR (index.html)
   ========================================================== */
.entrance {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: var(--ink);
}

/* Left: the crest, oxblood with a fine brass diamond pattern */
.crest-panel {
  position: relative;
  background-color: var(--oxblood);
  background-image:
    radial-gradient(circle, rgba(201,166,103,.32) 1px, transparent 1.6px),
    radial-gradient(circle, rgba(201,166,103,.32) 1px, transparent 1.6px),
    linear-gradient(160deg, rgba(255,255,255,.04), rgba(0,0,0,.25));
  background-size: 18px 18px, 18px 18px, 100% 100%;
  background-position: 0 0, 9px 9px, 0 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.crest-panel::before { /* double brass frame, as on the letterhead crest */
  content: "";
  position: absolute; inset: 22px;
  border: 1px solid rgba(201,166,103,.7);
  box-shadow: 0 0 0 4px var(--oxblood), 0 0 0 5px rgba(201,166,103,.45);
  pointer-events: none;
}
.crest-panel .duck {
  width: min(52%, 360px);
  color: #c9a667;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}

/* Right: cream card, set like the letterhead */
.card {
  background: var(--parchment);
  color: var(--paper-ink);
  display: flex; flex-direction: column; justify-content: center;
  margin: 0; max-width: none;
  padding: 64px clamp(28px, 7vw, 96px);
}
.card h1 {
  font-family: var(--script);
  color: var(--oxblood);
  font-size: clamp(3rem, 6.4vw, 5rem);
  line-height: 1.05;
  margin: 0;
}
.card .motto {
  font-family: var(--caps);
  letter-spacing: .18em;
  font-size: .9rem;
  color: #3b342a;
  margin: 10px 0 0;
}
.card hr {
  border: 0; height: 1px; background: var(--oxblood);
  width: 100%; max-width: 380px; margin: 36px 0 32px;
  opacity: .6;
}

.porter { max-width: 380px; }
.porter > label {
  display: block;
  font-family: var(--body);
  font-size: 1.05rem;
  color: #3b342a;
  margin-bottom: 8px;
}
.porter .field { display: flex; gap: 0; }
.porter input[type="password"] {
  flex: 1; min-width: 0;
  font-family: var(--body);
  font-size: 1.15rem;
  padding: 11px 14px;
  color: var(--paper-ink);
  background: #f6f0e1;
  border: 1px solid #b8ab8e;
  border-right: 0;
  border-radius: 0;
  outline: none;
}
.porter input[type="password"]:focus { border-color: var(--oxblood); background: #fbf7ec; }
.porter button {
  font-family: var(--caps); letter-spacing: .14em; font-size: .9rem;
  padding: 0 22px;
  background: var(--ink); color: var(--parchment);
  border: 1px solid var(--ink); border-radius: 0;
  cursor: pointer;
}
.porter button:hover { background: var(--oxblood); border-color: var(--oxblood); }
.porter .remember {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; font-size: .98rem; color: #5a5040; cursor: pointer;
}
.porter .remember input { accent-color: var(--oxblood); width: 15px; height: 15px; }
.porter .msg { min-height: 1.5em; margin: 12px 0 0; font-style: italic; color: var(--oxblood); font-size: 1.02rem; }
.porter .msg.ok { color: var(--green); }
.porter.shake .field { animation: shake .4s; }
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.card .fogg {
  margin: 56px 0 0;
  max-width: 380px;
  font-style: italic;
  font-size: 1.05rem;
  color: #4a4236;
}
.card .fogg span { font-style: normal; font-size: .95rem; color: #6d6352; }
.card .small {
  margin-top: 14px;
  font-size: .9rem; color: #7a705e;
}

.entrance.opening .card > * { transition: opacity .8s; opacity: 0; }

@media (max-width: 820px) {
  .entrance { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .crest-panel { min-height: 34vh; padding: 36px 0; }
  .crest-panel::before { inset: 12px; }
  .crest-panel .duck { width: 120px; }
  .card { justify-content: flex-start; padding: 40px 22px 48px; }
  .card hr { margin: 26px 0 24px; }
  .card .fogg { margin-top: 40px; }
}

/* ==========================================================
   MEMBER PAGES: header, clocks, nav, footer
   ========================================================== */
/* ---------- World clocks: split-flap board ---------- */
.clocks {
  background: linear-gradient(#0a0908, #11100d);
  border-bottom: 1px solid var(--rule);
  box-shadow: inset 0 -8px 16px rgba(0,0,0,.35);
  overflow-x: auto;
  scrollbar-width: none;
}
.clocks::-webkit-scrollbar { display: none; }
.board {
  display: flex; gap: 30px; justify-content: center;
  width: max-content; min-width: 100%;
  margin: 0 auto; padding: 12px 16px 14px;
}
.city { display: flex; flex-direction: column; gap: 5px; }
.city .name {
  font-family: var(--caps); font-size: .66rem; letter-spacing: .24em;
  color: var(--brass); white-space: nowrap;
}
.time { display: flex; align-items: center; font-size: 17px; }
.colon {
  width: .55em; text-align: center;
  font-family: var(--flip); color: var(--brass-dim);
}

.flap {
  position: relative;
  display: inline-block;
  width: 1.05em; height: 1.55em;
  margin: 0 1px;
  perspective: 120px;
  font-family: var(--flip); font-weight: 500;
  color: var(--cream);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.flap .h {
  position: absolute; left: 0; right: 0; height: 50%;
  overflow: hidden;
  backface-visibility: hidden;
}
.flap .t, .flap .ft { top: 0; border-radius: 2px 2px 0 0; background: linear-gradient(#2a2620, #221f1a); }
.flap .b, .flap .fb { bottom: 0; border-radius: 0 0 2px 2px; background: linear-gradient(#1e1b17, #171511); }
.flap b {
  display: block; height: 200%;
  line-height: 1.55em; text-align: center; font-weight: 500;
}
.flap .b b, .flap .fb b { transform: translateY(-50%); }
.flap::after { /* the hinge */
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; margin-top: -.5px;
  background: rgba(0,0,0,.85); z-index: 3;
}
.flap .ft, .flap .fb { display: none; z-index: 2; }
.flap .ft { transform-origin: 50% 100%; }
.flap .fb { transform-origin: 50% 0; transform: rotateX(90deg); }
.flap.go .ft, .flap.go .fb { display: block; }
.flap.go .ft { animation: flap-down .15s ease-in forwards; }
.flap.go .fb { animation: flap-up .15s .15s ease-out forwards; }
@keyframes flap-down { from { transform: rotateX(0); } to { transform: rotateX(-90deg); filter: brightness(.6); } }
@keyframes flap-up   { from { transform: rotateX(90deg); filter: brightness(1.4); } to { transform: rotateX(0); } }

.bar {
  max-width: var(--wrap); margin: 0 auto;
  padding: 18px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--cream); }
.brand .duck { width: 30px; }
.brand .script { font-size: 2rem; }
.bar ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 26px; margin: 0; padding: 0; align-items: center; }
.bar a, .bar button {
  font-family: var(--caps); font-size: .8rem; letter-spacing: .22em;
  color: var(--cream-dim); text-decoration: none;
  background: none; border: 0; cursor: pointer; padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.bar a:hover, .bar button:hover { color: var(--cream); }
.bar a[aria-current="page"] { color: var(--brass); border-bottom-color: var(--brass); }
.bar button { color: var(--brass-dim); }

main { max-width: var(--wrap); margin: 0 auto; padding: 24px 16px 80px; }

.page-head { text-align: center; padding: 40px 0 36px; }
.page-head h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }
.page-head p.lede { max-width: 560px; margin: 14px auto 0; color: var(--cream-dim); font-style: italic; }

.foot {
  border-top: 1px solid var(--rule);
  text-align: center; padding: 36px 16px 48px; color: var(--cream-dim);
}
.foot .duck { width: 26px; color: var(--brass-dim); }
.foot p { margin: 8px 0 0; font-family: var(--caps); letter-spacing: .3em; font-size: .7rem; }

/* ==========================================================
   THE ITINERARY (events.html)
   ========================================================== */
.ticket {
  display: grid;
  grid-template-columns: 190px 1fr;
  background: var(--green);
  border: 1px solid rgba(184,149,90,.4);
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.ticket .stub {
  padding: 28px 20px;
  text-align: center;
  border-right: 2px dashed rgba(236,227,207,.22);
  background: var(--green-deep);
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.stub .leg { font-family: var(--caps); font-size: .72rem; letter-spacing: .3em; color: var(--brass); }
.stub .day { font-family: var(--serif); font-size: 3.6rem; line-height: 1; }
.stub .month { font-family: var(--caps); letter-spacing: .25em; font-size: .9rem; }
.stub .year { color: var(--cream-dim); font-size: .9rem; }
.ticket .body { padding: 28px 32px; }
.ticket h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 10px; }
.ticket .countdown {
  display: inline-block;
  font-family: var(--caps); letter-spacing: .2em; font-size: .72rem;
  color: var(--ink); background: var(--brass);
  padding: 4px 10px; margin-bottom: 14px;
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 14px 0 0; }
.facts dt { font-family: var(--caps); letter-spacing: .2em; font-size: .75rem; color: var(--brass); padding-top: 4px; }
.facts dd { margin: 0; }
.ticket p.details { margin: 16px 0 0; color: var(--cream); opacity: .9; }
.btn {
  display: inline-block; margin-top: 20px;
  font-family: var(--caps); letter-spacing: .25em; font-size: .78rem;
  color: var(--cream); text-decoration: none;
  border: 1px solid var(--brass); padding: 10px 20px;
  background: none; cursor: pointer;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--brass); color: var(--ink); }

.section-title {
  display: flex; align-items: center; gap: 18px;
  font-family: var(--caps); letter-spacing: .3em; font-size: .85rem; color: var(--brass);
  margin: 64px 0 18px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.legs { list-style: none; margin: 0; padding: 0; }
.legs li {
  display: grid; grid-template-columns: 150px 1fr auto; gap: 8px 28px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid rgba(236,227,207,.08);
}
.legs .when { font-family: var(--caps); letter-spacing: .14em; font-size: .85rem; color: var(--brass); }
.legs h3 { font-size: 1.35rem; }
.legs .where { color: var(--cream-dim); font-style: italic; margin-top: 2px; }
.legs .dress { font-family: var(--caps); letter-spacing: .18em; font-size: .72rem; color: var(--cream-dim); white-space: nowrap; }
.legs.past li { opacity: .55; }
.legs.past .when::after { content: "  ·  Completed"; color: var(--cream-dim); }
.empty { color: var(--cream-dim); font-style: italic; text-align: center; padding: 30px 0; }

/* ==========================================================
   THE CLUBHOUSE (clubhouse.html and room.html)
   A strategy-game view: the stage on the left, HUD on the right
   ========================================================== */
.game-page .foot { display: none; }

.game {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "stage plaque" "stage side";
  background: #0c0b09;
  height: calc(100vh - var(--head, 140px));
  height: calc(100dvh - var(--head, 140px));
  min-height: 560px;
  border-top: 1px solid var(--rule);
}

.stage {
  grid-area: stage;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(184,149,90,.35);
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.65)),
    linear-gradient(rgba(184,149,90,.05) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(184,149,90,.05) 1px, transparent 1px) 0 0 / 32px 32px,
    #0a0908;
}
.stage .scene {
  position: absolute; inset: 20px;
  width: calc(100% - 40px); height: calc(100% - 40px);
  animation: camera .9s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes camera { from { opacity: 0; transform: scale(1.06); } }

/* HUD panels: dark glass with brass corner brackets */
.hud {
  --c: var(--brass);
  position: relative;
  padding: 14px 16px 16px;
  border: 1px solid rgba(184,149,90,.28);
  background:
    linear-gradient(var(--c), var(--c)) top left / 14px 2px,
    linear-gradient(var(--c), var(--c)) top left / 2px 14px,
    linear-gradient(var(--c), var(--c)) top right / 14px 2px,
    linear-gradient(var(--c), var(--c)) top right / 2px 14px,
    linear-gradient(var(--c), var(--c)) bottom left / 14px 2px,
    linear-gradient(var(--c), var(--c)) bottom left / 2px 14px,
    linear-gradient(var(--c), var(--c)) bottom right / 14px 2px,
    linear-gradient(var(--c), var(--c)) bottom right / 2px 14px,
    rgba(14,13,11,.92);
  background-repeat: no-repeat;
}
.hud-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--caps); font-size: .7rem; letter-spacing: .28em;
  color: var(--brass); margin-bottom: 10px;
}
.hud-title::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.key {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 5px;
  border: 1px solid var(--brass-dim); border-bottom-width: 2px; border-radius: 3px;
  font-family: var(--flip); font-size: .72rem; color: var(--brass);
  background: rgba(0,0,0,.35);
  line-height: 1;
}

.side {
  grid-area: side;
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}
.side-h { font-size: 1.8rem; }
.side-p { margin: 6px 0 0; color: var(--cream-dim); font-style: italic; font-size: 1rem; line-height: 1.45; }

.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.roster a {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: center;
  padding: 8px 10px; text-decoration: none; color: var(--cream);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.roster a:hover, .roster a.hot { background: rgba(201,166,103,.08); border-color: rgba(184,149,90,.4); }
.r-name { display: block; font-family: var(--serif); font-size: 1.05rem; line-height: 1.2; }
.r-tag { display: block; font-style: italic; color: var(--cream-dim); font-size: .92rem; line-height: 1.3; }

.hint {
  position: absolute; left: 16px; bottom: 12px; z-index: 2;
  margin: 0; font-size: .85rem; color: var(--cream-dim);
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  pointer-events: none;
}

.tip {
  position: absolute; z-index: 5; display: none;
  transform: translate(14px, 14px);
  pointer-events: none;
  padding: 5px 10px;
  background: rgba(10,9,8,.95); border: 1px solid var(--brass);
  font-family: var(--caps); font-size: .74rem; letter-spacing: .14em; color: var(--cream);
  white-space: nowrap;
}
.tip.on { display: block; }

/* Floor plan */
.plan-room { cursor: pointer; outline: none; }
.plan-room .hl { fill: rgba(201,166,103,0); stroke: transparent; stroke-width: 4; transition: fill .2s, stroke .2s; }
.plan-room:hover .hl, .plan-room.hot .hl, .plan-room:focus-visible .hl { fill: rgba(201,166,103,.1); stroke: var(--brass); }
.plate { transition: opacity .25s; pointer-events: none; }
.plate rect { fill: rgba(10,9,8,.84); stroke: var(--brass); stroke-width: .8; }
.plate-name { font-family: var(--caps); font-size: 16px; letter-spacing: 1.5px; fill: var(--cream); }
.plate-key { font-family: var(--flip); font-size: 9.5px; letter-spacing: 2px; fill: var(--brass); }
.plan-room:hover .plate, .plan-room.hot .plate { opacity: .15; }

/* Furniture you can select */
.spot { cursor: pointer; outline: none; transition: filter .15s; }
.spot:hover:not(:has(.photo:hover)), .spot:focus-visible, .spot.on { filter: brightness(1.22) drop-shadow(0 0 3px rgba(232,201,122,.65)); }
/* Members' portraits in the Gallery, each one clickable */
.photo { cursor: pointer; outline: none; transition: filter .15s; }
.photo:hover, .photo:focus-visible, .photo.on { filter: brightness(1.18) drop-shadow(0 0 3px rgba(232,201,122,.75)); }
.sel-box { fill: rgba(232,201,122,.06); stroke: #e8c97a; stroke-width: 1; stroke-dasharray: 4 3; animation: march 1.1s linear infinite; }
.sel-corners { fill: none; stroke: #e8c97a; stroke-width: 2.2; }
@keyframes march { to { stroke-dashoffset: -14; } }

/* Fire and lamplight */
.flame { transform-box: fill-box; transform-origin: center; animation: flick 1.7s ease-in-out infinite alternate; }
@keyframes flick { 0% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08, 1.15); } 100% { opacity: .9; transform: scale(.95, 1); } }
.glow.fire { animation: fireglow 2.3s ease-in-out infinite alternate; }
@keyframes fireglow { from { opacity: .7; } to { opacity: 1; } }

/* The old portrait in the Gallery: no glow, nothing to give it away */
.secret { cursor: pointer; outline: none; }
.upstairs { margin: 0; color: var(--cream-dim); font-style: italic; }

.vault {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 16px;
  background: rgba(5,4,3,.72);
  animation: vault-in .3s ease both;
}
@keyframes vault-in { from { opacity: 0; } }
.vault-box { width: 100%; max-width: 380px; padding: 24px 24px 18px; text-align: center; }
.vault-lead { margin: 0; color: var(--cream-dim); font-style: italic; font-size: 1rem; }
.vault-ins { margin: 10px 0 16px; font-family: var(--script); font-size: 2rem; color: #e8c97a; line-height: 1.2; }
.vault input {
  width: 100%; font: inherit; font-size: 1.1rem; text-align: center; letter-spacing: .1em;
  color: var(--cream); background: #15130f; border: 1px solid rgba(184,149,90,.4); padding: 9px;
}
.vault input:focus { outline: none; border-color: var(--brass); }
.vault-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.vault-row button { font-family: var(--caps); font-size: .74rem; letter-spacing: .16em; padding: 9px 14px; cursor: pointer; border: 1px solid rgba(184,149,90,.5); background: none; color: var(--cream-dim); }
.vault-row .vault-yes { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.vault-msg { min-height: 1.3em; margin: 10px 0 0; font-style: italic; color: var(--cream-dim); }
.vault.open .vault-box { transition: transform .7s ease, opacity .7s; transform: perspective(600px) rotateY(-70deg); transform-origin: left center; opacity: 0; }

/* The Members' Book, open on the Library lectern */
.ledger {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 16px;
  background: rgba(5,4,3,.78);
  animation: vault-in .3s ease both;
}
.ledger-book {
  position: relative; width: 100%; max-width: 900px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  background: #4a1a1d; padding: 14px; border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7), inset 0 0 0 1px rgba(201,166,103,.4);
  outline: none;
}
.ledger-book header {
  text-align: center; padding: 18px 20px 12px;
  background: var(--parchment); color: var(--paper-ink);
  border-bottom: 1px solid rgba(35,31,25,.25);
}
.ledger-book header .script { font-size: 1.6rem; color: var(--oxblood); display: block; line-height: 1; }
.ledger-book header h2 { font-family: var(--caps); font-weight: 400; font-size: 1.3rem; letter-spacing: .14em; margin: 4px 0 0; color: var(--paper-ink); }
.ledger-pages {
  overflow-y: auto; padding: 18px 28px 28px;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(35,31,25,.28) 50%, transparent calc(50% + 1px)),
    repeating-linear-gradient(transparent 0 31px, rgba(42,58,85,.16) 31px 32px),
    var(--parchment);
  color: var(--paper-ink);
  columns: 2; column-gap: 56px;
  min-height: 320px;
}
.ledger .entry { break-inside: avoid; padding: 10px 0 14px; border-bottom: 1px solid rgba(35,31,25,.18); }
.ledger .entry-no { font-family: var(--caps); font-size: .68rem; letter-spacing: .22em; color: var(--oxblood); }
.ledger .entry h3 { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; margin: 2px 0 0; color: var(--paper-ink); }
.ledger .entry-sub { font-style: italic; color: #5a4f40; }
.ledger dl { display: grid; grid-template-columns: 84px 1fr; gap: 2px 12px; margin: 8px 0 0; }
.ledger dt { font-family: var(--caps); font-size: .66rem; letter-spacing: .16em; color: #7a6a52; padding-top: .3em; }
.ledger dd { margin: 0; overflow-wrap: anywhere; }
.ledger dd a { color: var(--paper-ink); }
.ledger .entry-notes { margin: 8px 0 0; font-style: italic; color: #4a4134; }
.ledger-empty { column-span: all; text-align: center; font-style: italic; color: #7a6a52; margin: 120px 0; }
.ledger-close {
  position: absolute; top: 18px; right: 22px; z-index: 1;
  width: 34px; height: 34px; border: 0; background: none; cursor: pointer;
  font-size: 1.6rem; line-height: 1; color: var(--paper-ink);
}
@media (max-width: 700px) {
  .ledger-pages { columns: 1; padding: 14px 18px 20px; background: repeating-linear-gradient(transparent 0 31px, rgba(42,58,85,.16) 31px 32px), var(--parchment); }
  .ledger-book { padding: 8px; }
}

/* Room page HUD */
.plaque { grid-area: plaque; margin: 16px 16px 0; }
.plaque .up { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--cream-dim); text-decoration: none; margin-bottom: 10px; }
.plaque .up:hover { color: var(--cream); }
.plaque .num { font-family: var(--caps); font-size: .7rem; letter-spacing: .28em; color: var(--brass); }
.plaque h1 { font-size: 1.7rem; margin-top: 2px; }
.plaque .tag { font-style: italic; color: var(--cream-dim); font-size: 1rem; }
.plaque .chip {
  display: inline-block; margin-top: 10px; padding: 3px 9px;
  border: 1px solid rgba(184,149,90,.5); font-family: var(--caps); font-size: .68rem; letter-spacing: .2em; color: var(--brass);
}

.minimap svg { display: block; width: 100%; height: auto; }
.minimap a rect { transition: opacity .15s; }
.minimap a:hover rect { opacity: .75; }

.panel h2 { font-size: 1.35rem; }
.panel .sub { font-style: italic; color: var(--cream-dim); font-size: .95rem; }
.panel p { margin: 12px 0 0; color: var(--cream); opacity: .9; font-size: 1.02rem; line-height: 1.5; }
.panel .btn { margin-top: 16px; }
.panel .nokey { color: var(--brass-dim); font-style: italic; }
.panel .hint-inline { color: var(--cream-dim); font-style: italic; font-size: .95rem; }
.panel .back {
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--body); font-size: .95rem; color: var(--cream-dim);
}
.panel .back:hover { color: var(--cream); }
.unit { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; }
.portrait {
  width: 92px; height: 92px;
  border: 1px solid rgba(184,149,90,.5);
  background: #0a0908;
  box-shadow: inset 0 0 18px rgba(0,0,0,.8);
}
.portrait svg { display: block; width: 100%; height: 100%; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.panel .picture {
  margin: 14px 0 0; padding: 6px;
  background: linear-gradient(135deg, #c9a667, #8a7046);
  box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
.panel .picture img { display: block; width: 100%; max-height: 340px; object-fit: contain; background: #0a0908; }

.tabs { display: none; }

@media (max-width: 900px) {
  .game { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "plaque" "stage" "side" "tabs"; height: auto; min-height: 0; }
  .stage { aspect-ratio: 416 / 316; border-right: 0; }
  .tabs { grid-area: tabs; }
  .stage:has(.plan) { aspect-ratio: 1228 / 628; }
  .stage .scene { inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
  .hint { display: none; }
  .plaque { margin: 14px 16px; }
  .side { border-left: 0; border-top: 1px solid rgba(184,149,90,.35); }
  .minimap-box { display: none; }
  .tabs {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 24px; background: #0c0b09;
  }
  .tabs a {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 10px; border: 1px solid rgba(184,149,90,.3);
    color: var(--cream-dim); text-decoration: none; font-size: .95rem;
  }
  .tabs a[aria-current="page"] { color: var(--cream); border-color: var(--brass); }
}

/* ==========================================================
   THE SECRETARY'S OFFICE (admin.html)
   ========================================================== */
.of-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.of-door { width: 100%; max-width: 400px; text-align: center; padding: 32px 28px; }
.of-door .duck { width: 56px; }
.of-door h1 { font-size: 1.7rem; margin: 10px 0 22px; }
.of-door label { display: block; text-align: left; font-size: 1rem; color: var(--cream-dim); margin-bottom: 6px; }
.of-door a { display: inline-block; margin-top: 18px; font-size: .95rem; color: var(--cream-dim); }
.of-row { display: flex; gap: 8px; }
.of-row input { flex: 1; min-width: 0; }
.of-msg { min-height: 1.4em; margin: 10px 0 0; color: #e07a7f; font-style: italic; }

.office input[type="text"], .office input[type="password"], .office input[type="date"], .office input[type="time"],
.office input[type="email"], .office input[type="tel"],
.office textarea, .office select {
  width: 100%;
  font: inherit; font-size: 1.02rem;
  color: var(--cream); background: #15130f;
  border: 1px solid rgba(184,149,90,.35); border-radius: 2px;
  padding: 8px 10px;
  color-scheme: dark;
}
.office textarea { resize: vertical; line-height: 1.45; }
.office input:focus, .office textarea:focus, .office select:focus { outline: none; border-color: var(--brass); background: #1a1813; }

.of-btn {
  font-family: var(--caps); font-size: .76rem; letter-spacing: .14em;
  padding: 9px 14px; cursor: pointer; white-space: nowrap;
  color: var(--cream); background: transparent;
  border: 1px solid rgba(184,149,90,.55); border-radius: 2px;
}
.of-btn:hover { border-color: var(--brass); background: rgba(201,166,103,.08); }
.of-btn.primary { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.of-btn.primary:hover { background: #d8b878; }
.of-btn.primary:disabled { opacity: .4; cursor: default; }
.of-btn.ghost { border-color: transparent; color: var(--cream-dim); }

.of-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding: 12px 20px;
  background: rgba(13,12,10,.96);
  border-bottom: 1px solid rgba(184,149,90,.35);
}
.of-brand { display: flex; align-items: center; gap: 12px; }
.of-brand .duck { width: 28px; }
.of-brand .script { font-size: 1.8rem; display: block; }
.of-brand small { display: block; font-family: var(--caps); font-size: .66rem; letter-spacing: .26em; color: var(--brass); margin-top: 2px; }
.of-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.of-status { font-size: .95rem; font-style: italic; color: var(--cream-dim); margin-right: 6px; }
.of-status::before { content: "●"; font-style: normal; margin-right: 6px; color: #5f8f6a; }
.of-status.dirty::before { color: #e8c97a; }
.of-status.done { color: #9cc7a6; }
.of-status.bad { color: #e8a06a; }
.of-status.bad::before { color: #e07a7f; }
label.of-btn { display: inline-flex; align-items: center; justify-content: center; }

.of-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
.of-nav { display: flex; flex-direction: column; gap: 2px; padding: 24px 12px; position: sticky; top: 70px; align-self: start; }
.of-nav button {
  text-align: left; font: inherit; font-size: 1.05rem;
  color: var(--cream-dim); background: none; border: 0; border-left: 2px solid transparent;
  padding: 8px 12px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.of-nav button:hover { color: var(--cream); }
.of-nav button.on { color: var(--cream); border-left-color: var(--brass); background: rgba(201,166,103,.06); }
.of-count { font-family: var(--flip); font-size: .72rem; color: var(--brass); }

.of-main { padding: 28px 24px 80px; min-width: 0; margin: 0; max-width: 860px; width: 100%; }
.of-main h1 { font-size: 2rem; }
.of-intro { color: var(--cream-dim); font-style: italic; max-width: 640px; margin: 8px 0 22px; }
.of-empty { color: var(--cream-dim); font-style: italic; }
.of-add {
  font-family: var(--caps); font-size: .78rem; letter-spacing: .16em;
  color: var(--ink); background: var(--brass); border: 0; padding: 10px 16px; cursor: pointer; margin-bottom: 16px;
}
.of-list { display: grid; gap: 10px; }
.of-card { border: 1px solid rgba(184,149,90,.28); background: #110f0c; }
.of-card[open] { border-color: rgba(184,149,90,.55); }
.of-card summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; cursor: pointer; list-style: none;
}
.of-card summary::-webkit-details-marker { display: none; }
.of-sum { min-width: 0; display: flex; flex-direction: column; }
.of-sum b { font-weight: 500; font-size: 1.08rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-sum i { color: var(--cream-dim); font-size: .92rem; }
.of-tools { display: flex; gap: 4px; flex-shrink: 0; }
.of-tools button {
  font: inherit; font-size: .9rem; min-width: 32px; height: 30px;
  color: var(--cream-dim); background: none; border: 1px solid rgba(184,149,90,.25); cursor: pointer;
}
.of-tools button:hover:not(:disabled) { color: var(--cream); border-color: var(--brass); }
.of-tools button:disabled { opacity: .3; cursor: default; }
.of-tools .of-del { padding: 0 10px; }
.of-tools .of-del:hover { color: #e07a7f !important; border-color: #a0393f !important; }

.of-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding: 4px 14px 18px; }
.of-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.of-field.wide { grid-column: 1 / -1; }
.of-field.check { flex-direction: row; align-items: center; gap: 10px; grid-column: 1 / -1; cursor: pointer; }
.of-field.check input { width: 18px; height: 18px; accent-color: var(--brass); }
.of-label { font-family: var(--caps); font-size: .7rem; letter-spacing: .18em; color: var(--brass); }
.of-field.check .of-label { font-family: var(--body); font-size: 1rem; letter-spacing: 0; color: var(--cream); }
.of-hint { color: var(--cream-dim); font-size: .88rem; font-style: italic; margin: 0; }
.of-warn { color: #e8a06a; font-size: .88rem; }
.of-warn:empty { display: none; }
.of-spot { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; border: 1px solid rgba(184,149,90,.2); padding: 12px 14px 14px; margin: 4px 0 0; }
.of-spot legend { font-family: var(--serif); font-size: 1.05rem; padding: 0 6px; }
.of-pic { grid-column: 1 / -1; display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.of-pic-view {
  width: 120px; height: 90px; display: grid; place-items: center; overflow: hidden;
  background: #0a0908; border: 1px solid rgba(184,149,90,.45);
  color: var(--cream-dim); font-style: italic; font-size: .9rem; text-align: center;
}
.of-pic-view img { width: 100%; height: 100%; min-height: 0; object-fit: cover; display: block; grid-area: 1 / 1; }
.of-pic-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.of-pic-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.of-hang { grid-column: 1 / -1; border: 1px solid rgba(184,149,90,.2); padding: 12px 14px 14px; }
.of-hang h3 { font-family: var(--serif); font-weight: 400; font-size: 1.1rem; margin: 0 0 4px; }
.of-pass { padding: 16px; }
.of-pass h3 { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; margin: 0 0 10px; }
.of-passrow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.of-steps ol { padding-left: 22px; line-height: 1.7; }
.of-steps code { font-family: var(--flip); font-size: .9em; color: #e8c97a; }
.of-steps p { max-width: 640px; color: var(--cream-dim); }

@media (max-width: 820px) {
  .of-body { grid-template-columns: 1fr; }
  .of-nav { flex-direction: row; overflow-x: auto; position: static; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
  .of-nav button { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; gap: 8px; }
  .of-nav button.on { border-bottom-color: var(--brass); }
  .of-top { position: static; }
  .of-fields, .of-spot, .of-passrow { grid-template-columns: 1fr; }
  .of-pic { grid-template-columns: 96px 1fr; }
  .of-pic-view { width: 96px; height: 72px; }
  .of-main { padding: 20px 16px 60px; }
}

/* ---------- Announcements and the admin's preview bar ---------- */
.announce {
  overflow: hidden;
  transition: opacity .8s ease, height .8s ease, border-width .8s ease;
  animation: announce-in .6s ease both;
  background: linear-gradient(90deg, var(--oxblood), #7a2228 50%, var(--oxblood));
  border-top: 1px solid rgba(201,166,103,.5);
  border-bottom: 1px solid rgba(201,166,103,.5);
}
.announce-in {
  max-width: var(--wrap); margin: 0 auto; padding: 9px 48px 9px 16px;
  position: relative;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 14px;
  text-align: center; font-size: 1.02rem; color: var(--cream);
}
.announce.gone { opacity: 0; height: 0 !important; border-width: 0; }
@keyframes announce-in { from { opacity: 0; } }
.announce-k { font-family: var(--caps); font-size: .68rem; letter-spacing: .28em; color: #e8c97a; }
.announce a { color: #e8c97a; white-space: nowrap; }
.announce button {
  position: absolute; right: 10px; top: 50%; translate: 0 -50%;
  width: 30px; height: 30px; background: none; border: 0; cursor: pointer;
  color: rgba(236,227,207,.7); font-size: 1.3rem; line-height: 1;
}
.announce button:hover { color: var(--cream); }

.preview-bar {
  position: fixed; left: 50%; bottom: 16px; translate: -50% 0; z-index: 50;
  max-width: calc(100% - 32px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px;
  padding: 10px 16px;
  background: #e8c97a; color: var(--ink);
  font-size: .98rem; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.preview-bar a { color: var(--ink); font-weight: 500; }
.preview-bar button { font: inherit; background: var(--ink); color: #e8c97a; border: 0; padding: 4px 10px; cursor: pointer; }

/* ==========================================================
   THE NOTICEBOARD (noticeboard.html)
   ========================================================== */
.baize {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at center, #22442f, var(--green-deep) 80%);
  border: 10px solid #2a1d12;
  outline: 1px solid var(--brass-dim);
  box-shadow: inset 0 0 60px rgba(0,0,0,.5), 0 20px 50px rgba(0,0,0,.4);
  padding: 44px 32px;
  columns: 3 280px;
  column-gap: 32px;
}
.notice {
  break-inside: avoid;
  display: block;
  margin: 0 0 32px;
  background: var(--parchment);
  color: var(--paper-ink);
  padding: 26px 24px 22px;
  position: relative;
  box-shadow: 0 8px 18px rgba(0,0,0,.4);
  transform: rotate(var(--tilt, 0deg));
}
.notice::before { /* brass pin */
  content: ""; position: absolute; top: 9px; left: 50%; translate: -50% 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f0d79c, var(--brass) 45%, #6b5530);
  box-shadow: 0 2px 3px rgba(0,0,0,.5);
}
.notice .date { font-family: var(--caps); letter-spacing: .2em; font-size: .7rem; color: var(--oxblood); }
.notice h2 { font-size: 1.35rem; margin: 6px 0 10px; color: var(--paper-ink); }
.notice p { margin: 0 0 .7em; font-size: 1.05rem; line-height: 1.5; }
.notice .from { font-style: italic; margin: 12px 0 0; text-align: right; color: #4a4236; }
.notice.pinned { outline: 1px solid var(--oxblood); outline-offset: -6px; }

.notice.telegram { background: #efe5c9; padding-top: 30px; }
.telegram .wirehead {
  border-bottom: 2px solid var(--oxblood);
  padding-bottom: 8px; margin-bottom: 14px;
  text-align: center;
}
.telegram .wirehead strong { display: block; font-family: var(--caps); letter-spacing: .28em; font-size: .78rem; font-weight: 700; color: var(--oxblood); }
.telegram .wirehead span { font-family: var(--caps); letter-spacing: .2em; font-size: .62rem; color: #5a5040; }
.telegram .meta { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; font-family: var(--caps); font-size: .68rem; letter-spacing: .15em; color: #5a5040; margin-bottom: 12px; }
.telegram .tape {
  font-family: var(--wire); text-transform: uppercase; font-size: .9rem; line-height: 1.7;
  background: #f7f0dc; padding: 10px 12px; border: 1px solid rgba(0,0,0,.08);
}
.telegram .tape .stop { color: var(--oxblood); font-weight: 700; }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .bar { justify-content: center; }
  .bar ul { justify-content: center; }
  .ticket { grid-template-columns: 1fr; }
  .ticket .stub { border-right: 0; border-bottom: 2px dashed rgba(236,227,207,.22); flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 12px; padding: 18px; }
  .stub .leg, .stub .year { flex-basis: 100%; }
  .stub .day { font-size: 2.4rem; }
  .ticket .body { padding: 22px 20px; }
  .legs li { grid-template-columns: 1fr; gap: 2px; }
  .baize { padding: 32px 18px; border-width: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
