@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap");

:root {
  --ink: #2a1b18;
  --wine: #641f25;
  --wine-dark: #421217;
  --gold: #b58a43;
  --parchment: #eee0bd;
  --paper: #f6edcf;
  --shadow: rgba(29, 14, 12, 0.42);
  --sage: #29493e;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #211614; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 6%, rgba(187, 143, 70, 0.2), transparent 28rem),
    linear-gradient(135deg, #2e1717, #171213 70%);
  font: 16px/1.65 "Libre Baskerville", Georgia, serif;
}

button, input, select { font: inherit; }

button { cursor: pointer; }

.page-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  background-image: repeating-radial-gradient(circle at 20% 20%, #fff 0 1px, transparent 1px 5px);
  mix-blend-mode: soft-light;
  z-index: 10;
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px;
  color: var(--parchment);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  line-height: 1.15;
}

.brand-mark { color: var(--gold); font-size: 1.65rem; }
.brand strong, h1, h2, h3, .button, .eyebrow { font-family: Cinzel, Georgia, serif; }
.brand strong { display: block; letter-spacing: .04em; }
.brand small { color: #d4bf92; font-size: .64rem; letter-spacing: .13em; text-transform: uppercase; }

.header-button, .button {
  border: 1px solid rgba(245, 228, 190, .48);
  border-radius: 2px;
  padding: .54rem .86rem;
  color: var(--paper);
  background: transparent;
  transition: transform .18s, background .18s;
}
.header-button:hover, .button:hover { transform: translateY(-2px); background: rgba(255,255,255,.1); }

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 42px;
}

.sheet {
  overflow: hidden;
  border: 1px solid rgba(103, 63, 34, .52);
  border-radius: 5px;
  box-shadow: 0 18px 42px var(--shadow);
  background:
    linear-gradient(90deg, rgba(119, 73, 32, .09), transparent 9%, transparent 91%, rgba(119, 73, 32, .09)),
    var(--paper);
}

.hero {
  min-height: 390px;
  padding: clamp(2rem, 8vw, 6rem) clamp(1.3rem, 8vw, 7rem);
  color: var(--paper);
  background:
    linear-gradient(90deg, rgba(24, 10, 10, .94), rgba(40, 14, 16, .72), rgba(40, 14, 16, .32)),
    url("History/Shute Barton's history _ National Trust_files/gatehouse-building-exterior-shute-barton-1540914.jpg") center/cover;
}

.eyebrow {
  margin: 0 0 1rem;
  color: #d8ad64;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { max-width: 720px; font-size: clamp(2rem, 7vw, 4.7rem); }
h2 { font-size: clamp(1.45rem, 3.3vw, 2.4rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }

.hero-copy { max-width: 680px; margin: 1.3rem 0 1.7rem; color: #f1e3bf; }
.button { display: inline-block; text-decoration: none; }
.button.primary { border-color: #8d5c24; background: var(--wine); }
.button.primary:hover { background: #7c2930; }
.button.gold { color: #261813; border-color: #986b27; background: #c99c50; }
.button.gold:hover { background: #ddb56c; }
.button.danger { background: var(--wine-dark); }

.home-grid, .content-grid { display: grid; gap: 18px; padding: 22px; }
.home-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.content-grid { grid-template-columns: minmax(0, 1.8fr) minmax(230px, .8fr); }

.card, .panel {
  padding: 20px;
  border: 1px solid #d7c49e;
  background: rgba(255, 250, 230, .54);
}
.card h2, .panel h2 { margin-bottom: .8rem; }
.card p { color: #58453b; font-size: .88rem; }

.callout {
  padding: 17px 20px;
  border-left: 5px solid var(--wine);
  background: #f0dfbb;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #d7c49e;
}
.tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.tabs button, .pill {
  border: 1px solid #c8b384;
  border-radius: 99px;
  padding: .42rem .7rem;
  color: var(--ink);
  background: #f5e8c9;
  font-size: .76rem;
}
.tabs button.active { color: white; border-color: var(--wine); background: var(--wine); }

.map-viewport {
  overflow: auto;
  max-height: min(72vh, 730px);
  padding: 18px;
  background: #30221c;
  -webkit-overflow-scrolling: touch;
}
.map-canvas { position: relative; width: 100%; }
.map-canvas img { display: block; width: 100%; height: auto; }
.hotspot {
  position: absolute;
  min-width: 25px;
  min-height: 25px;
  transform: translate(-50%, -50%);
  border: 2px solid #fff1c7;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(82, 20, 24, .55);
  color: white;
  background: var(--wine);
  font-size: .68rem;
  font-weight: bold;
}
.hotspot:hover, .hotspot:focus { z-index: 2; outline: 3px solid #e4be75; }

.room-list { display: grid; gap: 8px; margin-top: 14px; }
.room-list button {
  width: 100%;
  padding: 10px;
  border: 1px solid #d3bf96;
  text-align: left;
  color: var(--ink);
  background: #faefd4;
}
.room-list button:hover { background: #ead5a8; }

.rounds { display: grid; gap: 10px; }
.round-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  padding: 12px;
  border: 1px solid #d2bc91;
  background: #fff6dd;
}
.round-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: white;
  background: var(--wine);
  font-family: Cinzel, serif;
}
.round-card p { margin: .3rem 0 0; font-size: .79rem; }

.member-list { display: grid; gap: 8px; }
.member-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid #d1bc92;
  color: var(--ink);
  background: #fff4d9;
  text-decoration: none;
}
.member-link span { font-size: .75rem; color: #72562f; }

.dossier-head {
  padding: 28px 22px;
  color: var(--paper);
  background: linear-gradient(115deg, #451a1c, #762a2b);
}
.dossier-head p { margin-top: .7rem; color: #f1dcae; }
.secret {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px dashed #9b7341;
  background: #e9d5aa;
}
.secret h3 { color: var(--wine); margin-bottom: .6rem; }
.check-row { display: grid; gap: 8px; margin: 16px 0; }
.check-row label { display: flex; gap: 9px; align-items: flex-start; font-size: .82rem; }
.check-row input { margin-top: .33rem; accent-color: var(--wine); }

.host-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.status { font-size: .82rem; color: #654f3a; }

.player-map .content-grid { grid-template-columns: 1fr; }
.player-map .panel { display: none; }
.player-map .map-viewport--detail {
  max-height: min(68vh, 760px);
  cursor: grab;
  touch-action: pan-x pan-y;
}
.player-map .map-viewport--detail:active { cursor: grabbing; }
.player-map .map-viewport--detail .map-canvas { width: max-content; }
.player-map .map-viewport--detail .map-canvas img {
  width: auto;
  max-width: none;
  height: auto;
}

.modal:has(.player-map) {
  width: min(1180px, calc(100% - 28px));
  max-height: calc(100% - 28px);
}
.modal:has(.player-map) .modal-close {
  position: fixed;
  top: 18px;
  right: 22px;
}

.modal {
  width: min(520px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  border: 0;
  box-shadow: 0 20px 70px rgba(0,0,0,.65);
  padding: 0;
  color: var(--ink);
  background: var(--paper);
}
.modal::backdrop { background: rgba(15, 9, 9, .76); }
.modal-close {
  position: absolute; top: 8px; right: 9px; z-index: 1;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  color: white; background: var(--wine); font-size: 1.4rem; line-height: 1;
}

@media (max-width: 720px) {
  .site-header { padding: 14px; }
  .app-shell { padding: 0 12px 24px; }
  .content-grid { grid-template-columns: 1fr; padding: 13px; }
  .home-grid { padding: 13px; }
  .toolbar { padding: 14px; align-items: flex-start; }
  .map-viewport { padding: 9px; max-height: 60vh; }
  .player-map .map-viewport--detail { max-height: 64vh; }
  .modal:has(.player-map) .modal-close { top: 12px; right: 12px; }
}
