/* Opt-in host UI only. Game engines and unflagged pages retain their styles. */
.gd-night {
  color-scheme: dark;
  --gd-bg: #10121e;
  --gd-surface: #1b1e30;
  --gd-ink: #f3f2ff;
  --gd-muted: #b6b8ce;
  --gd-line: #383c54;
  --gd-accent: #c3a6ff;
  --gd-accent-soft: #302447;
  --gd-mint-surface: #183c36;
  --gd-mint-ink: #a7e4d1;
  --gd-gold: #f4d28c;
  --gd-gold-surface: #3a3021;
  --gd-button-ink: #201331;
  --gd-control-line: #73758d;
  --gd-secondary-line: #85719b;
  --gd-focus: #65e1ef;
  --gd-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gd-space-1: 4px;
  --gd-space-2: 8px;
  --gd-space-3: 12px;
  --gd-space-4: 16px;
  --gd-space-5: 24px;
  --gd-space-6: 32px;
  --gd-space-7: 48px;
  --gd-space-8: 64px;
  --gd-radius-control: 10px;
  --gd-radius-card: 18px;
  --gd-shadow: 0 12px 35px #0002;
  --gd-content-width: 1120px;
  margin: 0;
  background: var(--gd-bg);
  color: var(--gd-ink);
  font-family: var(--gd-font);
  font-size: 1rem !important; /* Existing body rule uses !important. */
  line-height: 1.6;
}

.gd-night .gd-container {
  width: min(var(--gd-content-width), calc(100% - 40px));
  margin-inline: auto;
}

.gd-night .gd-surface {
  background: var(--gd-surface);
  border: 1px solid var(--gd-line);
  border-radius: var(--gd-radius-card);
  padding: var(--gd-space-5);
  box-shadow: var(--gd-shadow);
}

.gd-night .gd-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--gd-radius-control);
  background: var(--gd-accent);
  color: var(--gd-button-ink);
  font: 700 .875rem/1.5 var(--gd-font);
  text-decoration: none;
}

.gd-night .gd-button:hover {
  background: #d3bfff;
  color: var(--gd-button-ink);
  text-decoration: none;
}

.gd-night .gd-button-secondary {
  border-color: var(--gd-secondary-line);
  background: var(--gd-accent-soft);
  color: var(--gd-accent);
}

.gd-night .gd-button-secondary:hover {
  background: #3c2d58;
  color: var(--gd-ink);
}

.gd-night .gd-button:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.gd-night :focus-visible {
  outline: 3px solid var(--gd-focus);
  outline-offset: 4px;
  box-shadow: none;
}

.gd-night .gd-skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1060;
  padding: 12px 16px;
  border-radius: var(--gd-radius-control);
  background: var(--gd-surface);
  color: var(--gd-ink);
}

.gd-night .gd-skip:focus {
  top: 12px;
}

/* Preserve Bootstrap's 1200px collapse boundary and existing IDs/attributes. */
.gd-night #navbar {
  position: relative;
  top: auto;
  z-index: 100;
  min-height: 76px;
  padding: 10px 0;
  background: var(--gd-surface) !important;
  border-bottom: 1px solid var(--gd-line);
  box-shadow: none;
  backdrop-filter: none;
}

.gd-night #nav-content {
  max-width: var(--gd-content-width);
  padding: 0;
  margin-inline: auto;
  width: calc(100% - 40px);
}

.gd-night #navbar .gd-logo {
  gap: 9px;
  min-height: 44px;
  margin-right: 16px;
  padding: 0;
}

.gd-night #navbar .gd-logo h3 {
  font: 800 1.25rem/1.3 var(--gd-font);
  letter-spacing: -.04em;
}

.gd-night #navbar .gd-icon {
  width: 35px;
  height: 35px;
  flex-basis: 35px;
  padding: 7px;
  background: var(--gd-accent);
  border-radius: 11px;
  box-shadow: none;
}

.gd-night #navbar .navbar-nav {
  gap: 4px;
}

.gd-night #navbar .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px;
  color: var(--gd-ink);
  border: 1px solid transparent;
  border-radius: var(--gd-radius-control);
  font: 650 .875rem/1.5 var(--gd-font);
  text-decoration: none;
  white-space: nowrap;
}

.gd-night #navbar a.nav-link:hover,
.gd-night #navbar .nav-link[aria-expanded="true"] {
  background: var(--gd-accent-soft);
  color: var(--gd-accent);
}

.gd-night #navbar .dropdown {
  position: relative;
}

.gd-night #navbar .mega-area {
  display: none !important;
}

.gd-night #navbar .dropdown-list {
  display: none !important;
  min-width: 210px;
  padding: 8px;
  border: 1px solid var(--gd-control-line);
  border-radius: var(--gd-radius-control);
  background: var(--gd-surface);
  box-shadow: var(--gd-shadow);
}

.gd-night #navbar .dropdown-list.show {
  display: block !important;
}

.gd-night #navbar .dropdown-item {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--gd-ink);
  font: 600 .9375rem/1.5 var(--gd-font);
}

.gd-night #navbar .dropdown-item:hover,
.gd-night #navbar .dropdown-item:focus {
  background: var(--gd-accent-soft);
  color: var(--gd-accent);
}

.gd-night #navbar .navbar-toggler {
  min-width: 48px;
  min-height: 44px;
  border-color: var(--gd-control-line);
  border-radius: var(--gd-radius-control);
}

