/* Picazzo FM — cassette deck (lobby) and compact player (games) */

.pz-deck, .pz-mini {
  --pz-pink: #ff3ea5;
  --pz-cyan: #3ff0ff;
  --pz-yellow: #ffe45c;
  --pz-tube: #fff4fb;
  --pz-dim: #8a7fb0;
  --pz-off: #3a3160;
  --pz-panel: #0a0618;
  font-family: "VT323", "Courier New", ui-monospace, monospace;
  color: var(--pz-tube);
  line-height: 1.2;
}
.pz-deck button, .pz-mini button {
  font: inherit; cursor: pointer; margin: 0;
  background: transparent; color: var(--pz-cyan);
  border: 1.5px solid var(--pz-cyan); border-radius: 7px;
  text-shadow: 0 0 6px var(--pz-cyan); box-shadow: none;
}
.pz-deck button:hover, .pz-mini button:hover { background: rgba(63, 240, 255, .15); color: var(--pz-tube); }
.pz-deck button:focus-visible, .pz-mini button:focus-visible,
.pz-deck input:focus-visible, .pz-mini input:focus-visible { outline: 2px solid var(--pz-tube); outline-offset: 2px; }

/* Volume slider */
.pz-deck .pz-vol, .pz-mini .pz-vol { -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; min-width: 0; margin: 0; padding: 0; border: 0; box-shadow: none; border-radius: 0; }
.pz-vol::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--pz-cyan), var(--pz-pink)); }
.pz-vol::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--pz-cyan), var(--pz-pink)); }
.pz-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: var(--pz-tube); box-shadow: 0 0 6px var(--pz-pink); border: 0; }
.pz-vol::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--pz-tube); box-shadow: 0 0 6px var(--pz-pink); border: 0; }

