/* ════════════════════════════════════════════════════════
   PixelJam — style.css
   Two-column layout: radar left | player right
   ════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Root tokens ── */
:root {
  --bg:        #eeeae3;
  --surface:   #f5f2ec;
  --border:    #d0cdc7;
  --text-hi:   #111111;
  --text-mid:  #555550;
  --text-lo:   #999990;
  --accent:    #111111;
  --pill-bg:   #e2dfd8;
  --font:      'Space Mono', monospace;
}

/* ── Page ── */
html, body { height: 100%; background: var(--bg); font-family: var(--font); color: var(--text-hi); }

/* ── App shell ── */
.app {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ════════════════════════════════════════════════════════
   LEFT PANEL
   ════════════════════════════════════════════════════════ */
.left-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 90px 90px 90px;
  gap: 24px;
  border-right: 1px solid var(--border);
  position: relative;
}

/* Dot-grid texture */
.left-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #bbb 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.3;
  pointer-events: none;
}

.left-top { text-align: center; position: relative; z-index: 1; }

.main-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.main-sub {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-lo);
  margin-top: 6px;
}

/* ── Radar wrap ── */
.radar-wrap {
  position: relative;
  width: 520px;
  height: 520px;
  z-index: 1;
  overflow: hidden;
  border-radius: 50%;
}
/* Axis labels */
.axis-lbl {
  position: absolute;
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: lowercase;
  color: var(--text-lo);
  pointer-events: none;
  z-index: 2;
}
.lbl-top   { top: 8px;   left: 50%;  transform: translateX(-50%); }
.lbl-right { right: 16px; top: 50%;  transform: translateY(-50%); }
.lbl-br    { bottom: 22%; right: 12px; }
.lbl-bl    { bottom: 22%; left: 12px; }
.lbl-left  { left: 16px; top: 50%;   transform: translateY(-50%); }

#radar-canvas {
  display: block;
  cursor: grab;
  touch-action: none; /* let JS handle all touch events */
}
#radar-canvas:active { cursor: grabbing; }

/* ════════════════════════════════════════════════════════
   RIGHT PANEL
   ════════════════════════════════════════════════════════ */
.right-panel {
  display: flex;
  flex-direction: column;
  padding: 52px 48px 40px;
  gap: 28px;
  overflow-y: auto;
}

/* ── Now playing ── */
.now-playing-block { border-bottom: 1px solid var(--border); padding-bottom: 24px; }

.np-num {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-lo);
  margin-bottom: 8px;
}

.np-name {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.05;
  margin-bottom: 6px;
  transition: opacity 0.3s;
}

.np-artist {
  font-size: 12px;
  color: var(--text-mid);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.np-desc {
  font-size: 10px;
  color: var(--text-lo);
  letter-spacing: 0.5px;
  line-height: 2;
  font-style: italic;
}

/* ── Vibe tag pills ── */
.vibe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vibe-pill {
  background: var(--pill-bg);
  border-radius: 40px;
  padding: 5px 14px;
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-mid);
  border: 1px solid var(--border);
}

/* ── Transport controls ── */
.controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ctrl-btn {
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: background 0.15s, border-color 0.15s;
}
.ctrl-btn:hover { background: var(--text-hi); color: var(--bg); border-color: var(--text-hi); }
.ctrl-btn svg   { width: 18px; height: 18px; }

.play-btn {
  width: 56px;
  height: 56px;
  background: var(--text-hi);
  color: var(--bg);
  border-color: var(--text-hi);
}
.play-btn:hover { background: #444; border-color: #444; }
.play-btn svg   { width: 22px; height: 22px; }

/* ── Dial position bar ── */
.dial-hint {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dial-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-lo);
  white-space: nowrap;
}
.dial-bar-wrap {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.dial-bar {
  height: 100%;
  width: 0%;
  background: var(--text-hi);
  border-radius: 2px;
  transition: width 0.1s;
}
.dial-deg {
  font-size: 10px;
  color: var(--text-lo);
  width: 40px;
  text-align: right;
}

/* ── Playlist ── */
.playlist { display: flex; flex-direction: column; border-top: 1px solid var(--border); }

.track-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: padding-left 0.15s;
}
.track-row:hover { padding-left: 8px; }

.t-num    { font-size: 10px; color: var(--text-lo); width: 30px; flex-shrink: 0; }
.t-info   { flex: 1; }
.t-name   { font-size: 12px; color: var(--text-mid); letter-spacing: 0.3px; }
.t-artist { font-size: 9px;  color: var(--text-lo);  margin-top: 2px; }
.t-dot    { width: 6px; height: 6px; border-radius: 50%; background: var(--border); flex-shrink: 0; }

.track-row.active .t-num  { color: var(--text-hi); }
.track-row.active .t-name { color: var(--text-hi); font-weight: 700; }
.track-row.active .t-dot  { background: var(--text-hi); }

/* ── ESP32 status ── */
.esp-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.esp-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #5a9a5a;
  box-shadow: 0 0 6px #5a9a5a;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.esp-label { font-size: 9px; letter-spacing: 1.5px; color: var(--text-lo); text-transform: uppercase; }

/* ── Responsive: stack on narrow screens ── */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .left-panel { border-right: none; border-bottom: 1px solid var(--border); padding: 32px 16px; }
  .radar-wrap { width: 320px; height: 320px; }
  #radar-canvas { width: 320px; height: 320px; }
  .right-panel { padding: 32px 20px; }
}

/* img of vinyl disk */
#vinyl-disk {
  position: absolute;
  width: 510px;
  height: 510px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  border-radius: 50%;
  object-fit: cover;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}