:root {
  color-scheme: dark;
  --ink: #f7ead1;
  --muted: #c6b18d;
  --bg: #130f12;
  --panel: #211719;
  --panel-2: #2d211e;
  --gold: #d8a94c;
  --green: #7da071;
  --red: #b95b51;
  --line: rgba(216, 169, 76, 0.22);
  --shadow: rgba(0, 0, 0, 0.32);
  font-family: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(216, 169, 76, 0.12), transparent 28rem),
    radial-gradient(circle at 82% 18%, rgba(125, 160, 113, 0.16), transparent 30rem),
    linear-gradient(135deg, #100c10, #1d1515 46%, #17110f);
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: var(--gold);
}

.hero,
.app-shell {
  min-height: 34vh;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(216, 169, 76, 0.24);
}

.topbar {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(19, 15, 18, 0.76);
  border-bottom: 1px solid rgba(216, 169, 76, 0.18);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.topbar a,
.topbar button {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  background: transparent;
  border: 0;
  padding: 0.35rem;
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.6fr);
  gap: 2rem;
  align-items: center;
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5rem 0 4rem;
}

.shell-status {
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.35fr);
  gap: 2rem;
  align-items: end;
}

.shell-status aside {
  display: grid;
  gap: 0.35rem;
  background: rgba(33, 23, 25, 0.78);
  border: 1px solid var(--line);
  padding: 1rem;
}

.shell-status span {
  color: var(--muted);
  font-size: 0.85rem;
}

.kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin: 0 0 0.6rem;
}

h1,
h2,
h3,
h4,
p,
li,
dd,
dt {
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 0.92;
  margin: 0;
  max-width: 12ch;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin: 0;
}

h3 {
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
}

h4 {
  color: var(--gold);
  margin: 1rem 0 0.45rem;
}

.lede {
  max-width: 44rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.55;
}

.gate {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 2rem;
  width: min(1160px, calc(100% - 2rem));
  margin-inline: auto;
  padding: 3rem 0;
}

.status-panel {
  display: grid;
  gap: 0.55rem;
  background: rgba(33, 23, 25, 0.9);
  border: 1px solid rgba(216, 169, 76, 0.36);
  box-shadow: 0 24px 50px var(--shadow);
  padding: 1.25rem;
}

.status-panel span,
.mini-record span,
.record footer {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-panel strong {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

main {
  display: grid;
  padding-bottom: 7rem;
}

.band {
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem) clamp(4.5rem, 8vw, 7rem);
  border-bottom: 1px solid rgba(216, 169, 76, 0.16);
}

.band:last-child {
  padding-bottom: clamp(7rem, 12vw, 10rem);
}

.section-head {
  width: min(1160px, 100%);
  margin: 0 auto 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
}

.section-copy {
  color: var(--muted);
  max-width: 32rem;
  line-height: 1.45;
  margin: 0;
}

.month-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--panel);
  border: 1px solid rgba(216, 169, 76, 0.28);
  padding: 0.6rem;
  min-width: 16rem;
  justify-content: space-between;
}

button {
  cursor: pointer;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid rgba(216, 169, 76, 0.32);
  padding: 0.75rem 1rem;
}

button:hover,
button:focus-visible,
a:focus-visible,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
  outline: 1px solid rgba(216, 169, 76, 0.36);
  outline-offset: 2px;
}

.month-controls button {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  font-size: 1.1rem;
}

.calendar-grid,
.home-dashboard,
.day-details,
.filter-panel,
.directory-count,
.note-form,
.dm-form,
.reveal-form,
.current-day-form,
.calendar-event-form,
.store-form,
.unlock-form,
.note-list,
.wiki-grid,
.account-layout,
.court-layout,
.store-grid,
.dm-grid,
.card-grid,
.portal-grid {
  width: min(1160px, 100%);
  margin-inline: auto;
}

