/* =========================================================
 * AI 미디어아트 제너레이터 — 다크 갤러리 스타일
 * ========================================================= */
:root {
  --bg: #050508;
  --panel-bg: rgba(12, 12, 20, 0.78);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #ececf1;
  --muted: #9a9aad;
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- 브랜드 ---------- */
.brand {
  position: fixed;
  top: 22px;
  left: 26px;
  pointer-events: none;
  user-select: none;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

/* ---------- 알림 ---------- */
.notice {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 18, 28, 0.92);
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 40;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease;
  max-width: 90vw;
  text-align: center;
}

.notice.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ---------- 패널 토글 ---------- */
#panelToggle {
  position: fixed;
  top: 18px;
  right: 322px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  z-index: 30;
  transition: right 0.3s ease, background 0.2s ease;
}

#panelToggle:hover { background: rgba(40, 40, 60, 0.85); }

body.panel-hidden #panelToggle { right: 18px; }

/* ---------- 컨트롤 패널 ---------- */
#panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--panel-border);
  padding: 70px 20px 24px;
  overflow-y: auto;
  z-index: 20;
  transition: transform 0.32s ease;
}

#panel.collapsed { transform: translateX(105%); }

#panel section { margin-bottom: 26px; }

#panel h2 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- 버튼 ---------- */
.btn-row { display: flex; flex-direction: column; gap: 8px; }

.mode-btn, .action-btn {
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}

.mode-btn:hover, .action-btn:hover { background: rgba(255, 255, 255, 0.09); }
.mode-btn:active, .action-btn:active { transform: scale(0.98); }

.mode-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #d9ccff;
  font-weight: 600;
}

.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-btn.accent {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.action-btn:disabled { opacity: 0.55; cursor: wait; }

/* ---------- 팔레트 ---------- */
.palette-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  padding: 0;
}

.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.35); }

/* ---------- 슬라이더 ---------- */
.slider { display: block; margin-bottom: 14px; }

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  margin-bottom: 6px;
}

.slider-head em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(124, 92, 255, 0.7);
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
}

/* ---------- 도움말 ---------- */
.tip {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
  margin: 12px 0 0;
}

/* ---------- 반응형 ---------- */
@media (max-width: 720px) {
  #panel { width: 84vw; }
  #panelToggle { right: calc(84vw + 16px); }
  .brand h1 { font-size: 16px; }
  .notice { top: auto; bottom: 22px; font-size: 12px; }
}
