:root {
  --ink: #f4f8ff;
  --muted: #b9cdf2;
  --panel: rgba(6, 18, 52, 0.78);
  --panel-hi: rgba(20, 50, 120, 0.88);
  --edge: #7fdcff;
  --shadow: #020818;
  --gold: #e8b630;
  --green: #3fbf5f;
  --red: #ff5a5a;
  --discord: #5865f2;
  --reddit: #ff4500;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #0b2a6b;
  color: var(--ink);
  font-family: 'VT323', monospace;
  font-size: 22px;
  line-height: 1.3;
  overflow-x: hidden;
}
#water { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; z-index: 0; }
.shade {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(2,8,24,0.55) 100%);
}
main {
  position: relative; z-index: 2;
  max-width: 1100px; margin: 0 auto; padding: 28px 16px 48px;
  display: flex; flex-direction: column; align-items: center; gap: 34px;
}
a { color: var(--edge); }
.pixel { font-family: 'Press Start 2P', monospace; }
.ts { text-shadow: 2px 2px 0 var(--shadow); }

/* IP block */
.ip { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.ip-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.ip-label { font-family: 'Press Start 2P', monospace; font-size: 11px; color: var(--muted); text-shadow: 2px 2px 0 var(--shadow); letter-spacing: 1px; }
.ip-btn {
  font-family: 'Press Start 2P', monospace; color: var(--ink);
  background: var(--panel); border: 3px solid var(--edge); box-shadow: 4px 4px 0 var(--shadow);
  padding: 14px 18px; cursor: pointer; font-size: clamp(14px, 3.4vw, 26px); text-shadow: 2px 2px 0 var(--shadow);
}
.ip-btn.small { font-size: clamp(10px, 2.2vw, 14px); padding: 10px 14px; border-width: 2px; }
.ip-btn:hover { background: var(--panel-hi); }
.ip-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.copied { font-family: 'Press Start 2P', monospace; font-size: 10px; color: #8fffa8; height: 12px; text-shadow: 2px 2px 0 var(--shadow); }

/* Sub-page layout */
.topbar { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.back {
  font-family: 'Press Start 2P', monospace; font-size: 11px; color: var(--ink); text-decoration: none;
  background: var(--panel); border: 2px solid var(--edge); box-shadow: 3px 3px 0 var(--shadow); padding: 10px 12px;
}
.back:hover { background: var(--panel-hi); }
.hero { display: flex; gap: 28px; align-items: center; width: 100%; flex-wrap: wrap; justify-content: center; }
.hero img { width: min(360px, 80vw); height: auto; filter: drop-shadow(0 10px 18px rgba(0,0,0,0.45)); }
.hero-text { flex: 1 1 380px; }
.hero h1 { margin: 0 0 12px; font-family: 'Press Start 2P', monospace; font-size: clamp(26px, 6vw, 48px); text-shadow: 4px 4px 0 var(--shadow); }
.hero p { margin: 0 0 10px; font-size: 26px; text-shadow: 2px 2px 0 var(--shadow); }

nav.jump { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; }
nav.jump a {
  font-family: 'Press Start 2P', monospace; font-size: 10px; color: var(--ink); text-decoration: none;
  background: var(--panel); border: 2px solid var(--edge); padding: 8px 10px;
}
nav.jump a:hover { background: var(--panel-hi); }

section.block { width: 100%; scroll-margin-top: 20px; }
section.block > h2 {
  font-family: 'Press Start 2P', monospace; font-size: clamp(14px, 3vw, 20px); margin: 0 0 14px;
  text-shadow: 3px 3px 0 var(--shadow); color: var(--gold);
}
.panel {
  background: var(--panel); border: 3px solid var(--edge); box-shadow: 4px 4px 0 var(--shadow);
  padding: 18px 20px;
}
.panel + .panel, .grid2 + .panel, .grid3 + .panel, .panel + .grid2, .panel + .grid3 { margin-top: 14px; }
.panel h3 { margin: 0 0 8px; font-family: 'Press Start 2P', monospace; font-size: 12px; color: var(--edge); }
.panel p { margin: 0 0 10px; }
.panel p:last-child { margin-bottom: 0; }
.panel ul { margin: 0; padding-left: 22px; }
code, .cmd {
  font-family: 'VT323', monospace; background: rgba(0,0,0,0.35); border: 1px solid rgba(127,220,255,0.35);
  padding: 0 6px; color: #ffe9a0; white-space: nowrap;
}
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid2 > .panel + .panel, .grid3 > .panel + .panel { margin-top: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px dashed rgba(127,220,255,0.3); vertical-align: top; }
th { font-family: 'Press Start 2P', monospace; font-size: 10px; color: var(--muted); font-weight: normal; }
td.num, th.num { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; }

/* Leaderboards */
.boards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.board { background: var(--panel); border: 3px solid var(--gold); box-shadow: 4px 4px 0 var(--shadow); padding: 14px 16px; }
.board h3 { margin: 0 0 8px; font-family: 'Press Start 2P', monospace; font-size: 11px; color: var(--gold); }
.board ol { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.board li { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; border-bottom: 1px dashed rgba(232,182,48,0.25); counter-increment: r; }
.board li::before { content: counter(r); font-family: 'Press Start 2P', monospace; font-size: 10px; color: var(--muted); width: 22px; }
.board li .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .val { color: #ffe9a0; white-space: nowrap; }
.board .empty { color: var(--muted); }
.updated { color: var(--muted); font-size: 18px; margin-top: 8px; }
.online { display: flex; flex-wrap: wrap; gap: 8px; }
.online span { background: rgba(63,191,95,0.18); border: 1px solid var(--green); padding: 0 8px; }

.tier { font-family: 'Press Start 2P', monospace; font-size: 9px; padding: 3px 6px; border: 1px solid; white-space: nowrap; }
.tier.t0 { color: var(--muted); }
.tier.t1 { color: #9be37a; }
.tier.t2 { color: #7fdcff; }
.tier.t3 { color: var(--gold); }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.off { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* Gallery + map */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gallery a { display: block; border: 3px solid var(--edge); box-shadow: 4px 4px 0 var(--shadow); background: var(--panel); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.mapframe { width: 100%; height: min(560px, 70vh); border: 3px solid var(--edge); box-shadow: 4px 4px 0 var(--shadow); background: #000; display: block; }

.lightbox { position: fixed; inset: 0; z-index: 10; background: rgba(2,8,24,0.92); display: none; align-items: center; justify-content: center; padding: 16px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border: 3px solid var(--edge); }

footer { position: relative; z-index: 2; text-align: center; color: var(--muted); padding: 0 16px 28px; font-size: 18px; }

@media (max-width: 800px) {
  .grid2, .grid3, .boards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) { .gallery { grid-template-columns: 1fr; } }

/* Claim diagram */
.diagram { margin: 14px 0; }
.diagram svg { width: 100%; height: auto; display: block; border: 3px solid var(--edge); box-shadow: 4px 4px 0 var(--shadow); image-rendering: pixelated; }
.diagram figcaption { margin-top: 8px; text-align: center; color: var(--muted); text-shadow: 2px 2px 0 var(--shadow); }
table.ranks td.yes { color: #8fffa8; text-align: center; }
table.ranks td.no { color: var(--red); text-align: center; }
table.ranks th:nth-child(n+3) { text-align: center; }

/* Y-level rent diagram */
.ylevels { border: 3px solid var(--shadow); }
.yl { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; text-shadow: 2px 2px 0 var(--shadow); }
.yl .y { font-family: 'Press Start 2P', monospace; font-size: 11px; color: #fff; white-space: nowrap; }
.yl .cost { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.yl .cost i { width: 24px; height: 24px; background: url(/assets/sbt.png) center / contain no-repeat; image-rendering: pixelated; filter: drop-shadow(1px 1px 0 var(--shadow)); }
.yl .cost b { font-family: 'Press Start 2P', monospace; font-size: 12px; color: #ffe9a0; margin-left: 6px; min-width: 18px; text-align: right; }
.yl.sky { background: #7ea8ff; padding: 30px 16px; }
.yl.sea { background: linear-gradient(#5daa3a 0 12%, #8a5a33 12%); }
.yl.stone { background: #7d7d7d; }
.yl.deep { background: #3d3d48; }

/* Land-slice rent diagram */
svg.slice { width: 100%; height: auto; display: block; border: 3px solid var(--shadow); }
.slice-note { margin-top: 10px; }
.slice-note p { margin: 0 0 6px; }
.layer-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.layer-stats li { background: rgba(0,0,0,0.25); border: 1px solid rgba(127,220,255,0.3); padding: 6px 8px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.layer-stats li span:first-child { font-family: 'Press Start 2P', monospace; font-size: 9px; color: var(--muted); width: 100%; }
.layer-stats li span:nth-child(2) { color: #ffe9a0; font-size: 26px; }
.layer-stats li span:nth-child(3) { color: var(--muted); }
@media (max-width: 600px) { .layer-stats { grid-template-columns: repeat(2, 1fr); } }

.layer-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; }
.layer-stats li { background: none; border: none; padding: 0; display: block; }
.layer-stats li b { color: #ffe9a0; font-weight: normal; }
ol.steps { margin: 0; padding-left: 26px; }
ol.steps li { margin: 4px 0; }
img.drowned-art { width: 100%; height: auto; display: block; margin: 14px 0; border: 3px solid var(--edge); box-shadow: 4px 4px 0 var(--shadow); image-rendering: pixelated; }

/* Stratis plot diagram */
.plotmap { display: grid; grid-template-columns: 70px repeat(3, 1fr); grid-template-rows: auto repeat(3, minmax(110px, auto)); gap: 0; border: 3px solid var(--shadow); box-shadow: 4px 4px 0 var(--shadow); }
.pm-corner { background: var(--panel); }
.pm-head { background: var(--panel); text-align: center; padding: 8px 4px; font-family: 'Press Start 2P', monospace; font-size: 10px; color: var(--muted); border-left: 2px dashed rgba(255,255,255,0.35); }
.pm-side { background: var(--panel); display: flex; align-items: center; justify-content: center; font-family: 'Press Start 2P', monospace; font-size: 9px; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); border-top: 2px dashed rgba(255,255,255,0.35); }
.pm-cell { position: relative; border-left: 2px dashed rgba(255,255,255,0.45); border-top: 2px dashed rgba(255,255,255,0.45); display: flex; align-items: center; justify-content: center; padding: 26px 6px 10px; }
.pm-cell.sky { background: #7ea8ff; }
.pm-cell.ground { background: linear-gradient(#7ea8ff 0 86%, #5daa3a 86% 92%, #8a5a33 92%); }
.pm-cell.under { background: repeating-linear-gradient(90deg, #7d7d7d 0 14px, #737373 14px 28px); }
.pm-cell::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.pm-cell.t1::after { background: rgba(155,227,122,0.28); box-shadow: inset 0 0 0 3px #9be37a; }
.pm-cell.t2::after { background: rgba(127,220,255,0.22); box-shadow: inset 0 0 0 3px #7fdcff; }
.pm-cell.t3::after { background: rgba(232,182,48,0.2); box-shadow: inset 0 0 0 3px #e8b630; }
.tb { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; font-family: 'Press Start 2P', monospace; font-size: 10px; color: #020818; text-shadow: none; }
.pm-cell .tb { position: absolute; top: 6px; left: 6px; z-index: 1; }
.t1 .tb, .tb.t1 { background: #9be37a; }
.t2 .tb { background: #7fdcff; }
.t3 .tb { background: #e8b630; }
.pm-feat { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(2,8,24,0.78); padding: 6px 8px; font-family: 'Press Start 2P', monospace; font-size: 9px; color: #fff; }
.pm-feat .ic { display: flex; gap: 4px; }
.pm-feat img, .pm-feat svg { width: 30px; height: 30px; image-rendering: pixelated; }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.tier-card { background: var(--panel); border: 3px solid; box-shadow: 4px 4px 0 var(--shadow); padding: 14px 16px; }
.tier-card.t1 { border-color: #9be37a; } .tier-card.t2 { border-color: #7fdcff; } .tier-card.t3 { border-color: #e8b630; }
.tier-card h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-family: 'Press Start 2P', monospace; font-size: 12px; }
.tier-card p { margin: 0 0 6px; }
.tier-card .cost { color: var(--muted); }
.tier-card .cost b { color: #ffe9a0; font-weight: normal; }
.tier-card .small { font-size: 18px; color: var(--muted); }
.tiers + .panel { margin-top: 14px; }

/* Auto-farm flow */
.flow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.fstep { flex: 1 1 110px; display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--panel); border: 3px solid var(--edge); box-shadow: 4px 4px 0 var(--shadow); padding: 14px 8px; }
.fstep img { width: 48px; height: 48px; image-rendering: pixelated; }
.fstep span { font-family: 'Press Start 2P', monospace; font-size: 9px; text-align: center; }
.farrow { display: flex; flex-direction: column; align-items: center; color: #ffe9a0; font-size: 28px; text-shadow: 2px 2px 0 var(--shadow); }
.farrow b { font-family: 'Press Start 2P', monospace; font-size: 8px; font-weight: normal; color: var(--muted); }
@media (max-width: 800px) {
  .tiers { grid-template-columns: 1fr; }
  .plotmap { grid-template-columns: 34px repeat(3, 1fr); grid-template-rows: auto repeat(3, minmax(90px, auto)); }
  .pm-feat { font-size: 7px; padding: 4px; }
  .pm-feat img, .pm-feat svg { width: 22px; height: 22px; }
  .flow { flex-direction: column; }
  .fstep { width: 100%; flex-direction: row; justify-content: flex-start; padding: 10px 14px; }
  .farrow { flex-direction: row; gap: 8px; transform: none; }
  .farrow::after { content: ""; }
}

/* Claimed / total table on a gold block */
table.claimed { width: auto; min-width: min(100%, 420px); margin: 12px auto 4px; border-collapse: separate; border-spacing: 0;
  background: url(/assets/gold.png) 0 0 / 64px 64px; image-rendering: pixelated;
  border: 4px solid #8a5a10; box-shadow: 4px 4px 0 var(--shadow); }
table.claimed th, table.claimed td { text-align: center; padding: 10px 22px; border-bottom: 2px solid rgba(110,70,0,0.45);
  color: #3a2400; text-shadow: 1px 1px 0 rgba(255,245,190,0.7); }
table.claimed th { font-family: 'Press Start 2P', monospace; font-size: 11px; color: #3a2400; background: rgba(255,240,160,0.35); }
table.claimed td { font-size: 24px; }
table.claimed td b { color: #1e1200; font-size: 28px; }
table.claimed tr:last-child td { border-bottom: none; }
table.claimed td:first-child { text-align: left; }
table.claimed td { vertical-align: middle; }
.topbar:has(> .back:only-child) { justify-content: center; }
