:root {
  color-scheme: light;
  --ink: #1c2430;
  --muted: #586170;
  --paper: #f6f3ed;
  --panel: #ffffff;
  --line: #ded7c9;
  --accent: #2f6f5e;
  --accent-strong: #1f4f43;
  --warm: #b85f38;
  --gold: #d7aa43;
  --sky: #e8f1ee;
  --shadow: 0 18px 60px rgba(28, 36, 48, 0.1);
  --header-bg: rgba(255, 253, 248, 0.92);
  --wash: #fffdf8;
  --wash-end: #f8f7f3;
  --panel-soft: rgba(255, 255, 255, 0.86);
  --input-bg: #fff;
  --page-gutter: 18px;
  --page-max: 72rem;
  --page-width: min(var(--page-max), calc(100% - (2 * var(--page-gutter))));
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8e4dc;
  --muted: #9aa3b0;
  --paper: #16181d;
  --panel: #1e222a;
  --line: #3a414c;
  --accent: #5aa88f;
  --accent-strong: #7ec4ad;
  --warm: #e08a62;
  --gold: #d7aa43;
  --sky: #24302c;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  --header-bg: rgba(18, 20, 24, 0.92);
  --wash: #121418;
  --wash-end: #0e1014;
  --panel-soft: rgba(30, 34, 42, 0.92);
  --input-bg: #16181d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(215, 170, 67, 0.14), transparent 34rem),
    linear-gradient(180deg, var(--wash) 0%, var(--paper) 44%, var(--wash-end) 100%);
  line-height: 1.55;
}

a {
  color: var(--accent-strong);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  min-height: 78px;
  padding: 14px 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 24px;
  row-gap: 10px;
  width: var(--page-width);
  margin: 0 auto;
}

.site-header nav {
  justify-self: start;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 6.5rem;
}

.brand {
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.95rem;
}

nav a {
  text-decoration: none;
  color: var(--muted);
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--ink);
}

nav a[aria-current="page"] {
  font-weight: 800;
}

.account-menu {
  position: relative;
}

.theme-toggle {
  appearance: none;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(28, 36, 48, 0.08);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.theme-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.avatar-button {
  appearance: none;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(31, 79, 67, 0.24);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(31, 79, 67, 0.18);
}

.settings-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  width: 230px;
  padding: 8px;
  border: 1px solid rgba(31, 79, 67, 0.14);
  border-radius: 14px;
  background: var(--panel-soft);
  box-shadow: var(--shadow);
}

.settings-menu[hidden] {
  display: none;
}

.menu-identity {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.menu-identity span {
  display: block;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.menu-identity small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.settings-menu button {
  appearance: none;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.settings-menu button:hover {
  background: var(--sky);
}

main {
  overflow: hidden;
}

.hero,
.page-hero,
.band,
.grid,
.timeline,
.note {
  width: var(--page-width);
  margin: 0 auto;
}

main:has(.doc) .page-hero,
.doc,
main:has(.doc) ~ footer {
  width: var(--page-width);
}

main:has(.doc) h1,
main:has(.doc) .lede {
  max-width: none;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 0 12px;
}

.hero-copy {
  flex: 1 1 28rem;
  min-width: 0;
}

.hero .eyebrow {
  margin: 0 0 6px;
}

.hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  line-height: 1.2;
}

.hero .lede {
  max-width: 860px;
  margin: 8px 0 0;
}

.hero .button {
  margin-top: 2px;
  flex: 0 0 auto;
}

.discord-panel {
  width: var(--page-width);
  margin: 8px auto 28px;
  padding: 18px 18px 0;
  border: 1px solid #1e1f22;
  border-radius: 14px;
  background: #2b2d31;
  color: #dbdee1;
  box-shadow: var(--shadow);
}

.doc .discord-panel {
  width: 100%;
  margin: 18px 0 28px;
}

.discord-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding-bottom: 14px;
}

.discord-panel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.discord-panel .secondary {
  border-color: #dbdee1;
  color: #f2f3f5;
}

.discord-panel h2,
.discord-panel h3 {
  margin: 0 0 6px;
  color: #f2f3f5;
}

.discord-panel .eyebrow {
  color: #b5bac1;
}

.discord-panel p {
  margin: 0;
  color: #b5bac1;
  font-size: 0.95rem;
}

.discord-panel iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
  border-radius: 0 0 13px 13px;
  background: #1e1f22;
}