.gd-night #navbar #player-points-outline {
  margin-left: 4px !important;
  border-color: var(--gd-line);
  color: var(--gd-gold) !important;
  background: var(--gd-gold-surface);
  min-width: 72px;
}

.gd-night #navbar #player-points {
  font-variant-numeric: tabular-nums;
}

.gd-night #navbar #start-over-btn {
  margin-left: 0 !important;
  border-color: var(--gd-secondary-line);
  background: var(--gd-accent-soft);
  color: var(--gd-accent) !important;
}

.gd-night .gd-main {
  max-width: none;
  height: auto;
  margin: 0;
  padding: 48px 0 64px;
  overflow: visible;
}

.gd-night .gd-document {
  padding: 0;
}

.gd-night .gd-document > .container {
  width: min(var(--gd-content-width), calc(100% - 40px));
  max-width: none;
  padding: 32px;
  background: var(--gd-surface);
  border: 1px solid var(--gd-line);
  border-radius: var(--gd-radius-card);
  box-shadow: var(--gd-shadow);
}

.gd-night .gd-document .row {
  margin: 0;
}

.gd-night .gd-document .row > div {
  width: 100%;
  max-width: 72ch;
  margin-inline: auto;
  padding: 0;
  flex: 0 1 72ch;
}

.gd-night .gd-document h1,
.gd-night .gd-document h2 {
  color: var(--gd-ink);
  font-family: var(--gd-font);
  font-weight: 800;
  letter-spacing: -.035em;
}

.gd-night .gd-document h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
  margin-bottom: 24px;
}

.gd-night .gd-document h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.25;
}

.gd-night .gd-document p,
.gd-night .gd-document li {
  color: var(--gd-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.gd-night .gd-document a {
  color: var(--gd-accent);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.gd-night .page-footer {
  padding: 32px 0 24px !important;
  background: var(--gd-surface);
  border-top: 1px solid var(--gd-line);
  color: var(--gd-muted);
}

.gd-night .gd-footer-intro {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.gd-night .gd-footer-brand {
  color: var(--gd-ink);
  font-size: 1.25rem;
  font-weight: 800;
}

.gd-night .gd-footer-intro p {
  margin: 4px 0 0;
}

.gd-night .gd-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.gd-night .gd-footer-links a,
.gd-night .footer-copyright a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--gd-accent) !important;
  text-underline-offset: .2em;
}

.gd-night .gd-footer-categories {
  padding: 16px 0;
  border-block: 1px solid var(--gd-line);
}

.gd-night .gd-footer-categories summary {
  display: list-item;
  min-height: 44px;
  padding: 10px 4px;
  color: var(--gd-ink);
  font-weight: 700;
  cursor: pointer;
}

.gd-night .gd-footer-categories .footer-tags {
  margin: 16px 0 0 !important;
}

.gd-night .gd-footer-categories .footer-tags > div {
  flex: 0 0 100%;
  max-width: 100%;
  padding: 0;
  text-align: left !important;
}

.gd-night .footer-tags .btn {
  min-height: 44px;
  margin: 4px 2px;
  border: 1px solid var(--gd-secondary-line);
  border-radius: var(--gd-radius-control);
  background: var(--gd-accent-soft);
  color: var(--gd-accent);
  font: 600 .875rem/1.5 var(--gd-font);
  padding: 10px 12px;
}

.gd-night .page-footer > .container-fluid {
  width: min(var(--gd-content-width), calc(100% - 40px));
  padding: 0;
}

.gd-night .page-footer .home-footer .footer-card-wrapper {
  padding: 24px 0 !important;
}

.gd-night .page-footer .home-footer .footer-card-wrapper::before,
.gd-night .page-footer .home-footer .footer-card-wrapper::after {
  content: none;
}

.gd-night .page-footer .home-footer {
  margin: 0;
}

.gd-night .page-footer .home-footer-title {
  font: 700 1rem/1.5 var(--gd-font);
}

.gd-night .page-footer .home-footer-description {
  margin: 8px 0 0 !important;
  font: 400 .9375rem/1.6 var(--gd-font) !important;
  color: var(--gd-muted);
}

.gd-night .page-footer .fa-keyboard,
.gd-night .page-footer .fa-mouse,
.gd-night .page-footer .fa-tablet-alt,
.gd-night .page-footer .fa-mobile-alt,
.gd-night .page-footer .footer-emojis,
.gd-night .page-footer .gd-footer-decoration {
  display: none;
}

.gd-night .page-footer .footer-copyright {
  border-top: 1px solid var(--gd-line);
  font-size: .875rem;
}

.gd-night .page-footer #wink {
  font-size: 2rem;
}

@media (max-width: 1199.98px) {
  .gd-night #navbar {
    min-height: 64px;
  }

  .gd-night #navbarResponsive {
    padding: 16px 0 8px;
  }

  .gd-night #navbar .nav-link {
    justify-content: flex-start;
  }

  .gd-night #navbar .dropdown-list {
    position: static;
    box-shadow: none;
  }

  .gd-night #navbar #player-points-outline {
    margin-left: 0 !important;
  }
}

@media (max-width: 600px) {
  .gd-night .gd-container,
  .gd-night #nav-content,
  .gd-night .gd-document > .container,
  .gd-night .page-footer > .container-fluid {
    width: calc(100% - 28px);
  }

  .gd-night .gd-main {
    padding: 24px 0 40px;
  }

  .gd-night .gd-document > .container {
    padding: 22px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gd-night .gd-button,
  .gd-night #navbar .collapsing,
  .gd-night #navbar .gd-logo {
    transition: none;
    transform: none;
  }
}
