:root {
  --acc: #ffc46b;
  --acc2: #ff8a3d;
  --bg1: #14100a;
  --bg2: #020203;
  --ink: #f4efe6;
  --mui: "Noto Sans CJK KR", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg2);
  font-family: var(--mui); color: var(--ink);
  overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.vig {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(120% 90% at 50% 42%, rgba(0,0,0,0) 38%, rgba(0,0,0,0.55) 100%);
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: 0.055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.7'/></svg>");
}

/* 상단 */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 22px 0;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--acc);
  box-shadow: 0 0 14px var(--acc), 0 0 30px var(--acc); flex: 0 0 auto;
}
.brand b { display: block; font-size: 15px; letter-spacing: 0.14em; font-weight: 700; }
.brand i { display: block; font-style: normal; font-size: 11px; letter-spacing: 0.02em; opacity: 0.6; margin-top: 3px; }
.state { text-align: right; }
.state span { display: block; font-size: 11.5px; letter-spacing: 0.02em; opacity: 0.85; font-variant-numeric: tabular-nums; }
.state em { display: block; font-style: normal; font-size: 9.5px; letter-spacing: 0.16em; opacity: 0.38; margin-top: 4px; }

/* 안내 */
.tip .mo { display: none; }
.tip {
  position: fixed; z-index: 5; left: 50%; transform: translateX(-50%);
  bottom: calc(104px + env(safe-area-inset-bottom));
  font-size: 11.5px; letter-spacing: 0.02em; color: rgba(244,239,230,0.55);
  padding: 7px 14px; border-radius: 99px;
  background: rgba(10,9,8,0.35); border: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(6px); pointer-events: none; white-space: nowrap;
}

/* 하단 패널 */
.panel {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(4,4,6,0.92) 30%, rgba(4,4,6,0.45) 75%, rgba(4,4,6,0));
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
.play {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  height: 50px; padding: 0 26px 0 22px; border-radius: 99px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #14100a; font-weight: 800; font-size: 15px; letter-spacing: 0.04em;
  box-shadow: 0 6px 24px -6px var(--acc), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform .16s ease, box-shadow .25s ease, filter .25s ease;
}
.play:hover { filter: brightness(1.06); box-shadow: 0 8px 30px -6px var(--acc); }
.play:active { transform: scale(0.97); }
.play .ico { font-size: 12px; letter-spacing: 0; }
.play.on { background: linear-gradient(135deg, #2a2a2f, #14141a); color: var(--ink); box-shadow: 0 0 0 1px var(--acc), 0 6px 26px -8px var(--acc); }
.seg {
  display: flex; height: 42px; border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
}
.seg button { padding: 0 15px; font-size: 13px; font-weight: 700; color: rgba(244,239,230,0.55); letter-spacing: 0.02em; transition: .2s; }
.seg button.on { background: rgba(255,255,255,0.12); color: var(--acc); }
.theme {
  height: 42px; padding: 0 16px; border-radius: 12px; font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  transition: .2s; white-space: nowrap;
}
.theme:hover { background: rgba(255,255,255,0.1); }
.vol { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 10px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
.vol button { font-size: 15px; line-height: 1; opacity: 0.9; }
.vol button.off { opacity: 0.35; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 96px; height: 3px; border-radius: 3px;
  background: linear-gradient(to right, var(--acc) 0%, var(--acc) var(--p, 62%), rgba(255,255,255,0.18) var(--p, 62%));
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
}
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }

/* 부팅 */
#boot {
  position: fixed; inset: 0; z-index: 20; background: #040406;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity .7s ease, visibility .7s;
}
#boot.done { opacity: 0; visibility: hidden; }
#boot .ring {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12); border-top-color: var(--acc);
  animation: spin 0.9s linear infinite;
}
#boot p { margin: 0; font-size: 12px; letter-spacing: 0.18em; opacity: 0.5; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .hud { padding: calc(14px + env(safe-area-inset-top)) 16px 0; }
  .brand b { font-size: 13.5px; }
  .brand i { font-size: 10px; }
  .state span { font-size: 10px; }
  .state em { display: none; }
  .tip { bottom: calc(150px + env(safe-area-inset-bottom)); font-size: 10.5px; padding: 6px 12px; }
  .tip .pc { display: none; }
  .tip .mo { display: inline; }
  .panel {
    display: grid; grid-template-columns: auto 1fr; gap: 8px;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    align-items: center;
  }
  .play { height: 46px; padding: 0 20px 0 18px; font-size: 0; gap: 0; width: 62px; justify-content: center; }
  .play .ico { font-size: 15px; }
  .play .lbl { display: none; }
  .seg { height: 40px; justify-self: start; }
  .seg button { padding: 0 14px; font-size: 12.5px; }
  .theme { height: 40px; font-size: 12px; padding: 0 12px; justify-self: stretch; }
  .vol { height: 40px; padding: 0 8px; }
  input[type=range] { width: 100%; min-width: 60px; }
}
@media (max-width: 380px) {
  .tip { display: none; }
}