.portal-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(16rem, 1.5fr) minmax(12rem, 0.75fr) minmax(12rem, 0.75fr) auto;
  gap: 0.8rem;
  align-items: end;
  background: rgba(33, 23, 25, 0.58);
  border: 1px solid var(--line);
  padding: 1rem;
  margin-bottom: 1rem;
}

.filter-panel.compact {
  width: 100%;
  grid-column: 1 / -1;
  grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 0.8fr) minmax(10rem, 0.8fr) auto;
  margin-bottom: 0.2rem;
}

.filter-panel label {
  margin: 0;
}

.filter-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.directory-count {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  gap: 1rem;
  padding: clamp(1rem, 4vw, 2.5rem) 0 1rem;
}

.home-panel {
  background: rgba(33, 23, 25, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px var(--shadow);
  padding: 1rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.panel-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.home-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.home-day {
  min-height: 3.2rem;
  display: grid;
  place-items: center;
  padding: 0.35rem;
  background: rgba(16, 12, 16, 0.62);
}

.home-day span {
  font-weight: 700;
}

.home-day.has-event {
  border-color: rgba(125, 160, 113, 0.85);
}

.home-day.selected {
  background: #3a2a1e;
  border-color: var(--gold);
}

.player-list {
  display: grid;
  gap: 0.7rem;
}

.player-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  background: rgba(16, 12, 16, 0.48);
  border: 1px solid rgba(216, 169, 76, 0.16);
  padding: 0.75rem;
}

.player-row div:last-child {
  display: grid;
  gap: 0.15rem;
}

.player-row span {
  color: var(--muted);
}

.portrait.small {
  width: 3rem;
  font-size: 0.95rem;
}

.portal-card .portrait.logo {
  width: 4.25rem;
  margin-bottom: 0.75rem;
}

.portal-card {
  min-height: 10rem;
  display: grid;
  align-content: space-between;
  text-align: left;
  background: rgba(33, 23, 25, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px var(--shadow);
}

.portal-card strong {
  font-size: 1.45rem;
}

.portal-card span {
  color: var(--muted);
  line-height: 1.35;
}

.portal-card small {
  color: var(--gold);
  font-weight: 700;
}

.store-directory {
  width: min(1160px, 100%);
  margin-inline: auto;
  display: grid;
  gap: 1.25rem;
}

.store-court-group {
  background: rgba(33, 23, 25, 0.42);
  border: 1px solid rgba(216, 169, 76, 0.18);
  padding: 1rem;
}

.store-court-group .card-grid {
  width: 100%;
  margin-top: 0.8rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}

.weekday {
  color: var(--gold);
  font-size: 0.78rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 0.35rem;
}

.day {
  min-height: 5.8rem;
  display: grid;
  align-content: space-between;
  text-align: left;
  background: rgba(33, 23, 25, 0.78);
}

.day span {
  font-size: 1.3rem;
  font-weight: 700;
}

.day small {
  color: var(--muted);
}

.day.has-event {
  border-color: rgba(125, 160, 113, 0.85);
}

.day.selected,
.account-pill.selected,
.court-tabs button.selected {
  background: #3a2a1e;
  border-color: var(--gold);
}

.day-details {
  margin-top: 1rem;
  background: rgba(33, 23, 25, 0.82);
  border: 1px solid rgba(216, 169, 76, 0.25);
  padding: 1rem;
  line-height: 1.5;
}

.note-form,
.dm-form,
.character-add-form,
.character-remove-form,
.npc-message-form,
.unlock-form {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr) auto;
  gap: 0.8rem;
  align-items: end;
}

.character-add-form,
.character-remove-form,
.npc-message-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.character-add-form button,
.character-remove-form button,
.npc-message-form button {
  align-self: end;
}

.store-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 0.8rem;
  align-items: end;
  background: rgba(33, 23, 25, 0.52);
  border: 1px solid var(--line);
  padding: 1rem;
  margin-bottom: 1rem;
}

.wide {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  color: var(--ink);
  background: rgba(16, 12, 16, 0.82);
  border: 1px solid rgba(216, 169, 76, 0.25);
  padding: 0.8rem;
}

