:root {
  color-scheme: dark;
  --doom-bg: #070706;
  --doom-bg-deep: #020202;
  --doom-stone: #242321;
  --doom-stone-light: #3b3934;
  --doom-panel: #111211;
  --doom-panel-raised: #1b1b19;
  --doom-line: #57534b;
  --doom-line-dark: #080808;
  --doom-text: #e7e0d2;
  --doom-muted: #aaa395;
  --doom-gold: #e3bd4d;
  --doom-red: #a83220;
  --doom-red-bright: #e25035;
  --doom-green: #78b766;
  --doom-blue: #6d88a1;
  --doom-danger: #ff765d;
  --doom-shadow: #000;
  --doom-mono: "Courier New", Courier, monospace;
  --doom-ui: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--doom-bg-deep); }
body {
  margin: 0;
  min-height: 100%;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% -15%, rgba(122, 40, 24, .20), transparent 38%),
    radial-gradient(circle at 12% 55%, rgba(74, 70, 58, .12), transparent 32%),
    linear-gradient(180deg, #151410 0%, #080807 36%, #020202 100%);
  color: var(--doom-text);
  font-family: var(--doom-ui);
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .25;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,.018) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(0,0,0,.18) 50%, transparent 51%);
  background-size: 13px 13px, 17px 17px;
}

