/* ==========================================================================
   MineMonkeys — Design Tokens
   Palette: deep cave-blue, lapis + diamond accents, gold torch highlight
   Type: Silkscreen (pixel display) / Manrope (body) / JetBrains Mono (data)
   Signature: Minecraft-GUI-style beveled "slot" panels, in blue
   ========================================================================== */

:root {
  /* Color */
  --ink-deep:      #0a1622;
  --ink-deeper:    #060d15;
  --panel:         #122b40;
  --panel-raised:  #1b3a54;
  --panel-line:    #234a68;
  --lapis:         #4d9fe0;
  --lapis-bright:  #7cc4ff;
  --diamond:       #5fe0c4;
  --gold:          #f0b429;
  --text-hi:       #eaf3fa;
  --text-lo:       #8fa9bd;
  --text-faint:    #5c7590;
  --online:        #5fe0a0;
  --offline:       #9c6b5a;

  /* Bevel (inventory-slot) edges */
  --bevel-light:   rgba(255,255,255,0.14);
  --bevel-dark:    rgba(0,0,0,0.55);

  /* Type */
  --font-display: "Silkscreen", monospace;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-deep);
  background-image:
    linear-gradient(180deg, var(--ink-deeper) 0%, var(--ink-deep) 6%, var(--ink-deep) 100%);
  color: var(--text-hi);
  font-family: var(--font-body);
  line-height: 1.55;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--lapis-bright); text-decoration: none; }
a:hover { color: var(--diamond); }

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

/* Focus visibility */
a:focus-visible, button:focus-visible, .slot:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

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

/* ---- Layout shells ---- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--diamond);
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--diamond);
  display: inline-block;
  box-shadow: 0 0 6px var(--diamond);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin: 0;
}
h1 { font-size: clamp(1.8rem, 4vw, 3rem); color: var(--text-hi); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); color: var(--text-hi); }
h3 { font-size: 1.05rem; color: var(--lapis-bright); }

p { margin: 0 0 1em; color: var(--text-lo); }
p:last-child { margin-bottom: 0; }

.mono { font-family: var(--font-mono); }

/* ---- Beveled "inventory slot" panel — the signature element ---- */
.slot {
  background: var(--panel);
  border: 2px solid transparent;
  border-top-color: var(--bevel-dark);
  border-left-color: var(--bevel-dark);
  border-bottom-color: var(--bevel-light);
  border-right-color: var(--bevel-light);
  box-shadow:
    inset 2px 2px 0 rgba(0,0,0,0.35),
    inset -2px -2px 0 rgba(255,255,255,0.06);
  border-radius: 3px;
  padding: var(--space-3);
}

.slot-raised {
  background: var(--panel-raised);
}

/* ---- Header / hotbar nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 13, 21, 0.86);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--panel-line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7em;
}
.brand img {
  width: 40px; height: 40px;
  image-rendering: pixelated;
  border-radius: 4px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-hi);
}

.hotbar {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0; padding: 0;
}
.hotbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 62px;
  height: 52px;
  background: var(--panel);
  border-top: 2px solid var(--bevel-dark);
  border-left: 2px solid var(--bevel-dark);
  border-bottom: 2px solid var(--bevel-light);
  border-right: 2px solid var(--bevel-light);
  border-radius: 3px;
  color: var(--text-lo);
  font-size: 0.62rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.hotbar a .icon { font-size: 1.15rem; line-height: 1; }
.hotbar a:hover {
  background: var(--panel-raised);
  color: var(--diamond);
  transform: translateY(-2px);
}
.hotbar a.active {
  background: var(--panel-raised);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 0.85em 1.4em;
  border-radius: 3px;
  border-top: 2px solid var(--bevel-light);
  border-left: 2px solid var(--bevel-light);
  border-bottom: 2px solid var(--bevel-dark);
  border-right: 2px solid var(--bevel-dark);
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--lapis); color: var(--ink-deeper); }
.btn-primary:hover { filter: brightness(1.1); color: var(--ink-deeper); }
.btn-gold { background: var(--gold); color: var(--ink-deeper); }
.btn-gold:hover { filter: brightness(1.08); color: var(--ink-deeper); }
.btn-ghost { background: var(--panel); color: var(--text-hi); }
.btn-ghost:hover { background: var(--panel-raised); color: var(--diamond); }

/* ---- Sections ---- */
section { padding: var(--space-6) 0; }
.section-head { max-width: 640px; margin-bottom: var(--space-4); }
.section-head h2 { margin-top: 0.4em; }

.strata {
  height: 3px;
  background: repeating-linear-gradient(90deg,
    var(--panel-line) 0 40px, transparent 40px 44px);
  opacity: 0.6;
}

