/* ============================================================================
   포트라인 게임 엔진 — 엔진 콘솔 화면
   ==========================================================================*/
:root {
  --bg: #070c16;
  --bg2: #0b1220;
  --panel: #0c1524;
  --panel2: #0f1b2d;
  --line: rgba(247, 241, 230, 0.12);
  --line-gold: rgba(224, 176, 97, 0.34);
  --cream: #f7f1e6;
  --dim: rgba(247, 241, 230, 0.6);
  --dim2: rgba(247, 241, 230, 0.42);
  --gold: #e0b061;
  --gold-2: #ffe9b0;
  --rust: #bf451f;
  --serif: "Gowun Batang", "Nanum Myeongjo", serif;
  --sans: "Noto Sans KR", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  line-height: 1.6;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-x: hidden;
  padding-bottom: calc(var(--pl-bar) + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(52% 38% at 78% 4%, rgba(224, 176, 97, 0.11), transparent 70%),
    radial-gradient(48% 40% at 10% 12%, rgba(46, 92, 138, 0.14), transparent 72%),
    radial-gradient(70% 50% at 50% 104%, rgba(191, 69, 31, 0.07), transparent 70%);
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, header, footer { position: relative; z-index: 1; }

::selection { background: rgba(224, 176, 97, 0.3); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img, canvas { max-width: 100%; }

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--gold);
  color: #10182a;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  z-index: 99999;
}
.skip:focus { left: 12px; }

/* ------------------------------------------------------------------ 상단 바 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(7, 12, 22, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(247, 241, 230, 0.08);
}
.topbar__in {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand__sym { flex: none; filter: drop-shadow(0 2px 10px rgba(224, 176, 97, 0.18)); }
.brand__txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__txt b {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand__txt i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--dim2);
  letter-spacing: 0.08em;
}
.topbar__right { display: flex; align-items: center; gap: 8px; }

.fps {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(247, 241, 230, 0.04);
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
}
.fps__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5ad39a;
  box-shadow: 0 0 8px rgba(90, 211, 154, 0.8);
}
.fps.is-low .fps__dot { background: #e8a33d; box-shadow: 0 0 8px rgba(232, 163, 61, 0.8); }
.fps b { color: var(--cream); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.fps__unit { font-size: 10px; color: var(--dim2); }

.snd {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-gold);
  background: rgba(224, 176, 97, 0.08);
  color: var(--gold-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.snd:active { transform: scale(0.97); }
.snd__bars { display: flex; align-items: flex-end; gap: 2px; height: 13px; }
.snd__bars i {
  width: 2px;
  background: currentColor;
  border-radius: 1px;
  animation: sndbar 1s ease-in-out infinite;
}
.snd__bars i:nth-child(1) { height: 6px; animation-delay: 0s; }
.snd__bars i:nth-child(2) { height: 11px; animation-delay: 0.14s; }
.snd__bars i:nth-child(3) { height: 8px; animation-delay: 0.3s; }
.snd__bars i:nth-child(4) { height: 5px; animation-delay: 0.42s; }
@keyframes sndbar { 0%, 100% { transform: scaleY(0.55); } 50% { transform: scaleY(1); } }
.snd.is-off { color: var(--dim2); border-color: var(--line); background: transparent; }
.snd.is-off .snd__bars i { animation: none; height: 2px; opacity: 0.5; }

@media (max-width: 520px) {
  .topbar__in { height: 58px; }
  .brand__txt i { display: none; }
  .snd span:last-child { display: none; }
  .snd { padding: 0 12px; }
  .fps__unit { display: none; }
}

/* -------------------------------------------------------------------- 대문 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: center;
  padding: 76px 0 64px;
  position: relative;
}
.eyebrow {
  margin: 0 0 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}
.hero h1 {
  margin: 0;
  font-size: clamp(44px, 6.6vw, 78px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.hero h1 em {
  font-style: normal;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #ffe9b0, #e0b061 60%, #b9832f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lead {
  margin: 26px 0 0;
  max-width: 44ch;
  color: var(--dim);
  font-size: 15.5px;
  line-height: 1.78;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 241, 230, 0.028);
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.chip i {
  font-style: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  color: var(--gold);
  opacity: 0.85;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.12s, background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(0.975); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn--gold {
  background: linear-gradient(180deg, #f0cd8b, #d9a751);
  color: #1a1206;
  border-color: rgba(255, 236, 190, 0.5);
  box-shadow: 0 10px 30px -12px rgba(224, 176, 97, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn--gold:hover { background: linear-gradient(180deg, #ffe0a3, #e3b360); }
.btn--ghost {
  background: rgba(247, 241, 230, 0.035);
  border-color: var(--line);
  color: var(--cream);
}
.btn--ghost:hover { border-color: var(--line-gold); background: rgba(224, 176, 97, 0.07); }
.btn--rust {
  background: linear-gradient(180deg, #cf5730, #a53a19);
  border-color: rgba(255, 155, 120, 0.35);
  color: #fff2e8;
  box-shadow: 0 8px 24px -14px rgba(191, 69, 31, 0.9);
}
.btn--key {
  background: linear-gradient(180deg, #16243a, #101b2c);
  border-color: rgba(247, 241, 230, 0.14);
  color: var(--cream);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 4px 0 -1px rgba(0, 0, 0, 0.45);
}
.btn--key:hover { border-color: var(--line-gold); background: linear-gradient(180deg, #1a2a43, #122035); }
.btn--key small {
  font-size: 10px;
  font-weight: 500;
  color: var(--dim2);
  margin-left: 2px;
}
.btn--wide { width: 100%; }

.hero__art { position: relative; height: 360px; }
.hero__glow {
  position: absolute;
  inset: 8% 4% 12% 4%;
  background: radial-gradient(closest-side, rgba(224, 176, 97, 0.24), transparent 72%);
  filter: blur(28px);
  z-index: 0;
}
.deck {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
}
.deck__card {
  position: absolute;
  width: 152px;
  height: 214px;
  border-radius: 15px;
  background:
    repeating-linear-gradient(135deg, rgba(224, 176, 97, 0.09) 0 1px, transparent 1px 9px),
    linear-gradient(150deg, #16304a, #0b1727 55%, #12283f);
  border: 1px solid rgba(224, 176, 97, 0.55);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.9), inset 0 0 0 7px rgba(7, 12, 22, 0.55);
  display: grid;
  place-items: center;
  transform-origin: 50% 120%;
  animation: deckfloat 7s ease-in-out infinite;
}
.deck__card span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 46px;
  color: rgba(247, 241, 230, 0.94);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}
.deck__card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224, 176, 97, 0.8), transparent);
}
.deck__card--1 { transform: rotate(-16deg) translate(-58px, 10px); animation-delay: -1.4s; }
.deck__card--2 { transform: rotate(-2deg) translate(0, -6px); z-index: 2; }
.deck__card--3 { transform: rotate(13deg) translate(60px, 14px); animation-delay: -3s; }
@keyframes deckfloat {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -14px; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 10px; padding: 52px 0 40px; }
  .hero__art { height: 206px; order: -1; margin-bottom: 0; }
  .deck__card { width: 104px; height: 146px; }
  .deck__card span { font-size: 32px; }
  .deck__card--1 { transform: rotate(-16deg) translate(-38px, 6px); }
  .deck__card--3 { transform: rotate(13deg) translate(40px, 10px); }
  .lead { margin-top: 20px; font-size: 14.5px; }
  .chips { margin-top: 22px; }
  .hero__cta { margin-top: 26px; }
}

/* -------------------------------------------------------------------- 콘솔 */
.console { padding-bottom: 24px; }
.tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 21, 36, 0.72);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 76px;
  z-index: 150;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  scroll-behavior: smooth;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  min-width: 76px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.tab:hover { color: var(--cream); background: rgba(247, 241, 230, 0.04); }
