@font-face {
  font-family: 'Silkscreen';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/silkscreen-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'PT Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ptmono-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'PT Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ptmono-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'PT Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ptmono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'PT Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ptmono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html, body {
  height: 100%;
}

body {
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Silkscreen', monospace;
  overflow: auto;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 1px,
    transparent 1px,
    transparent 3px
  );
}

.player {
  width: 380px;
  background: #2a2a2a;
  border-top: 2px solid #4a4a4a;
  border-left: 2px solid #4a4a4a;
  border-right: 2px solid #1a1a1a;
  border-bottom: 2px solid #1a1a1a;
  user-select: none;
}

/* TITLE BAR */
.titlebar {
  background: linear-gradient(90deg, #3a4a3a 0%, #1a2a1a 100%);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #0a0a0a;
}

.titlebar-text {
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #00ff66;
  text-shadow: 0 0 4px #00ff66, 0 0 8px #00cc44;
}

.titlebar-controls {
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  color: #00aa44;
  letter-spacing: 3px;
  cursor: default;
}

/* LCD DISPLAY */
.display {
  background: #0a1a0a;
  margin: 6px;
  border-top: 2px solid #0a0a0a;
  border-left: 2px solid #0a0a0a;
  border-right: 2px solid #4a4a4a;
  border-bottom: 2px solid #4a4a4a;
  box-shadow: inset 0 0 20px rgba(0,255,100,0.1);
  padding: 4px 6px;
  overflow: hidden;
}

.display-marquee-wrap {
  overflow: hidden;
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
}

.display-marquee {
  white-space: nowrap;
  font-family: 'PT Mono', monospace;
  font-size: 22px;
  color: #00ff66;
  text-shadow: 0 0 4px #00ff66, 0 0 8px #00cc44;
  display: inline-block;
}

@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(var(--marquee-offset)); }
}

.display-marquee.scrolling {
  animation: marquee-scroll var(--marquee-duration, 8s) linear infinite;
}

#visualizer {
  display: block;
  width: 100%;
  height: 50px;
  margin: 4px 0;
}

.display-meta {
  font-family: 'PT Mono', monospace;
  font-size: 14px;
  color: #00aa44;
  white-space: nowrap;
  overflow: hidden;
}

/* CONTROLS ROW */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  gap: 6px;
}

.transport {
  display: flex;
  gap: 4px;
}

