:root {
  color-scheme: dark;
  --black: #030303;
  --panel: #0b0b0b;
  --panel-soft: #121212;
  --line: #3c3c3c;
  --red: #dc1721;
  --red-dark: #610007;
  --yellow: #ffd21c;
  --white: #f4f4f4;
  --muted: #d0d0d0;
}

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

html {
  min-width: 320px;
  background: var(--black);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--white);
  background:
    repeating-linear-gradient(135deg, rgba(220, 23, 33, 0.06) 0 1px, transparent 1px 10px),
    #030303;
  font-family: Tahoma, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.9);
  border-inline: 1px solid #2b0003;
}

.topbar {
  display: flex;
  min-height: 64px;
  padding: 8px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background:
    repeating-linear-gradient(135deg, #250002 0 8px, #0a0a0a 8px 16px);
  border-bottom: 2px solid var(--red);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  color: var(--yellow);
  background: #090909;
  border: 2px solid var(--red);
  box-shadow: inset 0 0 0 2px #310004;
  place-items: center;
  font-family: "Courier New", monospace;
  font-size: 24px;
  font-weight: 900;
}

.brand-lockup h1 {
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
}

.brand-lockup p {
  margin-top: 4px;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.signal {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #d9d9d9;
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
}

.signal span {
  width: 8px;
  height: 8px;
  background: #37d36b;
  border-radius: 50%;
  box-shadow: 0 0 7px #37d36b;
}

.archive-layout {
  display: grid;
  grid-template-columns: 230px minmax(420px, 1fr) 310px;
  min-height: 620px;
}

.filters,
.player-panel {
  background: rgba(7, 7, 7, 0.97);
}

.filters {
  border-right: 1px solid var(--line);
}

.player-panel {
  border-left: 1px solid var(--line);
}

.panel-title {
  display: flex;
  height: 30px;
  padding: 6px 9px;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(90deg, #690006, #c6121b 72%, #2f2000);
  border-bottom: 2px solid var(--yellow);
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
}

.search-box {
  display: grid;
  padding: 12px 10px;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.search-box input,
.toolbar-actions select {
  min-width: 0;
  color: #fff;
  background: #111;
  border: 1px solid #555;
  border-radius: 0;
  outline: none;
}

.search-box input {
  width: 100%;
  height: 34px;
  padding: 0 9px;
}

.search-box input:focus,
.toolbar-actions select:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px var(--red);
}

.filter-list {
  display: grid;
  border-top: 1px solid #292929;
}

.filter-button {
  display: flex;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  align-items: center;
  justify-content: space-between;
  color: #ddd;
  background: transparent;
  border: 0;
  border-bottom: 1px dotted #3a3a3a;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}

.filter-button span {
  color: #b8b8b8;
  font-family: "Courier New", monospace;
  font-size: 9px;
}

.filter-button:hover,
.filter-button.is-active {
  color: #fff;
  background: #2d0003;
  box-shadow: inset 4px 0 var(--red);
}

.filter-button.is-active span {
  color: var(--yellow);
}

.archive-note {
  margin: 14px 10px;
  padding: 9px;
  color: #d0d0d0;
  background: #0e0e0e;
  border: 1px dashed #650008;
  font-size: 10px;
  line-height: 1.4;
}

.archive-note strong {
  color: var(--yellow);
  font-family: "Courier New", monospace;
  font-size: 9px;
}

.archive-note p {
  margin-top: 5px;
}

.track-browser {
  min-width: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    #090909;
}

.browser-toolbar {
  display: flex;
  min-height: 72px;
  padding: 12px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.toolbar-kicker {
  color: var(--red);
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
}

.browser-toolbar h2 {
  margin-top: 3px;
  font-family: "Courier New", monospace;
  font-size: 19px;
  text-transform: uppercase;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-actions select {
  height: 31px;
  padding: 0 28px 0 8px;
  font-size: 10px;
}

.icon-button {
  width: 32px;
  height: 31px;
  color: var(--yellow);
  background: #1a0002;
  border: 1px solid var(--red);
  font-size: 17px;
}

.icon-button:hover {
  color: #fff;
  background: #5d0007;
}

.track-columns,
.track-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 135px 46px;
  align-items: center;
}

.track-columns {
  min-height: 27px;
  padding: 0 8px 0 14px;
  color: #bcbcbc;
  background: #0e0e0e;
  border-bottom: 1px solid #333;
  font-family: "Courier New", monospace;
  font-size: 8px;
  font-weight: 900;
}

.track-list {
  max-height: 520px;
  overflow-y: auto;
}

.track-row {
  width: 100%;
  min-height: 54px;
  padding: 5px 8px 5px 14px;
  color: #ddd;
  background: transparent;
  border: 0;
  border-bottom: 1px dotted #3b3b3b;
  text-align: left;
}

.track-row:hover,
.track-row.is-selected {
  background: #230003;
}

.track-row.is-selected {
  box-shadow: inset 4px 0 var(--red);
}

.track-name {
  min-width: 0;
  padding-right: 8px;
}

.track-name,
.track-release,
.track-duration {
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.track-name strong,
.track-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-name strong {
  color: #fff;
  font-size: 12px;
}

.track-name span {
  margin-top: 3px;
  color: #c2c2c2;
  font-size: 9px;
}

.track-release {
  color: #c8c8c8;
  font-size: 9px;
}

.track-duration {
  color: var(--yellow);
  font-family: "Courier New", monospace;
  font-size: 9px;
}

.empty-state {
  padding: 45px 20px;
  color: #c2c2c2;
  font-family: "Courier New", monospace;
  font-size: 11px;
  text-align: center;
}

.track-list::-webkit-scrollbar {
  width: 10px;
}

.track-list::-webkit-scrollbar-track {
  background: #070707;
}

.track-list::-webkit-scrollbar-thumb {
  background: #5f0006;
  border: 2px solid #070707;
}

.album-art {
  position: relative;
  margin: 14px;
  aspect-ratio: 1;
  overflow: hidden;
  background: #160002;
  border: 2px solid var(--red);
  box-shadow: 4px 4px 0 #2b0003;
}

.album-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-year {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 4px 6px;
  color: var(--yellow);
  background: rgba(0, 0, 0, 0.86);
  border: 1px solid var(--red);
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
}

.player-readout {
  margin: 0 14px;
  min-height: 78px;
  padding: 9px;
  background: #111;
  border: 1px inset #666;
}

.player-readout span {
  color: var(--red);
  font-family: "Courier New", monospace;
  font-size: 8px;
  font-weight: 900;
}

.player-readout h2 {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--yellow);
  font-family: "Courier New", monospace;
  font-size: 17px;
  line-height: 1.08;
}

.player-readout p {
  margin-top: 5px;
  color: #bbb;
  font-size: 10px;
  font-weight: 700;
}

.visualizer {
  display: flex;
  height: 36px;
  margin: 8px 14px;
  padding: 4px 6px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3px;
  background: #070707;
  border: 1px solid #333;
}

.visualizer i {
  width: 100%;
  height: 35%;
  background: linear-gradient(180deg, var(--yellow), var(--red));
  animation: pulse 1.2s steps(4, end) infinite alternate;
}

.visualizer i:nth-child(2n) { height: 70%; animation-delay: -0.2s; }
.visualizer i:nth-child(3n) { height: 45%; animation-delay: -0.5s; }
.visualizer i:nth-child(4n) { height: 90%; animation-delay: -0.8s; }

.track-details {
  margin: 0 14px;
  border-top: 1px solid #333;
}

.track-details div {
  display: grid;
  grid-template-columns: 70px 1fr;
  min-height: 31px;
  padding: 6px 3px;
  align-items: center;
  border-bottom: 1px dotted #353535;
}

.track-details dt {
  color: #b8b8b8;
  font-family: "Courier New", monospace;
  font-size: 8px;
  font-weight: 900;
}

.track-details dd {
  color: #ddd;
  font-size: 9px;
  font-weight: 700;
}

.player-note {
  min-height: 55px;
  margin: 9px 14px;
  color: #d0d0d0;
  font-size: 10px;
  line-height: 1.4;
}

.player-actions {
  margin: 0 14px 14px;
}

.listen-button {
  min-height: 36px;
  font-size: 10px;
  font-weight: 900;
}

.listen-button {
  display: grid;
  padding: 0 8px;
  color: #fff;
  background: #750008;
  border: 1px solid var(--red);
  place-items: center;
  text-decoration: none;
}

.listen-button:hover {
  color: var(--yellow);
  background: #a0000c;
}

.footer {
  display: flex;
  min-height: 42px;
  padding: 8px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: #e0e0e0;
  background: #050505;
  border-top: 2px solid var(--red);
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
}

.footer a {
  color: var(--yellow);
  line-height: 1.35;
  text-align: right;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.footer small {
  color: #fff;
  font-size: 9px;
}

@keyframes pulse {
  to {
    height: 95%;
  }
}

@media (max-width: 1050px) {
  .archive-layout {
    grid-template-columns: 210px minmax(400px, 1fr);
  }

  .player-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 230px minmax(260px, 1fr) minmax(260px, 1fr);
    padding-bottom: 14px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .player-panel .panel-title {
    grid-column: 1 / -1;
  }

  .album-art {
    grid-row: 2 / 7;
  }

  .player-readout,
  .visualizer {
    grid-column: 2;
  }

  .track-details,
  .player-note,
  .player-actions {
    grid-column: 3;
  }

  .track-details {
    margin-top: 14px;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 58px;
  }

  .signal {
    font-size: 0;
  }

  .archive-layout {
    display: block;
  }

  .filters {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .filter-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-note {
    display: none;
  }

  .track-columns,
  .track-row {
    grid-template-columns: minmax(150px, 1fr) 90px 0;
  }

  .track-columns span:nth-child(3),
  .track-duration {
    display: none;
  }

  .track-list {
    max-height: 480px;
  }

  .player-panel {
    display: grid;
    grid-template-columns: 120px 1fr;
    padding-bottom: 14px;
  }

  .player-panel .panel-title {
    grid-column: 1 / -1;
  }

  .album-art {
    grid-row: auto;
    margin: 12px;
  }

  .player-readout {
    grid-column: 2;
    margin: 12px 12px 5px 0;
  }

  .visualizer {
    grid-column: 2;
    margin: 5px 12px 5px 0;
  }

  .track-details,
  .player-note,
  .player-actions {
    grid-column: 1 / -1;
  }

  .track-details {
    margin-top: 4px;
  }

  .footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .visualizer i {
    animation: none;
  }
}
