/* ============================================================
   NOXEN STUDIO — CRT / 아날로그 호러 테마
   팔레트는 팀 로고에서 추출: 블랙 그린 배경 / 크림 화이트 / 네온 그린
   ============================================================ */
:root {
  --bg: #050706;
  --bg-2: #090c0a;
  --panel: #0c110d;
  --panel-2: #10160f;
  --line: #1c2b21;
  --line-soft: #14201a;
  --neon: #3dff9e;
  --neon-dim: #1e7c4e;
  --neon-ghost: rgba(61, 255, 158, 0.08);
  --bone: #ece7d9;
  --muted: #7d8f83;
  --red: #ff4d4d;
  --red-ghost: rgba(255, 77, 77, 0.09);
  --amber: #ffb347;
  --amber-ghost: rgba(255, 179, 71, 0.09);
  --font-d: 'Chakra Petch', sans-serif;
  --font-b: 'IBM Plex Sans KR', sans-serif;
  --font-m: 'Nanum Gothic Coding', monospace;
}

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

body {
  background: var(--bg);
  color: var(--bone);
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--neon); color: #04120a; }

a { color: var(--neon); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── CRT 오버레이 ─────────────────────────────── */
.crt {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 60;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.14) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: multiply;
  animation: flicker 6s infinite steps(60);
}
.vignette {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 59;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}
@keyframes flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.82; }
  98% { opacity: 1; }
  99% { opacity: 0.9; }
}

/* ── 부팅 오버레이 ─────────────────────────────── */
.boot {
  position: fixed; inset: 0; z-index: 100;
  background: #020403;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
.boot.done { opacity: 0; pointer-events: none; }
.boot-inner { width: min(560px, 90vw); }
.boot-logo {
  width: 120px; display: block; margin: 0 auto 28px;
  filter: drop-shadow(0 0 18px rgba(61, 255, 158, 0.25));
  animation: bootglitch 4s infinite;
}
@keyframes bootglitch {
  0%, 93%, 100% { transform: none; }
  94% { transform: translateX(2px) skewX(2deg); }
  95% { transform: none; }
  96% { transform: translateX(-2px); }
}
.boot-lines {
  font-family: var(--font-m);
  font-size: 14px;
  color: var(--neon);
  min-height: 180px;
  white-space: pre-wrap;
  text-shadow: 0 0 8px rgba(61, 255, 158, 0.4);
  margin: 0 0 20px;
}
.boot-bar {
  height: 6px; border: 1px solid var(--neon-dim); padding: 1px;
}
.boot-bar span {
  display: block; height: 100%; width: 0%;
  background: var(--neon);
  box-shadow: 0 0 12px var(--neon);
  transition: width 0.3s ease;
}
.boot-skip {
  margin-top: 18px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-m); font-size: 12px; color: var(--muted);
}
.boot-skip:hover { color: var(--neon); }

