/* ============================================================
   kunimal — 야간 조업 (Nightshift)
   coal black × brass × copper × verdigris, 2:1 iso voxel
   ============================================================ */

:root {
  --coal-0: #0e0c0a;
  --coal-1: #141210;
  --coal-2: #1b1815;
  --coal-3: #242019;
  --line:   #372f24;
  --line-2: #4f4433;
  --steam:  #efeae0;
  --muted:  #b1a693;
  --brass:  #d9a441;
  --brass-2:#f2c866;
  --copper: #c1663b;
  --copper-2:#e08653;
  --verdi:  #57b79f;
  --ok:     #5ecc7e;
  --bad:    #e5604c;
  --amber:  #efaa2b;
  --ink:    #191307; /* text on brass */

  --font-sans: "Segoe UI Variable Display", "Segoe UI", "Malgun Gothic",
               "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, "D2Coding",
               ui-monospace, "SF Mono", monospace;

  --wrap: 1120px;
  --pad: clamp(20px, 4vw, 40px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }

body {
  background: var(--coal-1);
  color: var(--steam);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}

/* faint film-grain over everything (inline SVG turbulence, self-contained) */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: .05;
  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)' opacity='0.7'/%3E%3C/svg%3E");
}

::selection { background: var(--brass); color: var(--ink); }

img { max-width: 100%; display: block; }

a { color: var(--brass-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--steam); }

:focus-visible {
  outline: 2px solid var(--brass-2);
  outline-offset: 2px;
  border-radius: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -48px;
  z-index: 100;
  background: var(--brass); color: var(--ink);
  padding: 8px 14px; font-weight: 700; text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 12px; color: var(--ink); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

/* anchor targets must clear the fixed nav (and the sticky tabbar on /mods) */
.sec, .status-board { scroll-margin-top: 76px; }
.mod-card, .mod-row { scroll-margin-top: 128px; }

/* ------------------------------------------------ nav */

.nav {
  position: fixed; inset: 0 0 auto 0;
  z-index: 50;
  height: 60px;
  display: flex; align-items: center;
  background: rgba(14, 12, 10, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  width: 100%; max-width: var(--wrap); margin-inline: auto;
  padding-inline: var(--pad);
  display: flex; align-items: center; gap: clamp(12px, 3vw, 28px);
}
.nav-logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.06rem; letter-spacing: .01em;
  color: var(--steam); text-decoration: none;
}
.nav-logo svg { display: block; }
.nav-logo .gear-mini { animation: spin 9s linear infinite; transform-origin: center; }
.nav-links {
  display: flex; gap: clamp(10px, 2.4vw, 22px);
  margin-left: auto; align-items: center;
}
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: .95rem; font-weight: 600;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--steam); }
.nav-links a[aria-current="page"] {
  color: var(--brass-2);
  border-bottom-color: var(--brass);
}

.status-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: .8rem;
  color: var(--muted);
  border: 1px solid var(--line-2);
  padding: 5px 10px;
  background: var(--coal-2);
  white-space: nowrap;
}
.status-chip .lamp { width: 8px; height: 8px; flex: none; }

/* lamp: little square indicator, glows by state */
.lamp {
  display: inline-block;
  width: 10px; height: 10px;
  background: #575046;
}
[data-state="online"]  .lamp { background: var(--ok);   box-shadow: 0 0 10px 1px rgba(94, 204, 126, .55); }
[data-state="offline"] .lamp { background: var(--bad);  box-shadow: 0 0 10px 1px rgba(229, 96, 76, .45); }
[data-state="unknown"] .lamp { background: var(--amber); box-shadow: 0 0 8px 1px rgba(239, 170, 43, .4); }
[data-state="online"] .lamp { animation: lamp-breathe 2.6s ease-in-out infinite; }
@keyframes lamp-breathe { 50% { opacity: .55; } }

