:root {
  --bg: #0D0D0C;
  --panel: #171715;
  --inset: #0F0F0E;
  --screen: #050505;
  --line: #2A2926;
  --line-soft: #23221F;
  --text: #EDEAE3;
  --text-2: #A7A39B;
  --text-3: #8D8A84;
  --muted: #6B6862;
  --off: #4A4843;
  --accent: #FF6A2B;
  --on-accent: #120700;
  --green: #3BE37A;
  --bar-ok: #2FA862;
  --yellow: #FFC833;
  --red: #FF3B30;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Geist', system-ui, -apple-system, sans-serif;
  --dot: 'Doto', var(--mono);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.4; }
a { color: var(--accent); }
a:hover { color: #FF9466; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 36px 20px 64px; display: flex; flex-direction: column; gap: 28px; }
main { display: flex; flex-direction: column; gap: 32px; }
section { display: flex; flex-direction: column; gap: 12px; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-weight: 600; }
.brand-sub { color: var(--muted); }
.live { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; color: var(--text-2); }

.led { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; }
.led.green { background: var(--green); box-shadow: 0 0 0 3px rgba(59,227,122,.18), 0 0 12px var(--green); }
.led.yellow { background: var(--yellow); box-shadow: 0 0 0 3px rgba(255,200,51,.16), 0 0 10px var(--yellow); }
.led.red { background: var(--red); box-shadow: 0 0 0 3px rgba(255,59,48,.18), 0 0 12px var(--red); }
.led.grey { background: var(--text-3); }
.led.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .led.pulse { animation: none; } }

/* hero */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 12px; }
.screen { background: var(--screen); border-radius: 16px; padding: 24px 26px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; box-shadow: inset 0 0 0 1px #1E1D1B, inset 0 8px 24px rgba(0,0,0,.6); min-height: 200px; }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--muted); }
.hero-word { margin: 0; font-family: var(--dot); font-weight: 900; font-size: clamp(44px, 8vw, 64px); line-height: .95; letter-spacing: .02em; color: var(--accent); text-shadow: 0 0 18px rgba(255,106,43,.45); }
.hero-word.red { color: var(--red); text-shadow: 0 0 18px rgba(255,59,48,.45); }
.hero-word.yellow { color: var(--yellow); text-shadow: 0 0 18px rgba(255,200,51,.4); }
.hero-sub { margin: 0; font-size: 15px; color: var(--text-2); line-height: 1.5; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--inset); border: 1px solid var(--line-soft); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; min-width: 0; }
.stat-label { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--muted); }
.stat-value { font-family: var(--dot); font-weight: 900; font-size: clamp(24px, 6.2vw, 44px); line-height: 1; }
.stat-foot { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.c-green { color: var(--green); } .c-yellow { color: var(--yellow); } .c-red { color: var(--red); } .c-grey { color: var(--text-3); } .c-off { color: var(--off); }

/* section heads */
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; font-family: var(--mono); }
.sec-head h2 { margin: 0; font-weight: 600; font-size: 12px; letter-spacing: .16em; }
.sec-head > span { font-size: 12px; color: var(--muted); letter-spacing: .04em; display: flex; flex-wrap: wrap; gap: 14px; }
.host { display: inline-flex; align-items: center; gap: 7px; }
.notice { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--yellow); border: 1px dashed #4A3F1C; border-radius: 12px; padding: 10px 14px; }