.btn {
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  color: #cccccc;
  background: linear-gradient(180deg, #3a3a3a 0%, #1a1a1a 100%);
  border-top: 2px solid #5a5a5a;
  border-left: 2px solid #5a5a5a;
  border-right: 2px solid #0a0a0a;
  border-bottom: 2px solid #0a0a0a;
  padding: 4px 8px;
  cursor: pointer;
  min-width: 32px;
  text-align: center;
  line-height: 1;
  outline: none;
}

.btn:active {
  border-top: 2px solid #0a0a0a;
  border-left: 2px solid #0a0a0a;
  border-right: 2px solid #5a5a5a;
  border-bottom: 2px solid #5a5a5a;
  background: linear-gradient(180deg, #1a1a1a 0%, #3a3a3a 100%);
}

.btn:focus-visible {
  outline: 1px solid #00ff66;
  outline-offset: 1px;
}

.btn-play {
  min-width: 40px;
  color: #00ff66;
}

/* VOLUME */
.volume-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  justify-content: flex-end;
}

.vol-label {
  font-family: 'Silkscreen', monospace;
  font-size: 9px;
  color: #00aa44;
  letter-spacing: 1px;
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 8px;
  background: #0a0a0a;
  border-top: 1px solid #0a0a0a;
  border-left: 1px solid #0a0a0a;
  border-right: 1px solid #4a4a4a;
  border-bottom: 1px solid #4a4a4a;
  outline: none;
  cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 16px;
  background: linear-gradient(180deg, #5a5a5a 0%, #2a2a2a 100%);
  border-top: 2px solid #7a7a7a;
  border-left: 2px solid #7a7a7a;
  border-right: 2px solid #0a0a0a;
  border-bottom: 2px solid #0a0a0a;
  cursor: pointer;
}

.vol-slider::-moz-range-thumb {
  width: 12px;
  height: 16px;
  background: linear-gradient(180deg, #5a5a5a 0%, #2a2a2a 100%);
  border-top: 2px solid #7a7a7a;
  border-left: 2px solid #7a7a7a;
  border-right: 2px solid #0a0a0a;
  border-bottom: 2px solid #0a0a0a;
  cursor: pointer;
  border-radius: 0;
}

.vol-slider:focus-visible {
  outline: 1px solid #00ff66;
}

.vol-led {
  width: 8px;
  height: 8px;
  background: #00aa44;
  border-radius: 50%;
  box-shadow: 0 0 4px #00ff66;
  flex-shrink: 0;
}

.vol-led.active {
  background: #00ff66;
  box-shadow: 0 0 6px #00ff66, 0 0 12px #00cc44;
}

/* SEEK BAR */
.seekbar-wrap {
  padding: 2px 8px 8px;
}

.seekbar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #0a0a0a;
  border-top: 1px solid #0a0a0a;
  border-left: 1px solid #0a0a0a;
  border-right: 1px solid #4a4a4a;
  border-bottom: 1px solid #4a4a4a;
  outline: none;
  cursor: pointer;
  display: block;
}

.seekbar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 14px;
  background: linear-gradient(180deg, #5a5a5a 0%, #2a2a2a 100%);
  border-top: 2px solid #7a7a7a;
  border-left: 2px solid #7a7a7a;
  border-right: 2px solid #0a0a0a;
  border-bottom: 2px solid #0a0a0a;
  cursor: pointer;
}

.seekbar::-moz-range-thumb {
  width: 10px;
  height: 14px;
  background: linear-gradient(180deg, #5a5a5a 0%, #2a2a2a 100%);
  border-top: 2px solid #7a7a7a;
  border-left: 2px solid #7a7a7a;
  border-right: 2px solid #0a0a0a;
  border-bottom: 2px solid #0a0a0a;
  cursor: pointer;
  border-radius: 0;
}

.seekbar::-webkit-slider-runnable-track {
  background: linear-gradient(
    90deg,
    #00aa44 0%,
    #00aa44 var(--seek-progress, 0%),
    #0a0a0a var(--seek-progress, 0%),
    #0a0a0a 100%
  );
  height: 8px;
}

.seekbar::-moz-range-progress {
  background: #00aa44;
  height: 8px;
}

.seekbar:focus-visible {
  outline: 1px solid #00ff66;
}

/* PLAYLIST */
.playlist {
  margin: 0 6px 6px;
  border-top: 2px solid #1a1a1a;
}

.playlist-header {
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #00aa44;
  padding: 5px 6px 3px;
  border-bottom: 1px solid #1a1a1a;
}

.playlist-row {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  cursor: pointer;
  font-family: 'PT Mono', monospace;
  font-size: 16px;
  color: #888888;
  gap: 4px;
  border-bottom: 1px solid #1a1a1a;
  outline: none;
}

.playlist-row:hover {
  background: #222222;
}

.playlist-row:focus-visible {
  outline: 1px solid #00ff66;
  outline-offset: -1px;
}

.playlist-row.active {
  color: #00ff66;
  background: rgba(0,255,102,0.05);
  text-shadow: 0 0 4px #00ff66;
}

.pl-arrow {
  width: 12px;
  flex-shrink: 0;
  color: #00ff66;
  text-shadow: 0 0 4px #00ff66;
}

.pl-num {
  flex-shrink: 0;
  width: 18px;
}

.pl-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-duration {
  flex-shrink: 0;
  color: inherit;
  margin-left: 6px;
}

.pl-download {
  flex-shrink: 0;
  color: #555555;
  text-decoration: none;
  padding: 0 2px;
  font-family: 'Silkscreen', monospace;
  font-size: 10px;
  margin-left: 6px;
  line-height: 1;
}

.pl-download:hover {
  color: #00ff66;
  text-shadow: 0 0 4px #00ff66;
}

.playlist-row.active .pl-download {
  color: #00aa44;
}
