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

html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  background: var(--bg);
  color: var(--tekst);
  font-size: 14px;
  line-height: 1.5;
  font-family: var(--font, "Segoe UI", system-ui, sans-serif);
  transition:
    background 0.2s,
    color 0.2s;
}

.sc_samo {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

#apl_stol {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

#stol_sb {
  width: 300px;
  min-width: 300px;
  height: 100vh;
  background: var(--povrsina);
  border-right: 1px solid var(--rub);
  display: flex;
  flex-direction: column;
}

#stol_sb_vrh {
  flex-shrink: 0;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--rub);
}

#stol_sb_red {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#stol_sb_red h1 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--prigus);
}

#stol_broj {
  font-size: 11px;
  color: var(--prigus);
}

#stol_lista {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 4px 0;
}

#stol_lista::-webkit-scrollbar {
  width: 4px;
}
#stol_lista::-webkit-scrollbar-thumb {
  background: var(--rub);
  border-radius: 2px;
}

#stol_lista li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.1s;
}

#stol_lista li:hover {
  background: rgba(128, 128, 128, 0.1);
}
#stol_lista li.aktivan {
  background: rgba(128, 128, 128, 0.13);
  background: color-mix(in srgb, var(--naglasak) 15%, transparent);
}
#stol_lista li.aktivan .red_naziv {
  color: var(--naglasak);
}

#stol_glavni {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

#stol_repro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 520px;
}

#stol_slika_omot {
  width: min(100%, calc(100vh - 270px));
  aspect-ratio: 1;
  border-radius: var(--radijus);
  overflow: hidden;
  background: var(--povrsina);
  border: 1px solid var(--rub);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#stol_slika {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#stol_slika[hidden] {
  display: none;
}
#stol_slika_ph {
  font-size: 72px;
  color: var(--rub);
  user-select: none;
}

#stol_info {
  text-align: center;
  width: 100%;
}
#stol_naziv {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#stol_izv {
  font-size: 14px;
  color: var(--prigus);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#stol_alb {
  font-size: 12px;
  color: var(--prigus);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#stol_ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
}

#stol_ctrl button {
  background: none;
  border: none;
  color: var(--prigus);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.15s,
    background 0.15s;
}

#stol_ctrl button:hover {
  color: var(--tekst);
  background: rgba(128, 128, 128, 0.12);
}

#stol_play {
  font-size: 22px !important;
  color: var(--naglasak_fg) !important;
  background: var(--naglasak) !important;
  width: 50px;
  height: 50px;
  border-radius: 50% !important;
}
#stol_play:hover {
  opacity: 0.85;
}

#stol_mij[aria-pressed="true"],
#stol_pon[aria-pressed="true"] {
  color: var(--naglasak);
}

#stol_traka_omot {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

#stol_vrij_sad,
#stol_vrij_kraj {
  font-size: 11px;
  color: var(--prigus);
  min-width: 34px;
  font-variant-numeric: tabular-nums;
}
#stol_vrij_kraj {
  text-align: right;
}

#stol_glas_omot {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 220px;
}

#stol_glas_ik {
  font-size: 16px;
  user-select: none;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s;
}
#stol_glas_ik:hover {
  opacity: 1;
}

#stol_glas {
  flex: 1;
  height: 5px !important;
  background: linear-gradient(
    to right,
    var(--naglasak) 0%,
    var(--naglasak) var(--vol_posto, 100%),
    var(--rub) var(--vol_posto, 100%),
    var(--rub) 100%
  ) !important;
  border-radius: 3px !important;
}

#stol_glas::-webkit-slider-thumb {
  width: 14px !important;
  height: 14px !important;
  background: var(--tekst) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
#stol_glas::-moz-range-thumb {
  width: 14px !important;
  height: 14px !important;
  background: var(--tekst) !important;
  border: none;
}
#stol_glas:hover::-webkit-slider-thumb,
#stol_glas:hover::-moz-range-thumb {
  background: var(--naglasak) !important;
}

#stol_tema_omot {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 100;
}

#stol_tema_gumb {
  background: var(--povrsina2);
  border: 1px solid var(--rub);
  color: var(--prigus);
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
  line-height: 1;
}
#stol_tema_gumb:hover {
  border-color: var(--naglasak);
}

#stol_tema_pop {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--povrsina);
  border: 1px solid var(--rub);
  border-radius: var(--radijus);
  padding: 12px;
  width: 170px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
#stol_tema_pop.otvoren {
  display: block;
}

#stol_tema_pop h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--prigus);
  margin-bottom: 10px;
}

#stol_tema_lista {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#apl_mob {
  display: none;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg);
}

#mob_player {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px 10px;
  gap: 10px;
}

#mob_slika_omot {
  width: min(80vw, 280px);
  aspect-ratio: 1;
  border-radius: var(--radijus);
  overflow: hidden;
  background: var(--povrsina);
  border: 1px solid var(--rub);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#mob_slika {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#mob_slika[hidden] {
  display: none;
}
#mob_slika_ph {
  font-size: 52px;
  color: var(--rub);
  user-select: none;
}

#mob_info {
  text-align: center;
  width: 100%;
}
#mob_naziv {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#mob_izv {
  font-size: 13px;
  color: var(--prigus);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#mob_ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#mob_ctrl button {
  background: none;
  border: none;
  color: var(--prigus);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

#mob_ctrl button:active {
  background: rgba(128, 128, 128, 0.12);
}