textarea {
  resize: vertical;
}

.note-list,
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.private-message {
  border-color: rgba(216, 169, 76, 0.34);
}

.message-type {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.message-sender {
  color: #c6b18d;
  margin-bottom: 0.65rem;
}

.message-mental {
  box-shadow: inset 0 0 0 1px rgba(143, 178, 216, 0.28), 0 16px 40px var(--shadow);
}

.message-note {
  box-shadow: inset 0 0 0 1px rgba(125, 160, 113, 0.28), 0 16px 40px var(--shadow);
}

.message-whisper {
  box-shadow: inset 0 0 0 1px rgba(185, 91, 81, 0.28), 0 16px 40px var(--shadow);
}

.message-dock {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 30;
  display: grid;
  justify-items: end;
  gap: 0.75rem;
  width: min(25rem, calc(100vw - 2rem));
}

.message-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: auto;
  border: 1px solid rgba(216, 169, 76, 0.45);
  background: rgba(33, 23, 25, 0.94);
  color: var(--ink);
  padding: 0.8rem 1rem;
  box-shadow: 0 16px 40px var(--shadow);
  cursor: pointer;
}

.message-fab strong {
  display: inline-grid;
  place-items: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.35rem;
  background: var(--red);
  color: white;
  font-size: 0.8rem;
}

.message-fab.has-unread {
  border-color: rgba(185, 91, 81, 0.86);
  box-shadow: 0 0 0 3px rgba(185, 91, 81, 0.15), 0 16px 40px var(--shadow);
}

.message-panel {
  width: 100%;
  max-height: min(35rem, calc(100vh - 7rem));
  overflow: hidden;
  background: rgba(19, 15, 18, 0.96);
  border: 1px solid rgba(216, 169, 76, 0.32);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
}

.message-panel header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.message-panel h3 {
  margin: 0;
}

.message-thread {
  display: grid;
  gap: 0.8rem;
  max-height: min(28rem, calc(100vh - 13rem));
  overflow-y: auto;
  padding: 1rem;
}

.chat-message {
  background: rgba(33, 23, 25, 0.88);
  border: 1px solid rgba(216, 169, 76, 0.2);
  padding: 0.9rem;
}

.chat-message h4 {
  margin: 0 0 0.45rem;
}

.chat-message p {
  margin: 0 0 0.65rem;
}

.chat-message footer {
  color: var(--muted);
  font-size: 0.82rem;
}

.record,
.mini-record,
.feature-panel,
.store-card,
.court-map-panel,
.portrait-card {
  position: relative;
  background: rgba(33, 23, 25, 0.82);
  border: 1px solid rgba(216, 169, 76, 0.22);
  padding: 1rem;
  box-shadow: 0 16px 40px var(--shadow);
}

.record p,
.mini-record p,
.feature-panel p,
.store-card p,
.court-map-panel p,
.feature-panel li,
.portrait-card p,
.portrait-card span {
  color: #e6d5b8;
  line-height: 1.45;
}

.portrait-card {
  display: grid;
  gap: 0.7rem;
  text-align: left;
}

.my-character-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  background: rgba(33, 23, 25, 0.82);
  border: 1px solid rgba(216, 169, 76, 0.22);
  padding: 1rem;
  box-shadow: 0 16px 40px var(--shadow);
}

.my-character-hero h2 {
  margin: 0.15rem 0 0.5rem;
}

.sheet-link {
  display: inline-block;
  margin-top: 0.7rem;
  color: var(--gold);
  font-weight: 700;
}

.sheet-link-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: end;
  margin-top: 1rem;
  background: rgba(33, 23, 25, 0.52);
  border: 1px solid var(--line);
  padding: 1rem;
}

.sheet-link-form h3 {
  grid-column: 1 / -1;
  margin: 0;
}

