:root {
  --bg: #0c0e0a;
  --panel: #14170f;
  --line: #2a3220;
  --ink: #d7e8b4;
  --dim: #8a9770;
  --phos: #c6ef4a;
  --warn: #ffb14a;
  --fail: #ff5a3c;
  --sys: 44px;
  --pull: 40px;
  --safe: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bahnschrift", "DIN Alternate", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
}
body {
  min-height: 100dvh;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgb(198 239 74 / .03) 3px 4px);
  mix-blend-mode: overlay;
}

.screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(10px + var(--safe));
}
.screen[hidden] { display: none !important; }

.kicker {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--phos);
}
h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: .04em;
}
.lead {
  margin: 10px 0 22px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--dim);
}
#pick { overflow-y: auto; }
.choice {
  display: grid;
  gap: 6px;
  width: 100%;
  margin: 0 0 8px;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
}
.choice b { font-size: 18px; font-weight: 700; }
.choice span { font-size: 13px; color: var(--dim); line-height: 1.4; }
.choice:active { border-color: var(--phos); }

.bar {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 8px;
}
.bar h2 {
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 650;
}
.back, .ghost {
  font: inherit;
  min-height: 36px;
  padding: 0 8px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}
.back { text-align: left; }

.tip {
  margin: 10px 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--dim);
}

.meters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  background: #0a0c08;
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.meters div { display: grid; gap: 2px; min-width: 0; }
.meters span { font-size: 9px; letter-spacing: .08em; color: var(--dim); }
.meters b {
  font-size: 13px;
  font-weight: 650;
  color: var(--phos);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.surface {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgb(198 239 74 / .08), #10140c 58%);
  border: 1px solid var(--line);
  overflow: hidden;
  touch-action: none;
}
.blob {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgb(198 239 74 / .28);
  transform: scale(.2);
  pointer-events: none;
}
.surface .verdict,
.surface .why {
  position: relative;
  z-index: 1;
  text-align: center;
  pointer-events: none;
}
.verdict {
  margin: 22% 16px 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .06em;
}
.why {
  margin: 0 18px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--dim);
}
.verdict[data-kind="idle"] { color: var(--dim); }
.verdict[data-kind="track"] { color: var(--warn); }
.verdict[data-kind="ok"] { color: var(--phos); }
.verdict[data-kind="miss"] { color: var(--fail); }

.edge-board {
  background: #10140c;
}
.pull-band {
  position: absolute;
  top: 52%;
  bottom: 0;
  width: var(--pull);
  background: rgb(198 239 74 / .28);
  pointer-events: none;
}
.pull-l { left: var(--sys); }
.pull-r { right: var(--sys); }
.sys-band {
  position: absolute;
  top: 52%;
  bottom: 0;
  width: var(--sys);
  background: rgb(255 90 60 / .22);
  pointer-events: none;
}
.sys-l { left: 0; }
.sys-r { right: 0; }

.sheet {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--sys) + var(--pull));
  right: calc(var(--sys) + var(--pull));
  z-index: 4;
}
.sheet-dim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgb(0 0 0 / .38);
  cursor: pointer;
}
.sheet-card {
  position: absolute;
  inset: 10px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 16px 14px;
  border: 1px solid rgb(198 239 74 / .28);
  border-radius: 16px;
  background: rgb(16 22 12 / .52);
  color: var(--ink);
  box-shadow: 0 12px 40px rgb(0 0 0 / .28);
  animation: sheet-in .22s ease;
}
@keyframes sheet-in {
  from { transform: translateX(28%); opacity: .4; }
  to { transform: none; opacity: 1; }
}
.sheet-kicker {
  margin: 0;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--phos);
}
.sheet-card h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
}
.sheet-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--dim);
}
.sheet-acts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.sheet-acts button,
.sheet-fold {
  font: inherit;
  min-height: 44px;
  color: var(--ink);
  background: rgb(198 239 74 / .12);
  border: 1px solid rgb(198 239 74 / .35);
  cursor: pointer;
}
.sheet-fold {
  margin-top: auto;
  width: 100%;
  background: var(--phos);
  color: #0c0e0a;
  border-color: var(--phos);
  font-weight: 700;
}

.log {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  max-height: 64px;
  overflow: auto;
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.log li { border-top: 1px solid var(--line); padding: 4px 0; }
.log .ok { color: var(--phos); }
.log .miss { color: var(--fail); }