/* ------------------------------------------------ hero */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding-top: 88px;
  padding-bottom: 24px;
  background:
    radial-gradient(1100px 520px at 74% 12%, #262019 0%, transparent 55%),
    linear-gradient(180deg, #0d0b09 0%, #12100d 52%, var(--coal-1) 100%);
  overflow: clip;
}
.hero-grid {
  width: 100%; max-width: 1280px; margin-inline: auto;
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 30rem) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.hero-copy { position: relative; z-index: 2; }

.shift-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .78rem;
  letter-spacing: .14em;
  color: var(--amber);
  border: 1px solid #5a4620;
  background: rgba(239, 170, 43, .07);
  padding: 6px 12px;
  margin-bottom: 22px;
}
.shift-badge .dot {
  width: 6px; height: 6px; background: var(--amber);
  animation: lamp-breathe 1.8s ease-in-out infinite;
}

.wordmark { width: min(430px, 100%); height: auto; display: block; }

.hero-tag {
  margin-top: 26px;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.hero-sub {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 26rem;
}

.hero-dio {
  position: relative;
  min-width: 0;
}
.hero-dio svg {
  width: 100%; height: auto;
  max-height: 82svh;
  display: block;
}

/* ------------------------------------------------ status board */

.status-board {
  margin-top: 30px;
  display: flex; align-items: center; gap: 20px;
  background: var(--coal-2);
  border: 1px solid #6e5a33;
  padding: 16px 20px;
  position: relative;
  max-width: 30rem;
}
/* corner rivets */
.status-board::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle 2.5px at 8px 8px,            #8a6d2f 99%, transparent) ,
    radial-gradient(circle 2.5px at calc(100% - 8px) 8px, #8a6d2f 99%, transparent),
    radial-gradient(circle 2.5px at 8px calc(100% - 8px), #8a6d2f 99%, transparent),
    radial-gradient(circle 2.5px at calc(100% - 8px) calc(100% - 8px), #8a6d2f 99%, transparent);
}
.gauge { width: 104px; flex: none; }
.gauge .needle {
  transform-origin: 50px 54px;
  transform: rotate(var(--needle, -90deg));
  transition: transform 1.1s cubic-bezier(.3, 1.5, .4, 1);
}
.status-text { min-width: 0; }
.status-label {
  font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .16em; color: var(--muted);
}
.status-state {
  display: flex; align-items: center; gap: 9px;
  font-size: 1.3rem; font-weight: 800;
  margin-top: 2px;
}
[data-state="online"]  .status-state { color: var(--ok); }
[data-state="offline"] .status-state { color: var(--bad); }
[data-state="unknown"] .status-state { color: var(--amber); }
.status-detail {
  color: var(--muted); font-size: .9rem; line-height: 1.55; margin-top: 3px;
}
.status-detail strong { color: var(--steam); font-family: var(--font-mono); font-weight: 700; }
.status-time {
  font-family: var(--font-mono); font-size: .7rem;
  color: #8d8271; margin-top: 6px; letter-spacing: .06em;
  min-height: 1em;
}

/* ------------------------------------------------ address plate */

.addr-row {
  margin-top: 18px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch;
}
.addr-plate {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--coal-3);
  border: 1px solid var(--line-2);
  padding: 10px 8px 10px 16px;
}
.addr-plate code {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  letter-spacing: .03em;
  color: var(--steam);
  text-shadow: 0 1px 0 rgba(0,0,0,.8);
}
.copy-btn {
  font-family: var(--font-mono); font-size: .8rem; font-weight: 700;
  background: var(--brass); color: var(--ink);
  border: none; cursor: pointer;
  padding: 7px 12px;
  transition: background .15s, transform .1s;
}
.copy-btn:hover { background: var(--brass-2); }
.copy-btn:active { transform: translateY(1px); }
.copy-btn.copied { background: var(--ok); }

.hero-links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .95rem;
  text-decoration: none;
  padding: 10px 18px;
  border: 1px solid var(--line-2);
  color: var(--steam);
  background: transparent;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--brass); color: var(--brass-2); transform: translateY(-1px); }
