:root {
  --night-ink: #100d19;
  --night-panel: #1e172e;
  --night-gold: #efcb86;
  --night-text: #faf4e9;
  --night-muted: #d3c8e1;
  --night-line: #776487;
  --night-display: Georgia, "Times New Roman", serif;
  --night-body: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.night-home, .calendar, .night-download {
  background: var(--night-ink);
  color: var(--night-text);
  font: 1rem/1.65 var(--night-body);
}
.night-home {
  --dark: var(--night-ink);
  --gold: var(--night-gold);
  --pale: var(--night-text);
  --muted: var(--night-muted);
  --serif: var(--night-display);
  --sans: var(--night-body);
}
:where(.night-home, .calendar, .night-download) :focus-visible {
  outline: 2px solid #ffe0a1;
  outline-offset: 4px;
}
.night-home > .header {
  position: relative;
  z-index: 10;
  min-height: 80px;
  height: auto;
  gap: .8rem 1.5rem;
  padding: .8rem clamp(1rem, 4vw, 4rem);
  background: #151022;
  border-bottom: 1px solid #786047;
}
.night-home .header .brand, .calendar-brand {
  color: var(--night-gold);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font: bold clamp(1rem, 2vw, 1.38rem)/1.2 var(--night-display);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: .04em;
}
.night-home .header nav {gap: .25rem clamp(.4rem, 1.1vw, 1.3rem); flex-wrap: wrap; justify-content: center;}
.night-home .header nav a {
  color: var(--night-text);
  min-height: 44px;
  padding: .35rem .35rem;
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}
.night-home .header nav a:hover, .night-home .header nav .active {color: var(--night-gold);}
.night-home .header nav a.active::after {bottom: .1rem;}
.night-home #imperium-donate-trigger {
  width: auto;
  min-width: 70px;
  min-height: 44px;
  height: auto;
  padding: .5rem .8rem;
  margin: 0;
  background: #30223e;
  border-color: #a38350;
  color: var(--night-gold);
  font: 700 .875rem var(--night-body);
  border-radius: .4rem;
}
.night-home #imperium-donate-trigger span {font-size: inherit;}
.night-home .hero {
  isolation: isolate;
  min-height: clamp(450px, 52vw, 690px);
  height: auto;
  max-height: none;
  display: grid;
  place-items: center;
  text-align: left;
  padding: clamp(2rem, 6vw, 6rem) clamp(1rem, 5vw, 5rem);
  background: radial-gradient(ellipse at 70% 38%, #34254c, var(--night-ink) 72%);
}
.night-home .hero-art {
  position: absolute;
  z-index: -2;
  top: 0;
  right: 0;
  width: min(100%, 1774px);
  height: 100%;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 19%);
}
.night-home .hero-art img {width: 100%; height: 100%; object-fit: contain; object-position: right center;}
.night-home .hero-shade {
  z-index: -1;
  background: linear-gradient(90deg, #100d19 1%, #100d19ed 21%, #100d1940 68%, transparent),
    linear-gradient(0deg, #100d19 0%, #100d1900 22%, #100d1900 87%, #100d1966);
}
.night-home .hero .hero-content {max-width: 1440px; padding: 0;}
.night-home .hero h1 {
  font: 700 clamp(2.25rem, 6.7vw, 6.75rem)/1.05 var(--night-display);
  color: var(--night-gold);
  letter-spacing: .02em;
  margin: 0;
  text-shadow: 0 3px 20px #080511;
}
.night-home .hero h1 span {display: block; font-size: .55em; margin-top: .18em; color: var(--night-text);}
.night-home .hero-actions {justify-content: flex-start; flex-wrap: wrap; gap: .75rem; margin: 2rem 0 0;}
.night-home .hero-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: .75rem 1.2rem;
  border-radius: .38rem;
  border: 1px solid #aa8e5e;
  background: #251c35;
  color: var(--night-text);
  font: 700 1rem/1.35 var(--night-body);
  text-transform: none;
  letter-spacing: 0;
  transition: background-color .2s, border-color .2s;
}
.night-home .hero-actions .primary {background: #efcb86; color: #211626;}
.night-home .hero-actions .button:hover {border-color: #ffe8b5; background: #4b3765;}
.night-home .hero-actions .primary:hover {background: #ffe2a7;}
.night-home .stats {background: #1c1429; border-color: #796547;}
.night-home .stats p {color: var(--night-text); font-size: 1rem;}
.night-home .section {color: var(--night-text);}
.night-home .world-card, .night-home .faq details {background-color: var(--night-panel);}
.night-home .imp-corner {
  position: static;
  width: min(calc(100% - 2rem), 1150px);
  max-height: none;
  margin: 1.8rem auto;
  padding: 1rem 1.3rem;
  background: var(--night-panel);
  border-color: #806a55;
  color: var(--night-text);
}
.night-home .imp-mini-ranks {display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px),1fr)); gap: 1rem;}
.night-home .imp-mini-rank {border: 0; padding: .45rem .5rem;}
.night-home .imp-mini-rank h3, .night-home .imp-mini-rank ol,
.night-home .imp-corner .imp-online-line, .night-home .imp-corner #imp-updated {font-size: .9rem; color: var(--night-muted);}
.night-home .imp-mini-rank h3 {font-weight: 700; color: var(--night-gold);}
.night-home .menu-toggle {min-width: 44px; min-height: 44px;}
@media (max-width: 900px) {
  .night-home > .header {justify-content: flex-start;}
  .night-home .menu-toggle {display: block; margin-left: auto;}
  .night-home .header nav {display: none; position: absolute; top: 100%; left: 0; right: 0; height: auto; background: #1e172e; padding: .75rem 1rem; flex-direction: column; align-items: stretch;}
  .night-home .header nav.open {display: flex;}
  .night-home .header nav a {display: flex; align-items: center;}
}
@media (max-width: 600px) {
  .night-home > .header {min-height: 70px;}
  .night-home .hero {min-height: 420px; align-items: end;}
  .night-home .hero-art {mask-image: none; height: 82%;}
  .night-home .hero-art img {object-position: right top; object-fit: cover;}
  .night-home .hero-shade {background: linear-gradient(0deg,#100d19 8%,#100d19ed 30%,#100d1930 100%);}
}
.calendar {margin: 0; min-height: 100vh;}
.calendar-header {
  padding: .85rem clamp(1rem, 5vw, 4rem);
  background: #161023;
  border-bottom: 1px solid #786047;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}
.calendar-header nav {display: flex; flex-wrap: wrap; gap: .8rem;}
.calendar-header nav a, .calendar table a {
  color: var(--night-gold);
  text-underline-offset: .22em;
}
.calendar-header nav a {display: inline-flex; align-items: center; min-height: 44px;}
.calendar-main {width: min(100% - 2rem, 1440px); margin: 0 auto; padding-bottom: 4rem;}
.calendar-intro {padding: clamp(2rem,7vw,6rem) 0 2rem; max-width: 65ch;}
.calendar h1 {font: 700 clamp(2.05rem,6vw,5rem)/1.09 var(--night-display); margin: 0 0 .6em; color: var(--night-gold);}
.calendar h2 {font: 700 clamp(1.3rem,2.3vw,1.8rem)/1.2 var(--night-display); color: var(--night-gold);}
.calendar-intro p, .event-location {color: var(--night-muted); margin: .4rem 0;}
.event-grid {display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,305px),1fr)); gap: 1.15rem;}
.event-card {
  min-width: 0;
  scroll-margin-top: 1rem;
  overflow: hidden;
  border-radius: .7rem;
  border: 1px solid var(--night-line);
  background: linear-gradient(155deg,#251a38,var(--night-panel) 55%);
  box-shadow: 0 12px 30px #07051255;
}
.event-card:target {border-color: var(--night-gold);}
.event-card img {display: block; width: 100%; max-width: 590px; height: auto; margin: auto;}
.event-body {padding: 1.05rem;}
.event-body h2 {margin: .4rem 0;}
.event-body p {margin: .55rem 0;}
.event-date {color: #f2d89e; font-weight: 700; font-variant-numeric: tabular-nums;}
#schedule {margin-top: 3rem;}
.schedule-scroll {overflow-x: auto; border: 1px solid var(--night-line); border-radius: .6rem;}
.calendar table {width: 100%; min-width: 42rem; border-collapse: collapse; text-align: start;}
.calendar th, .calendar td {text-align: start; padding: .85rem; border-bottom: 1px solid #5e4c70;}
.calendar thead {background: #322145;}
.calendar tbody tr:nth-child(odd) {background: #1a1328;}
.calendar tbody tr:last-child > * {border-bottom: 0;}
.night-download header, .night-download .panel {background: var(--night-panel);}
.night-download a.download {min-height: 48px;}
.night-download .panel p, .night-download .panel ol {color: var(--night-text);}
@media (prefers-reduced-motion: reduce) {
  :where(.night-home, .calendar, .night-download) *,
  :where(.night-home, .calendar, .night-download) *::before,
  :where(.night-home, .calendar, .night-download) *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  html:has(.night-home, .calendar, .night-download) {scroll-behavior: auto;}
}
@media (max-width: 380px) {
  .night-home > .header {gap: .4rem; padding-inline: .6rem;}
  .night-home .header .brand {font-size: .9rem; gap: .35rem;}
  .night-home .header .brand img {width: 27px; height: 27px;}
  .night-home #imperium-donate-trigger {min-width: 54px; padding-inline: .42rem;}
  .night-home .hero-actions .button {width: 100%;}
}

.holiday-editor {margin-top: 1rem;}
.holiday-editor summary {
  width: fit-content;
  padding: .4rem .75rem;
  border: 1px solid currentColor;
  border-radius: .35rem;
  cursor: pointer;
  color: var(--night-gold);
}
.holiday-editor form, .holiday-editor label {display: grid; gap: .5rem;}
.holiday-editor form {margin-top: .75rem;}
.holiday-editor :is(input, textarea, button) {box-sizing: border-box; max-width: 100%; font: inherit;}
.holiday-editor textarea {min-height: 4rem; resize: vertical;}
.holiday-editor button {justify-self: start;}

.holiday-gifts summary {cursor: pointer; color: var(--night-gold);}
.calendar .holiday-gifts table {min-width: 0; margin-top: 1rem;}
.holiday-gifts caption {text-align: left; font-weight: 700; padding-bottom: .5rem;}
.holiday-gifts :is(th,td) {padding: .5rem; white-space: normal; overflow-wrap: anywhere;}