/* games */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.game { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.game.disabled { opacity: .6; }
.game-top { display: flex; align-items: center; gap: 14px; }
.icon { flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--screen); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px #1E1D1B; }
.game-title { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.game-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-name { margin: 0; font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.state { flex: none; display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; }
.readout { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--inset); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 14px; }
.readout-l { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.meter { display: flex; gap: 5px; flex-wrap: wrap; }
.meter i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.meter i.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.detail { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { font-family: var(--dot); font-weight: 900; font-size: 34px; line-height: 1; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { font-family: var(--mono); font-weight: 600; font-size: 13px; letter-spacing: .12em; border: 0; border-radius: 999px; padding: 0 20px; min-height: 44px; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,.22); transition: transform .08s ease, filter .15s ease; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(0,0,0,.22); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-light { background: var(--text); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn-sq { border-radius: 12px; }

.keypad { display: flex; flex-direction: column; gap: 10px; background: var(--screen); border-radius: 14px; padding: 14px; box-shadow: inset 0 0 0 1px #1E1D1B; }
.keypad label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--accent); }
.keypad-row { display: flex; gap: 8px; }
.keypad input { font-family: var(--mono); font-size: 16px; flex: 1 1 auto; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: #121211; color: var(--text); letter-spacing: .08em; }
.keypad input::placeholder { color: var(--muted); letter-spacing: .02em; }
.keypad-msg { font-family: var(--mono); font-size: 11px; color: var(--muted); min-height: 1em; }
.keypad-msg.err { color: var(--red); }
.keypad-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.link-btn { background: none; border: 0; padding: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--text-3); cursor: pointer; min-height: 32px; }
.link-btn:hover { color: var(--text); }

.unlocked { display: flex; flex-direction: column; gap: 10px; background: var(--screen); border-radius: 14px; padding: 12px 12px 12px 16px; box-shadow: inset 0 0 0 1px #1E3A26; }
.unlocked-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.unlocked-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.unlocked-msg { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--green); }
.addr { font-family: var(--dot); font-weight: 900; font-size: 22px; overflow-wrap: anywhere; }
.unlocked-tools { display: flex; gap: 14px; flex-wrap: wrap; }

/* services */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 6px 18px; }
.svc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 0; }
.svc + .svc { border-top: 1px solid var(--line-soft); }
.svc-num { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 22px; }
.svc-name { display: flex; align-items: baseline; gap: 10px; flex: 1 1 200px; min-width: 0; }
.svc-name a, .svc-name strong { font-size: 16px; font-weight: 500; color: var(--text); text-decoration: none; }
.svc-name a:hover { color: var(--accent); }
.svc-desc { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.bars { display: flex; gap: 3px; flex: 2 1 260px; min-width: 0; }
.bars i { flex: 1 1 0; height: 18px; border-radius: 3px; background: var(--bar-ok); }
.bars i.bad { background: var(--red); }
.bars i.none { background: var(--line); }
.uptime { font-family: var(--dot); font-weight: 900; font-size: 18px; width: 74px; text-align: right; }
.foot-note { margin: 0; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* news */
.news { display: flex; flex-direction: column; gap: 10px; }
.post { display: flex; flex-wrap: wrap; gap: 10px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; }
.post.pinned { border-color: #5A2A16; }
.post-meta { flex: 0 0 150px; display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); }
.post-date { font-size: 12px; color: var(--text-2); }
.kind { align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: .12em; border-radius: 999px; padding: 4px 10px; }
.kind-news { background: var(--accent); color: var(--on-accent); }
.kind-incident { background: #B3261E; color: #FFFFFF; }
.kind-maintenance { background: var(--text); color: var(--bg); }
.post-body { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.post-head h3 { margin: 0; font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.pstatus { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.prose { font-size: 15px; line-height: 1.6; color: var(--text-2); overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; } .prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 .7em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--inset); border-radius: 6px; padding: 1px 5px; }
.prose img { max-width: 100%; border-radius: 12px; }
.empty { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 8px 0; }

.bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); padding-top: 8px; }

@media (max-width: 520px) {
  .wrap { padding: 24px 16px 48px; gap: 22px; }
  .brand-sub { display: none; }
  .screen { padding: 20px; min-height: 0; }
  .stat { padding: 12px; gap: 10px; }
  .game { padding: 14px; }
  .panel { padding: 4px 14px; }
  .svc-num { display: none; }
  .uptime { width: auto; }
  .post-meta { flex-direction: row; align-items: center; flex-basis: 100%; }
}