/* ── 경고 띠 ─────────────────────────────── */
.alert-banner {
  position: sticky; top: 0; z-index: 70;
  border-bottom: 1px solid var(--red);
  background: var(--red-ghost);
  backdrop-filter: blur(6px);
  animation: alertpulse 2.4s infinite;
}
.alert-banner.warn { border-color: var(--amber); background: var(--amber-ghost); }
@keyframes alertpulse {
  0%, 100% { box-shadow: inset 0 -8px 18px -12px rgba(255, 77, 77, 0.6); }
  50% { box-shadow: inset 0 -8px 22px -10px rgba(255, 77, 77, 0.9); }
}
.alert-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: baseline; gap: 14px;
  padding: 9px 20px;
}
.alert-tag {
  font-family: var(--font-m); font-size: 12px; font-weight: 700;
  color: var(--red); letter-spacing: 0.12em; white-space: nowrap;
  animation: blink 1.6s ease-in-out infinite;
}
.alert-banner.warn .alert-tag { color: var(--amber); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.alert-body { font-size: 13.5px; color: var(--bone); flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.alert-body .alert-track { display: inline-block; white-space: nowrap; padding-left: 100%; animation: banner-run 24s linear infinite; }
@keyframes banner-run { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.alert-body b { color: var(--red); font-family: var(--font-m); font-weight: 700; }
.alert-banner.warn .alert-body b { color: var(--amber); }

/* ── 상단 바 ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 26px;
  padding: 10px 22px;
  background: rgba(5, 7, 6, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; border-radius: 4px; }
.brand-text {
  font-family: var(--font-d); font-weight: 700; font-size: 18px;
  letter-spacing: 0.06em; color: var(--bone);
}
.brand-text em {
  display: block; font-style: normal; font-weight: 500;
  font-size: 10px; letter-spacing: 0.5em; color: var(--neon);
}
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  font-family: var(--font-m); font-size: 13.5px;
  color: var(--muted);
  padding: 7px 13px;
  border: 1px solid transparent;
  letter-spacing: 0.04em;
  position: relative;
}
.nav a:hover { color: var(--bone); text-decoration: none; }
.nav a.active {
  color: var(--neon);
  border-color: var(--neon-dim);
  background: var(--neon-ghost);
  text-shadow: 0 0 8px rgba(61, 255, 158, 0.5);
}
.nav a.tab-blocked { color: #a05555; }
.nav a.tab-blocked::after {
  content: '⚠'; font-size: 10px; margin-left: 5px; color: var(--red);
}
.top-right { display: flex; align-items: center; gap: 14px; }
.cart-btn {
  font-family: var(--font-m); font-size: 12.5px;
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 12px; cursor: pointer;
}
.cart-btn:hover { color: var(--neon); border-color: var(--neon-dim); }
.userchip { font-family: var(--font-m); font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.userchip a { color: var(--bone); }
.userchip .adm { color: var(--neon); font-weight: 700; }

/* ── 레이아웃 ─────────────────────────────── */
.app {
  flex: 1;
  width: 100%; max-width: 1200px;
  margin: 0 auto;
  padding: 34px 22px 80px;
}
.footer {
  border-top: 1px solid var(--line);
  padding: 18px 22px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
}
.footer .sig { font-family: var(--font-m); font-size: 11.5px; color: #3a4a40; }

/* 섹션 헤더 — 터미널 프롬프트 스타일 */
.panel-title, .sec-title {
  font-family: var(--font-m); font-size: 14px; font-weight: 700;
  color: var(--neon); letter-spacing: 0.06em;
}
.sec-title::before { content: '> '; color: var(--neon-dim); }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 10px; margin: 44px 0 20px;
}
.sec-head:first-child { margin-top: 0; }
.sec-sub { font-family: var(--font-m); font-size: 11.5px; color: var(--muted); }

/* ── 패널 / 카드 ─────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
  position: relative;
}
.panel::before, .panel::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  border-color: var(--neon-dim); border-style: solid;
}
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card.clickable { cursor: pointer; }
.card.clickable:hover {
  border-color: var(--neon-dim);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px -18px rgba(61, 255, 158, 0.45);
}
.card .thumb {
  aspect-ratio: 16/9; overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-fallback {
  font-family: var(--font-d); font-weight: 700; letter-spacing: 0.2em;
  color: #24382c; font-size: 15px; text-align: center; padding: 0 12px;
  text-transform: uppercase;
}

/* ── 상태 배지 ─────────────────────────────── */
.badge {
  display: inline-block; font-family: var(--font-m); font-size: 11px; font-weight: 700;
  padding: 2px 9px; border: 1px solid; letter-spacing: 0.08em;
}
.badge.done { color: var(--neon); border-color: var(--neon-dim); background: var(--neon-ghost); }
.badge.wip { color: var(--amber); border-color: rgba(255, 179, 71, 0.5); background: var(--amber-ghost); }
.badge.plan { color: var(--muted); border-color: var(--line); }
.badge.soldout { color: var(--red); border-color: rgba(255, 77, 77, 0.5); background: var(--red-ghost); }
.mono { font-family: var(--font-m); }
.dim { color: var(--muted); }
.small { font-size: 13px; }

/* ── 히어로 ─────────────────────────────── */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px;
  align-items: center;
  padding: 30px 0 10px;
}
.hero .eyebrow {
  font-family: var(--font-m); font-size: 12px; letter-spacing: 0.3em;
  color: var(--neon); margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-d); font-weight: 700;
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.25; margin: 0 0 18px;
  color: var(--bone);
  position: relative;
}
.hero h1 .g { position: relative; display: inline-block; }
.hero h1 .g::before, .hero h1 .g::after {
  content: attr(data-t); position: absolute; inset: 0; overflow: hidden;
}
.hero h1 .g::before { color: var(--neon); animation: gl1 3.2s infinite steps(1); }
.hero h1 .g::after { color: var(--red); animation: gl2 2.7s infinite steps(1); }
@keyframes gl1 {
  0%, 92%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  93% { clip-path: inset(20% 0 40% 0); transform: translateX(-4px); }
  95% { clip-path: inset(60% 0 5% 0); transform: translateX(3px); }
  97% { clip-path: inset(0 0 100% 0); }
}
@keyframes gl2 {
  0%, 90%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  91% { clip-path: inset(70% 0 8% 0); transform: translateX(4px); }
  94% { clip-path: inset(30% 0 55% 0); transform: translateX(-3px); }
  96% { clip-path: inset(0 0 100% 0); }
}
.hero .lead { color: var(--muted); max-width: 56ch; margin: 0 0 26px; }
.hero-logo {
  background: var(--panel); border: 1px solid var(--line);
  padding: 14px; position: relative;
}
.hero-logo::after {
  content: 'NOXEN_IDENTITY_v3'; position: absolute; bottom: 8px; right: 12px;
  font-family: var(--font-m); font-size: 10px; color: #2c4034;
}
.hero-logo img { width: 100%; display: block; filter: drop-shadow(0 0 24px rgba(61, 255, 158, 0.18)); }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: var(--font-m); font-size: 13.5px; font-weight: 700;
  padding: 11px 22px; cursor: pointer;
  background: none; border: 1px solid var(--neon-dim); color: var(--neon);
  letter-spacing: 0.05em;
  transition: all 0.15s;
}
.btn:hover { background: var(--neon-ghost); box-shadow: 0 0 18px -6px rgba(61, 255, 158, 0.6); }
.btn-solid { background: var(--neon); color: #04120a; border-color: var(--neon); }
.btn-solid:hover { background: #66ffb8; box-shadow: 0 0 24px -4px rgba(61, 255, 158, 0.8); }
.btn-danger { border-color: rgba(255, 77, 77, 0.6); color: var(--red); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { background: none; box-shadow: none; }

/* ── 공지 / 상태 칩 ─────────────────────────────── */
.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--neon);
  background: var(--panel); padding: 14px 18px; margin: 26px 0;
  font-size: 14.5px;
}
.notice.important { border-left-color: var(--red); }
.notice .n-tag { font-family: var(--font-m); font-size: 11px; color: var(--neon); margin-right: 10px; }
.notice.important .n-tag { color: var(--red); }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-m); font-size: 12px;
  border: 1px solid var(--line); padding: 6px 12px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip.ok .dot { background: var(--neon); box-shadow: 0 0 8px var(--neon); }