a { color: var(--doom-gold); }
a:hover { color: #ffe186; }

/* Legacy content pages receive this stylesheet from server.js as well. These
   selectors give older About/legal pages the same stone-and-metal frame even
   before their markup is moved to the newer doom-* component classes. */
body > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 64px;
  padding: 11px 16px;
  border-bottom: 3px solid #0a0a09;
  background: linear-gradient(180deg, #2b2924, #11110f);
  box-shadow: inset 0 -2px 0 #5b564c, 0 5px 0 rgba(0,0,0,.65);
}
body > header > a,
body > header nav a {
  color: #eee4d1;
  font-family: var(--doom-mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
}
body > header nav { display: flex; flex-wrap: wrap; gap: 8px; }
body > header nav a {
  padding: 7px 10px;
  border: 2px solid #615d54;
  border-right-color: #171714;
  border-bottom-color: #171714;
  background: linear-gradient(#302f2b, #151513);
}
body > header nav a:hover { border-color: var(--doom-gold); color: #ffe58b; }
body > main:not(.doom-page-main):not(#workshopPage) {
  width: min(1000px, calc(100% - 28px));
  margin: 0 auto;
  padding: 38px 0 52px;
}
body > main:not(.doom-page-main):not(#workshopPage) > section,
body > main:not(.doom-page-main):not(#workshopPage) > article,
body > main:not(.doom-page-main):not(#workshopPage) > .panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 3px solid #6c675e;
  border-right-color: #161512;
  border-bottom-color: #161512;
  background: linear-gradient(180deg, #23221e, #0b0b0a);
  box-shadow: inset 0 0 0 2px #050505, 6px 6px 0 rgba(0,0,0,.72);
}
body > main:not(.doom-page-main):not(#workshopPage) h1,
body > main:not(.doom-page-main):not(#workshopPage) h2 {
  color: #fff0ce;
  font-family: var(--doom-mono);
  letter-spacing: .04em;
  text-shadow: 2px 2px 0 #000;
  text-transform: uppercase;
}
button, input, select, textarea { font: inherit; }
button, .doom-button, .button {
  min-height: 40px;
  padding: 8px 14px;
  border: 2px solid #6b6558;
  border-right-color: #171714;
  border-bottom-color: #171714;
  border-radius: 0;
  background: linear-gradient(#32302b, #1a1917);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.12), 3px 3px 0 #000;
  color: var(--doom-text);
  font-family: var(--doom-mono);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}
button:hover:not(:disabled), .doom-button:hover, .button:hover {
  border-color: var(--doom-gold);
  background: linear-gradient(#464136, #24211d);
  color: #fff4cf;
}
button:active:not(:disabled), .doom-button:active, .button:active {
  transform: translate(2px, 2px);
  box-shadow: inset 1px 1px 0 rgba(0,0,0,.4), 1px 1px 0 #000;
}
button.primary, .doom-button.primary, .button.primary {
  border-color: #d36a46 #45140d #45140d #d36a46;
  background: linear-gradient(#b43d27, #66190f);
  color: #fff0d5;
}
button.danger, .doom-button.danger, .button.danger {
  border-color: #e1674f #3d0c08 #3d0c08 #e1674f;
  background: linear-gradient(#7e2015, #3e0d08);
  color: #ffd5ca;
}
button.secondary { background: linear-gradient(#2e3231, #161818); }
button:disabled { opacity: .42; cursor: not-allowed; filter: grayscale(.5); }

input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 2px solid #171714;
  border-right-color: #5d594f;
  border-bottom-color: #5d594f;
  border-radius: 0;
  outline: none;
  background: #080908;
  color: #fff9e9;
  font-family: var(--doom-mono);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--doom-gold);
  box-shadow: 0 0 0 2px rgba(227,189,77,.18);
}
input[type="checkbox"] { width: 19px; min-height: 19px; height: 19px; accent-color: var(--doom-red); }
label { color: #d0c8b9; font-size: 13px; }
small, .doom-muted { color: var(--doom-muted); }

:focus-visible {
  outline: 3px solid #ffe06b;
  outline-offset: 3px;
}

#discordInviteUi {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 5000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border: 2px solid #7a77d2;
  border-right-color: #29264f;
  border-bottom-color: #29264f;
  background: linear-gradient(#242330, #0c0c12);
  box-shadow: 3px 3px 0 #000;
  color: #f0e8d9;
  font-family: var(--doom-mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
}
#discordInviteUi:hover { color: #fff; border-color: #9d99ff; }
#discordInviteUi img { width: 23px; height: 23px; object-fit: contain; image-rendering: pixelated; }

#topNavigation {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 5000;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: calc(100vw - 190px);
}
.topNavLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 12px;
  border: 2px solid #615d54;
  border-right-color: #171714;
  border-bottom-color: #171714;
  background: linear-gradient(#302f2b, #151513);
  box-shadow: 2px 2px 0 #000;
  color: #d8d0c1;
  font-family: var(--doom-mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
}
.topNavLink:hover, .topNavLink.active, .topNavLink[aria-current="page"] {
  border-color: var(--doom-gold) #5a4513 #5a4513 var(--doom-gold);
  color: #ffe58b;
  background: linear-gradient(#4a3b20, #21190d);
}
.topNavLink.staff-link { border-left-color: var(--doom-red-bright); color: #ffb19f; }

.doom-page-main {
  width: min(1160px, calc(100% - 28px));
  margin: 0 auto;
  padding: calc(88px + env(safe-area-inset-top)) 0 48px;
}
.doom-panel {
  position: relative;
  border: 3px solid #6c675e;
  border-right-color: #161512;
  border-bottom-color: #161512;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #23221e, #11110f 62%, #090909);
  box-shadow: inset 0 0 0 2px #050505, 7px 7px 0 rgba(0,0,0,.75), 0 20px 55px rgba(0,0,0,.55);
  padding: 18px;
}
.doom-panel + .doom-panel { margin-top: 16px; }
.doom-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -18px -18px 18px;
  padding: 11px 14px;
  border-bottom: 3px solid #0b0b0a;
  background:
    linear-gradient(90deg, rgba(145,36,22,.92), rgba(72,17,11,.96) 44%, rgba(28,25,21,.96));
  box-shadow: inset 0 -2px 0 #5d574d, inset 0 1px 0 rgba(255,255,255,.13);
}
.doom-titlebar h1, .doom-titlebar h2 {
  margin: 0;
  color: #fff0ce;
  font-family: var(--doom-mono);
  font-weight: 900;
  letter-spacing: .055em;
  text-shadow: 2px 2px 0 #000;
  text-transform: uppercase;
}
.doom-titlebar h1 { font-size: clamp(22px, 4vw, 34px); }
.doom-titlebar h2 { font-size: clamp(17px, 3vw, 23px); }
.doom-kicker {
  margin: 0 0 5px;
  color: var(--doom-gold);
  font-family: var(--doom-mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.doom-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 2px solid #655f53;
  background: #0c0c0b;
  color: var(--doom-muted);
  font-family: var(--doom-mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.doom-badge.online, .doom-badge.success { color: #a8e598; border-color: #527847; }
.doom-badge.warning { color: #ffe181; border-color: #816d32; }
.doom-badge.danger, .doom-badge.offline { color: #ff9a85; border-color: #8e4639; }
.doom-grid { display: grid; gap: 14px; }
.doom-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doom-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doom-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.doom-card {
  border: 2px solid #4c4942;
  border-right-color: #121210;
  border-bottom-color: #121210;
  background: rgba(7,7,6,.78);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.045);
  padding: 13px;
}
.doom-card h2, .doom-card h3 { margin: 0 0 10px; color: #efe5d2; font-family: var(--doom-mono); text-transform: uppercase; }
.doom-card h2 { font-size: 18px; }
.doom-card h3 { font-size: 14px; }
.doom-message { min-height: 22px; margin: 12px 0 0; color: #d7b58c; font-family: var(--doom-mono); font-size: 12px; }
.doom-message.error { color: var(--doom-danger); }
.doom-message.success { color: #9bd88b; }
.doom-table-wrap { overflow: auto; border: 2px solid #4c4942; background: #070706; }
.doom-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.doom-table th, .doom-table td { padding: 9px 10px; border-bottom: 1px solid #302e29; text-align: left; vertical-align: middle; }
.doom-table th { position: sticky; top: 0; z-index: 1; background: #2a2823; color: var(--doom-gold); font-family: var(--doom-mono); font-size: 11px; text-transform: uppercase; }
.doom-table tr:hover td { background: rgba(155, 51, 30, .12); }
.doom-table tr.selected td { background: rgba(186, 58, 33, .24); outline: 1px solid #b64b32; outline-offset: -1px; }
.doom-table code { color: #f4d77d; }
.doom-empty { padding: 22px; color: var(--doom-muted); text-align: center; font-family: var(--doom-mono); }

.visuallyHidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
[hidden] { display: none !important; }

@media (max-width: 860px) {
  #discordInviteUi span { display: none; }
  #topNavigation { left: 62px; right: 8px; max-width: none; }
  .topNavLink { min-height: 36px; padding: 5px 9px; font-size: 10px; }
  .doom-page-main { width: calc(100% - 18px); padding-top: calc(104px + env(safe-area-inset-top)); }
  .doom-grid.two, .doom-grid.three { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  #topNavigation { top: calc(7px + env(safe-area-inset-top)); gap: 4px; }
  #discordInviteUi { top: calc(7px + env(safe-area-inset-top)); left: 7px; padding: 5px; }
  .topNavLink { min-height: 32px; padding: 4px 6px; font-size: 9px; }
  .doom-page-main { padding-top: calc(116px + env(safe-area-inset-top)); }
  .doom-panel { padding: 13px; }
  .doom-titlebar { margin: -13px -13px 14px; padding: 10px; }
  button, .doom-button, .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