/* ---- Hero ---- */
.hero {
  padding-top: var(--space-6);
  padding-bottom: var(--space-5);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-5);
  align-items: center;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero h1 { margin-bottom: 0.5em; }
.hero-cta { display: flex; gap: 0.8em; margin-top: var(--space-3); flex-wrap: wrap; }

/* ---- Status ore-block indicator ---- */
.status-row {
  display: flex;
  align-items: center;
  gap: 0.7em;
}
.ore {
  width: 22px; height: 22px;
  border-radius: 3px;
  flex-shrink: 0;
  position: relative;
  background: var(--offline);
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.3), inset -2px -2px 0 rgba(255,255,255,0.08);
}
.ore.online {
  background: linear-gradient(135deg, var(--lapis) 0%, var(--diamond) 100%);
  animation: pulse-ore 2.2s ease-in-out infinite;
}
@keyframes pulse-ore {
  0%, 100% { box-shadow: inset 2px 2px 0 rgba(0,0,0,0.3), inset -2px -2px 0 rgba(255,255,255,0.15), 0 0 0px rgba(95,224,196,0.4); }
  50% { box-shadow: inset 2px 2px 0 rgba(0,0,0,0.3), inset -2px -2px 0 rgba(255,255,255,0.15), 0 0 14px rgba(95,224,196,0.55); }
}
.status-label { font-family: var(--font-mono); font-size: 0.85rem; }
.status-label .state-online { color: var(--online); }
.status-label .state-offline { color: var(--offline); }

/* ---- Cards / grids ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card { display: flex; flex-direction: column; gap: 0.6em; }
.card .tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--ink-deeper);
  display: inline-block;
  padding: 0.25em 0.6em;
  border-radius: 2px;
  width: fit-content;
}
.ip-line {
  font-family: var(--font-mono);
  background: var(--ink-deeper);
  color: var(--lapis-bright);
  padding: 0.6em 0.9em;
  border-radius: 3px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
}
.copy-btn {
  background: none; border: none; color: var(--text-faint);
  cursor: pointer; font-family: var(--font-mono); font-size: 0.75rem;
}
.copy-btn:hover { color: var(--diamond); }

/* ---- Player list ---- */
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5em; }
.player-list li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--ink-deeper);
  padding: 0.4em 0.7em;
  border-radius: 3px;
  color: var(--text-lo);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--panel-line);
  padding: var(--space-4) 0;
  margin-top: var(--space-5);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--text-faint);
  font-size: 0.85rem;
}
.site-footer a { color: var(--text-lo); }

/* ---- Rules page ---- */
.rules-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9em; }
.rules-list li {
  display: flex;
  gap: 0.8em;
  padding: 0.9em 1em;
  background: var(--panel);
  border-radius: 3px;
  border-left: 3px solid var(--lapis);
}
.rules-list li .num {
  font-family: var(--font-mono);
  color: var(--text-faint);
  min-width: 1.6em;
}
.rules-list li .exception {
  display: block;
  margin-top: 0.4em;
  font-size: 0.82rem;
  color: var(--gold);
  font-family: var(--font-mono);
}

.world-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.world-tabs button {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.6em 1em;
  background: var(--panel);
  color: var(--text-lo);
  border: none;
  border-radius: 3px;
  cursor: pointer;
}
.world-tabs button.active {
  background: var(--panel-raised);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.world-panel { display: none; }
.world-panel.active { display: block; }

/* ---- Wiki ---- */
.wiki-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 780px) {
  .wiki-layout { grid-template-columns: 1fr; }
}
.wiki-nav {
  position: sticky; top: 90px;
  display: flex; flex-direction: column; gap: 4px;
}
.wiki-nav .group-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 1em 0 0.4em;
}
.wiki-nav .group-label:first-child { margin-top: 0; }
.wiki-nav a {
  padding: 0.5em 0.7em;
  border-radius: 3px;
  color: var(--text-lo);
  font-size: 0.88rem;
}
.wiki-nav a:hover { background: var(--panel); color: var(--diamond); }
.wiki-nav a.active { background: var(--panel-raised); color: var(--gold); }

.wiki-article h2:not(:first-child) { margin-top: 1.6em; }
.wiki-article h3 { margin-top: 1.2em; }
.wiki-article p, .wiki-article ul, .wiki-article ol { color: var(--text-lo); }
.wiki-article code {
  font-family: var(--font-mono);
  background: var(--ink-deeper);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.88em;
  color: var(--lapis-bright);
}
.coming-soon {
  border: 1px dashed var(--panel-line);
  border-radius: 4px;
  padding: var(--space-3);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ---- Vote page ---- */
.vote-card { text-align: center; align-items: center; }
.vote-card .btn { margin-top: 0.4em; }

/* ---- Portal diagram (hero) ---- */
.portal-diagram { width: 100%; height: auto; }