.portrait {
  width: 5rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #17110f;
  background:
    linear-gradient(145deg, rgba(216, 169, 76, 0.96), rgba(125, 160, 113, 0.86)),
    var(--gold);
  border: 1px solid rgba(247, 234, 209, 0.5);
  font-weight: 700;
  font-size: 1.4rem;
}

.portrait.image {
  object-fit: cover;
  object-position: center;
  padding: 0;
}

.portrait.generated {
  overflow: hidden;
  color: #f7ead1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  background:
    radial-gradient(circle at 50% 38%, rgba(247, 234, 209, 0.2), transparent 32%),
    linear-gradient(145deg, #58333a, #17110f);
}

.portrait.generated::before,
.portrait.generated::after {
  content: "";
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(247, 234, 209, 0.16);
  border-radius: 999px;
}

.portrait.generated::after {
  inset: 26%;
  border-color: rgba(216, 169, 76, 0.22);
}

.portrait.generated[data-seed="1"] {
  background:
    radial-gradient(circle at 50% 38%, rgba(247, 234, 209, 0.2), transparent 32%),
    linear-gradient(145deg, #315f45, #102019);
}

.portrait.generated[data-seed="2"] {
  background:
    radial-gradient(circle at 50% 38%, rgba(247, 234, 209, 0.2), transparent 32%),
    linear-gradient(145deg, #31577a, #121a2b);
}

.portrait.generated[data-seed="3"] {
  background:
    radial-gradient(circle at 50% 38%, rgba(247, 234, 209, 0.2), transparent 32%),
    linear-gradient(145deg, #62407c, #21152b);
}

.portrait.generated[data-seed="4"] {
  background:
    radial-gradient(circle at 50% 38%, rgba(247, 234, 209, 0.2), transparent 32%),
    linear-gradient(145deg, #7c3f26, #251711);
}

.portrait.generated[data-seed="5"] {
  background:
    radial-gradient(circle at 50% 38%, rgba(247, 234, 209, 0.2), transparent 32%),
    linear-gradient(145deg, #2d5a62, #111d25);
}

.portrait.logo {
  object-fit: cover;
}

.portrait.large {
  width: 8rem;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.detail-panel {
  width: min(1160px, 100%);
  margin: 0 auto 1rem;
}

.section-subhead {
  width: min(1160px, 100%);
  margin: 1.5rem auto 0.8rem;
}

.delete {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
}

.wiki-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.mini-record {
  margin-bottom: 0.8rem;
}

.doc-links {
  display: grid;
  gap: 0.5rem;
}

.doc-links a {
  background: rgba(33, 23, 25, 0.82);
  border: 1px solid rgba(216, 169, 76, 0.22);
  padding: 0.8rem;
  text-decoration: none;
}

.account-layout,
.court-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 0.42fr) minmax(0, 1fr);
  gap: 1rem;
}

.account-list,
.court-tabs {
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.account-pill {
  text-align: left;
  display: grid;
  gap: 0.25rem;
}

.account-pill span {
  color: var(--muted);
  font-size: 0.9rem;
}

dl {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.8rem 1rem;
  margin: 0;
}

dt {
  color: var(--gold);
  font-weight: 700;
}

dd {
  margin: 0;
  color: #e6d5b8;
  line-height: 1.45;
}

.store-card {
  overflow-x: auto;
}

.store-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0;
}

.store-summary span {
  border: 1px solid rgba(216, 169, 76, 0.22);
  background: rgba(16, 12, 16, 0.52);
  color: #e6d5b8;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
}

.inventory-stack {
  display: grid;
  gap: 1rem;
}

.inventory-section {
  border: 1px solid rgba(216, 169, 76, 0.18);
  background: rgba(16, 12, 16, 0.34);
  padding: 0.85rem;
}

.inventory-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.inventory-head h3 {
  margin: 0;
  color: var(--gold);
  font-size: 1rem;
}

.inventory-head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.court-map-panel {
  overflow: hidden;
}

.map-toolbar,
.court-map-layout {
  display: grid;
  gap: 1rem;
}

.map-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 1rem;
}

.map-toolbar h3 {
  margin-bottom: 0;
}

.map-controls {
  display: flex;
  gap: 0.5rem;
}

.map-controls button {
  min-width: 2.5rem;
}

.map-controls button.selected {
  background: #3a2a1e;
  border-color: var(--gold);
}

.court-map-layout {
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.36fr);
}

.court-map-viewport {
  position: relative;
  min-height: clamp(24rem, 52vw, 38rem);
  overflow: hidden;
  border: 1px solid rgba(216, 169, 76, 0.28);
  background: #100c10;
  cursor: grab;
  touch-action: none;
}

.court-map-viewport:active {
  cursor: grabbing;
}

.court-map-content {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2400px;
  height: 1600px;
  margin-left: -1200px;
  margin-top: -800px;
  transform-origin: 50% 50%;
  transition: transform 120ms ease;
}

.court-map-art {
  position: absolute;
  inset: 0;
  width: 2400px;
  height: 1600px;
  z-index: 0;
}

.measure-layer {
  position: absolute;
  inset: 0;
  width: 2400px;
  height: 1600px;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.measure-layer line {
  stroke: #f7ead1;
  stroke-width: 8;
  stroke-linecap: round;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.65));
}

.measure-layer circle {
  fill: var(--gold);
  stroke: #17110f;
  stroke-width: 6;
}

.measure-layer text {
  fill: #f7ead1;
  stroke: rgba(16, 12, 16, 0.9);
  stroke-width: 7;
  paint-order: stroke;
  font-size: 40px;
  font-family: Georgia, "Times New Roman", serif;
  text-anchor: middle;
}

.map-districts ellipse {
  fill: rgba(247, 234, 209, 0.08);
  stroke: rgba(216, 169, 76, 0.2);
  stroke-width: 2;
}

.map-roads path,
.map-roads circle,
.map-grid-lines path {
  fill: none;
  stroke-linecap: round;
}

.map-roads path {
  stroke: rgba(216, 169, 76, 0.45);
  stroke-width: 14;
}

.map-roads circle {
  stroke: rgba(216, 169, 76, 0.5);
  stroke-width: 12;
}

.map-grid-lines path {
  stroke: rgba(247, 234, 209, 0.12);
  stroke-width: 2;
}

.map-pin {
  position: absolute;
  z-index: 3;
  width: 2.2rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -90%) rotate(-45deg);
  background: var(--panel-2);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.map-pin span {
  transform: rotate(45deg);
  color: #17110f;
  font-weight: 700;
  font-size: 0.82rem;
}

.map-pin.court {
  background: var(--gold);
}

.map-pin.store {
  background: var(--green);
}

.map-pin.npc {
  background: #8fb2d8;
}

.map-pin.district {
  background: #c6b18d;
}

.map-pin.portal {
  background: #b95b51;
}

.map-pin.selected {
  outline: 2px solid #f7ead1;
  outline-offset: 3px;
}

.map-popup {
  position: absolute;
  z-index: 5;
  width: min(23rem, 34vw);
  min-width: 16rem;
  padding: 0.9rem;
  border: 1px solid rgba(216, 169, 76, 0.38);
  background: rgba(20, 14, 17, 0.94);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, calc(-100% - 3rem));
  pointer-events: auto;
}

.map-popup::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.55rem;
  width: 1rem;
  aspect-ratio: 1;
  background: rgba(20, 14, 17, 0.94);
  border-right: 1px solid rgba(216, 169, 76, 0.38);
  border-bottom: 1px solid rgba(216, 169, 76, 0.38);
  transform: translateX(-50%) rotate(45deg);
}