.discord-frame {
  position: relative;
  width: calc(100% + 36px);
  margin: 0 -18px;
  min-height: 220px;
}

.discord-widget-fallback {
  margin: 0;
  padding: 48px 24px;
  color: #b5bac1;
  font-size: 1rem;
  line-height: 1.5;
}

.discord-voice-toggle {
  appearance: none;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid #dbdee1;
  border-radius: 6px;
  background: #1e1f22;
  color: #f2f3f5;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.discord-voice-toggle:hover,
.discord-voice-toggle:focus-visible {
  color: #f2f3f5;
}

.discord-voice-toggle[aria-pressed="true"] {
  background: #248046;
  color: #fff;
}

.discord-voice-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.discord-voice-toggle[aria-pressed="true"] .discord-voice-listen,
.discord-voice-toggle:not([aria-pressed="true"]) .discord-voice-record {
  display: none;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(30px, 6vw, 78px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.2;
}

h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.lede {
  max-width: 640px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  appearance: none;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  padding: 12px 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  background: var(--accent-strong);
  color: #fff;
}

.secondary {
  background: transparent;
  color: var(--accent-strong);
}

.danger {
  border-color: #9c3d2f;
  background: #9c3d2f;
  color: #fff;
}

.identity-strip .label,
.identity-strip strong,
.identity-strip #welcomeLine {
  grid-column: 1;
}

.identity-strip .label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.band,
.note {
  padding: 28px 0 58px;
  border-top: 1px solid rgba(222, 215, 201, 0.86);
}

#times.band,
#status.band,
#pcs-status.band,
#player-hook-band.band {
  padding: 14px 0 36px;
}

#status.band,
#pcs-status.band {
  padding: 10px 0 16px;
}

#status h2 {
  margin: 0 0 8px;
}

#times h2 {
  margin-bottom: 8px;
}

.section-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: baseline;
}

.wide-copy {
  max-width: 860px;
  color: var(--muted);
  font-size: 1rem;
}

.grid {
  display: grid;
  gap: 18px;
  padding: 32px 0 58px;
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid rgba(31, 79, 67, 0.12);
  border-radius: 14px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 34px rgba(28, 36, 48, 0.06);
}

.video-card {
  width: var(--page-width);
  margin: 0 auto 58px;
  padding: 22px;
  border: 1px solid rgba(31, 79, 67, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.video-card h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.video-frame {
  overflow: hidden;
  border-radius: 10px;
  background: #111;
}

.video-frame video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

ul,
ol {
  margin: 12px 0 0;
  padding-left: 20px;
}

li + li {
  margin-top: 8px;
}

.signup-form {
  margin-top: 24px;
  padding: 26px;
  border: 1px solid rgba(31, 79, 67, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.admin-panel {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  padding: 22px;
  border: 1px solid rgba(31, 79, 67, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 34px rgba(28, 36, 48, 0.06);
}

.admin-panel h3,
.admin-panel p {
  margin: 0;
}

.admin-panel p {
  color: var(--muted);
}

.admin-panel .label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
}

.identity-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px 12px;
  align-items: center;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sky);
}

.identity-strip strong {
  display: block;
  font-size: 1.05rem;
}

.identity-strip #welcomeLine {
  color: var(--muted);
  font-size: 0.92rem;
}

body:not(.is-logged-in) #logoutInline {
  display: none;
}

body.is-logged-in #openLoginInline {
  display: none;
}

