/* Admin console 시안 — 공용 디자인 시스템.
 *
 * 부스 운영자가 어두운 미디어월 옆에서 보는 콘솔이라 어두운 판을 깔고,
 * 단청/오방색에서 강조색을 가져왔다(황 #f0b429 · 청 #4aa3d8 · 적 #e0574a ·
 * 녹 #4fb783). 모든 화면이 이 파일 하나만 링크한다.
 */

:root {
  color-scheme: dark;
  --bg: #0e1217;
  --bg-2: #131923;
  --panel: #171e29;
  --panel-2: #1d2633;
  --panel-3: #242f3f;
  --line: #2a3644;
  --line-2: #354352;
  --ink: #e7edf5;
  --ink-2: #b3c0d1;
  --mute: #7f8da0;
  --gold: #f0b429;
  --blue: #4aa3d8;
  --red: #e0574a;
  --green: #4fb783;
  --violet: #9b8bd4;
  --radius: 12px;
  --sidebar: 244px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic",
    "Apple SD Gothic Neo", sans-serif;
  font-feature-settings: "tnum" 1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.4px; font-weight: 650; }
p { margin: 0; }
code, .mono {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  font-size: 0.92em;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* --- 레이아웃 ------------------------------------------------------------- */

.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.side {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 20px 14px 32px;
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: linear-gradient(150deg, #f0b429, #c2544c);
  color: #24180a; display: grid; place-items: center; font-size: 17px;
}
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: -0.3px; }
.brand-sub { font-size: 11px; color: var(--mute); letter-spacing: 0.4px; }

.nav-group { margin-bottom: 16px; }
.nav-group > span {
  display: block; padding: 0 8px 6px;
  font-size: 10.5px; letter-spacing: 1.4px; color: var(--mute); font-weight: 700;
}
.side a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: 13px;
}
.side a:hover { background: var(--panel-2); color: var(--ink); }
.side a[aria-current="page"] {
  background: var(--panel-3); color: #fff; font-weight: 600;
  box-shadow: inset 2px 0 0 var(--gold);
}
.side a .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); flex: none; }
.side a[aria-current="page"] .dot { background: var(--gold); }
.side-foot { padding: 10px 9px; font-size: 11px; color: var(--mute); border-top: 1px solid var(--line); margin-top: 20px; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 28px; background: #0e1217e8; backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.crumb { font-size: 12px; color: var(--mute); }
.crumb b { color: var(--ink-2); font-weight: 600; }
.topbar .spacer { flex: 1 1 auto; }
.live { display: flex; gap: 8px; flex-wrap: wrap; }

.content { padding: 26px 28px 64px; max-width: 1280px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 25px; }
.page-head p { color: var(--ink-2); margin-top: 7px; max-width: 78ch; }
.page-head .controls { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* --- 조각 ---------------------------------------------------------------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink-2);
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.chip.ok { color: #8ee0b4; border-color: #2f6a4f; background: #14301f; }
.chip.warn { color: #f4cf7a; border-color: #6b5424; background: #2f2611; }
.chip.bad { color: #f19b91; border-color: #6f342d; background: #2f1714; }
.chip.info { color: #9ed4f2; border-color: #2c5b76; background: #102733; }
.chip.live::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.tag {
  display: inline-block; padding: 2px 7px; border-radius: 5px;
  background: var(--panel-3); color: var(--ink-2); font-size: 11px; font-weight: 600;
}
.tag.gold { background: #3a2c0d; color: #f0c65f; }
.tag.blue { background: #12293a; color: #8fcaeb; }
.tag.red { background: #331915; color: #f0a096; }
.tag.green { background: #143024; color: #85dcae; }

.btn {
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink);
}
.btn:hover { background: var(--panel-3); border-color: #435365; }
.btn.primary { background: var(--gold); border-color: #d39a17; color: #241906; }
.btn.primary:hover { background: #ffc844; }
.btn.danger { background: #331915; border-color: #6f342d; color: #f0a096; }
.btn.danger:hover { background: #46201a; }
.btn.ghost { background: none; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- 패널 ---------------------------------------------------------------- */

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 18px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: #1a2230;
}
.panel-head h2 { font-size: 15px; }
.panel-head .sub { font-size: 12px; color: var(--mute); }
.panel-head .spacer { flex: 1 1 auto; }
.panel-body { padding: 18px; }
.panel-body > p.note {
  font-size: 12px; color: var(--mute); background: var(--bg-2);
  border-left: 2px solid var(--line-2); padding: 9px 12px; border-radius: 0 7px 7px 0;
}
.panel-body > p.note + * { margin-top: 14px; }
.panel-foot {
  padding: 12px 18px; border-top: 1px solid var(--line); background: #141b26;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  font-size: 12px; color: var(--mute);
}

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

/* --- 폼 ------------------------------------------------------------------ */

.field { display: block; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > .label {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.field > .label .hint { font-weight: 400; color: var(--mute); font-size: 11px; }
.field > .label .spacer { flex: 1 1 auto; }
/* 블록이어야 한다 — inline-flex 인 .switch 뒤에 오면 같은 줄에 붙어 겹친다 */
.field .help { display: block; margin-top: 5px; font-size: 11.5px; color: var(--mute); }
.field .help code { color: var(--ink-2); }

input[type="text"], input[type="number"], input[type="password"], select, textarea {
  font: inherit; width: 100%;
  padding: 8px 11px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink);
}
input[type="text"]:hover, input[type="number"]:hover, select:hover { border-color: #435365; }
textarea { resize: vertical; min-height: 74px; line-height: 1.6; }
input[readonly] { color: var(--ink-2); background: #111721; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input, .inline select { width: auto; flex: 1 1 auto; min-width: 0; }
.unit { color: var(--mute); font-size: 12px; white-space: nowrap; }

input[type="range"] { width: 100%; accent-color: var(--gold); }
.slider { display: flex; align-items: center; gap: 12px; }
.slider input[type="range"] { flex: 1 1 auto; }
.slider output {
  flex: none; min-width: 62px; text-align: right;
  font-family: ui-monospace, Consolas, monospace; font-size: 13px;
  color: var(--gold); font-weight: 600;
}

/* 토글 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; }
.switch input { appearance: none; margin: 0; width: 38px; height: 21px; flex: none;
  border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2);
  position: relative; cursor: pointer; transition: background 0.14s; }
.switch input::after {
  content: ""; position: absolute; inset: 2px auto 2px 2px; width: 15px;
  border-radius: 50%; background: var(--mute); transition: transform 0.14s, background 0.14s;
}
.switch input:checked { background: #3d6b52; border-color: #4f8b6b; }
.switch input:checked::after { transform: translateX(17px); background: #b6f0d1; }
.switch .sw-label { color: var(--ink-2); }
.switch input:checked + .sw-label { color: var(--ink); }

/* 세그먼트 */
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 9px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border-radius: 6px; border: 0; background: none; color: var(--ink-2);
}
.seg button:hover { color: var(--ink); background: var(--panel-2); }
.seg button[aria-pressed="true"] { background: var(--gold); color: #241906; }

/* 색 입력 */
.color { display: flex; align-items: center; gap: 9px; }
.color input[type="color"] {
  appearance: none; width: 34px; height: 30px; padding: 0; flex: none; cursor: pointer;
  background: none; border: 1px solid var(--line-2); border-radius: 7px;
}
.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.color .hex { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--ink-2); }
.swatches { display: flex; gap: 4px; }
.swatches i { width: 18px; height: 18px; border-radius: 4px; border: 1px solid #0006; }

/* --- 표 ------------------------------------------------------------------ */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-size: 11px; letter-spacing: 0.7px; color: var(--mute);
  font-weight: 700; padding: 0 12px 9px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid #1f2937; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1a2230; }
td.num, th.num { text-align: right; font-family: ui-monospace, Consolas, monospace; }
td.tight { white-space: nowrap; }
.table-wrap { overflow-x: auto; margin: -18px; padding: 18px; }
table input[type="text"], table input[type="number"], table select { padding: 5px 8px; font-size: 12.5px; }
table .cell-n { max-width: 84px; }

/* --- 상태 카드 ----------------------------------------------------------- */

.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 15px 16px; }
.stat .k { font-size: 11.5px; color: var(--mute); font-weight: 600; letter-spacing: 0.3px; }
.stat .v { font-size: 27px; font-weight: 700; letter-spacing: -1px; margin-top: 3px; }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--mute); letter-spacing: 0; }
.stat .d { font-size: 11.5px; color: var(--mute); margin-top: 3px; }
.stat.hi { border-color: #5d4a17; background: linear-gradient(180deg, #26200f, #1b1c18); }
.stat.hi .v { color: var(--gold); }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; font-size: 13px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; color: var(--ink); }

/* 카드(활·스킨·맵 등 목록) */
.card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.card.off { opacity: 0.5; }
.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-top h3 { font-size: 14px; }
.card-top .spacer { flex: 1 1 auto; }
.card .meta { font-size: 11.5px; color: var(--mute); }
.card .preview {
  height: 86px; border-radius: 8px; border: 1px solid #0006;
  display: grid; place-items: center; font-size: 12px; color: #0009; font-weight: 700;
}
.card hr { border: 0; border-top: 1px solid var(--line); margin: 2px 0; }

/* 목록 행 (사운드 트랙 등) */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 0; border-bottom: 1px solid #1f2937;
}
.row:last-child { border-bottom: 0; }
.row .rname { flex: 0 0 190px; min-width: 0; }
.row .rname b { display: block; font-size: 13px; font-weight: 600; }
.row .rname span { font-size: 11px; color: var(--mute); }
.row .rmid { flex: 1 1 220px; min-width: 180px; }
.row .rend { flex: none; display: flex; gap: 8px; align-items: center; }

/* 리스트 나열 */
ul.bullets { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 12.5px; }
ul.bullets li { margin: 4px 0; }

/* 저장 바 */
.savebar {
  position: sticky; bottom: 0; z-index: 15; margin: 24px -28px -64px;
  padding: 14px 28px 20px; background: #0e1217f2; border-top: 1px solid var(--line);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  backdrop-filter: blur(8px);
}
.savebar .msg { font-size: 12px; color: var(--mute); flex: 1 1 auto; }

/* 토스트 */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 18px);
  background: #202a38; border: 1px solid var(--line-2); color: var(--ink);
  padding: 11px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
  box-shadow: 0 12px 34px #0009; opacity: 0; pointer-events: none;
  transition: opacity 0.18s, transform 0.18s; z-index: 100;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 시안 배너 */
.mock-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: #2a2211; border: 1px solid #5d4a17; color: #f4d68b;
  padding: 11px 14px; border-radius: 10px; font-size: 12.5px; margin-bottom: 20px;
}
.mock-note b { color: var(--gold); }

/* --- gallery.html 갤러리 --------------------------------------------------- */

.gal-wrap { max-width: 1340px; margin: 0 auto; padding: 0 28px; }
.gal-head { padding: 56px 0 22px; }
.gal-head .eyebrow { font-size: 11px; letter-spacing: 2.2px; color: var(--gold); font-weight: 700; }
.gal-head h1 { font-size: clamp(28px, 4vw, 40px); margin: 12px 0 12px; }
.gal-head p { color: var(--ink-2); max-width: 82ch; }
.gal-head .highlights { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.gal-toolbar {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 14px 0 4px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mute);
}
.gal-toolbar label { display: flex; gap: 9px; align-items: center; }
.gal-toolbar select { width: auto; }
.gal-group { padding-top: 40px; scroll-margin-top: 16px; }
.gal-group h2 { font-size: 21px; }
.gal-group > p { color: var(--mute); font-size: 13px; margin: 7px 0 20px; }
.gal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.gal-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; min-width: 0;
}
.gal-card .ch { display: flex; align-items: baseline; gap: 9px; margin-bottom: 6px; }
.gal-card .ch h3 { font-size: 16px; }
.gal-card .ch a { color: inherit; text-decoration: none; }
.gal-card .ch a:hover { text-decoration: underline; text-underline-offset: 4px; }
.gal-card > p { font-size: 12.5px; color: var(--mute); min-height: 40px; margin-bottom: 12px; }
.frame {
  position: relative; width: 100%; overflow: hidden;
  border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2);
}
.frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: top left; }
.gal-card .ca {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-top: 12px; font-size: 12px;
}
.gal-card .ca a { color: var(--ink-2); text-decoration: none; }
.gal-card .ca a:hover { color: var(--ink); text-decoration: underline; }
.gal-nav {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 12px max(28px, calc((100vw - 1284px) / 2));
  background: var(--bg-2); border-block: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.gal-nav a { color: var(--ink-2); font-size: 12.5px; text-decoration: none; padding: 6px 10px; border-radius: 7px; }
.gal-nav a:hover { background: var(--panel-2); color: var(--ink); }
.gal-foot { padding: 44px 0; font-size: 12px; color: var(--mute); }

/* --- 반응형 -------------------------------------------------------------- */

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
  .g3, .g2 { grid-template-columns: minmax(0, 1fr); }
  .gal-grid { grid-template-columns: minmax(0, 1fr); }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .savebar { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .gal-wrap { padding-left: 16px; padding-right: 16px; }
}

/* 코드에 대응이 없어 잠긴 컨트롤 — 왜 잠겼는지 옆에 적는다. */
[data-locked] { opacity: .5; cursor: not-allowed; }
.locked-note { display: block; color: #f4cf7a; margin-top: 4px; }

/* 잠긴 버튼 — 눌러도 아무 일이 없다는 것이 눈에 보여야 한다. */
.btn[disabled], .btn:disabled, .pick[disabled], .pick:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.btn[disabled]:hover, .btn:disabled:hover { background: var(--bg-2); }
/* 잠긴 입력칸도 같다 — 다국어 화면의 간판 한국어 칸처럼 쓰이지 않는 값. */
table input:disabled { opacity: .45; cursor: not-allowed; }