.map-popup h4 {
  margin-bottom: 0.35rem;
}

.map-popup p {
  margin-bottom: 0.55rem;
  color: #e6d5b8;
}

.map-popup button {
  margin-top: 0.35rem;
}

.blackthorn-scale text,
.blackthorn-labels text {
  fill: rgba(247, 234, 209, 0.76);
  font-size: 30px;
  font-family: Georgia, "Times New Roman", serif;
  text-anchor: middle;
  pointer-events: none;
}

.blackthorn-vignette {
  fill: rgba(0, 0, 0, 0);
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 80;
}

.blackthorn-scale path {
  stroke: rgba(247, 234, 209, 0.72);
  stroke-width: 8;
  stroke-linecap: round;
}

.blackthorn-labels text {
  fill: rgba(198, 177, 141, 0.62);
  font-size: 26px;
}

.map-location-card {
  background: rgba(16, 12, 16, 0.62);
  border: 1px solid rgba(216, 169, 76, 0.2);
  padding: 1rem;
  align-self: stretch;
}

.map-location-card h3 {
  margin-bottom: 0.5rem;
}

.map-location-card button {
  margin-top: 0.8rem;
}

.measure-readout {
  display: grid;
  gap: 0.2rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.measure-readout span {
  color: var(--gold);
  font-size: 1.35rem;
  font-weight: 700;
}

.measure-readout small {
  color: var(--muted);
  line-height: 1.35;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.92rem;
}

th,
td {
  border-bottom: 1px solid rgba(216, 169, 76, 0.16);
  padding: 0.55rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--gold);
  font-weight: 700;
}