.chip.ok { color: var(--bone); }
.chip.error .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.chip.error { color: var(--red); border-color: rgba(255, 77, 77, 0.4); }
.chip.warn .dot { background: var(--amber); }
.chip.warn { color: var(--amber); }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 22px; }
.filter {
  font-family: var(--font-m); font-size: 12.5px; cursor: pointer;
  background: none; border: 1px solid var(--line); color: var(--muted); padding: 6px 14px;
}
.filter.active { color: var(--neon); border-color: var(--neon-dim); background: var(--neon-ghost); }

/* ── 팀원 카드 ─────────────────────────────── */
.member .avatar {
  width: 64px; height: 64px;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-d); font-weight: 700; font-size: 22px; color: var(--neon-dim);
  overflow: hidden;
}
.member .avatar img { width: 100%; height: 100%; object-fit: cover; }
.member h3 { margin: 12px 0 2px; font-size: 17px; }
.member .role { font-family: var(--font-m); font-size: 12px; color: var(--neon); }

/* ── 게임 상세 ─────────────────────────────── */
.gd-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.gd-head h1 { font-family: var(--font-d); font-size: clamp(26px, 3.6vw, 40px); margin: 0; }
.gd-meta { font-family: var(--font-m); font-size: 12.5px; color: var(--muted); margin: 8px 0 22px; }
.gd-meta span { margin-right: 18px; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.shots .shot {
  aspect-ratio: 16/9; background: var(--bg-2); border: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.shots .shot img { width: 100%; height: 100%; object-fit: cover; }

/* ── 폼 ─────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.form label { font-family: var(--font-m); font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.form input, .form textarea, .form select {
  width: 100%; margin-top: 5px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--bone);
  font-family: var(--font-m); font-size: 14px;
  padding: 11px 13px; outline: none;
}
.form input:focus, .form textarea:focus { border-color: var(--neon-dim); box-shadow: 0 0 0 1px var(--neon-dim); }
.form .err { color: var(--red); font-size: 13.5px; min-height: 20px; }
.form-note { font-size: 12.5px; color: var(--muted); }

.auth-shell { max-width: 520px; margin: 0 auto; }
.auth-term {
  background: var(--panel); border: 1px solid var(--line); padding: 28px;
}
.auth-term .term-bar {
  display: flex; gap: 6px; margin-bottom: 20px;
  font-family: var(--font-m); font-size: 11px; color: var(--muted);
}
.auth-term .term-bar .dots { display: flex; gap: 5px; margin-right: 10px; }
.auth-term .term-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: block; }
.auth-term .term-bar .dots i:first-child { background: rgba(255, 77, 77, 0.5); }
.auth-term .term-bar .dots i:nth-child(2) { background: rgba(255, 179, 71, 0.5); }
.auth-term .term-bar .dots i:last-child { background: var(--neon-dim); }

.idnum {
  font-family: var(--font-m); font-weight: 700; font-size: 34px;
  color: var(--neon); text-align: center; letter-spacing: 0.12em;
  text-shadow: 0 0 18px rgba(61, 255, 158, 0.5);
  padding: 18px 0; border: 1px dashed var(--neon-dim); margin: 16px 0;
}

/* ── 콘텐츠 편집 ─────────────────────────────── */
.kv-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); }
.kv-row:last-of-type { border-bottom: none; }
.kv-key { width: 220px; flex: none; }
.kv-key[readonly] { color: var(--neon); background: transparent; border-style: dashed; }
.kv-val { flex: 1; }
.kv-row input, .row-in {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--bone);
  font-family: var(--font-m); font-size: 13px; padding: 8px 10px; outline: none;
}
.kv-row input:focus, .row-in:focus { border-color: var(--neon-dim); }
.row-in { width: 100%; min-width: 90px; }