#mob_play {
  font-size: 22px !important;
  color: var(--naglasak_fg) !important;
  background: var(--naglasak) !important;
  width: 52px;
  height: 52px;
  border-radius: 50% !important;
}

#mob_mij[aria-pressed="true"],
#mob_pon[aria-pressed="true"] {
  color: var(--naglasak);
}

#mob_traka_omot {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#mob_vrij_sad,
#mob_vrij_kraj {
  font-size: 11px;
  color: var(--prigus);
  min-width: 30px;
  font-variant-numeric: tabular-nums;
}
#mob_vrij_kraj {
  text-align: right;
}

#mob_knjiz {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--povrsina);
  border-top: 1px solid var(--rub);
  overflow: hidden;
}

#mob_knjiz_vrh {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rub);
}

#mob_broj {
  font-size: 11px;
  color: var(--prigus);
  white-space: nowrap;
}

#mob_lista {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

#mob_lista::-webkit-scrollbar {
  width: 3px;
}
#mob_lista::-webkit-scrollbar-thumb {
  background: var(--rub);
  border-radius: 2px;
}

#mob_lista li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(128, 128, 128, 0.06);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
}

#mob_lista li:active {
  background: rgba(128, 128, 128, 0.08);
}
#mob_lista li.aktivan {
  background: rgba(128, 128, 128, 0.11);
  background: color-mix(in srgb, var(--naglasak) 12%, transparent);
}
#mob_lista li.aktivan .red_naziv {
  color: var(--naglasak);
}

#mob_tema_gumb {
  flex-shrink: 0;
  background: var(--povrsina2);
  border: 1px solid var(--rub);
  color: var(--prigus);
  font-size: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

#tema_ladica {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--povrsina);
  border-top: 1px solid var(--rub);
  border-radius: 16px 16px 0 0;
  padding: 12px 16px 28px;
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.28s ease;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.4);
}
#tema_ladica.otvoren {
  transform: translateY(0);
}

#tema_ladica::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  background: var(--rub);
  border-radius: 2px;
  margin: 0 auto 12px;
}

#tema_ladica h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--prigus);
  text-align: center;
  margin-bottom: 14px;
}

#mob_tema_lista {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#tema_overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
}
#tema_overlay.otvoren {
  display: block;
}

.slk_mala {
  width: 38px;
  height: 38px;
  border-radius: calc(var(--radijus) / 2);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--povrsina2);
  display: block;
}
.slk_ph {
  width: 38px;
  height: 38px;
  border-radius: calc(var(--radijus) / 2);
  background: var(--povrsina2);
  border: 1px solid var(--rub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--rub);
  flex-shrink: 0;
}
.mob_slk {
  width: 34px;
  height: 34px;
  border-radius: calc(var(--radijus) / 2);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--povrsina2);
  display: block;
}
.mob_slk_ph {
  width: 34px;
  height: 34px;
  border-radius: calc(var(--radijus) / 2);
  background: var(--povrsina2);
  border: 1px solid var(--rub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--rub);
  flex-shrink: 0;
}

.red_ {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}
.red_naziv {
  font-size: 13px;
  font-weight: 500;
  color: var(--tekst);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.red_izv {
  font-size: 11px;
  color: var(--prigus);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

input[type="search"] {
  flex: 1;
  min-width: 0;
  background: var(--povrsina2);
  border: 1px solid var(--rub);
  border-radius: calc(var(--radijus) / 2);
  padding: 5px 10px;
  color: var(--tekst);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input[type="search"]:focus {
  border-color: var(--naglasak);
}
input[type="search"]::placeholder {
  color: var(--prigus);
}

#stol_otv,
#mob_otv {
  padding: 4px 10px;
  background: var(--naglasak);
  color: var(--naglasak_fg);
  font-weight: 700;
  font-size: 12px;
  border-radius: calc(var(--radijus) / 2);
  cursor: pointer;
  transition: opacity 0.15s;
  user-select: none;
  white-space: nowrap;
  display: inline-block;
}
#stol_otv:hover,
#mob_otv:hover {
  opacity: 0.82;
}
#stol_otv_ulaz,
#mob_otv_ulaz {
  display: none;
}
#mob_otv {
  flex-shrink: 0;
  padding: 5px 10px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: var(--trak_vis, 3px);
  background: var(--rub);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: var(--palac_r, 50%);
  background: var(--tekst);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: var(--palac_r, 50%);
  background: var(--tekst);
  border: none;
}
input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:hover::-moz-range-thumb {
  background: var(--naglasak);
}

.tema_btn {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: calc(var(--radijus) - 2px);
  background: none;
  cursor: pointer;
  color: var(--tekst);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  transition:
    background 0.1s,
    border-color 0.1s;
  width: 100%;
}
.tema_btn:hover {
  background: rgba(128, 128, 128, 0.1);
}
.tema_btn.aktivan {
  border-color: var(--naglasak);
  color: var(--naglasak);
}

@media (max-width: 700px) {
  #apl_stol {
    display: none;
  }
  #apl_mob {
    display: flex;
  }
}

#stol_fmt {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 6px;
  min-height: 22px;
}

.fmt_znacka {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--povrsina2);
  border: 1px solid var(--rub);
  color: var(--prigus);
  font-family: "SF Mono", "Consolas", monospace;
}

.fmt_ext {
  color: var(--naglasak);
  border-color: var(--naglasak);
  background: rgba(128, 128, 128, 0.06);
}

.fmt_size {
  opacity: 0.7;
}

#stol_glas_ik i {
  font-size: inherit;
}
