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

:root {
  --banana: #f1ce05;
  --banana-dark: #c9a800;
  --purple: #610777;
  --magenta: #be1bbe;
  --hot-pink: #ff2d6a;
  --lime: #39ff14;
  --wood: #3d2817;
  --wood-light: #5c3d24;
  --chalk: #e8e4d9;
  --chalk-dim: #a8a498;
  --font-graffiti: "Permanent Marker", cursive;
  --font-display: "Rubik Mono One", monospace;
  --font-mono: "Space Mono", monospace;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-mono);
  background: #0d0a0f;
  color: var(--chalk);
  cursor: crosshair;
}

/* ── Grok background scene ── */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  inset: -4%;
  background: url("assets/barbershop-bg.jpg") center center / cover no-repeat;
  animation: ken-burns 28s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes ken-burns {
  0% {
    transform: scale(1) translate(0, 0);
  }
  100% {
    transform: scale(1.06) translate(-1.2%, -0.6%);
  }
}

.bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 72% 38%, rgba(255, 200, 80, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 18% 55%, rgba(190, 27, 190, 0.08) 0%, transparent 40%);
  animation: glow-pulse 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

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

.bg-flicker {
  position: absolute;
  inset: 0;
  background: rgba(255, 220, 140, 0.03);
  animation: light-flicker 5s infinite;
  pointer-events: none;
}

@keyframes light-flicker {
  0%,
  88%,
  90%,
  92%,
  100% {
    opacity: 0;
  }
  89%,
  91% {
    opacity: 1;
  }
}

/* ── Menu board ── */

.menu-board {
  position: fixed;
  top: 14%;
  left: 2.5%;
  z-index: 10;
  width: clamp(190px, 18vw, 260px);
}

.board-frame {
  background: linear-gradient(145deg, rgba(42, 34, 24, 0.92) 0%, rgba(26, 21, 16, 0.95) 100%);
  border: 5px solid var(--wood-light);
  border-radius: 4px;
  padding: 0.85rem 1.1rem 1.1rem;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.75),
    inset 0 0 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-graffiti);
  font-size: 1.2rem;
  color: var(--chalk);
  border-bottom: 2px dashed rgba(232, 228, 217, 0.25);
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
  text-shadow: 1px 1px 0 #000;
}

.board-screw {
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, #888 30%, #555 70%);
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.board-items {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.board-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-rows: auto auto;
  gap: 0 0.45rem;
  padding: 0.45rem 0.2rem;
  text-decoration: none;
  color: var(--chalk);
  border-bottom: 1px dotted rgba(232, 228, 217, 0.12);
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
}

.board-item:hover {
  background: rgba(241, 206, 5, 0.1);
  transform: translateX(4px);
}

.board-item:hover .item-name {
  color: var(--banana);
}

.item-price {
  grid-row: 1 / 3;
  font-family: var(--font-graffiti);
  font-size: 1rem;
  color: var(--magenta);
  align-self: center;
}

.item-name {
  font-family: var(--font-graffiti);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.item-desc {
  font-size: 0.6rem;
  color: var(--chalk-dim);
  letter-spacing: 0.05em;
}

.board-footer {
  text-align: center;
  font-family: var(--font-graffiti);
  font-size: 0.7rem;
  color: var(--banana);
  margin-top: 0.65rem;
  opacity: 0.75;
}

/* ── Jukebox ── */

.jukebox {
  position: fixed;
  top: 10%;
  right: 2.5%;
  z-index: 10;
  width: clamp(210px, 20vw, 280px);
}

.jukebox-body {
  background: linear-gradient(180deg, rgba(139, 0, 32, 0.94) 0%, rgba(58, 0, 13, 0.96) 100%);
  border-radius: 12px 12px 6px 6px;
  padding: 0.7rem;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.85),
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
  border: 3px solid #a00028;
  backdrop-filter: blur(4px);
}

.jukebox-top {
  background: linear-gradient(180deg, #c9a000 0%, #8b7000 100%);
  border-radius: 8px 8px 0 0;
  padding: 0.45rem;
  margin-bottom: 0.45rem;
  overflow: hidden;
}

.jukebox-lights {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 0.3rem;
}

.jukebox-lights span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #333;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.5);
}

.jukebox.playing .jukebox-lights span {
  animation: juke-light 0.6s ease-in-out infinite alternate;
}

.jukebox.playing .jukebox-lights span:nth-child(1) {
  background: var(--hot-pink);
}
.jukebox.playing .jukebox-lights span:nth-child(2) {
  background: var(--banana);
  animation-delay: 0.1s;
}
.jukebox.playing .jukebox-lights span:nth-child(3) {
  background: var(--lime);
  animation-delay: 0.2s;
}
.jukebox.playing .jukebox-lights span:nth-child(4) {
  background: var(--magenta);
  animation-delay: 0.3s;
}
.jukebox.playing .jukebox-lights span:nth-child(5) {
  background: #00d4ff;
  animation-delay: 0.4s;
}
.jukebox.playing .jukebox-lights span:nth-child(6) {
  background: var(--hot-pink);
  animation-delay: 0.15s;
}
.jukebox.playing .jukebox-lights span:nth-child(7) {
  background: var(--banana);
  animation-delay: 0.25s;
}
.jukebox.playing .jukebox-lights span:nth-child(8) {
  background: var(--lime);
  animation-delay: 0.35s;
}
.jukebox.playing .jukebox-lights span:nth-child(9) {
  background: var(--magenta);
  animation-delay: 0.45s;
}
.jukebox.playing .jukebox-lights span:nth-child(10) {
  background: #00d4ff;
  animation-delay: 0.05s;
}

@keyframes juke-light {
  from {
    opacity: 0.4;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 8px currentColor;
  }
}

.jukebox-brand {
  font-family: var(--font-graffiti);
  font-size: 0.8rem;
  text-align: center;
  color: #1a0800;
  letter-spacing: 0.1em;
}

.jukebox-screen {
  background: #0a1a0a;
  border: 3px solid #1a3a1a;
  border-radius: 4px;
  padding: 0.55rem;
  margin-bottom: 0.45rem;
  box-shadow: inset 0 0 12px rgba(57, 255, 20, 0.1);
}

.now-playing-label {
  font-size: 0.5rem;
  color: var(--lime);
  letter-spacing: 0.15em;
  margin-bottom: 0.2rem;
}

.track-title {
  font-family: var(--font-graffiti);
  font-size: 0.85rem;
  color: var(--lime);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}

.track-artist {
  font-size: 0.55rem;
  color: #4a8a4a;
  margin-top: 0.1rem;
}

.vu-meter {
  display: flex;
  gap: 3px;
  margin-top: 0.4rem;
  height: 10px;
  align-items: flex-end;
}

.vu-meter span {
  flex: 1;
  background: #1a3a1a;
  border-radius: 1px;
}

.jukebox.playing .vu-meter span {
  animation: vu-bounce 0.4s ease-in-out infinite alternate;
}

.jukebox.playing .vu-meter span:nth-child(2) {
  animation-delay: 0.08s;
}
.jukebox.playing .vu-meter span:nth-child(3) {
  animation-delay: 0.16s;
}
.jukebox.playing .vu-meter span:nth-child(4) {
  animation-delay: 0.04s;
}
.jukebox.playing .vu-meter span:nth-child(5) {
  animation-delay: 0.12s;
}

@keyframes vu-bounce {
  from {
    height: 3px;
    background: #2a5a2a;
  }
  to {
    height: 10px;
    background: var(--lime);
    box-shadow: 0 0 4px var(--lime);
  }
}

.track-list {
  list-style: none;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 0.45rem;
  scrollbar-width: thin;
  scrollbar-color: var(--banana) transparent;
}

.track-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.65rem;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s;
  color: var(--chalk-dim);
}