/* ── Discord 로그인 버튼 ─────────────────────────── */
.discord-btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-m); font-size: 15px; font-weight: 700;
  padding: 15px 34px; letter-spacing: 0.04em;
  color: #fff; background: #5865F2; border: 1px solid #7785ff;
  text-decoration: none; transition: all 0.15s;
}
.discord-btn:hover {
  background: #6a75f5; text-decoration: none;
  box-shadow: 0 0 28px -6px rgba(88, 101, 242, 0.9);
  transform: translateY(-2px);
}

/* ── 차단 / 점검 화면 ─────────────────────────────── */
.blocked {
  max-width: 640px; margin: 60px auto; text-align: center;
  border: 1px solid var(--red); background: var(--red-ghost); padding: 46px 34px;
}
.blocked.maint {
  border-color: var(--amber); background: var(--amber-ghost);
  position: relative; overflow: hidden; padding-top: 60px;
}
/* 개별 탭 점검 화면에도 노랑·검정 띠 */
.blocked.maint::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 12px;
  background: repeating-linear-gradient(-45deg, #111 0 14px, #ffd400 14px 28px);
  border-bottom: 2px solid #000;
}
.blocked .b-icon { font-family: var(--font-m); font-size: 13px; letter-spacing: 0.3em; color: var(--red); margin-bottom: 14px;   animation: blink 1.6s ease-in-out infinite; }
.blocked.maint .b-icon { color: var(--amber); }
.blocked h2 { font-family: var(--font-d); font-size: 26px; margin: 0 0 12px; }
.blocked p { color: var(--muted); margin: 0 0 24px; }
.blocked .b-detail {
  font-family: var(--font-m); font-size: 12.5px; color: var(--muted);
  border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 8px;
  word-break: break-all;
}

