:root {
  --ink: #f3ece2;
  --ink-dim: rgba(243, 236, 226, 0.62);
  --glass: rgba(16, 18, 26, 0.42);
  --glass-strong: rgba(14, 16, 24, 0.78);
  --stroke: rgba(255, 255, 255, 0.12);
  --accent: #8fd0b0;
  --radius: 16px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0b0d13;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---------- HUD ---------- */

.hud {
  position: fixed;
  z-index: 10;
  transition: opacity 0.4s ease;
}

body.hud-hidden .hud-place,
body.hud-hidden .hud-clock { opacity: 0; pointer-events: none; }

.hud-place {
  top: max(22px, env(safe-area-inset-top));
  left: 26px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

.place-name {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 6px;
}

.activity {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.activity-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-dim);
  max-width: 34ch;
}

.hud-clock {
  top: max(22px, env(safe-area-inset-top));
  right: 26px;
  text-align: right;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

.clock {
  font-size: 34px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
}

.clock-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

/* ---------- Player-dokk ---------- */

.dock {
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  max-width: min(680px, calc(100vw - 32px));
}

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.16); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn.small svg { width: 16px; height: 16px; }

.icon-btn.play { background: var(--accent); color: #10231c; border-color: transparent; }
.icon-btn.play:hover { background: #a6dfc3; }
.icon-btn.play .i-pause { display: none; }
body.playing .icon-btn.play .i-play { display: none; }
body.playing .icon-btn.play .i-pause { display: block; }

.track {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0 4px;
}

.track-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-sub {
  font-size: 11px;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vol { display: flex; align-items: center; gap: 6px; }
.vol-icon { width: 16px; height: 16px; fill: var(--ink-dim); flex: none; }

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

.vol input[type="range"] { width: 78px; }

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
}

/* ---------- Panel ---------- */

.panel {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  width: min(370px, 100vw);
  height: 100%;
  overflow-y: auto;
  padding: 22px 24px 40px;
  background: var(--glass-strong);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-left: 1px solid var(--stroke);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.45);
  animation: slide 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slide { from { transform: translateX(100%); } to { transform: none; } }

.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel h2 { font-size: 17px; font-weight: 600; margin: 0; }

.close {
  border: 0;
  background: none;
  color: var(--ink-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.close:hover { color: var(--ink); }

.panel section { margin-top: 26px; }
.panel h3 {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 12px;
  font-weight: 600;
}

.row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.row.col { flex-direction: column; align-items: stretch; gap: 6px; }
.row.col > span { font-size: 12px; color: var(--ink-dim); }
.row .lbl { font-size: 12px; color: var(--ink-dim); min-width: 42px; }
.slider-row input[type="range"] { flex: 1; }
.slider-row output {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
  min-width: 44px;
  text-align: right;
}

input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

input[type="text"] {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}
input[type="text"]:focus { outline: none; border-color: var(--accent); }

.btn {
  margin-top: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { background: rgba(255, 255, 255, 0.17); }

.hint { font-size: 11.5px; color: var(--ink-dim); line-height: 1.5; margin: 8px 0 0; }

.plan { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.plan li {
  display: flex;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--ink-dim);
}
.plan li.now { background: rgba(143, 208, 176, 0.14); color: var(--ink); }
.plan li b { font-variant-numeric: tabular-nums; font-weight: 500; flex: none; }

/* ---------- Skjult YouTube ---------- */

#ytHost {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -100px;
  top: -100px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 560px) {
  .activity { font-size: 21px; }
  .clock { font-size: 26px; }
  .hud-place, .hud-clock { left: 16px; right: 16px; }
  .hud-clock { left: auto; }
  .track { display: none; }
  .vol { display: none; }
}
