@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0a0b09;
  --surface: #14170f;
  --surface-2: #1c2016;
  --border: #2b3024;
  --text: #eceee6;
  --text-muted: #96a08d;
  --red: #a3392c;
  --red-bright: #c94b3a;
  --green: #6fae42;
  --green-bright: #8fd158;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(0,0,0,0.15), transparent 200px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0px, transparent 1px, transparent 3px);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
}

code, .badge, .server-address {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

a {
  color: var(--green-bright);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 2px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}
.logo {
  font-family: 'Oswald', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
}
.logo span { color: var(--red-bright); }
.logo:hover { text-decoration: none; }

.nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  padding-bottom: 3px;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); border-bottom-color: var(--red-bright); }
.nav a.discord-link {
  color: var(--text);
  background: var(--red);
  padding: 6px 14px;
  border: 1px solid var(--red-bright);
}
.nav a.discord-link:hover { background: var(--red-bright); }

/* Hero */
.hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-text {
  flex: 1 1 320px;
  min-width: 280px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  color: var(--text);
  margin-bottom: 0.15em;
}
.hero h1 span { color: var(--red-bright); }
.hero .tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 480px;
  margin-bottom: 16px;
}

/* Status widget */
.mascot-img {
  height: 320px;
  width: auto;
  flex-shrink: 0;
}
.status-widget {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 0.95rem;
}
#status-widget { margin-bottom: 14px; }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.status-widget.online .status-dot,
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-widget.offline .status-dot,
.status-dot.offline { background: var(--red-bright); }
.status-widget .status-text { color: var(--text); }
.status-widget .status-detail { color: var(--text-muted); margin-left: 4px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  border-color: var(--red);
  color: var(--red-bright);
}
.btn-primary:hover { background: var(--surface); border-color: var(--red-bright); }
.btn-secondary {
  background: transparent;
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-2); }
.btn-discord {
  border-color: var(--green);
  color: var(--green-bright);
}
.btn-discord:hover { background: var(--surface); border-color: var(--green-bright); }

/* Scoreboard */
.scoreboard-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}
.scoreboard-updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: -8px 0 20px;
}
.scoreboard-empty { color: var(--text-muted); }

.admin-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-badge {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red-bright);
  border: 1px solid var(--red);
  padding: 2px 8px;
}

.scoreboard-section > .scoreboard-panel {
  margin-top: 28px;
}

.scoreboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 800px) {
  .scoreboard-grid { grid-template-columns: 1fr; }
}

.scoreboard-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.table-scroll { overflow-x: auto; }

.scoreboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.85rem;
}
.scoreboard-table th,
.scoreboard-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}
.scoreboard-table th {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}
.scoreboard-table tbody tr:last-child td { border-bottom: none; }
.scoreboard-table tr.alive td { color: var(--green-bright); }
.scoreboard-table tr.dead td { color: var(--red-bright); }

.scoreboard-table td.status-cell { padding-left: 2px; }
.scoreboard-table th.status-th { padding-left: 40px; }
.row-status {
  display: flex;
  align-items: center;
  gap: 18px;
}
.status-dot-slot {
  width: 20px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.heart-monitor {
  width: 60px;
  height: 24px;
  overflow: hidden;
}
.heart-monitor .ekg {
  width: 120px;
  height: 24px;
  display: block;
  fill: none;
  stroke-width: 2;
}
.heart-monitor.alive .ekg {
  stroke: var(--green-bright);
  animation: ekg-scroll 1s linear infinite;
}
.heart-monitor.dead .ekg {
  stroke: var(--red-bright);
}
@keyframes ekg-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-60px); }
}
@media (prefers-reduced-motion: reduce) {
  .heart-monitor.alive .ekg { animation: none; }
}

/* News */
.news-preview { padding: 48px 0; }
.news-list { list-style: none; padding: 0; margin: 20px 0; }
.news-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.news-list li:first-child { padding-top: 0; }
.news-date {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.news-list strong { font-family: 'Oswald', sans-serif; font-size: 1.1rem; }
.news-list p { margin: 6px 0 0; color: var(--text-muted); }
.see-more { display: inline-block; margin-top: 8px; }

/* Generic page */
.page { padding: 48px 0 64px; }
.page h1 { font-size: 2.2rem; margin-bottom: 0.3em; }

/* Mods */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.mod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  padding: 18px;
  position: relative;
}
.mod-card.required { border-left-color: var(--red-bright); }
.mod-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.mod-card p { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 10px; }
.mod-card .badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.72rem;
  color: var(--red-bright);
  border: 1px solid var(--red);
  padding: 2px 8px;
}
.modpack-link { margin-top: 24px; color: var(--text-muted); }

/* Join steps */
.steps {
  margin: 28px 0;
  padding-left: 22px;
}
.steps li { margin-bottom: 16px; color: var(--text-muted); }
.steps li strong { color: var(--text); }
.server-address {
  display: inline-block;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  color: var(--green-bright);
  letter-spacing: 0.03em;
}

/* Changelog admin form */
.admin-post {
  margin-top: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 4px 18px 18px;
}
.admin-post summary {
  cursor: pointer;
  padding: 14px 0;
  color: var(--text-muted);
  font-family: 'Oswald', sans-serif;
}
.admin-post form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.admin-post label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--text-muted); }
.admin-post input, .admin-post textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  font-family: inherit;
  font-size: 1rem;
}
.form-error { color: var(--red-bright); margin: 10px 0 0; }

/* Not found */
.not-found { text-align: center; padding: 96px 0; }
.not-found h1 { font-size: 4rem; color: var(--red-bright); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .nav { gap: 14px; }
  .hero-inner { justify-content: center; text-align: center; }
  .hero-text { min-width: 0; }
  .mascot-img { height: 160px; }
}

/* Accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
