/* 원본(보라 그라디언트 + 둥근 버블 + Fredoka)과 정반대로 간다.
   콘크리트 검정, 하드 엣지, 모노 라벨, 애시드 라임 한 방울. 언더그라운드 믹스테이프 톤. */

:root {
  --bg: #0b0b0c;
  --bg-2: #121214;
  --line: #26262a;
  --line-2: #3a3a40;
  --ink: #f2f2ef;
  --dim: #8b8b93;
  --acid: #d4ff3f;
  --a: #d4ff3f;
  --b: #ff5a2b;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* 아주 옅은 그리드. 콘크리트 위의 눈금 같은 느낌만 준다. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.screen {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 18px calc(26px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100dvh;
}
.hidden { display: none !important; }

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: flex-end; gap: 14px; }
.brand-ko {
  font-size: 40px;
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.045em;
}
.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acid);
}
.brand-meta .dim { color: var(--dim); letter-spacing: 0.04em; text-transform: none; }
.brand-meta b { color: var(--ink); font-weight: 600; }

.ghost {
  flex: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  padding: 7px 11px;
  cursor: pointer;
}
.ghost:hover { color: var(--ink); border-color: var(--line-2); }

.block { display: flex; flex-direction: column; gap: 12px; }
.block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.block-head h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.idx { font-family: var(--mono); font-size: 11px; color: var(--acid); }
.tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--bg);
  background: var(--acid);
  padding: 2px 7px;
  letter-spacing: 0.08em;
}

.switcher { display: flex; align-items: stretch; gap: 10px; }
.switcher-value {
  flex: 1;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding: 14px 4px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.arrow {
  flex: none;
  width: 44px;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  cursor: pointer;
}
.arrow:hover { border-color: var(--acid); color: var(--acid); }

.preview { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.preview .row { display: grid; grid-template-columns: 1fr 1fr 1fr 1.7fr; gap: 5px; }
.preview .cell { height: 34px; border: 1px solid var(--line); background: var(--bg-2); }
.preview .cell.word {
  display: grid;
  place-items: center;
  border: 0;
  color: var(--bg);
  font-weight: 800;
  font-size: 14px;
  padding: 0 5px;
  overflow: hidden;
  white-space: nowrap;
}
.preview .cell.A { background: var(--a); }
.preview .cell.B { background: var(--b); }
.preview .cell.masked { background: transparent; color: var(--dim); font-family: var(--mono); }
.preview .cell.masked.A { border: 1px dashed var(--a); }
.preview .cell.masked.B { border: 1px dashed var(--b); }

.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.seg.styles { grid-template-columns: repeat(5, 1fr); }
.seg button {
  padding: 10px 2px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
}
.seg button:hover { border-color: var(--line-2); color: var(--ink); }
.seg button.on { background: var(--acid); border-color: var(--acid); color: var(--bg); }
.seg button small {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
  letter-spacing: 0.04em;
}
.seg button.on small { color: rgba(11, 11, 12, 0.65); }

.knobs { display: flex; flex-direction: column; gap: 8px; }
.knob { display: grid; grid-template-columns: 42px 1fr 40px; align-items: center; gap: 12px; }
.knob-label { font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 0.08em; }
.knob output { font-family: var(--mono); font-size: 15px; font-weight: 600; text-align: right; }
.knob input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  background: none;
  cursor: pointer;
}
.knob input[type='range']::-webkit-slider-runnable-track { height: 1px; background: var(--line-2); }
.knob input[type='range']::-moz-range-track { height: 1px; background: var(--line-2); }
.knob input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5.5px;
  background: var(--acid);
  border: 0;
}
.knob input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 0;
  background: var(--acid);
}

.check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--dim); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--acid); }

.start {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border: 0;
  background: var(--acid);
  color: var(--bg);
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.start span { font-size: 13px; }
.start:hover { background: #e4ff6b; }
.start:active { transform: translateY(1px); }

.colophon {
  font-size: 11px;
  line-height: 1.6;
  color: var(--dim);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.hud-mid { text-align: center; line-height: 1.3; }
.hud-mid span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; }
.hud-mid small { display: block; font-size: 10px; color: var(--dim); font-family: var(--mono); }
.hud-count { text-align: right; line-height: 1; }
.hud-count b { font-family: var(--mono); font-size: 24px; font-weight: 700; }
.hud-count small { display: block; font-family: var(--mono); font-size: 9px; color: var(--dim); letter-spacing: 0.14em; }

#stage { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; }
#ball {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--acid);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  will-change: left, top;
}

#grid { display: flex; flex-direction: column; gap: 6px; }
.bar {
  display: grid;
  grid-template-columns: 22px repeat(4, 1fr);
  align-items: center;
  gap: 6px;
  opacity: 0.28;
  transition: opacity 0.15s linear;
}
.bar.current { opacity: 1; }
.bar.upcoming { opacity: 0.6; }
.bar .num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  text-align: right;
  padding-right: 2px;
}
.bar.current .num { color: var(--acid); }

.slot {
  position: relative;
  height: 56px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: clamp(14px, 4.4vw, 21px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bg);
  overflow: hidden;
  padding: 0 3px;
  text-align: center;
  line-height: 1.1;
}
.slot.A { background: var(--a); border-color: var(--a); }
.slot.B { background: var(--b); border-color: var(--b); }
/* 표기와 발음이 다를 때만 발음을 보여준다. 왜 라임인지 보이라고. */
.slot .pron {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 0.6;
}
.slot.masked {
  background: transparent;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 18px;
}
.slot.masked.A { border: 1px dashed var(--a); }
.slot.masked.B { border: 1px dashed var(--b); }
.slot.beat::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--ink);
}
.slot.A.beat::after, .slot.B.beat::after { border-color: var(--bg); }

.countin {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 26vh;
  font-weight: 700;
  color: var(--acid);
  background: rgba(11, 11, 12, 0.86);
  z-index: 9;
  pointer-events: none;
}

.transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.meter { display: flex; gap: 5px; }
.meter i { width: 26px; height: 4px; background: var(--line-2); transition: background 0.06s linear; }
.meter i.on { background: var(--acid); }
.pause {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  background: none;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.pause:hover { border-color: var(--acid); color: var(--acid); }

@media (max-width: 380px) {
  .brand-ko { font-size: 34px; }
  .seg.styles button { font-size: 11px; }
}
