:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* ---------- shared ---------- */
.app-header {
  padding: 36px 40px 20px;
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
  border-bottom: 1px solid #23233a;
}
.app-header.sm { padding: 28px 40px 18px; }
.app-title { font-size: 40px; font-weight: 700; letter-spacing: 0.5px; }
.app-header.sm .app-title { font-size: 32px; }
.app-sub { margin-top: 6px; font-size: 18px; color: var(--text-secondary); }

.body { font-size: 21px; line-height: 1.5; color: var(--text-secondary); margin-bottom: 22px; }
.body.muted { color: var(--text-muted); font-size: 18px; }
.pad { padding: 30px 40px; flex: 1; display: flex; flex-direction: column; }
.info-list { list-style: none; margin: 0 0 22px; }
.info-list li {
  font-size: 19px; color: var(--text-secondary); line-height: 1.4;
  padding: 10px 0 10px 18px; border-left: 3px solid var(--accent);
  margin-bottom: 8px; background: var(--bg-secondary); border-radius: 0 8px 8px 0;
  padding-right: 14px;
}
.info-list b { color: var(--text-primary); }

/* ---------- home menu ---------- */
.menu { flex: 1; padding: 26px 40px; display: flex; flex-direction: column; gap: 18px; }
.menu-item {
  display: flex; align-items: center; gap: 22px;
  background: var(--bg-secondary); border-radius: var(--radius-md);
  padding: 22px 26px; min-height: 96px; text-align: left;
}
.menu-ic {
  font-size: 40px; color: var(--accent); width: 52px; text-align: center;
  flex-shrink: 0; line-height: 1;
}
.menu-tx { display: flex; flex-direction: column; gap: 4px; }
.menu-h { font-size: 25px; font-weight: 600; color: var(--text-primary); }
.menu-d { font-size: 17px; color: var(--text-secondary); }

.hint-bar {
  display: flex; justify-content: center; gap: 28px;
  padding: 18px; border-top: 1px solid #23233a; background: var(--bg-primary);
}
.hint { font-size: 16px; color: var(--text-muted); }
.hint b { color: var(--accent); font-weight: 600; margin-right: 4px; }

/* ---------- level screen ---------- */
.lvl-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; background: var(--bg-secondary);
  border-bottom: 1px solid #23233a;
}
.lvl-mode { font-size: 26px; font-weight: 700; letter-spacing: 0.5px; }
.status-chip {
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--bg-tertiary); color: var(--text-muted);
  border: 1px solid #2a2a40;
}
.status-chip.live {
  background: rgba(0, 255, 136, 0.12); color: var(--accent-secondary);
  border-color: rgba(0, 255, 136, 0.5);
}
.lvl-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary);
}
#vial { display: block; }

.readout-bar {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 10px 24px 14px; background: var(--bg-primary);
}
.readout {
  font-size: 30px; font-weight: 700; letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums; color: var(--text-primary);
}
.level-badge {
  font-size: 18px; font-weight: 800; letter-spacing: 2px;
  padding: 6px 16px; border-radius: 8px;
  background: var(--accent-secondary); color: #002417;
}

.lvl-footer {
  display: flex; gap: 12px; padding: 16px 24px;
  background: var(--bg-secondary); border-top: 1px solid #23233a;
}
.foot-btn {
  flex: 1; min-height: 64px; border-radius: var(--radius-md);
  background: var(--bg-tertiary); color: var(--text-primary);
  font-size: 19px; font-weight: 600; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  padding: 0 8px;
}

/* ---------- buttons ---------- */
.btn-col { display: flex; flex-direction: column; gap: 16px; margin-top: auto; }
.big-btn {
  min-height: 88px; border-radius: var(--radius-md);
  background: var(--accent); color: #001a20;
  font-size: 24px; font-weight: 700; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.big-btn.ghost { background: var(--bg-tertiary); color: var(--text-primary); }

.calib-now {
  font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--accent); background: var(--bg-secondary);
  border-radius: var(--radius-md); padding: 18px 22px; margin-bottom: 22px;
  text-align: center;
}
