/* ============================================================
   THE WEERDOS — style.css
   ============================================================ */

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

:root {
  --bg:       #0e0e0e;
  --surface:  #1a1a1a;
  --border:   #2e2e2e;
  --accent:   #5bb8d4;
  --text:     #f0f0f0;
  --muted:    #888;
  --radius:   8px;
  --font:     'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- HEADER ---- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.site-title {
  font-size: 1.32rem;
  font-family: 'Zen Dots', sans-serif;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.flip-e {
  display: inline-block;
  transform: scaleX(-1);
}

nav { display: flex; gap: 1.5rem; }
nav a { color: var(--text); font-size: 0.95rem; font-weight: 500; }
nav a:hover { color: var(--accent); text-decoration: none; }

/* ---- RANDO BANDO SECTION ---- */
#rando-bando {
  padding: 2rem 1.5rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

.rando-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.188rem;
}
.rando-header h2 { font-size: 2.8rem; font-family: 'Honk', sans-serif; font-weight: 400; color: var(--accent); }
.rando-subtitle { color: var(--muted); font-size: 0.95rem; }

/* ---- HEADS TRAY ---- */
.heads-tray-wrap {
  position: relative;
  margin-bottom: 1rem;
}

#heads-tray {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0.5rem 2.8rem 0.5rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 90px;
  align-items: center;
}

.reroll-heads-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  z-index: 1;
}

.head-thumb {
  height: 72px;
  width: auto;
  cursor: grab;
  border-radius: 4px;
  transition: transform 0.15s, opacity 0.15s;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}
.head-thumb:hover { transform: scale(1.1); }
.head-thumb.dragging { opacity: 0.4; }

/* ---- STAGE ---- */
.stage-wrap { position: relative; }

#stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: crosshair;
}

#stage-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  pointer-events: none;
}

#musicians-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.musician-img {
  position: absolute;
  bottom: 0;
  width: auto;  /* set by JS based on natural image size */
  height: auto;
  pointer-events: none;
  user-select: none;
}

.musician-back {
  bottom: 50px;
}

#heads-layer {
  position: absolute;
  inset: 0;
}

/* ---- PLACED HEAD ---- */
.placed-head {
  position: absolute;
  cursor: move;
  touch-action: none;
  user-select: none;
}

.placed-head img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.placed-head .head-controls {
  display: none;
  position: absolute;
  inset: -18px;
  pointer-events: none;
}

.placed-head.selected .head-controls { display: block; }

.placed-head .ctrl-remove {
  position: absolute;
  top: 0; right: 0;
  width: 20px; height: 20px;
  background: #e00;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  pointer-events: all;
  z-index: 10;
}

.placed-head .ctrl-resize {
  position: absolute;
  bottom: 0; right: 0;
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 3px;
  cursor: se-resize;
  pointer-events: all;
}

.placed-head .ctrl-rotate {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 18px; height: 18px;
  background: #f90;
  border-radius: 50%;
  cursor: grab;
  pointer-events: all;
}

.placed-head .ctrl-flip {
  position: absolute;
  bottom: 0; left: 0;
  width: 18px; height: 18px;
  background: #b06ce0;
  border-radius: 3px;
  cursor: pointer;
  pointer-events: all;
  border: none;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  color: #fff;
  padding: 0;
}

/* selection ring */
.placed-head.selected::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px dashed var(--accent);
  border-radius: 4px;
  pointer-events: none;
}

/* ---- BAND NAME ROW ---- */
.band-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.band-name-label { color: var(--muted); font-size: 0.9rem; }

.band-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

/* ---- ALL CONTROLS ROW ---- */
.all-controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  align-items: center;
  justify-content: center;
}

/* ---- BUTTONS ---- */
.big-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.big-btn:hover { opacity: 0.85; }

.reroll-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s;
}
.reroll-btn:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
  background: none;
  color: var(--text);
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.icon-btn:hover { color: var(--accent); }

/* ---- MUSIC PLAYER ---- */
#music-player {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 0.5rem 1.5rem;
}

.player-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.now-playing {
  font-size: 0.85rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-playing strong { color: var(--text); }

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

#volume {
  width: 80px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---- CONTENT SECTIONS ---- */
.content-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
}

.content-section h2 {
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-intro { color: var(--muted); margin-bottom: 1.5rem; }

.streaming-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.stream-link {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}
.stream-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---- FOOTER ---- */
footer {
  text-align: center;
  padding: 2rem 1rem 5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  header { padding: 0.75rem 1rem; }
  .site-title { font-size: 1.2rem; }
  nav { gap: 0.75rem; }
  .all-controls { justify-content: center; }
  #volume { width: 60px; }
}