.btn-solid {
  background: var(--brass); border-color: var(--brass); color: var(--ink);
}
.btn-solid:hover { background: var(--brass-2); border-color: var(--brass-2); color: var(--ink); }

/* ------------------------------------------------ sections */

.sec { padding-block: clamp(64px, 9vw, 110px); }
.sec-head { margin-bottom: clamp(28px, 4vw, 44px); }
.sec-label {
  font-family: var(--font-mono); font-size: .78rem;
  letter-spacing: .18em;
  color: var(--amber);
  display: flex; align-items: center; gap: 10px;
}
.sec-label::before {
  content: ""; width: 22px; height: 1px; background: var(--amber);
}
.sec-head h2 {
  margin-top: 10px;
  font-size: clamp(1.65rem, 3.4vw, 2.5rem);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.25;
}
.sec-head .sec-sub { margin-top: 10px; color: var(--muted); max-width: 40rem; }

/* belt divider between sections */
.belt-divider {
  height: 14px;
  border-block: 1px solid var(--line);
  background: var(--coal-2);
  overflow: hidden;
  position: relative;
}
.belt-divider::before {
  content: "";
  position: absolute; inset: 3px -56px;
  background: repeating-linear-gradient(90deg,
    transparent 0 20px, var(--line-2) 20px 24px, transparent 24px 28px);
  animation: belt-run 1.1s linear infinite;
}
@keyframes belt-run { to { transform: translateX(28px); } }

/* ------------------------------------------------ work cards (공정 01) */

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.work-card {
  background: var(--coal-3);
  border: 1px solid var(--line);
  padding: 22px 20px 24px;
  transition: transform .22s, border-color .22s;
}
.work-card:hover { transform: translateY(-4px); border-color: var(--line-2); }
.work-card .pict {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--coal-2);
  border: 1px solid var(--line-2);
  margin-bottom: 16px;
}
.work-card:hover .pict svg .spin-hover { animation: spin 2.4s linear infinite; transform-origin: center; }
.work-card h3 { font-size: 1.12rem; font-weight: 800; }
.work-card h3 .mono-no {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 400;
  color: var(--amber); display: block; letter-spacing: .16em; margin-bottom: 6px;
}
.work-card p { margin-top: 9px; color: var(--muted); font-size: .93rem; }

/* ------------------------------------------------ coins (공정 02) */

.coin-ladder {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: 6px 4px;
  padding: clamp(20px, 4vw, 40px) 10px;
  background: var(--coal-2);
  border: 1px solid var(--line);
}
.coin {
  display: grid; justify-items: center; gap: 8px;
  padding: 10px 12px;
}
.coin img {
  width: clamp(52px, 7vw, 76px); height: auto;
  image-rendering: pixelated;
}
.coin .coin-name {
  font-size: 1.02rem; color: var(--steam); font-weight: 800;
  text-align: center; line-height: 1.3;
}
.coin .coin-name small {
  display: block;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 400;
  color: var(--muted); letter-spacing: .08em;
}
.coin-x8 {
  font-family: var(--font-mono); font-size: .8rem; color: var(--amber);
  display: grid; justify-items: center; line-height: 1.2;
  padding-inline: 2px;
}
.coin-x8 .arr { font-size: 1rem; color: var(--muted); }
.coins-note { margin-top: 16px; color: var(--muted); max-width: 44rem; }

/* ------------------------------------------------ map (공정 03) */

.map-panel {
  position: relative;
  border: 1px solid var(--line-2);
  background: var(--coal-0);
  overflow: clip;
}
.map-panel svg { width: 100%; height: auto; display: block; }
.map-cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--coal-2);
}
.map-cta p { color: var(--muted); font-size: .93rem; flex: 1 1 260px; margin: 0; }

/* ------------------------------------------------ install (공정 04) */