.dm-band {
  background: rgba(57, 26, 25, 0.26);
}

.dm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dm-form,
.reveal-form,
.current-day-form,
.calendar-event-form {
  grid-template-columns: 1fr;
  background: rgba(33, 23, 25, 0.52);
  border: 1px solid var(--line);
  padding: 1rem;
}

.auth-form {
  display: grid;
  gap: 0.8rem;
  background: rgba(33, 23, 25, 0.52);
  border: 1px solid var(--line);
  padding: 1rem;
}

.auth-form h3 {
  margin-bottom: 0.2rem;
}

.character-claims {
  width: min(1160px, 100%);
  margin-inline: auto;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.claim-card {
  margin: 0;
}

.notice {
  color: var(--gold);
}

.center-form {
  width: min(28rem, 100%);
  margin: 1rem auto 0;
}

.calendar-note-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}

.check-row input {
  width: auto;
}

.private {
  border-color: rgba(185, 91, 81, 0.5);
}

.ghost {
  background: transparent;
}

.empty {
  color: var(--muted);
}

.centerline {
  width: min(1160px, 100%);
  margin: 0 auto 1rem;
}

@media (max-width: 920px) {
  .hero-grid,
  .shell-status,
  .home-dashboard,
  .section-head,
  .note-form,
  .dm-form,
  .reveal-form,
  .current-day-form,
  .calendar-event-form,
  .unlock-form,
  .wiki-grid,
  .account-layout,
  .court-layout,
  .court-map-layout,
  .map-toolbar,
  .dm-grid,
  .store-form,
  .filter-panel,
  .filter-panel.compact,
  .my-character-hero,
  .sheet-link-form {
    grid-template-columns: 1fr;
  }

  main {
    padding-bottom: 8rem;
  }

  .filter-actions {
    flex-wrap: wrap;
  }

  .wide {
    grid-column: auto;
  }

  .section-head {
    align-items: start;
  }

  .topbar {
    justify-content: start;
    overflow-x: auto;
  }

  .calendar-grid {
    gap: 0.35rem;
  }

  .weekday {
    font-size: 0.62rem;
  }

  .day {
    min-height: 4.4rem;
    padding: 0.5rem;
  }

  .day small {
    font-size: 0.65rem;
  }

  dl {
    grid-template-columns: 1fr;
  }

  .message-dock {
    right: 0.75rem;
    bottom: 0.75rem;
    width: calc(100vw - 1.5rem);
  }

  .message-panel {
    max-height: calc(100vh - 5rem);
  }

  .message-thread {
    max-height: calc(100vh - 11rem);
  }
}