.form-grid,
.suggest {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

label,
legend {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  background: var(--input-bg);
  box-shadow: inset 0 1px 0 rgba(28, 36, 48, 0.03);
}

fieldset {
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.full {
  display: block;
}

.time-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.time-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(232, 241, 238, 0.86), rgba(255, 255, 255, 0.9));
  cursor: pointer;
}

.time-card.joined {
  cursor: default;
}

.time-card > strong {
  grid-column: 1;
  grid-row: 1;
  font-size: 1rem;
}

.time-card > small {
  grid-column: 1;
  grid-row: 2;
  color: var(--muted);
}

.people-count {
  grid-column: 4;
  grid-row: 1 / span 2;
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
  align-items: center;
  justify-self: end;
  align-self: start;
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.hero-icon {
  width: 22px;
  height: 22px;
}

.time-card > .attendee {
  grid-row: 3;
}

.time-card > .choice {
  grid-row: 4;
  justify-self: start;
}

.attendee {
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
}

.attendee.mine {
  cursor: pointer;
  border-color: var(--accent);
}

.adventure-summary {
  display: grid;
  gap: 10px;
  margin: 8px 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(31, 79, 67, 0.14);
  border-radius: 12px;
  background: var(--sky);
}

.adventure-summary-link {
  font-weight: 800;
  font-size: 1.05rem;
}

.adventure-summary-link.is-empty {
  color: var(--muted);
}

.session-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
}

.adventure-summary-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.player-hook-wrap {
  margin: 12px 0 4px;
}

.player-hook-toggle {
  appearance: none;
  display: inline-flex;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.player-hook {
  position: relative;
  border: 1px solid rgba(31, 79, 67, 0.14);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  height: min(52vh, 480px);
}

.player-hook-wrap:not(.is-expanded) .player-hook {
  height: 180px;
}

.player-hook-wrap:not(.is-expanded) .player-hook::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 72px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 88%);
}

.player-hook-wrap.is-expanded .player-hook {
  height: min(52vh, 480px);
}

.player-hook iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.add-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 18px 0 12px;
  scroll-margin-top: 96px;
}

.scheduler {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(31, 79, 67, 0.14);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(28, 36, 48, 0.06);
}

#scheduler {
  min-height: 480px;
}

.scheduler-grid {
  height: 420px;
  width: 100%;
  --ag-row-height: 72px;
  --ag-header-height: 48px;
  --ag-cell-horizontal-padding: 16px;
}

.status-table-wrap {
  margin-top: 0;
}

.status-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.85rem;
}

.status-table th,
.status-table td {
  padding: 4px 8px;
  border: 1px solid rgba(31, 79, 67, 0.28);
  text-align: left;
  vertical-align: middle;
  line-height: 1.2;
}

.status-table thead th {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--ink);
}

.status-table thead th:nth-child(2) {
  background: #cfe6d8;
}

.status-table thead th:nth-child(3) {
  background: #f0e4bc;
}

.status-table thead th:nth-child(4) {
  background: #ebcfc6;
}

.status-table thead th:first-child {
  background: #ebe4d8;
  color: var(--ink);
  text-align: left;
}

.status-table tbody th {
  width: 46%;
  background: #ebe4d8;
  color: var(--ink);
  font-weight: 600;
}

.status-table tbody td {
  width: 18%;
}

.status-table tbody td:nth-child(2) {
  background: #e8f3ec;
}

.status-table tbody td:nth-child(3) {
  background: #faf4e4;
}

.status-table tbody td:nth-child(4) {
  background: #f8e8e3;
}

.status-table .vote-cell {
  justify-content: center;
  gap: 3px;
  cursor: default;
}

.status-table .grid-avatar {
  width: 22px;
  height: 22px;
  font-size: 0.58rem;
}