/* ── 장바구니 ─────────────────────────────── */
/* hidden 속성은 어떤 display 규칙보다 우선 — 오버레이가 hidden인데도 뜨는 버그 근본 차단 */
[hidden] { display: none !important; }
.cart-drawer[hidden] { display: none !important; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
  width: min(400px, 94vw);
  background: var(--panel); border-left: 1px solid var(--neon-dim);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
}
.cart-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.icon-btn { background: none; border: 1px solid var(--line); color: var(--muted); cursor: pointer; padding: 5px 10px; font-family: var(--font-m); }
.icon-btn:hover { color: var(--neon); border-color: var(--neon-dim); }
.cart-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.cart-item { border: 1px solid var(--line-soft); padding: 12px 14px; }
.cart-item .ci-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.cart-item .ci-name { font-size: 14.5px; font-weight: 500; }
.cart-item .ci-price { font-family: var(--font-m); font-size: 12.5px; color: var(--neon); }
.cart-item .ci-ctl { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cart-item .ci-ctl button {
  width: 24px; height: 24px; background: none; border: 1px solid var(--line);
  color: var(--bone); cursor: pointer; font-family: var(--font-m); line-height: 1;
}
.cart-item .ci-ctl button:hover { border-color: var(--neon-dim); color: var(--neon); }
.cart-item .ci-ctl .rm { width: auto; padding: 0 8px; color: var(--red); border-color: rgba(255,77,77,0.4); }
.cart-foot { border-top: 1px solid var(--line); padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.cart-total { display: flex; justify-content: space-between; font-size: 14.5px; }
.cart-total strong { font-family: var(--font-m); color: var(--neon); }

/* ── 관리자 ─────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  font-family: var(--font-m); font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-align: left; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line); padding: 9px 10px;
}
.tbl td { border-bottom: 1px solid var(--line-soft); padding: 9px 10px; vertical-align: top; }
.tbl tr:hover td { background: rgba(61, 255, 158, 0.03); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.toggle-row:last-child { border-bottom: none; }
.tg { position: relative; width: 46px; height: 24px; flex: none; cursor: pointer; }
.tg input { opacity: 0; width: 0; height: 0; }
.tg span {
  position: absolute; inset: 0; background: var(--bg-2); border: 1px solid var(--line);
  transition: 0.2s;
}
.tg span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: var(--muted); transition: 0.2s;
}
.tg input:checked + span { border-color: var(--red); background: var(--red-ghost); }
.tg input:checked + span::after { left: 24px; background: var(--red); box-shadow: 0 0 8px var(--red); }
.tg-label { font-family: var(--font-m); font-size: 13px; }
.tg-label small { display: block; color: var(--muted); font-size: 11px; }

/* ── 뮤모리 ─────────────────────────────── */
.ext-panel { text-align: center; padding: 70px 24px; }
.ext-panel .big-btn {
  display: inline-block; margin-top: 26px;
  font-family: var(--font-m); font-size: 17px; font-weight: 700;
  padding: 18px 46px; border: 1px solid var(--neon); color: var(--neon);
  letter-spacing: 0.12em;
  transition: all 0.2s;
}
.ext-panel .big-btn:hover {
  background: var(--neon); color: #04120a;
  box-shadow: 0 0 40px -8px rgba(61, 255, 158, 0.8);
  text-decoration: none;
}

/* ── 토스트 ─────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 90; max-width: 90vw;
  background: var(--panel); border: 1px solid var(--neon-dim); color: var(--bone);
  font-family: var(--font-m); font-size: 13px;
  padding: 12px 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
.toast.err { border-color: var(--red); color: var(--red); }

.empty {
  text-align: center; color: var(--muted); padding: 60px 20px;
  border: 1px dashed var(--line); font-family: var(--font-m); font-size: 13px;
}

/* ── 반응형 (노트북 / 태블릿 / 모바일) ─────── */
html { -webkit-text-size-adjust: 100%; }
@media (max-width: 1024px) { /* 태블릿 가로 · 노트북 */
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .topbar { gap: 16px; padding: 10px 16px; }
}
@media (max-width: 768px) { /* 태블릿 세로 · 큰 폰 */
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .app { padding: 20px 14px 64px; }
  .maint-box { margin: 0 14px; padding: 34px 22px; }
  .blocked { margin: 30px 14px; padding: 34px 20px; }
  #app table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cart-drawer { width: 100%; }
}
@media (max-width: 480px) { /* 폰 */
  .shots { grid-template-columns: 1fr; }
  .app { padding: 16px 12px 58px; }
  .maint-box { padding: 28px 18px; }
  .m-count { font-size: 24px; }
  .tape { height: 24px; }
  .tape .tape-text { line-height: 24px; }
  body.tape-push { padding-top: 24px; padding-bottom: 24px; }
  body.tape-push .topbar { top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── 점검 경고 테이프 (사이트 상·하단 검정/노랑) ── */
.tape {
  position: fixed; left: 0; right: 0; z-index: 95;
  height: 26px; overflow: hidden; pointer-events: none;
  background: repeating-linear-gradient(-45deg, #111 0 18px, #ffd400 18px 36px);
  border-top: 2px solid #000; border-bottom: 2px solid #000;
  box-shadow: 0 0 18px rgba(0,0,0,.6);
}
.tape.top { top: 0; }
.tape.bottom { bottom: 0; }
/* 테이프가 떠 있으면 본문을 밀어내서 내용을 가리지 않음 */
body.tape-push { padding-top: 26px; padding-bottom: 26px; }
body.tape-push .topbar { top: 26px; }
/* 사이트 전체 점검 중: 배경 노출 차단 + 스크롤 잠금 */
body.maint-lock { overflow: hidden; }
.tape .tape-text {
  position: absolute; top: 0; left: 0; height: 100%; width: max-content;
  font-family: 'Nanum Gothic Coding', monospace; font-weight: 700; font-size: 12px;
  color: #000; line-height: 26px; letter-spacing: .25em; white-space: nowrap;
  animation: tape-slide 30s linear infinite;
  background: repeating-linear-gradient(-45deg, transparent 0 18px, rgba(0,0,0,.14) 18px 36px);
}
@keyframes tape-slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── 점검 중앙 오버레이 (카운트다운 포함) ── */
.maint-overlay {
  position: fixed; inset: 0; z-index: 94;
  background: #020403;
  display: flex; align-items: center; justify-content: center;
}
.maint-box {
  text-align: center; max-width: 620px; padding: 44px 40px;
  border: 1px solid var(--amber); background: var(--amber-ghost);
}
.maint-box .m-tag {
  font-family: 'Nanum Gothic Coding', monospace; font-size: 12px; letter-spacing: .3em;
  color: var(--amber);   animation: blink 1.6s ease-in-out infinite;
}
.maint-box h2 { font-family: 'Chakra Petch', sans-serif; font-size: 26px; margin: 12px 0 10px; color: var(--bone); }
.maint-box .m-msg { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; }
.maint-box .m-count {
  font-family: 'Nanum Gothic Coding', monospace; font-weight: 700; font-size: 30px;
  color: var(--amber); letter-spacing: .08em; text-shadow: 0 0 16px rgba(255,179,71,.45);
}
.maint-box .m-elapsed { font-family: 'Nanum Gothic Coding', monospace; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.maint-box .m-link { margin-top: 22px; }

/* ── 점검 예정 안내 마퀴 (내비 아래) ── */
.sched-bar {
  position: sticky; top: 0; z-index: 49;
  overflow: hidden; white-space: nowrap;
  background: var(--amber-ghost); border-bottom: 1px solid rgba(255,179,71,.4);
  height: 30px;
}
.sched-bar .sched-track {
  display: inline-block; padding-left: 100%;
  font-family: 'Nanum Gothic Coding', monospace; font-size: 12.5px; color: var(--amber);
  line-height: 30px; animation: sched-run 18s linear infinite;
}
@keyframes sched-run { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.sched-bar .sd { color: var(--bone); font-weight: 700; }

/* ── 자동진단 페이지 ── */
.diag { max-width: 680px; margin: 50px auto; text-align: center; padding: 40px 30px;
  border: 1px solid var(--line); background: var(--panel); }
.diag-icon { font-family: 'Nanum Gothic Coding', monospace; font-size: 12px; letter-spacing: .3em; color: var(--neon); }
.diag h2 { font-family: 'Chakra Petch', sans-serif; font-size: 24px; margin: 12px 0 8px; }
.diag-why { color: var(--muted); margin: 0 0 22px; }
.diag-grid { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.diag-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--line-soft); }
.diag-item .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; }
.diag-item.ok .dot { background: var(--neon); box-shadow: 0 0 8px var(--neon); }
.diag-item.err .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.diag-item.err b { color: var(--red); }
