@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  color-scheme: light;
  --bg: #f6f5f0;
  --panel: #fffefa;
  --border: #deddd1;
  --ink: #232e28;
  --muted: #505e54;
  --gold: #315b48;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.6 "DM Sans", sans-serif;
}
[hidden] { display: none !important; }
.bar {
  min-height: 72px;
  padding: 12px max(24px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: #fffefa;
}
.brand { display: flex; align-items: center; gap: 7px; font: 700 1.13rem Cinzel, Georgia, serif; white-space: nowrap; }
.brand > span:last-child { color: var(--gold); }
.mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: 7px;
  border: 1px solid var(--border);
  transform: rotate(45deg);
  color: var(--gold);
}
main { width: min(1160px, calc(100% - 48px)); margin: auto; padding: 32px 0 60px; }
.eyebrow {
  margin: 0 0 11px;
  font-family: Cinzel, Georgia, serif;
  font-size: .87rem;
  font-weight: 700;
  letter-spacing: .17em;
  color: var(--gold) !important;
}
h1, h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; line-height: 1; }
h1 { font-size: clamp(3.2rem, 8vw, 7.2rem); margin: 0; text-wrap: balance;  }
h1 em { color: var(--gold); }
h2 { font-size: 2.15rem; margin: 0 0 22px; }
h2 span { color: var(--gold); font: .97rem Georgia, serif; margin-right: 5px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: clamp(20px, 4vw, 32px);
  border-radius: 14px;
}
.panel > h1 { font-size: 4.2rem; margin-bottom: 22px; }
.narrow { max-width: 610px; }
.notice, .preview-note { color: var(--muted); font-size: .9rem; margin: 0 0 19px; }
label { display: block; font-size: .93rem; font-weight: 650; margin-bottom: 14px; }
small, .muted, dt { color: var(--muted); }
small { font-weight: 400; margin-left: .35rem; }
input, textarea, select {
  display: block;
  background: #fffefa;
  border: 1px solid #c5cbbf;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  width: 100%;
  margin-top: 5px;
  font: inherit;
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
textarea { resize: vertical; }
button, a { cursor: pointer; }
button { font: inherit; font-weight: 700; border-radius: 8px; border: 1px solid transparent; padding: 10px 18px; }
button:disabled { opacity: .6; cursor: wait; }
.primary { background: #315b48; color: #fffefa; border-color: #315b48; }
.primary:hover { background: #254937; }
.quiet { background: #f8f8f1; color: var(--ink); border-color: var(--border); }
.quiet:hover, .campaign:hover { background: #edf1e7; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.campaign { display: block; border-top: 1px solid var(--border); padding: 12px 8px; font-weight: 700; }
.back { display: inline-block; margin-bottom: 20px; }
.error { color: #a52d25; margin: 8px 0 0; }
.error:empty { display: none; }
dl { margin: 0; }
dt { font-size: .9rem; }
dd { margin: 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.room-title { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  main { width: calc(100% - 28px); padding-top: 18px; }
  .bar { padding-inline: 16px; }
}

.bar { gap: 14px; }
.bar nav { display: flex; gap: clamp(12px, 3vw, 32px); }
.bar a { text-decoration: none; }
.bar nav a { color: var(--muted); padding-block: 8px; }
.bar nav a[aria-current] { color: var(--gold); border-bottom: 1px solid currentColor; }
body:has(.landing) main { width: min(1240px, calc(100% - 48px)); }
.landing {
  min-height: clamp(510px, 69vh, 700px);
  display: grid;
  align-content: center;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(90deg, #12231df0, #1b2e26aa 45%, #1a222136 76%), url("./citadel.webp") center 52% / cover;
  color: #fffaf0;
}
.landing .eyebrow, .landing h1 em { color: #f5d897 !important; }
.landing .primary { background: #f5d897; color: #18302a; }
.landing .primary:hover { background: #ffe6ac; }
.landing-content { width: 100%; padding: 54px clamp(24px, 7vw, 92px); }
.landing h1 { font-size: clamp(3.5rem, 9vw, 7.25rem); letter-spacing: -.03em; line-height: .9; text-wrap: unset; }
.landing-content > p:not(.eyebrow) { max-width: 340px; margin: 24px 0; }
.action { display: inline-block; padding: 10px 18px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-weight: 700; }
.landing-foot { margin-top: 26px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.landing-foot > div { padding: 22px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
.landing-foot h2 { margin: 7px 0; }
.landing-foot div > p:last-child { color: var(--muted); margin-bottom: 0; }
.shelf-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 24px 0; }
.shelf-heading h1 { font-size: clamp(3.4rem, 8vw, 6rem); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr)); gap: 18px; }
.shelf-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 13px; padding: 64px 18px; border: 1px dashed #a6b6a9; border-radius: 14px; background: #edf1e9; }
.shelf-empty h2 { margin: 0; }
.empty-icon { color: var(--gold); font-size: 1.9rem; }
.campaign { padding: 0; border: 1px solid var(--border); background: var(--panel); text-decoration: none; border-radius: 14px; overflow: hidden; }
.card-art { height: 130px; background: url("./citadel.webp") center / cover; }
.card-details { padding: 12px 18px 18px; overflow-wrap: anywhere; }
.card-details h2, .card-details p { margin: 0; }
.card-details p { margin-top: 7px; font-size: .92rem; color: var(--muted); font-weight: 400; }
dialog { width: min(520px, calc(100% - 28px)); max-height: calc(100dvh - 30px); border: 1px solid var(--border); background: var(--panel); color: var(--ink); padding: 24px; border-radius: 16px; }
dialog::backdrop { background: #0d0909cf; backdrop-filter: blur(4px); }
dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
dialog h2 { margin: 0; }
.room-heading h1 { font-size: clamp(3rem, 7vw, 5.5rem); margin-bottom: 8px; }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 295px); gap: 17px; align-items: start; }
.board, .room-sidebar { border: 1px solid var(--border); background: var(--panel); border-radius: 14px; overflow: hidden; }
.room-sidebar { padding: 20px; }
.board-map { position: relative; aspect-ratio: 3 / 2; background: #363d2c url("./courtyard.webp") center / cover; }
.board-map::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(90deg, #f3dcc547 1px, transparent 1px), linear-gradient(#f3dcc547 1px, transparent 1px); background-size: 6.25% 9.375%; }
.board-map.hide-grid::after { display: none; }
.board-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
@media (max-width: 700px) {
  .landing-foot, .room-layout { grid-template-columns: 1fr; }
  body:has(.landing) main { width: calc(100% - 28px); }
  .landing { min-height: 490px; background-position: 61% center; }
  .bar { flex-wrap: wrap; }
  .bar nav { order: 2; width: 100%; }
}