.tab.is-on {
  background: linear-gradient(180deg, rgba(224, 176, 97, 0.2), rgba(224, 176, 97, 0.08));
  color: var(--gold-2);
  box-shadow: inset 0 0 0 1px rgba(224, 176, 97, 0.32);
}
.tab:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
@media (max-width: 900px) {
  .tabs { top: 64px; }
  .tab { flex: 0 0 auto; padding: 0 15px; }
}
@media (max-width: 560px) {
  .tabs { top: 58px; border-radius: 14px; padding: 5px; }
  .tab { min-width: 0; min-height: 42px; padding: 0 14px; font-size: 12.5px; }
}

.panel {
  display: none;
  grid-template-columns: minmax(0, 1.62fr) minmax(280px, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
  animation: panelin 0.32s ease both;
}
.panel.is-on { display: grid; }
@keyframes panelin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.stage-card {
  position: relative;
  background: linear-gradient(180deg, #0d1727, #0a1220);
  border: 1px solid rgba(247, 241, 230, 0.11);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9);
  min-width: 0;
}
.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid rgba(247, 241, 230, 0.07);
}
.stage-head h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stage-head p {
  margin: 5px 0 0;
  color: var(--dim2);
  font-size: 11.5px;
  line-height: 1.55;
  max-width: 46ch;
}
.state-pill {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-gold);
  background: rgba(224, 176, 97, 0.07);
  color: var(--gold-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stage {
  position: relative;
  width: 100%;
  background: #05080e;
  overflow: hidden;
  touch-action: none;
}
.stage--wide { aspect-ratio: 640 / 360; }
.stage--cards { aspect-ratio: 480 / 420; }
.stage--portrait { aspect-ratio: 360 / 560; max-width: 430px; margin: 0 auto; }
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.stage-note {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(5, 8, 14, 0.7);
  border: 1px solid rgba(247, 241, 230, 0.1);
  color: var(--dim2);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 15;
}

.hud-layer { position: absolute; inset: 0; pointer-events: none; }
.hud-layer .pl-hud { top: 10px; left: 10px; right: 10px; gap: 6px; }
.hud-layer--mini .pl-hud { left: 8px; right: 8px; top: 8px; }
.hud-layer--mini .pl-hud__cell { padding: 6px 8px 7px; }
.hud-layer--mini .pl-hud__k { font-size: 8.5px; }
.hud-layer--mini .pl-hud__v { font-size: 15px; }

.squeeze-hint {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(224, 176, 97, 0.14);
  border: 1px solid rgba(224, 176, 97, 0.45);
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  animation: hintpulse 2.2s ease-in-out infinite;
  z-index: 16;
  transition: opacity 0.4s;
}
.squeeze-hint.is-off { opacity: 0; }
@keyframes hintpulse { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -4px); } }