.status-table-empty {
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.pcs-glance {
  font-size: 0.78rem;
}

.pcs-glance thead th,
.pcs-glance tbody td {
  padding: 3px 8px;
}

.pcs-glance thead th:nth-child(n),
.pcs-glance tbody td:nth-child(n) {
  background: #f4f0e8;
  width: auto;
}

.pcs-glance thead th {
  background: #ebe4d8;
}

.pcs-glance thead th:first-child,
.pcs-glance tbody td:first-child {
  width: 40px;
  text-align: center;
}

.pcs-glance th:nth-child(4),
.pcs-glance td:nth-child(4),
.pcs-glance th:nth-child(5),
.pcs-glance td:nth-child(5) {
  width: 56px;
  text-align: center;
}

.pcs-glance .pc-portrait {
  width: 26px;
  height: 26px;
  margin: 0 auto;
  border-radius: 6px;
}

.pcs-glance .grid-avatar {
  width: 22px;
  height: 22px;
  font-size: 0.58rem;
  margin: 0 auto;
}

.pcs-glance a {
  color: inherit;
  font-weight: 700;
}

.scheduler-grid .ag-cell {
  display: flex;
  align-items: center;
  line-height: 1.3;
}

.schedule-context-menu {
  position: fixed;
  z-index: 40;
  width: 220px;
  padding: 8px;
  border: 1px solid rgba(31, 79, 67, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.schedule-context-menu button {
  appearance: none;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.schedule-context-menu button:first-child {
  margin-top: 0;
}

.schedule-context-menu button:hover:not(:disabled) {
  background: var(--sky);
}

.schedule-context-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.vote-cell {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
  justify-content: start;
  align-items: center;
  height: 100%;
  cursor: pointer;
}

.grid-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.grid-avatar.mine {
  outline: 2px solid var(--gold);
}

.grid-context-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.grid-context-menu {
  position: fixed;
  margin: 0;
  padding: 6px;
  min-width: 160px;
  border: 1px solid rgba(31, 79, 67, 0.18);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(28, 36, 48, 0.16);
}

.grid-context-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1c2430;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.grid-context-menu button:hover:not(:disabled) {
  background: rgba(31, 79, 67, 0.08);
}

.grid-context-menu button:disabled {
  color: #7a8490;
  cursor: not-allowed;
}

.edit-row {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.edit-row label {
  display: grid;
  gap: 6px;
}

.save-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 50;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: #1c2430;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 28px rgba(28, 36, 48, 0.22);
  transform: translateX(-50%);
  pointer-events: none;
  animation: save-toast-fade 1.8s ease forwards;
}

@keyframes save-toast-fade {
  0% { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  12% { opacity: 1; transform: translateX(-50%) translateY(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

.choice {
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--accent-strong);
  font-weight: 800;
  cursor: pointer;
}

.choice.active {
  background: var(--accent);
  color: #fff;
}

.form-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.form-actions {
  display: grid;
  grid-auto-flow: column;
  gap: 12px;
  justify-content: start;
  align-items: center;
}

.form-actions .button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

pre {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
}

.email-list {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.email-row {
  display: grid;
  grid-template-columns: minmax(8rem, 0.8fr) minmax(12rem, 1.4fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.email-row:last-child {
  border-bottom: 0;
}

.email-head {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--sky);
}

.email-row .button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.85rem;
  justify-self: end;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  width: var(--page-width);
  margin: 0 auto 8px;
  padding: 0;
}

.admin-tab {
  appearance: none;
  border: 1px solid rgba(31, 79, 67, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.promote-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 18px;
}

.promote-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(31, 79, 67, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  display: grid;
  gap: 12px;
}

.promote-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.promote-card textarea,
.promote-card input {
  width: 100%;
}

.promote-post-row {
  grid-template-columns: 0.7fr 1.4fr 0.6fr minmax(180px, 1.6fr);
}

.promote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.admin-gate {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.admin-gate:hover {
  color: var(--ink);
}

.spreadsheet {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(31, 79, 67, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 34px rgba(28, 36, 48, 0.06);
}

.spreadsheet h3 {
  margin: 0;
}

.table-wrap {
  width: 100%;
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.pcs-band {
  padding-top: 8px;
}

.pcs-table {
  min-width: 560px;
}

.pcs-table th,
.pcs-table td {
  vertical-align: middle;
}

.pcs-table td:last-child,
.pcs-table th:last-child {
  text-align: center;
  width: 72px;
}

.pc-portrait {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--sky);
}

.pc-portrait-empty {
  border: 1px dashed var(--line);
}

.sheet-link-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0 8px;
}

.sheet-link-form label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

.pcs-table .grid-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.62rem;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .sheet-link-form {
    grid-template-columns: 1fr;
  }
}

main:has(.doc) .page-hero {
  padding: 52px 0 20px;
}

.timeline {
  display: grid;
  gap: 16px;
  padding-bottom: 58px;
}

.timeline article {
  display: grid;
  grid-template-columns: 48px 180px 1fr;
  gap: 18px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  font-weight: 900;
}

.timeline h2,
.timeline p {
  margin: 0;
}

.timeline h2 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.checklist input {
  width: auto;
  margin: 0;
}

.doc {
  display: flex;
  flex-direction: column;
  width: var(--page-width);
  margin: 0 auto 52px;
}

.doc > p:first-child,
.doc > p:first-child + p {
  color: var(--muted);
}

.doc h2 {
  margin: 28px 0 8px;
}

.doc p,
.doc ul {
  margin: 0;
}

.doc p {
  color: var(--ink);
}

.doc p + p,
.doc p + ul,
.doc ul + p {
  margin-top: 0.9em;
}

.doc .form-note,
.doc .drop-login-prompt {
  color: var(--muted);
}

.drop-band {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 88px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.dropzone.is-over {
  border-color: var(--accent);
  background: var(--sky);
}

body:not(.is-logged-in) .logged-in-only {
  display: none;
}

body.is-logged-in .login-required-panel {
  display: none;
}

body.is-logged-in .drop-band {
  display: grid;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.file-list span {
  color: var(--muted);
  font-size: 0.92rem;
}

.file-list .file-remove {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0 4px;
}

.file-list .file-remove:hover,
.file-list .file-remove:focus-visible {
  color: var(--ink);
}

.doc .example {
  margin-top: 12px;
}

.doc code {
  font-size: 0.92em;
}

.example {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fff;
}

.example p {
  color: var(--muted);
}

.related {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
}

.related a {
  font-weight: 750;
}

footer {
  width: var(--page-width);
  margin: 0 auto;
  padding: 26px 0 44px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28, 36, 48, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(28, 36, 48, 0.24);
}

dialog.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  max-width: min(720px, calc(100% - 32px));
}

dialog.modal::backdrop {
  background: rgba(28, 36, 48, 0.48);
}

.small-modal {
  width: min(520px, 100%);
}

.modal-copy {
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.handle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.profile-details {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.profile-details div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sky);
}

.profile-details span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-details strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.security-roadmap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.security-roadmap article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.guide-links {
  width: var(--page-width);
  margin: 0 auto 58px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.guide-links a {
  padding: 18px;
  border: 1px solid rgba(31, 79, 67, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(28, 36, 48, 0.06);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.guide-links a:hover {
  border-color: rgba(31, 79, 67, 0.34);
}

@media (max-width: 860px) {
  .player-hook-wrap.is-expanded .player-hook {
    height: min(70vh, 480px);
  }

  .split,
  .section-head,
  .three,
  .two,
  .form-grid,
  .compact,
  .suggest,
  .timeline article,
  .checklist,
  .time-card,
  .add-row,
  .adventure-summary-form,
  .identity-strip,
  .handle-row,
  .security-roadmap,
  .guide-links {
    grid-template-columns: 1fr;
  }

  .identity-strip .label,
  .identity-strip strong,
  .identity-strip #welcomeLine,
  .time-card > strong,
  .time-card > small,
  .people-count,
  .time-card > .attendee,
  .time-card > .choice {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .settings-menu {
    right: 0;
  }

  h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .discord-panel-head {
    grid-template-columns: 1fr;
  }
}

[data-theme="dark"] .primary {
  color: #121418;
}

[data-theme="dark"] .card,
[data-theme="dark"] .video-card,
[data-theme="dark"] .signup-form,
[data-theme="dark"] .admin-panel,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .spreadsheet,
[data-theme="dark"] .guide-links a,
[data-theme="dark"] .schedule-context-menu,
[data-theme="dark"] .promote-card,
[data-theme="dark"] .admin-tab {
  background: var(--panel-soft);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .admin-tab.is-active {
  background: #f3f0ea;
  color: #121418;
  border-color: #f3f0ea;
}

[data-theme="dark"] .status-table th,
[data-theme="dark"] .status-table td {
  border-color: rgba(232, 228, 220, 0.22);
}

[data-theme="dark"] .status-table thead th:first-child,
[data-theme="dark"] .status-table tbody th {
  background: #2c3038;
  color: #f3f0ea;
}

[data-theme="dark"] .status-table thead th:nth-child(2) {
  background: #8fcdb0;
  color: #10241c;
}

[data-theme="dark"] .status-table thead th:nth-child(3) {
  background: #e0c56a;
  color: #241c08;
}

[data-theme="dark"] .status-table thead th:nth-child(4) {
  background: #e0a090;
  color: #2a1210;
}

[data-theme="dark"] .status-table tbody td:nth-child(2) {
  background: #3d6b5c;
}

[data-theme="dark"] .status-table tbody td:nth-child(3) {
  background: #6a5c36;
}

[data-theme="dark"] .status-table tbody td:nth-child(4) {
  background: #6a4540;
}

[data-theme="dark"] .pcs-glance thead th:nth-child(n) {
  background: #2c3038;
  color: #f3f0ea;
}

[data-theme="dark"] .pcs-glance tbody td:nth-child(n) {
  background: #252830;
  color: #f3f0ea;
}

[data-theme="dark"] .pcs-glance a {
  color: #f3f0ea;
}

[data-theme="dark"] .attendee,
[data-theme="dark"] .player-hook,
[data-theme="dark"] .scheduler,
[data-theme="dark"] .status-table-wrap,
[data-theme="dark"] .grid-context-menu,
[data-theme="dark"] .choice,
[data-theme="dark"] pre,
[data-theme="dark"] .email-list,
[data-theme="dark"] .timeline article,
[data-theme="dark"] .checklist label,
[data-theme="dark"] .dropzone,
[data-theme="dark"] .example,
[data-theme="dark"] .modal-close {
  background: var(--panel);
}

[data-theme="dark"] .time-card {
  background: linear-gradient(135deg, rgba(36, 48, 44, 0.9), rgba(30, 34, 42, 0.95));
}

[data-theme="dark"] .player-hook-wrap:not(.is-expanded) .player-hook::after {
  background: linear-gradient(180deg, transparent, var(--panel) 88%);
}

[data-theme="dark"] .grid-context-menu button {
  color: var(--ink);
}

[data-theme="dark"] .band,
[data-theme="dark"] .note {
  border-top-color: rgba(58, 65, 76, 0.86);
}

[data-theme="dark"] .avatar-button,
[data-theme="dark"] .grid-avatar {
  background: linear-gradient(135deg, #1f4f43, #2f6f5e);
  color: #fff;
}

[data-theme="dark"] .scheduler-grid {
  --ag-background-color: #1e222a;
  --ag-foreground-color: #f3f0ea;
  --ag-header-background-color: #2c3038;
  --ag-header-foreground-color: #f3f0ea;
  --ag-odd-row-background-color: #252a33;
  --ag-row-hover-color: rgba(143, 205, 176, 0.22);
  --ag-border-color: #4a5160;
  --ag-control-panel-background-color: #1e222a;
  --ag-input-background-color: var(--input-bg);
  --ag-input-focus-border-color: var(--accent);
  --ag-data-color: #f3f0ea;
  --ag-secondary-foreground-color: #d4cfc4;
  color-scheme: dark;
}