.steps { display: grid; gap: 0; counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step-no {
  font-family: var(--font-mono);
  font-size: 1.9rem; font-weight: 700;
  color: var(--brass);
  line-height: 1;
  padding-top: 2px;
}
.step h3 { font-size: 1.12rem; font-weight: 800; }
.step p { margin-top: 7px; color: var(--muted); font-size: .95rem; max-width: 46rem; }
.step .addr-plate { margin-top: 14px; }
.step .step-cta { margin-top: 14px; }
.step .btn small { font-size: .78em; font-weight: 400; opacity: .8; }
.step b { color: var(--brass-2); font-weight: 700; }

/* ------------------------------------------------ CTA band → /mods/ */

.cta-band {
  border-block: 1px solid var(--line);
  background:
    linear-gradient(180deg, var(--coal-2), var(--coal-1));
  overflow: clip;
}
.cta-band .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
  padding-block: clamp(36px, 6vw, 60px);
}
.cta-band h2 {
  flex: 1 1 320px;
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  font-weight: 800; letter-spacing: -.01em; line-height: 1.4;
}
.cta-band h2 small {
  display: block; font-size: .82rem; font-weight: 400;
  font-family: var(--font-mono); letter-spacing: .14em;
  color: var(--amber); margin-bottom: 8px;
}

/* ------------------------------------------------ footer */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 36px 44px;
  color: var(--muted);
  font-size: .88rem;
}
.footer .wrap {
  display: flex; flex-wrap: wrap; gap: 14px 28px;
  align-items: center; justify-content: space-between;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--brass-2); }
.footer .foot-links { display: flex; gap: 18px; }

/* ------------------------------------------------ mods page */

.page-head { padding-top: 124px; padding-bottom: 30px; }

.tabbar {
  position: sticky; top: 60px; z-index: 30;
  background: rgba(20, 18, 16, .92);
  backdrop-filter: blur(10px);
  border-block: 1px solid var(--line);
}
.tabbar-inner {
  max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad);
  display: flex; gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabbar-inner::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  font-family: var(--font-sans); font-size: .93rem; font-weight: 700;
  color: var(--muted);
  background: none; border: none; cursor: pointer;
  padding: 14px 14px 12px;
  border-bottom: 3px solid transparent;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.tab:hover { color: var(--steam); }
.tab[aria-selected="true"] { color: var(--brass-2); border-bottom-color: var(--brass); }
.tab .count {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 400;
  color: var(--muted);
  border: 1px solid var(--line-2);
  padding: 1px 6px;
}
.tab[aria-selected="true"] .count { color: var(--amber); border-color: #5a4620; }

.tab-panel { padding-block: 36px 80px; }
.tab-panel[hidden] { display: none; }

.dept-note {
  font-family: var(--font-mono); font-size: .8rem; color: var(--muted);
  letter-spacing: .06em;
  margin-bottom: 22px;
}
.dept-note b { color: var(--amber); font-weight: 400; }

/* mod cards */
.mod-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mod-grid .mod-card--flagship, .mod-grid .span-2 { grid-column: 1 / -1; }

.mod-card {
  position: relative;
  background: var(--coal-3);
  border: 1px solid var(--line);
  padding: clamp(20px, 3vw, 30px);
  overflow: clip;
}
.mod-card--flagship { border-color: var(--line-2); }
.mod-card--flagship::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--copper), var(--brass), transparent 70%);
}
.mod-motif {
  position: absolute; right: -30px; bottom: -30px;
  opacity: .07; pointer-events: none;
}

.mod-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mod-icon {
  width: 48px; height: 48px; flex: none;
  border: 1px solid var(--line-2);
  background: var(--coal-2);
}
.mod-icon.pix { image-rendering: pixelated; }
.mod-head h3 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.mod-tagline {
  font-family: var(--font-mono); font-size: .75rem; color: var(--amber);
  letter-spacing: .12em; display: block; margin-top: 2px;
}
.mod-card > p { color: var(--muted); font-size: .95rem; max-width: 62rem; }
.mod-card > p strong { color: var(--steam); }