/* ------------------------------------------------------------------ 조작부 */
.controls { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ctl {
  padding: 16px 17px 17px;
  border-radius: 16px;
  border: 1px solid rgba(247, 241, 230, 0.1);
  background: linear-gradient(180deg, rgba(15, 27, 45, 0.72), rgba(10, 18, 32, 0.72));
}
.ctl h3 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: none;
}
.ctl__hint { margin: -4px 0 12px; color: var(--dim2); font-size: 11.5px; line-height: 1.6; }
.btn-row { display: flex; flex-wrap: wrap; gap: 7px; }
.btn-row + .btn-row { margin-top: 7px; }
.btn-row .btn { flex: 1 1 auto; padding: 0 13px; min-height: 44px; font-size: 12.5px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.btn-grid .btn { width: 100%; }

.range { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.range + .range { margin-top: 6px; }
.range span { flex: 0 0 84px; color: var(--dim); font-size: 12px; }
.range b {
  flex: 0 0 58px;
  text-align: right;
  color: var(--gold-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 26px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(224, 176, 97, 0.85), rgba(247, 241, 230, 0.16));
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: rgba(247, 241, 230, 0.2);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: #ffe9b0;
  border: 2px solid #a97a2c;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffe9b0;
  border: 2px solid #a97a2c;
}
input[type="range"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.curve-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.curve {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding: 9px 11px 10px;
  border-radius: 10px;
  border: 1px solid rgba(247, 241, 230, 0.12);
  background: rgba(247, 241, 230, 0.03);
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s, background 0.18s;
}
.curve:hover { border-color: var(--line-gold); background: rgba(224, 176, 97, 0.06); }
.curve__track {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: rgba(247, 241, 230, 0.12);
  overflow: hidden;
}
.curve__track i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 9px;
  border-radius: 3px;
  background: linear-gradient(90deg, #e0b061, #ffe9b0);
}

.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.readout div { min-width: 0; }
.readout dt { color: var(--dim2); font-size: 10.5px; }
.readout dd {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.steps { margin: 0; padding-left: 18px; color: var(--dim); font-size: 12px; line-height: 1.7; }
.steps li + li { margin-top: 7px; }
.steps b { color: var(--cream); font-weight: 700; }

.taglist { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.taglist li {
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid rgba(247, 241, 230, 0.1);
  background: rgba(247, 241, 230, 0.03);
  color: var(--dim);
  font-size: 10.5px;
}

/* -------------------------------------------------------------------- 소리 */
.sound-stage { padding: 16px; }
.pads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pad {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 88px;
  padding: 12px 12px 11px;
  border-radius: 12px;
  border: 1px solid rgba(247, 241, 230, 0.11);
  background: linear-gradient(180deg, #142139, #0d1728);
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.18s, background 0.18s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 20px -16px #000;
  overflow: hidden;
}
.pad:hover { border-color: var(--line-gold); background: linear-gradient(180deg, #182842, #101d31); }
.pad:active, .pad.is-hit { transform: scale(0.965); border-color: rgba(224, 176, 97, 0.9); }
.pad.is-hit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side at 50% 60%, rgba(224, 176, 97, 0.35), transparent 75%);
  animation: padflash 0.45s ease-out forwards;
}
@keyframes padflash { from { opacity: 1; } to { opacity: 0; } }
.pad i {
  font-style: normal;
  font-size: 15px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.1;
}
.pad b { font-size: 12px; font-weight: 700; letter-spacing: -0.01em; }
.pad small { font-size: 9.5px; color: var(--dim2); font-weight: 500; }

.meter { height: 8px; border-radius: 5px; background: rgba(247, 241, 230, 0.1); overflow: hidden; }
.meter i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 5px;
  background: linear-gradient(90deg, #7fd6a8, #e0b061 70%, #cf5730);
  transition: width 0.12s ease;
}
.meter__label { margin: 8px 0 0; font-size: 11px; color: var(--dim2); font-variant-numeric: tabular-nums; }
.meter__label b { color: var(--gold-2); font-size: 12.5px; }

.ladder { display: flex; gap: 5px; }
.ladder span {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 8px;
  border: 1px solid rgba(247, 241, 230, 0.1);
  color: var(--dim2);
  font-size: 11px;
  font-weight: 600;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.ladder span.is-on {
  background: rgba(224, 176, 97, 0.18);
  border-color: rgba(224, 176, 97, 0.7);
  color: var(--gold-2);
  transform: translateY(-3px);
}

/* ---------------------------------------------------------------- 미니 게임 */
.stage-card--mini .stage-head { padding-bottom: 13px; }
.mini-over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(6, 10, 18, 0.82);
  backdrop-filter: blur(4px);
  z-index: 30;
  text-align: center;
  padding: 20px;
}
.mini-over[hidden] { display: none; }
.mini-over b { font-size: 22px; font-weight: 900; letter-spacing: -0.03em; }
.mini-over span { color: var(--gold-2); font-size: 14px; font-weight: 700; }
.mini-over .btn { margin-top: 8px; min-width: 150px; }

/* ------------------------------------------------------------------ 사용법 */
.panel[data-panel="how"] { grid-template-columns: 1fr; }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.code-card {
  border: 1px solid rgba(247, 241, 230, 0.1);
  border-radius: 16px;
  background: linear-gradient(180deg, #0c1524, #091120);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(247, 241, 230, 0.08);
  background: rgba(247, 241, 230, 0.02);
}
.code-head b { font-size: 12.5px; font-weight: 700; }
.code-meta { color: var(--dim2); font-size: 10.5px; font-family: ui-monospace, monospace; }
.copy {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}
.copy:hover { color: var(--gold-2); border-color: var(--line-gold); }
.code-card pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.72;
  color: #d9e2ef;
  background: transparent;
}
.code-card pre code { font-family: inherit; white-space: pre; }
.code-card--table { grid-column: 1 / -1; }
.modtable { width: 100%; border-collapse: collapse; font-size: 12px; }
.modtable th, .modtable td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(247, 241, 230, 0.07);
}
.modtable th { color: var(--dim2); font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; }
.modtable td:first-child { color: var(--gold-2); font-family: ui-monospace, monospace; font-size: 11px; white-space: nowrap; }
.modtable td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--dim); white-space: nowrap; }
.code-note { margin: 0; padding: 12px 16px; color: var(--dim2); font-size: 11px; }
.code-card--note { grid-column: 1 / -1; }
.notes { margin: 0; padding: 16px 16px 16px 34px; color: var(--dim); font-size: 12px; line-height: 1.75; }
.notes li + li { margin-top: 6px; }
.notes code { color: var(--gold-2); font-size: 11px; }

/* -------------------------------------------------------------------- 원칙 */
.principles {
  padding: 84px 0 60px;
  border-top: 1px solid rgba(247, 241, 230, 0.07);
  margin-top: 60px;
}
.principles__head { max-width: 720px; margin-bottom: 34px; }
.principles__head h2 {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.32;
}
.principles__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.principles__grid article {
  padding: 20px 18px 22px;
  border: 1px solid rgba(247, 241, 230, 0.09);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15, 27, 45, 0.5), rgba(10, 18, 32, 0.35));
}
.principles__grid b {
  display: block;
  color: var(--gold);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.principles__grid h3 { margin: 0 0 8px; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.principles__grid p { margin: 0; color: var(--dim2); font-size: 12px; line-height: 1.7; }

/* ---------------------------------------------------------------- 시작 상자 */
.how-anchor { padding-bottom: 70px; }
.how-anchor__box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 34px;
  border-radius: 20px;
  border: 1px solid rgba(224, 176, 97, 0.3);
  background:
    radial-gradient(80% 140% at 90% 0%, rgba(224, 176, 97, 0.14), transparent 60%),
    linear-gradient(180deg, #101e33, #0a1424);
}
.how-anchor__box h2 { margin: 0 0 10px; font-size: clamp(20px, 2.6vw, 27px); font-weight: 900; letter-spacing: -0.03em; }
.how-anchor__box h2 em { font-style: normal; color: var(--gold); font-family: ui-monospace, monospace; font-size: 0.9em; }
.how-anchor__box p { margin: 0; color: var(--dim); font-size: 13px; max-width: 52ch; }
.how-anchor__btns { display: flex; gap: 9px; flex-wrap: wrap; }

/* -------------------------------------------------------------------- 푸터 */
.footer { border-top: 1px solid rgba(247, 241, 230, 0.08); background: rgba(6, 10, 18, 0.7); }
.footer__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 30px;
}
.footer__brand { display: flex; align-items: center; gap: 11px; }
.footer__brand div { display: flex; flex-direction: column; line-height: 1.25; }
.footer__brand b { font-size: 13px; font-weight: 800; }
.footer__brand span { font-size: 10.5px; color: var(--dim2); }
.footer__mail { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--dim2); }
.footer__mail a {
  color: var(--gold-2);
  font-weight: 600;
  border-bottom: 1px solid rgba(224, 176, 97, 0.4);
  padding-bottom: 1px;
}
.footer__copy { margin: 0; color: var(--dim2); font-size: 10.5px; }

/* --------------------------------------------------------------- 반응형 */
@media (max-width: 1000px) {
  .principles__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .panel,
  .panel.is-on { grid-template-columns: 1fr; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ctl--wide, .ctl--readout { grid-column: 1 / -1; }
  .how-grid { grid-template-columns: 1fr; }
  .stage--cards { aspect-ratio: 480 / 450; }
  .principles { padding-top: 60px; margin-top: 40px; }
}
@media (max-width: 640px) {
  .controls { grid-template-columns: 1fr; }
  .pads { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pad { min-height: 82px; padding: 10px 10px 9px; }
  .pad b { font-size: 11px; }
  .pad small { font-size: 9px; }
  .hero { padding: 28px 0 30px; }
  .principles__grid { grid-template-columns: 1fr; }
  .how-anchor__box { padding: 24px 20px; }
  .how-anchor__btns { width: 100%; }
  .how-anchor__btns .btn { flex: 1; }
  .footer__in { justify-content: center; text-align: center; }
  .stage-head { padding: 15px 15px 13px; }
  .stage-head p { font-size: 11px; }
  .state-pill { font-size: 9.5px; padding: 4px 9px; }
  .squeeze-hint { font-size: 10px; padding: 7px 11px; top: 8px; }
}
@media (max-width: 380px) {
  .brand__txt b { font-size: 13.5px; }
  .hero h1 { font-size: 40px; }
  .chip { font-size: 10.5px; padding: 6px 10px; }
}

/* 움직임 최소화 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
