:root {
  font-family: Georgia, "Times New Roman", serif;
  color: #241408;
  background: #160b06;
  --wood: #2b1409;
  --wood-dark: #140905;
  --gold: #c58a2f;
  --cream: #fff0bd;
  --red: #8e1e16;
  --black: #140f0a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #4b2410 0, #1b0d07 55%, #090403 100%);
}
button, input, select { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }

.jukebox-shell {
  width: min(1500px, 98%);
  margin: 14px auto 28px;
  border: 5px solid #8b5b24;
  border-radius: 44% 44% 24px 24px / 17% 17% 24px 24px;
  overflow: hidden;
  background: linear-gradient(90deg, #1d0d06, #3a1c0d 8%, #1c0d06 50%, #3a1c0d 92%, #1d0d06);
  box-shadow: 0 0 0 5px #2a160c, 0 16px 45px rgba(0,0,0,.7), inset 0 0 25px rgba(255,199,94,.25);
}

.jukebox-arch {
  position: relative;
  min-height: 315px;
  padding: 36px 5% 25px;
  border-bottom: 5px solid #9b671f;
  border-radius: 48% 48% 0 0 / 63% 63% 0 0;
  background:
    radial-gradient(ellipse at center 72%, rgba(255,248,202,.98) 0 43%, rgba(246,202,104,.98) 68%, rgba(111,27,13,.98) 69% 74%, rgba(27,11,5,.98) 75%),
    linear-gradient(90deg, #7d120e, #f6c95f 12%, #f4e4aa 21%, #f1c453 50%, #f4e4aa 79%, #f6c95f 88%, #7d120e);
  box-shadow: inset 0 -18px 25px rgba(0,0,0,.35), inset 0 0 0 8px rgba(255,224,143,.35);
}
.arch-title {
  text-align: center;
  font-size: clamp(32px, 5vw, 65px);
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .025em;
  color: #251305;
  text-shadow: 0 1px #fff1ad;
}
.now-playing {
  max-width: 860px;
  margin: 16px auto 0;
  text-align: center;
}
.now-label { margin: 0; color: #8c1912; font-weight: 700; font-style: italic; font-size: 20px; }
#nowArtist { margin: 4px 0 0; font-size: clamp(26px, 4vw, 47px); line-height: 1.05; }
#nowTitle { margin: 5px 0 4px; font-size: clamp(21px, 3vw, 35px); color: #781a14; line-height: 1.1; }
.now-details { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 20px; font-weight: 700; }
.now-details span:not(:empty)::before { content: "• "; }
.progress-row {
  display: grid;
  grid-template-columns: 48px minmax(130px, 1fr) 48px;
  align-items: center;
  gap: 10px;
  max-width: 680px;
  margin: 15px auto 0;
}
.progress-row input { width: 100%; accent-color: #8c1b13; }

.jukebox-body {
  display: grid;
  grid-template-columns: minmax(190px, 245px) minmax(0, 1fr) minmax(190px, 245px);
  gap: 13px;
  padding: 15px;
  background: linear-gradient(#1a0d07, #301508);
}
.side-panel, .selection-panel {
  border: 3px solid #8e6427;
  border-radius: 8px;
  background: linear-gradient(180deg, #17100b, #24150c);
  box-shadow: inset 0 0 0 2px #261409, 0 3px 10px rgba(0,0,0,.45);
}
.side-panel { padding: 13px; color: #f7d67f; }
.side-panel h2, .selection-head h2 {
  margin: 0 0 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 19px;
  color: #e7b84d;
}
.side-panel label { display: block; margin: 9px 0 5px; font-weight: 700; }
.side-panel input, .side-panel select {
  width: 100%; min-height: 44px; padding: 8px 9px;
  border: 2px solid #a8782c; border-radius: 3px;
  background: #fff3c8; color: #21150b;
}
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 8px 0 10px; }
.side-panel button, .control-deck button, .pagination button, .pagination a, .top-link {
  min-height: 43px;
  border: 2px solid #9c6d25;
  border-radius: 5px;
  padding: 8px 10px;
  color: #241308;
  background: linear-gradient(#fff3bd, #dca84c);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.28), 0 2px 3px rgba(0,0,0,.45);
  text-decoration: none;
  text-align: center;
}
.side-panel button:hover, .side-panel button:focus-visible,
.control-deck button:hover, .control-deck button:focus-visible,
.pagination button:hover, .pagination button:focus-visible, .pagination a:hover, .top-link:hover {
  background: linear-gradient(#ffd766, #b72d1e);
  color: #fff9d7;
  outline: none;
}
.wide-button { width: 100%; margin-top: 12px; }
.alphabet { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 10px 0; }
.alphabet button { min-height: 38px; padding: 5px; font-weight: 700; }
.alphabet button.active { color: #fff; background: linear-gradient(#b42d1e, #6c130d); }
.alphabet .space-key { grid-column: span 2; }

.selection-panel { min-width: 0; padding: 11px; }
.selection-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 3px 8px 10px; }
.selection-head h2 { margin: 0; }
.selection-head p { margin: 0; color: #e8c873; font-size: 14px; text-align: right; }
.title-sheet { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; align-items:start; }
.title-strip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  border: 2px solid #a97b33;
  border-radius: 4px;
  overflow: hidden;
  background: #fff0bd;
  box-shadow: 0 2px 4px rgba(0,0,0,.5), inset 0 0 0 2px rgba(255,255,255,.4);
}
.title-strip.selected { border-color: #c92219; box-shadow: inset 0 0 0 3px #c92219, 0 2px 5px rgba(0,0,0,.55); }
.strip-play {
  display: grid;
  grid-template-columns:1fr;
  align-items: center;
  min-height:92px;
  border: 0;
  padding: 8px 7px;
  color: #1e1309;
  text-align: left;
  background: repeating-linear-gradient(0deg, rgba(113,76,26,.035) 0 1px, transparent 1px 4px), #fff0bd;
}
.strip-play:hover, .strip-play:focus-visible { background-color: #ffe397; outline: none; }
.strip-artist{padding:10px 12px 4px;font-weight:700;text-transform:none;font-size:18px;line-height:1.2;text-align:left;}
.strip-title{padding:0 12px 10px;font-size:17px;font-weight:700;line-height:1.25;text-align:left;}
.strip-favorite {
  width: 34px;
  min-height: 100%;
  border: 0;
  border-left: 1px solid #896127;
  padding: 3px;
  overflow: hidden;
  color: transparent;
  background: #f5d787;
  cursor: pointer;
}
.strip-favorite::after { content: "F"; color: #7c1811; font-weight: 700; font-size: 17px; }
.strip-favorite:hover, .strip-favorite:focus-visible { background: #bd2d20; outline: none; }
.strip-favorite:hover::after, .strip-favorite:focus-visible::after { color: #fff; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin: 15px 0 3px; color: #f5d47c; }
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination a { display: inline-flex; align-items: center; }

.favorites-panel p { text-align: center; margin: 0 0 10px; }
.favorites-list { display: grid; gap: 5px; max-height: 540px; overflow: auto; }
.favorites-list button {
  display: grid;
  min-height: 48px;
  width: 100%;
  padding: 6px 8px;
  text-align: left;
  color: #f8df9b;
  background: #21150d;
  border: 1px solid #65431c;
  box-shadow: none;
}
.favorites-list button strong, .favorites-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorites-list button span { font-size: 13px; color: #d9bd72; }
.favorites-actions { display: grid; gap: 7px; margin-top: 10px; }
.empty-small { color: #d6b86b; font-size: 14px; }
.empty { grid-column: 1 / -1; padding: 45px 20px; text-align: center; color: #f2d17c; }

.control-deck {
  display: grid;
  grid-template-columns: repeat(3, auto) minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 15px;
  border-top: 4px solid #8c6023;
  background: linear-gradient(#21110a, #110804);
}
.control-deck .main-control { color: #fff7cf; background: linear-gradient(#b42b1d, #67120d); }
.volume { display: grid; grid-template-columns: auto minmax(120px, 1fr); align-items: center; gap: 9px; color: #efcf78; }
.volume input { width: 100%; accent-color: #d2a23f; }
.top-link { display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 1100px) {
  .jukebox-body { grid-template-columns: 210px minmax(0, 1fr); }
  .favorites-panel { grid-column: 1 / -1; }
  .favorites-list { grid-template-columns: repeat(2, 1fr); max-height: 280px; }
  .control-deck { grid-template-columns: repeat(3, 1fr); }
  .volume { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .jukebox-shell { width: 100%; margin: 0; border-width: 2px; border-radius: 42% 42% 0 0 / 8% 8% 0 0; }
  .jukebox-arch { min-height: 285px; padding: 30px 18px 20px; border-radius: 46% 46% 0 0 / 45% 45% 0 0; }
  .arch-title { font-size: clamp(29px, 10vw, 48px); }
  .jukebox-body { grid-template-columns: 1fr; padding: 8px; }
  .search-panel, .favorites-panel { grid-column: auto; }
  .title-sheet { grid-template-columns: 1fr; }
  .selection-head { align-items: flex-start; flex-direction: column; }
  .selection-head p { text-align: left; }
  .favorites-list { grid-template-columns: 1fr; }
  .control-deck { grid-template-columns: 1fr 1fr; padding: 9px; }
  .control-deck .main-control, .volume { grid-column: auto; }
  .volume, #favoriteBtn, .top-link { grid-column: 1 / -1; }
  .strip-play { grid-template-columns: 42px minmax(90px, .85fr) minmax(105px, 1.2fr); min-height: 72px; }
}
@media (max-width: 430px) {
  .strip-play { grid-template-columns: 38px 1fr; grid-template-areas: "number artist" "number title"; }
    .strip-artist { grid-area: artist; padding-top: 4px; }
  .strip-title { grid-area: title; padding-bottom: 4px; }
  .alphabet { grid-template-columns: repeat(5, 1fr); }
}


/* v1.3: actieve zoekopdracht zichtbaar en bediening bovenaan */
.active-search {
  margin: 10px auto 0;
  width: fit-content;
  max-width: 90%;
  padding: 6px 18px;
  border: 1px solid #8d5d16;
  border-radius: 999px;
  background: rgba(255, 244, 202, .82);
  color: #2b1808;
  font-weight: 700;
}
.jukebox-arch + .control-deck {
  margin-top: 0;
  border-top: 0;
}


/* v1.9: lichte bladomslag boven de titelstrookjes */
.pagination-top {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #75501e;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(255,240,189,.10), rgba(0,0,0,.12));
}
.pagination-top span {
  min-width: 120px;
  text-align: center;
  font-weight: 700;
}
.sheet-stage {
  perspective: 1400px;
  overflow: hidden;
  border-radius: 5px;
}
.title-sheet {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
}
.title-sheet.turning-next {
  transform-origin: left center;
  animation: newspaperTurnNext .42s ease-in forwards;
}
.title-sheet.turning-previous {
  transform-origin: right center;
  animation: newspaperTurnPrevious .42s ease-in forwards;
}
.title-sheet.arrive-next {
  transform-origin: right center;
  animation: newspaperArriveNext .23s ease-out both;
}
.title-sheet.arrive-previous {
  transform-origin: left center;
  animation: newspaperArrivePrevious .23s ease-out both;
}
@keyframes newspaperTurnNext {
  0% { transform: rotateY(0deg) translateX(0); opacity: 1; }
  55% { transform: rotateY(-9deg) translateX(-1.5%); opacity: .78; }
  100% { transform: rotateY(-18deg) translateX(-5%); opacity: 0; }
}
@keyframes newspaperTurnPrevious {
  0% { transform: rotateY(0deg) translateX(0); opacity: 1; }
  55% { transform: rotateY(9deg) translateX(1.5%); opacity: .78; }
  100% { transform: rotateY(18deg) translateX(5%); opacity: 0; }
}
@keyframes newspaperArriveNext {
  from { transform: rotateY(13deg) translateX(4%); opacity: 0; }
  to { transform: rotateY(0deg) translateX(0); opacity: 1; }
}
@keyframes newspaperArrivePrevious {
  from { transform: rotateY(-13deg) translateX(-4%); opacity: 0; }
  to { transform: rotateY(0deg) translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .title-sheet.turning-next,
  .title-sheet.turning-previous,
  .title-sheet.arrive-next,
  .title-sheet.arrive-previous { animation: none; }
}


/* Jukebox scrollbar */
*{
  scrollbar-width: thin;
  scrollbar-color: #8c5a18 #2a1a10;
}
::-webkit-scrollbar{
  width:14px;
  height:14px;
}
::-webkit-scrollbar-track{
  background:#2a1a10;
  border-radius:8px;
}
::-webkit-scrollbar-thumb{
  background:#8c5a18;
  border:2px solid #2a1a10;
  border-radius:8px;
}
::-webkit-scrollbar-thumb:hover{
  background:#b37a2b;
}
::-webkit-scrollbar-corner{
  background:#2a1a10;
}


/* v2.5: rustigere titelstroken, bediening en speler */
#nowTitle:empty { display: none; }

/* Gelijke breedte voor de drie hoofdknoppen */
.control-deck > #prevBtn,
.control-deck > #playBtn,
.control-deck > #nextBtn {
  width: 112px;
  min-width: 112px;
}

/* Eigen jukebox-stijl voor voortgang en volume */
.progress-row input[type="range"],
.volume input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  height: 8px;
  border: 1px solid #76501d;
  border-radius: 999px;
  background: linear-gradient(180deg, #f5dfa0, #c89538);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.55), 0 1px rgba(255,246,197,.35);
  outline: none;
}
.progress-row input[type="range"]::-webkit-slider-thumb,
.volume input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #68150f;
  border-radius: 50%;
  background: linear-gradient(#c83b28, #7f170f);
  box-shadow: 0 1px 3px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.35);
}
.progress-row input[type="range"]::-moz-range-thumb,
.volume input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #68150f;
  border-radius: 50%;
  background: linear-gradient(#c83b28, #7f170f);
  box-shadow: 0 1px 3px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.35);
}

/* Titelstrookjes: iets hoger en meer ruimte tussen artiest en titel */
.strip-play {
  min-height: 106px;
  align-content: center;
  row-gap: 9px;
  padding: 12px 10px;
}
.strip-artist {
  padding: 0 12px;
  font-size: 18px;
  line-height: 1.18;
}
.strip-title {
  padding: 0 12px;
  font-size: 17px;
  line-height: 1.28;
}

/* Favorieten sluiten visueel aan op de papieren titelstroken */
.favorites-list { gap: 7px; }
.favorites-list button {
  min-height: 58px;
  padding: 8px 10px;
  color: #21150b;
  background: repeating-linear-gradient(0deg, rgba(113,76,26,.035) 0 1px, transparent 1px 4px), #fff0bd;
  border: 1px solid #a97b33;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 1px 3px rgba(0,0,0,.45);
}
.favorites-list button strong {
  color: #261408;
  font-size: 15px;
}
.favorites-list button span {
  margin-top: 3px;
  color: #6f3515;
  font-size: 13px;
}
.favorites-list button:hover,
.favorites-list button:focus-visible {
  color: #21150b;
  background: #ffe397;
  border-color: #c58a2f;
  outline: none;
}

@media (max-width: 760px) {
  .control-deck > #prevBtn,
  .control-deck > #playBtn,
  .control-deck > #nextBtn {
    width: 100%;
    min-width: 0;
  }
  .strip-play {
    min-height: 92px;
    grid-template-columns: 1fr;
    row-gap: 7px;
  }
}
@media (max-width: 430px) {
  .strip-play {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }
  .strip-artist,
  .strip-title { grid-area: auto; }
}


/* v2.6: automatische aanvulling bij het openen */
.scan-notice {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-height: 24px;
  margin: 0;
  color: #e8c873;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}
.scan-notice[hidden] { display: none; }
.scan-note {
  display: inline-block;
  color: #d6a63f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1;
  transform-origin: 50% 52%;
}
.scan-notice.is-scanning .scan-note {
  animation: jukeboxNoteTurn 1.15s linear infinite;
}
.scan-notice.is-done { color: #e8c873; }
.scan-notice.is-error { color: #f0a58d; }
@keyframes jukeboxNoteTurn {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .scan-notice.is-scanning .scan-note { animation: none; }
}