.mod-final {
  margin-top: 16px;
  background: var(--coal-2);
  border-left: 3px solid var(--brass);
  padding: 14px 18px;
}
.mod-final h4 {
  font-family: var(--font-mono); font-size: .74rem; font-weight: 400;
  letter-spacing: .16em; color: var(--brass-2);
  margin-bottom: 6px;
}
.mod-final p { color: var(--muted); font-size: .94rem; }

/* addon chips */
.addons { margin-top: 20px; }
.addons h4 {
  font-family: var(--font-mono); font-size: .74rem; font-weight: 400;
  letter-spacing: .16em; color: var(--muted); margin-bottom: 10px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .86rem; font-weight: 600;
  color: var(--steam);
  background: var(--coal-2);
  border: 1px solid var(--line-2);
  padding: 6px 11px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.chip img { width: 18px; height: 18px; }
.chip::after {
  content: "+"; font-family: var(--font-mono);
  color: var(--muted); font-size: .9rem; margin-left: 2px;
}
.chip:hover { border-color: var(--brass); }
.chip[aria-expanded="true"] {
  border-color: var(--brass); background: #2a2317; color: var(--brass-2);
}
.chip[aria-expanded="true"]::after { content: "−"; color: var(--brass-2); }

.addon-panel {
  margin-top: 10px;
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--coal-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--copper);
  padding: 14px 16px;
}
.addon-panel[hidden] { display: none; }
.addon-panel img { width: 40px; height: 40px; flex: none; border: 1px solid var(--line-2); }
.addon-panel .ap-name { font-weight: 800; font-size: .95rem; }
.addon-panel p { color: var(--muted); font-size: .9rem; margin-top: 3px; }

/* one-line rows (QoL / visual) */
.mod-rows { display: grid; gap: 8px; }
.mod-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--coal-3);
  border: 1px solid var(--line);
  padding: 12px 16px;
  transition: border-color .15s, transform .15s;
}
.mod-row:hover { border-color: var(--line-2); transform: translateX(3px); }
.mod-row img { width: 32px; height: 32px; flex: none; border: 1px solid var(--line); }
.mod-row img.pix { image-rendering: pixelated; }
.mod-row b { font-size: .95rem; font-weight: 700; flex: none; }
.mod-row span { color: var(--muted); font-size: .9rem; }

/* ================================================ 퀘스트 & 상점 */

/* --- 마크 인벤토리풍 슬롯 --- */
.slot {
  position: relative;
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  background: #211d18;
  border: 2px solid;
  border-color: #0d0b09 #4f4433 #4f4433 #0d0b09;
}
.slot img { width: 36px; height: 36px; image-rendering: pixelated; }
.slot .iph {
  color: var(--brass); font-weight: 800; font-size: 1.05rem;
  font-family: var(--font-mono);
}
.slot .stack {
  position: absolute; right: 2px; bottom: 0;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700;
  color: #fff; text-shadow: 1px 1px 0 #000; line-height: 1.2;
}
.slot--sm { width: 34px; height: 34px; border-width: 1.5px; }
.slot--sm img { width: 24px; height: 24px; }
.slot--sm .iph { font-size: .8rem; }
.slot--lg { width: 64px; height: 64px; }
.slot--lg img { width: 44px; height: 44px; }
.slot--node { width: 100%; height: 100%; }
.slot--node img { width: 38px; height: 38px; }

/* --- 코인 스택 가격 --- */
.coin-price { display: inline-flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.coin-amt { display: inline-flex; align-items: center; gap: 4px; }
.coin-amt img { width: 17px; height: 17px; image-rendering: pixelated; }
.coin-amt b { font-family: var(--font-mono); font-weight: 700; color: var(--brass-2); font-size: .9rem; white-space: nowrap; }
.cstack { display: inline-flex; }
.cstack img + img { margin-left: -9px; }

/* --- 화폐 범례 --- */
.coin-legend {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  background: var(--coal-2); border: 1px solid var(--line);
  padding: 12px 16px; margin-bottom: 20px;
}
.coin-legend .cl { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); }
.coin-legend .cl img { width: 20px; height: 20px; image-rendering: pixelated; }
.coin-legend .cl b { color: var(--steam); font-weight: 700; }
.coin-legend .cl span { font-family: var(--font-mono); color: var(--amber); }

