:root {
  --bg: #0b0e14; --panel: #121722; --panel2: #171d2a; --line: #232b3a; --text: #e8edf6; --dim: #8b94a7; --faint: #5d6678;
  --up: #3dff8a; --down: #ff3d5a; --gold: #ffc93d; --fire: #ff6a1a; --emerald: #2ee59d; --grass: #6fbf3a; --sky: #7fb8ff;
  --pixel: "Silkscreen", "Courier New", monospace; --sans: "Space Grotesk", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); font-size: 13px; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-family: var(--pixel); font-weight: 700; font-size: 22px; letter-spacing: 0.02em; text-transform: uppercase; }
.up { color: var(--up); } .down { color: var(--down); }

/* ── top bar ── */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 12px 24px; background: rgba(11, 14, 20, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--pixel); font-weight: 700; font-size: 26px; letter-spacing: 0.04em; }
.logo.sm { font-size: 18px; }
.mark { display: inline-flex; align-items: flex-end; gap: 3px; height: 26px; }
.mark i { display: block; width: 7px; background: var(--up); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25); }
.mark i:nth-child(1) { height: 14px; } .mark i:nth-child(2) { height: 24px; background: var(--down); } .mark i:nth-child(3) { height: 18px; }
.logo.sm .mark { height: 18px; } .logo.sm .mark i { width: 5px; } .logo.sm .mark i:nth-child(1) { height: 9px; } .logo.sm .mark i:nth-child(2) { height: 17px; } .logo.sm .mark i:nth-child(3) { height: 12px; }
.ticker { display: flex; align-items: baseline; gap: 12px; padding-left: 18px; border-left: 1px solid var(--line); white-space: nowrap; }
.ticker .sym { font-weight: 700; font-size: 17px; }
.ticker .cap { font-size: 17px; }
.mode { white-space: nowrap; font-family: var(--pixel); font-size: 12px; text-transform: uppercase; padding: 4px 9px; border: 1px solid var(--gold); color: var(--gold); letter-spacing: 0.06em; }
.links { margin-left: auto; display: flex; gap: 20px; font-size: 14px; color: var(--dim); white-space: nowrap; }
.links a:hover { color: var(--text); }
.wallet { margin-left: 14px; font: 700 13px var(--sans); color: #0b0e14; background: var(--up); border: 0; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.wallet.on { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }

main { max-width: 1600px; margin: 0 auto; padding: 20px 24px 40px; }

/* ── the stage: the town, and the side panel ── */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 380px; border: 1px solid var(--line); background: #070a0f; }
.view { position: relative; aspect-ratio: 16 / 9; background: #070a0f; overflow: hidden; }
.view iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.hud { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; font-size: 13px; background: rgba(11, 14, 20, 0.82); border: 1px solid var(--line); backdrop-filter: blur(6px); white-space: nowrap; }
.chip.live b { width: 8px; height: 8px; background: var(--faint); }
.chip.live.on b { background: var(--up); box-shadow: 0 0 10px var(--up); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.chip.sky i { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.chip.sky.night i { background: transparent; box-shadow: inset -4px -3px 0 0 #dfe6ff; }
.chip.sky.storm i { border-radius: 0; background: none; box-shadow: none; width: 10px; height: 14px; clip-path: polygon(60% 0, 0 58%, 45% 58%, 30% 100%, 100% 40%, 55% 40%); background: #cfe0ff; }
.hudcap { gap: 9px; }
.hudcap span { font-weight: 700; }
.hudcap b { font-weight: 600; }
.hudcap em { font-style: normal; font-size: 12px; }
.cams { position: absolute; right: 14px; top: 14px; display: flex; gap: 4px; }
.cams button { font: 600 12px var(--sans); color: var(--dim); background: rgba(11, 14, 20, 0.82); border: 1px solid var(--line); padding: 5px 10px; cursor: pointer; }
.cams button:hover { color: var(--text); }
.cams button.on { color: #0b0e14; background: var(--up); border-color: var(--up); }
.cams button[data-cam="mine"] { border-color: var(--gold); color: var(--gold); }
.cams button[data-cam="mine"].on { background: var(--gold); color: #0b0e14; }
.working { position: absolute; right: 14px; top: 50px; display: flex; align-items: center; gap: 8px; padding: 6px 11px; font-size: 13px; background: rgba(11, 14, 20, 0.84); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--gold)); pointer-events: none; max-width: 60%; }
.working[hidden] { display: none; }
.working b { width: 8px; height: 8px; background: var(--c, var(--gold)); animation: blink 0.9s infinite; flex: none; }
.lower { position: absolute; left: 18px; right: 18px; bottom: 16px; display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; max-width: 640px;
  background: linear-gradient(90deg, rgba(8, 10, 16, 0.94), rgba(8, 10, 16, 0.86)); border-left: 5px solid var(--c, var(--gold)); padding: 12px 18px 12px 14px;
  transform: translateY(16px); opacity: 0; transition: opacity 0.35s ease, transform 0.35s ease; pointer-events: none; }
.lower.on { transform: none; opacity: 1; }
.lower .who { font-family: var(--pixel); font-weight: 700; font-size: 15px; color: var(--c); letter-spacing: 0.04em; }
.lower .who em { font-family: var(--sans); font-style: normal; font-weight: 500; font-size: 12px; color: var(--dim); margin-left: 8px; letter-spacing: 0; }
.lower p { margin: 2px 0 0; font-size: 16px; line-height: 1.35; color: #fff; }
.lower .av { width: 42px; height: 42px; font-size: 20px; }
.av { display: inline-grid; place-items: center; width: 54px; height: 54px; background: var(--c); color: #0b0e14; font-family: var(--pixel); font-weight: 700; font-size: 26px; font-style: normal; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.25); }
.av.sm { width: 34px; height: 34px; font-size: 16px; }

.side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); }
.find { padding: 16px 16px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 9px; }
.find h2 { font-size: 18px; }
.find p { margin: 0; font-size: 13px; }
.find p b { color: var(--text); font-weight: 600; }
.find form { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.find input { min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); padding: 8px 10px; font-family: var(--mono); font-size: 12px; }
.find input:focus { outline: none; border-color: var(--gold); }
.find form button { font-weight: 700; font-size: 13px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); padding: 0 14px; cursor: pointer; }
.find form button:hover { border-color: var(--gold); }
.phantom { font-weight: 700; font-size: 13px; color: #0b0e14; background: #ab9ff2; border: 0; padding: 8px 12px; cursor: pointer; }
.phantom.on { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.res:empty { display: none; }
.res { font-size: 13px; color: var(--dim); }
.res .err { color: var(--down); }
.card { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--gold)); padding: 10px 12px; }
.card .ico { width: 54px; height: 54px; }
.card b { display: block; font-family: var(--pixel); font-size: 15px; color: var(--text); }
.card span { display: block; font-size: 12px; color: var(--dim); }
.card .hn { display: block; font-style: normal; font-family: var(--pixel); font-size: 14px; color: var(--c); margin-bottom: 1px; }
.card .grow, .card .acts, .card .namef, .card .msg { grid-column: 1 / -1; }
.grow { display: grid; gap: 4px; }
.grow .segs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.grow .segs i { height: 6px; background: linear-gradient(90deg, var(--c) var(--f), var(--line) var(--f)); }
.grow span { font-size: 11px; color: var(--dim); }
.acts { display: flex; gap: 6px; }
.acts button { flex: 1; font-weight: 700; font-size: 12px; background: var(--gold); color: #0b0e14; border: 0; padding: 7px 10px; cursor: pointer; }
.acts button.alt { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.acts button.alt:hover { border-color: var(--gold); }
.acts button:disabled { opacity: 0.4; cursor: default; }
.namef { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.namef[hidden] { display: none; }
.namef input { min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); padding: 7px 9px; font-size: 13px; }
.namef input:focus { outline: none; border-color: var(--gold); }
.namef button { font-weight: 700; font-size: 12px; background: #ab9ff2; color: #0b0e14; border: 0; padding: 0 12px; cursor: pointer; }
.namef .dim { grid-column: 1 / -1; font-size: 11px; }
.card .msg { font-size: 12px; color: var(--dim); }
.card .msg:empty { display: none; }
.card .msg .err { color: var(--down); }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(4, 6, 10, 0.78); backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.sheet { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line); padding: 18px 20px 20px; display: grid; gap: 12px; }
.sheet .ph { margin: 0; }
.sheet h2 { font-size: 18px; }
.sheet img { width: 100%; height: auto; display: block; border: 1px solid var(--line); }
.sheet .dim { margin: 0; }
.sheet .x { font-size: 26px; line-height: 1; background: none; border: 0; color: var(--dim); cursor: pointer; padding: 0 4px; }
.sheet .x:hover { color: var(--text); }
.need { background: var(--panel2); border: 1px solid var(--line); padding: 10px 12px; }
.need b { color: var(--text); }
.sh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 16px 6px; }
.sh h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }
.news { list-style: none; margin: 0; padding: 0 14px 10px; flex: 1; min-height: 0; overflow: auto; }
.news li { display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.news li:first-child { border-top: 0; }
.news li:hover .txt { color: var(--text); }
.news li.empty { display: block; color: var(--faint); cursor: default; }
.news li.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: rgba(255, 201, 61, 0.12); } to { background: transparent; } }
.news .tag { font-family: var(--pixel); font-size: 10px; text-transform: uppercase; text-align: center; padding: 3px 0; }
.news .in .tag { background: rgba(61, 255, 138, 0.12); color: var(--up); }
.news .out .tag { background: rgba(255, 61, 90, 0.12); color: var(--down); }
.news .up .tag { background: rgba(255, 201, 61, 0.14); color: var(--gold); }
.news .down .tag { background: rgba(139, 148, 167, 0.12); color: var(--dim); }
.news .burn .tag { background: rgba(255, 106, 26, 0.16); color: var(--fire); }
.news .say .tag { background: rgba(255, 210, 63, 0.08); color: #ffd23f; }
.news .grow .tag { background: rgba(61, 255, 138, 0.08); color: #9be8b8; }
.news .shrink .tag { background: rgba(139, 148, 167, 0.1); color: var(--faint); }
.news .named .tag { background: rgba(171, 159, 242, 0.16); color: #c4baff; }
.news .txt { color: var(--dim); line-height: 1.4; }
.news .txt b { color: var(--text); font-weight: 600; }
.news .txt i { font-style: normal; display: inline-block; width: 9px; height: 9px; margin-right: 5px; background: var(--c); vertical-align: 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3); }
.news .t { display: block; font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: 2px; }

/* ── stats ── */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-top: 0; background: var(--panel); }
.stat { padding: 14px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat:last-child { border-right: 0; }
.stat span { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.stat b { font-size: 24px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat em { font-style: normal; font-size: 13px; color: var(--faint); }
.stat.chest b { color: var(--emerald); } .stat.burned b { color: var(--gold); }

.intro { padding: 40px 0 10px; max-width: 900px; }
.intro h1 { font-family: var(--pixel); font-size: 46px; line-height: 1.08; text-transform: uppercase; }
.intro h1 span { color: var(--gold); }
.intro p { color: var(--dim); font-size: 18px; margin: 14px 0 0; }
.intro p b { color: var(--text); }

.ph { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* ── the houses ── */
.tiers { margin-top: 34px; }
.tier-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.tier { background: var(--panel); border: 1px solid var(--line); padding: 16px; display: grid; gap: 6px; justify-items: start; }
.tier .ico { width: 72px; height: 72px; margin-bottom: 4px; }
.tier h3 { font-family: var(--pixel); font-size: 18px; text-transform: uppercase; }
.tier .pct { font-family: var(--mono); font-size: 13px; color: var(--gold); }
.tier p { margin: 0; font-size: 13px; color: var(--dim); }
.tier .n { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.tier .n b { color: var(--text); font-weight: 600; }
.ico { image-rendering: pixelated; shape-rendering: crispEdges; display: block; }

/* ── panels ── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-top: 34px; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 18px 20px; }
.top10 { list-style: none; margin: 0; padding: 0; }
.top10 li { display: grid; grid-template-columns: 26px 34px 1fr auto; gap: 12px; align-items: center; padding: 8px 6px; border-top: 1px solid var(--line); cursor: pointer; }
.top10 li:first-child { border-top: 0; }
.top10 li:hover { background: var(--panel2); }
.top10 li.empty { display: block; color: var(--faint); cursor: default; }
.top10 li.me { background: rgba(255, 201, 61, 0.08); }
.top10 .rk { font-family: var(--pixel); font-size: 15px; color: var(--faint); text-align: center; }
.top10 li:nth-child(1) .rk { color: var(--gold); } .top10 li:nth-child(2) .rk { color: #d7dbe6; } .top10 li:nth-child(3) .rk { color: #d98a4e; }
.top10 .ico { width: 34px; height: 34px; }
.top10 .w { font-family: var(--mono); font-size: 14px; }
.top10 .w i { font-style: normal; display: inline-block; width: 10px; height: 10px; margin-right: 7px; background: var(--c); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3); }
.top10 .w span { display: block; font-family: var(--sans); font-size: 12px; color: var(--faint); }
.top10 .p { text-align: right; font-family: var(--mono); font-weight: 600; }
.top10 .p em { display: block; font-style: normal; font-weight: 400; font-size: 11px; color: var(--faint); }
#chart { height: 300px; }
.lede { color: var(--dim); font-size: 13px; margin: 12px 0 0; }

/* ── the crew ── */
.crew-sec { margin-top: 34px; }
.crew { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mate { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c); padding: 14px 16px; display: grid; gap: 8px; }
.mate .hd { display: flex; align-items: center; gap: 10px; }
.mate .nm { font-family: var(--pixel); font-weight: 700; font-size: 18px; color: var(--c); letter-spacing: 0.04em; }
.mate .ti { display: block; font-size: 12px; color: var(--dim); }
.mate .st { font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 7px; }
.mate .st b { width: 7px; height: 7px; background: var(--faint); flex: none; }
.mate.on .st b { background: var(--up); box-shadow: 0 0 8px var(--up); }
.mate.busy .st b { background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: blink 0.9s infinite; }
.mate .say { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text); min-height: 40px; border-left: 2px solid var(--line); padding-left: 10px; }

/* ── explainers ── */
.how, .faq { margin-top: 44px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.step { background: var(--panel); border: 1px solid var(--line); padding: 18px; }
.step .n { display: inline-grid; place-items: center; width: 30px; height: 30px; font-style: normal; font-family: var(--pixel); background: var(--grass); color: #0b1a05; margin-bottom: 12px; box-shadow: inset 0 -4px 0 #4f8a2a; }
.step h3 { font-size: 17px; }
.step p { color: var(--dim); font-size: 14px; margin: 8px 0 0; }
.faq details { border-top: 1px solid var(--line); padding: 14px 0; max-width: 900px; }
.faq details:first-of-type { margin-top: 14px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--dim); margin: 8px 0 0; }

.foot { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 22px 24px; border-top: 1px solid var(--line); }
.foot #footPool { margin-left: auto; }

/* the side panel takes the view's height, never its own: the news scrolls inside */
@media (min-width: 1101px) { .side { height: 0; min-height: 100%; } }
@media (max-width: 1250px) { .links { display: none; } .tier-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) {
  .stage { grid-template-columns: 1fr; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .news { max-height: 420px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(3) { border-right: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
  .grid { grid-template-columns: 1fr; }
  .crew { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: 10px 14px; padding: 10px 16px; }
  .ticker { padding-left: 12px; }
  .wallet { margin-left: auto; padding: 7px 10px; font-size: 12px; }
  main { padding: 12px 16px 32px; }
  .view { aspect-ratio: 4 / 4.2; }
  .hud .hudcap { display: none; }
  .cams { top: auto; bottom: 10px; left: 10px; right: 10px; flex-wrap: wrap; }
  .working { top: 48px; left: 14px; right: 14px; max-width: none; font-size: 12px; white-space: nowrap; }
  .working span { overflow: hidden; text-overflow: ellipsis; }
  .lower { left: 10px; right: 10px; bottom: 54px; grid-template-columns: 34px 1fr; padding: 8px 10px; }
  .lower .av { width: 34px; height: 34px; font-size: 16px; }
  .lower p { font-size: 13px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { border-right: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .intro h1 { font-size: 32px; }
  .tier-list { grid-template-columns: 1fr 1fr; }
  .crew, .steps { grid-template-columns: 1fr; }
  .foot #footPool { margin-left: 0; }
}
