/* Layout and type. Every color comes from palette.css. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: Inter, "Segoe UI", "Liberation Sans", "DejaVu Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--grunge-opacity);
  background-image: var(--grunge);
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

img {
  max-width: 100%;
  height: auto;
}

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

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

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

:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 50;
  transform: translateY(-140%);
  background: var(--yellow);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  transform: none;
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: 56px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 14px 10px 18px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 12px;
  padding: 2px 6px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 56px;
  height: 56px;
  flex: none;
}

.wordmark {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.15;
  text-transform: uppercase;
}

.wordmark span {
  display: block;
  margin-top: 3px;
  color: var(--yellow);
  letter-spacing: 0.22em;
}

.menu a {
  display: block;
  margin-bottom: 2px;
  padding: 9px 12px;
  border-left: 3px solid var(--clear);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.menu a:hover {
  background: var(--menu-hover);
}

.menu a[aria-current="page"] {
  background: var(--od);
  border-left-color: var(--yellow);
}

.menu-divider {
  height: 1px;
  margin: 12px 8px;
  border: 0;
  background: var(--border);
}

.topbar {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 22px;
  background-color: var(--od);
  background-image: var(--topbar-grunge);
  border-bottom: 3px solid var(--yellow);
}

.page-title {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.burger {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.burger-bars {
  width: 18px;
  height: 2px;
  background: var(--text);
  box-shadow: 0 -6px 0 var(--text), 0 6px 0 var(--text);
}

.topbar .btn {
  margin-left: auto;
  flex: none;
}

main {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  z-index: 2;
  min-width: 0;
  background: var(--clear);
}

.content {
  position: relative;
  z-index: 2;
  padding: 22px;
}

.scene-slot {
  position: fixed;
  z-index: 0;
  top: 56px;
  right: 0;
  bottom: 0;
  left: 248px;
  pointer-events: none;
}

.scene {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.scene-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.home-main,
.home-side,
.stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.lede {
  margin: 0 0 16px;
  color: var(--muted);
}

.muted,
.meta {
  color: var(--muted);
}

.meta {
  margin: 0 0 8px;
  font-size: 13px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.mini-grid,
.server-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini,
.server-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--od-accent);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
}

a.mini {
  display: block;
  text-decoration: none;
}

a.mini:hover {
  border-color: var(--yellow);
}

.mini-head,
.server-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-head b,
.server-head b {
  font-size: 16px;
}

.pill {
  display: inline-block;
  flex: none;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.pill-online {
  background: var(--status-online);
  color: var(--status-online-text);
}

.pill-offline {
  background: var(--status-offline);
  color: var(--status-offline-text);
}

.pill-rebooting {
  background: var(--status-rebooting);
  color: var(--status-rebooting-text);
}

.status-online {
  border-left-color: var(--status-online);
}

.status-offline {
  border-left-color: var(--status-offline);
}

.status-rebooting {
  border-left-color: var(--status-rebooting);
}

.players {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.bar {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 9px;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: var(--bar-track);
  color: var(--od-accent);
  accent-color: var(--od-accent);
}

.bar::-webkit-progress-bar {
  background: var(--bar-track);
}

.bar::-webkit-progress-value {
  background: var(--od-accent);
}

.bar::-moz-progress-bar {
  background: var(--od-accent);
}

.kv {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 6px 12px;
  margin: 12px 0 0;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
}

.mono {
  font-family: "Cascadia Mono", "JetBrains Mono", "Liberation Mono", ui-monospace, monospace;
  font-size: 14px;
}

.mods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.mods li {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--chip-bg);
  font-size: 12px;
}

.banner {
  border: 1px solid var(--yellow);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--banner-bg);
}

.kicker {
  margin: 0 0 4px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.banner h2,
.story h3,
.news-list {
  margin: 0;
}

.news-list {
  padding: 0;
  list-style: none;
}

.news-list li {
  margin: 0 0 12px;
}

.news-list a {
  font-weight: 700;
  text-decoration: none;
}

.news-list a:hover {
  text-decoration: underline;
}

.section-title {
  margin: 8px 0 0;
  font-size: 22px;
}

.story {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.story h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.prose h1 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.2;
}

.rundown h1 {
  font-size: 32px;
  letter-spacing: -0.02em;
}

.prose h2 {
  margin: 22px 0 8px;
  font-size: 20px;
}

.prose h3 {
  margin: 18px 0 8px;
  font-size: 17px;
}

.prose p {
  margin: 0 0 12px;
}

.prose ul {
  margin: 0 0 14px;
  padding-left: 1.2em;
}

.prose li {
  margin: 0 0 6px;
}

.prose a {
  color: var(--yellow);
}

.prose code {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--chip-bg);
  font-family: "Cascadia Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.92em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--clear);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn-grey {
  background: var(--grey);
  color: var(--text);
}

.btn-grey:hover {
  background: var(--grey-hover);
}

.btn-yellow {
  background: var(--yellow);
  color: var(--ink);
}

.btn-yellow:hover {
  background: var(--yellow-hover);
}

.btn-rust {
  background: var(--rust);
  color: var(--on-rust);
}

.btn-rust:hover {
  background: var(--rust-hover);
}

.donate-actions {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 16px;
  margin: 4px 0 22px;
}

.prose a.btn-donate {
  position: relative;
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  margin: 0;
  padding: 16px 22px;
  border-radius: 10px;
  overflow: hidden;
  background-image: var(--donate-shine), var(--donate-patreon-fill);
  background-repeat: no-repeat;
  background-size: 38% 140%, 100% 100%;
  background-position: -50% 0, 0 0;
  box-shadow: var(--donate-shadow);
  color: var(--donate-ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    background-position 700ms ease;
}

.prose a.btn-donate:focus:not(:focus-visible) {
  outline: 2px solid var(--clear);
}

.prose a.btn-paypal {
  background-image: var(--donate-shine), var(--donate-paypal-fill);
}

.prose a.btn-patreon:hover,
.prose a.btn-patreon:focus-visible,
.prose a.btn-paypal:hover,
.prose a.btn-paypal:focus-visible {
  transform: translateY(-6px);
  background-position: 150% 0, 0 0;
  box-shadow: var(--donate-glow);
  outline: 2px solid var(--donate-ring);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .prose a.btn-donate {
    transition: none;
  }

  .prose a.btn-patreon:hover,
  .prose a.btn-patreon:focus-visible,
  .prose a.btn-paypal:hover,
  .prose a.btn-paypal:focus-visible {
    transform: none;
    background-position: -50% 0, 0 0;
  }
}

.mock-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.notice,
.alert,
.ok {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
}

.alert {
  border: 1px solid var(--rust);
  background: var(--alert-bg);
  color: var(--alert-text);
}

.ok {
  border: 1px solid var(--status-online);
  background: var(--ok-bg);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.admin-nav a,
.admin-nav button {
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid var(--clear);
  border-radius: 6px;
  background: var(--clear);
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.admin-nav a:hover,
.admin-nav button:hover {
  background: var(--menu-hover);
}

.admin-nav a[aria-current="page"] {
  background: var(--od);
  border-left-color: var(--yellow);
}

.admin-nav form {
  margin: 0;
}

.post-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.post-row a {
  font-weight: 700;
}

.form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.form label,
.field {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.form input,
.form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text);
}

.form textarea {
  min-height: 280px;
  resize: vertical;
  font-weight: 450;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.help {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 450;
}

.preview {
  margin-bottom: 16px;
}

.login-wrap {
  max-width: 440px;
  margin: 28px auto;
}

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

.scheduled {
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .home-grid,
  .mini-grid,
  .server-grid,
  .post-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56px minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    z-index: 35;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(288px, 88vw);
    min-height: 0;
    transform: translateX(-105%);
    transition: transform 160ms ease;
  }

  .nav-toggle:checked ~ .app .sidebar {
    transform: translateX(0);
  }

  .nav-toggle:checked ~ .app::after {
    content: "";
    position: fixed;
    z-index: 30;
    inset: 0;
    background: var(--overlay);
  }

  .topbar,
  main {
    grid-column: 1;
  }

  .topbar {
    z-index: 40;
  }

  .burger {
    display: inline-flex;
  }

  .scene-slot {
    left: 0;
  }

  .content,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .kv dt {
    margin-top: 8px;
  }

  .donate-actions {
    flex-direction: column;
  }

  .prose a.btn-donate {
    width: 100%;
    min-height: 56px;
  }
}