/* Reels */
.pz-reel { display: block; }
.pz-tapewind { fill: #2a1a14; stroke: #5b3a2c; stroke-width: 1; }
.pz-hub { fill: #e9e3f5; }
.pz-spokes rect { fill: #2a2140; }
.pz-spokes { transform-origin: 0 0; }
[data-state="playing"] .pz-spokes { animation: pz-spin 1.6s linear infinite; }
@keyframes pz-spin { to { transform: rotate(-360deg); } }

/* ---------- Floating cassette deck (lobby) ---------- */
.pz-deck {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  width: min(300px, calc(100vw - 32px));
}
.pz-body {
  background: var(--pz-panel);
  border: 2px solid var(--pz-pink); border-radius: 14px;
  box-shadow: 0 0 8px var(--pz-pink), 0 0 26px rgba(255, 62, 165, .4), inset 0 0 16px rgba(255, 62, 165, .15);
  padding: 10px 12px 8px;
  display: grid; gap: 8px;
  box-sizing: border-box;
}
.pz-body > * { min-width: 0; }
.pz-deck *, .pz-mini * { box-sizing: border-box; }
.pz-head { display: flex; align-items: center; gap: 8px; }
.pz-brand { font-family: "Monoton", Impact, sans-serif; font-size: 1.05rem; letter-spacing: .06em;
  color: var(--pz-tube); text-shadow: 0 0 6px var(--pz-pink), 0 0 14px var(--pz-pink); }
.pz-led { width: 8px; height: 8px; border-radius: 50%; background: var(--pz-off); margin-left: auto; }
[data-state="playing"] .pz-led { background: #ff3b3b; box-shadow: 0 0 8px #ff3b3b; }
.pz-close { width: 30px; height: 24px; padding: 0; font-size: 1.1rem; line-height: 1; }

.pz-cassette {
  background: linear-gradient(180deg, #2a2050, #17112e);
  border: 1.5px solid #4c3f80; border-radius: 10px;
  padding: 8px 10px 10px; position: relative;
}
.pz-label {
  background: linear-gradient(180deg, var(--pz-yellow) 0 34%, var(--pz-pink) 34% 66%, var(--pz-cyan) 66%);
  border-radius: 4px; padding: 3px 8px 4px;
  display: flex; flex-direction: column; color: #140a24;
}
.pz-side { font-size: .85rem; opacity: .75; }
.pz-title { font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-state="waiting"] .pz-title { animation: pz-blink 1.2s steps(2, start) infinite; }
@keyframes pz-blink { to { visibility: hidden; } }
.pz-window {
  margin: 8px auto 0; width: 72%; height: 40px; border-radius: 20px;
  background: #0c0818; border: 1.5px solid #4c3f80;
  display: flex; align-items: center; justify-content: space-between; padding: 0 6px; position: relative;
}
.pz-window .pz-reel { width: 34px; height: 34px; position: relative; z-index: 1; }
.pz-tapeline { position: absolute; left: 24px; right: 24px; bottom: 5px; height: 2px; background: #5b3a2c; }

.pz-eq { width: 100%; height: 34px; display: block; }
.pz-row { display: flex; align-items: center; gap: 8px; }
.pz-row button { width: 42px; height: 32px; padding: 0; font-size: 1.1rem; }
.pz-row .pz-play { color: var(--pz-yellow); border-color: var(--pz-yellow); text-shadow: 0 0 6px var(--pz-yellow); }
.pz-row .pz-vol { flex: 1 1 40px; width: 40px; }
.pz-time { font-size: 1rem; white-space: nowrap; color: var(--pz-dim); font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }
.pz-note { margin: 0; font-size: .95rem; color: var(--pz-dim); }

/* Minimized: just a glowing tape button */
.pz-open {
  display: none; width: 60px; height: 60px; border-radius: 50%; padding: 0; margin-left: auto !important;
  border: 2px solid var(--pz-pink) !important; background: var(--pz-panel) !important;
  box-shadow: 0 0 8px var(--pz-pink), 0 0 22px rgba(255, 62, 165, .45) !important;
  position: relative;
}
.pz-open .pz-reel { width: 34px; height: 34px; margin: 0 auto; }
.pz-open-tx { position: absolute; bottom: 3px; left: 0; right: 0; font-size: .8rem; color: var(--pz-pink); text-shadow: none; }
.pz-deck.pz-is-min { width: auto; }
.pz-deck.pz-is-min .pz-body { display: none; }
.pz-deck.pz-is-min .pz-open { display: block; }

/* Keep page content clear of the deck */
body.pz-has-deck { padding-bottom: 300px; }
body.pz-has-deck.pz-deck-min { padding-bottom: 90px; }

/* ---------- Compact player (games) ---------- */
#music-slot { display: flex; justify-content: center; min-width: 0; flex: 1 1 260px; }
.pz-mini {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%;
  padding: 3px 10px; border: 1px solid var(--pz-pink); border-radius: 999px; font-size: 1.05rem;
  background: var(--pz-panel); box-shadow: 0 0 8px rgba(255, 62, 165, .35);
}
.pz-mini button { width: 30px; height: 24px; padding: 0; font-size: .9rem; line-height: 1; border-width: 1px; }
.pz-mini .pz-play { color: var(--pz-yellow); border-color: var(--pz-yellow); text-shadow: 0 0 6px var(--pz-yellow); }
.pz-reels { display: inline-flex; gap: 1px; }
.pz-reels .pz-reel { width: 18px; height: 18px; }
.pz-mini .pz-title { color: var(--pz-dim); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 150px; }
[data-state="playing"].pz-mini .pz-title { color: var(--pz-tube); }
.pz-mini .pz-vol { width: 70px; }

@media (max-width: 520px) {
  body.pz-has-deck { padding-bottom: 290px; }
  .pz-mini .pz-vol { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  [data-state="playing"] .pz-spokes { animation: none; }
  [data-state="waiting"] .pz-title { animation: none; }
}
