/* --------- pixel board :: base --------- */
:root {
  --bg: #0a0d16;
  --ink: #05070d;
  --line: #22304a;
  --text: #e8f1ff;
  --muted: #8ea2c4;
  --lime: #b8ff3d;
  --pink: #ff4fa3;
  --cyan: #5ad8ff;
  --gold: #ffd93d;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --body: ui-monospace, 'Courier New', 'PingFang SC', 'Microsoft YaHei', monospace;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 15% -10%, #1b2a4a 0%, transparent 55%),
    radial-gradient(circle at 92% 2%, #2c0f42 0%, transparent 48%),
    var(--bg);
}

/* crt grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(90, 216, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 216, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.28;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.5) 3px,
    rgba(0, 0, 0, 0.5) 4px
  );
}

/* --------- shell --------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 4px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.logo {
  width: 46px;
  height: 46px;
  flex: none;
  background:
    conic-gradient(from 0deg, var(--lime) 0 25%, var(--cyan) 0 50%, var(--pink) 0 75%, var(--gold) 0);
  box-shadow:
    0 0 0 4px var(--ink),
    inset 0 0 0 4px var(--ink);
  animation: spin 6s steps(4) infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.title {
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(15px, 3.4vw, 24px);
  line-height: 1.4;
  letter-spacing: 1px;
  color: var(--lime);
  text-shadow: 3px 3px 0 #16320a, 6px 6px 0 rgba(0, 0, 0, 0.45);
}

.subtitle {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.hud {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-stat {
  min-width: 92px;
  padding: 8px 10px;
  background: #0d1424;
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.hud-label {
  display: block;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 5px;
}

.hud-value {
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--cyan);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: blink 1.4s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0.15; } }

/* --------- generic pixel button --------- */
.btn {
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--lime);
  border: 0;
  cursor: pointer;
  box-shadow: 5px 5px 0 #2a3a12;
  transition: transform 60ms steps(2), box-shadow 60ms steps(2);
}

.btn:hover { background: #cbff66; }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #2a3a12; }
.btn[disabled] { cursor: not-allowed; background: #3b4657; color: #8e9cae; box-shadow: 5px 5px 0 #1a2130; }

.btn.ghost {
  background: transparent;
  color: var(--cyan);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.btn.ghost:hover { border-color: var(--cyan); color: var(--text); }

/* --------- board section --------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 30px 0 16px;
}

.section-title {
  margin: 0;
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--pink);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 18px;
  align-items: start;
  min-height: 120px;
}

.panel {
  grid-column: 1 / -1;
  padding: 26px 20px;
  text-align: center;
  border: 4px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
}

.offline-note {
  margin: 0 0 18px;
  padding: 10px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  line-height: 1.8;
  color: #10121a;
  background: var(--gold);
  border: 3px solid #10121a;
  box-shadow: 5px 5px 0 #10121a;
}

.offline-note[hidden] {
  display: none;
}

.panel strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--gold);
}

.foot {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 3px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #6d7f9e;
  letter-spacing: 0.05em;
}

@media (max-width: 560px) {
  .shell { padding: 20px 14px 60px; }
  .hud-stat { min-width: 78px; }
  .board { grid-template-columns: 1fr; }
}