/* --- 시장: 부스 --- */
.shop-wrap { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.booth { background: var(--coal-3); border: 1px solid var(--line-2); overflow: clip; }
.awning { display: block; width: 100%; height: 34px; }
.booth-head { padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.booth-head h3 { font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.booth-head .tag {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  padding: 2px 7px; border: 1px solid var(--line-2);
}
.booth--sell .tag { color: var(--verdi); border-color: #2f6e5f; }
.booth--buy .tag { color: var(--copper-2); border-color: #7c3f24; }
.booth-head p { color: var(--muted); font-size: .84rem; margin-top: 5px; }
.booth-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1px; background: var(--line); border-top: 1px solid var(--line);
}
.ware {
  display: flex; align-items: center; gap: 12px;
  background: var(--coal-3); padding: 12px 14px;
  transition: background .15s;
}
.ware:hover { background: var(--coal-2); }
.ware-info { min-width: 0; display: grid; gap: 3px; }
.ware-info > b { font-size: .93rem; font-weight: 700; line-height: 1.35; }
.ware-price { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ware-price .dir { color: var(--muted); font-size: .78rem; }

/* --- 길드: 퀘스트 트리 --- */
.q-tree-scroll {
  overflow-x: auto; overscroll-behavior-x: contain;
  background:
    radial-gradient(circle at 1px 1px, rgba(239,234,224,.05) 1px, transparent 1.5px) 0 0 / 24px 24px,
    var(--coal-2);
  border: 1px solid var(--line-2);
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.q-tree { position: relative; margin-inline: auto; }
.q-wires { position: absolute; inset: 0; pointer-events: none; }
.q-wires .wire { fill: none; stroke: #4f4433; stroke-width: 2; }
.q-wires .wire.lit { stroke: var(--brass); stroke-width: 2.5; }
.q-node {
  position: absolute; width: 58px; height: 58px;
  padding: 0; border: none; background: none; cursor: pointer;
  transition: transform .12s;
}
.q-node:hover { transform: translateY(-2px); }
.q-node:hover .slot { border-color: var(--brass) var(--brass) var(--brass) var(--brass); }
.q-node.sel .slot {
  border-color: var(--brass-2) var(--brass-2) var(--brass-2) var(--brass-2);
  background: #2a2317;
  box-shadow: 0 0 14px rgba(242, 200, 102, .3);
}
.q-node .q-repeat {
  position: absolute; right: -5px; top: -7px;
  width: 18px; height: 18px; display: grid; place-items: center;
  background: var(--coal-1); border: 1px solid #2f6e5f;
  color: var(--verdi); font-size: .72rem; font-weight: 700;
}

/* --- 퀘스트 상세 --- */
.q-detail {
  margin-top: 14px;
  background: var(--coal-3); border: 1px solid var(--line);
  border-left: 3px solid var(--brass);
  padding: 18px 20px;
  min-height: 120px;
}
.qd-head { display: flex; align-items: center; gap: 14px; }
.qd-head h4 { font-size: 1.12rem; font-weight: 800; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.qd-sub { color: var(--muted); font-size: .78rem; font-family: var(--font-mono); margin-top: 3px; }
.repeat-badge {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .08em;
  color: var(--verdi); border: 1px solid #2f6e5f; padding: 1px 6px;
}
.quest-desc { margin-top: 12px; display: grid; gap: 2px; }
.quest-desc p { color: var(--muted); font-size: .91rem; line-height: 1.65; max-width: 56rem; }
.qd-box {
  margin-top: 12px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--coal-2); border: 1px solid var(--line);
  padding: 9px 13px;
}
.qd-box--rw { border-left: 3px solid var(--brass); }
.qd-box .lbl { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; color: var(--muted); flex: none; }
.qd-box .tk, .qd-box .rw { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 700; }
.qd-box .tk-check { color: var(--verdi); font-weight: 600; }
.qd-box .rw-xp { color: var(--verdi); }

/* ------------------------------------------------ reveal on scroll */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------ animations shared */

@keyframes spin { to { transform: rotate(360deg); } }

/* diorama element animations (classes used by diorama.js) */
.dio .spin     { animation: spin var(--dur, 6s) linear infinite; transform-box: fill-box; transform-origin: center; }
.dio .spin.rev { animation-direction: reverse; }

.dio .puff {
  animation: puff-rise var(--dur, 3.4s) linear infinite;
  animation-delay: var(--d, 0s);
  transform-box: fill-box; transform-origin: center;
  opacity: 0;
}
@keyframes puff-rise {
  0%   { transform: translateY(0) scale(.55); opacity: 0; }
  12%  { opacity: .6; }
  70%  { opacity: .26; }
  100% { transform: translateY(-84px) scale(2.1); opacity: 0; }
}

.dio .belt-slats { animation: slat-move .62s linear infinite; }
@keyframes slat-move { to { transform: translate(13.2px, 6.6px); } }

.dio .belt-item { opacity: 0; }
/* @keyframes item-run is injected by diorama.js (needs computed pixel distance) */

.dio .piston-head { animation: press 3s infinite; }
@keyframes press {
  0%, 55%, 100% { transform: translateY(0); }
  12%           { transform: translateY(14px); }
  22%           { transform: translateY(14px); }
  38%           { transform: translateY(0); }
}

.dio .train { animation: train-run 17s linear infinite; }
/* @keyframes train-run is injected by diorama.js (needs computed pixel distance) */

.dio .glow-pulse { animation: glow-pulse 3.2s ease-in-out infinite; }
@keyframes glow-pulse { 50% { opacity: .55; } }

.dio .win-blink { animation: win-blink 7s step-end infinite; }
@keyframes win-blink { 0%, 88% { opacity: 1; } 92% { opacity: .2; } 96% { opacity: 1; } }

/* map vignette scan */
.map-scan { animation: map-scan 4.6s ease-in-out infinite; }
@keyframes map-scan {
  0%   { transform: translateX(-12%); opacity: 0; }
  12%  { opacity: .8; }
  88%  { opacity: .8; }
  100% { transform: translateX(112%); opacity: 0; }
}

/* wordmark pixel drop-in */
.wm-px {
  animation: px-drop .55s cubic-bezier(.2, .8, .3, 1.25) both;
  animation-delay: var(--d, 0s);
}
@keyframes px-drop {
  from { transform: translateY(-34px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ------------------------------------------------ responsive */

@media (max-width: 1020px) {
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero-dio { order: 2; margin-inline: -6vw; }
  .hero-dio svg { max-height: none; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .shop-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .mod-grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
  .step-no { font-size: 1.5rem; }
  .nav-links a.nav-map-link { display: none; }
  .mod-row { flex-wrap: wrap; gap: 8px 14px; }
  .mod-row span { flex-basis: 100%; }
}

@media (max-width: 520px) {
  .work-grid { grid-template-columns: 1fr; }
  .status-board { flex-direction: row; padding: 14px 16px; gap: 14px; }
  .gauge { width: 86px; }
  .addr-plate { flex: 1 1 auto; justify-content: space-between; }
}

/* ------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dio *, .wm-px, .belt-divider::before, .map-scan,
  .nav-logo .gear-mini, .lamp, .shift-badge .dot,
  .work-card .pict .spin-hover {
    animation: none !important;
  }
  .gauge .needle { transition: none; }
  .wm-px { opacity: 1; transform: none; }
  .dio .belt-item { opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