.track-list li:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--chalk);
}

.track-list li.active {
  background: rgba(241, 206, 5, 0.15);
  color: var(--banana);
}

.track-list li .num {
  font-family: var(--font-display);
  font-size: 0.5rem;
  color: var(--magenta);
  min-width: 16px;
}

.track-list li .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jukebox-controls {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.jukebox-controls button {
  font-family: var(--font-display);
  font-size: 0.65rem;
  padding: 0.45rem 0.65rem;
  background: linear-gradient(180deg, #444 0%, #222 100%);
  color: var(--chalk);
  border: 2px solid #555;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

.jukebox-controls button:hover {
  background: linear-gradient(180deg, #555 0%, #333 100%);
}

.jukebox-controls button:active {
  transform: scale(0.95);
}

#btn-play {
  background: linear-gradient(180deg, var(--banana) 0%, var(--banana-dark) 100%);
  color: #1a0800;
  border-color: var(--banana-dark);
  min-width: 48px;
}

.jukebox-base {
  height: 10px;
  background: linear-gradient(180deg, #2a2a2a 0%, #111 100%);
  border-radius: 0 0 4px 4px;
  margin: 0 -0.2rem -0.2rem;
}

/* ── Footer ── */

.floor-sign {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
}

.banana-mark {
  width: 32px;
  height: auto;
  filter: drop-shadow(0 0 6px rgba(241, 206, 5, 0.5));
  opacity: 0.85;
}

.floor-sign p {
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 228, 217, 0.45);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .menu-board {
    top: auto;
    bottom: 5rem;
    left: 1rem;
    width: calc(50% - 1.25rem);
  }

  .jukebox {
    top: auto;
    bottom: 5rem;
    right: 1rem;
    width: calc(50% - 1.25rem);
  }

  .bg-layer {
    background-position: 55% center;
  }
}

@media (max-width: 600px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
  }

  .scene {
    position: absolute;
    min-height: 100vh;
  }

  .menu-board,
  .jukebox {
    position: relative;
    width: calc(100% - 2rem);
    margin: 0 auto 1rem;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
  }

  .menu-board {
    margin-top: 62vh;
  }

  .floor-sign {
    position: relative;
    transform: none;
    padding: 1.5rem 1rem 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-layer,
  .bg-glow,
  .bg-flicker {
    animation: none;
  }
}