:root {
  color-scheme: light;
  --ink: #211b17;
  --muted: #6b625b;
  --paper: #efe6d3;
  --plastic: #d8d0be;
  --plastic-dark: #9a907d;
  --red: #c6503c;
  --green: #1db954;
  --teal: #2f706b;
  --line: #2a241f;
  --shadow: 0 24px 70px rgba(36, 29, 22, 0.22);
  font-family: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(33, 27, 23, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(33, 27, 23, 0.06) 1px, transparent 1px),
    #c9b78d;
  background-size: 28px 28px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.login-stage {
  display: grid;
  grid-template-columns: minmax(280px, 560px) minmax(280px, 420px);
  align-items: center;
  justify-content: center;
  gap: 48px;
  min-height: 100vh;
  padding: 42px;
}

.cassette {
  position: relative;
  min-height: 340px;
  padding: 28px;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #ddd7c8, #b9ad95);
  box-shadow: var(--shadow);
}

.cassette::before,
.cassette::after {
  position: absolute;
  bottom: 24px;
  width: 18px;
  height: 18px;
  border: 3px solid var(--line);
  border-radius: 50%;
  content: "";
}

.cassette::before {
  left: 28px;
}

.cassette::after {
  right: 28px;
}

.cassette-label {
  display: grid;
  gap: 8px;
  padding: 18px;
  min-height: 104px;
  border: 3px solid var(--line);
  border-radius: 6px;
  background:
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(198, 80, 60, 0.36) 23px 25px),
    #f6ead0;
}

.cassette-label span,
.eyebrow {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cassette-label strong {
  font-size: clamp(1.4rem, 3vw, 2.8rem);
  line-height: 1;
}

.reels {
  display: grid;
  grid-template-columns: 1fr minmax(80px, 140px) 1fr;
  align-items: center;
  gap: 18px;
  margin: 36px 22px 18px;
  padding: 18px;
  border: 3px solid var(--line);
  border-radius: 40px;
  background: #3a312b;
}

.reel {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 4px solid #efe6d3;
  border-radius: 50%;
  background: radial-gradient(circle, #efe6d3 0 10%, #4d443e 11% 18%, #211b17 19% 100%);
}

.reel span {
  width: 62%;
  aspect-ratio: 1;
  border: 2px dashed #efe6d3;
  border-radius: 50%;
}

.tape-window {
  height: 44px;
  border: 3px solid #efe6d3;
  border-radius: 22px;
  background: linear-gradient(90deg, #211b17, #6d4c3e, #211b17);
}

.cassette-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 12px 28px 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.cassette-footer span {
  text-align: center;
}

.cassette-footer span:first-child {
  text-align: left;
}

.cassette-footer span:last-child {
  text-align: right;
}

.login-panel,
.player-board,
.history-board,
.match-board {
  border: 3px solid var(--line);
  border-radius: 8px;
  background: rgba(239, 230, 211, 0.94);
  box-shadow: var(--shadow);
}

.login-panel {
  display: grid;
  gap: 16px;
  padding: 30px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.88;
}

h2 {
  font-size: 1.3rem;
}

.lede {
  color: var(--muted);
  line-height: 1.5;
}

label {
  font-weight: 700;
}

input {
  width: 100%;
  padding: 14px 16px;
  border: 3px solid var(--line);
  border-radius: 6px;
  background: #fff7e7;
  color: var(--ink);
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  word-break: break-word;
}

.error {
  color: var(--red);
  font-weight: 700;
}

.primary-button,
.secondary-button,
.ghost-button,
.recommend-row button {
  min-height: 46px;
  border: 3px solid var(--line);
  border-radius: 6px;
  background: var(--green);
  color: #101510;
  font-weight: 800;
  box-shadow: 5px 5px 0 var(--line);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.secondary-button {
  background: #fff7e7;
}

.compact {
  min-height: 40px;
  padding: 0 14px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  height: 2px;
  background: rgba(42, 36, 31, 0.35);
  content: "";
}

.play-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #101510;
}

.deck {
  min-height: 100vh;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 22px;
  max-width: 1240px;
}

.topbar h1 {
  font-size: clamp(2rem, 5vw, 4.5rem);
}

.ghost-button {
  padding: 0 18px;
  background: #efe6d3;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff7e7;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  grid-template-areas:
    "player matches"
    "history matches";
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
}

.player-board {
  grid-area: player;
  min-height: 330px;
  padding: 26px;
  background: linear-gradient(145deg, #d7cbb4, #efe6d3);
}

.meter {
  display: flex;
  align-items: end;
  gap: 7px;
  height: 76px;
  margin-bottom: 28px;
  padding: 10px;
  border: 3px solid var(--line);
  background: #231f1a;
}

.meter span {
  width: 100%;
  background: var(--green);
}

.meter span:nth-child(1),
.meter span:nth-child(8) {
  height: 30%;
}

.meter span:nth-child(2),
.meter span:nth-child(9) {
  height: 70%;
}

.meter span:nth-child(3),
.meter span:nth-child(6) {
  height: 46%;
}

.meter span:nth-child(4),
.meter span:nth-child(7) {
  height: 88%;
  background: var(--red);
}

.meter span:nth-child(5),
.meter span:nth-child(10) {
  height: 58%;
}

.now-playing {
  display: grid;
  gap: 12px;
}

.now-playing h2 {
  font-size: clamp(1.9rem, 4vw, 3.6rem);
  line-height: 1;
}

.progress {
  overflow: hidden;
  height: 18px;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff7e7;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.transport {
  display: flex;
  gap: 14px;
  margin-top: 28px;
}

.transport span {
  width: 46px;
  height: 24px;
  border: 3px solid var(--line);
  border-radius: 4px;
  background: #3a312b;
}

.history-board {
  grid-area: history;
  padding: 22px;
}

.match-board {
  grid-area: matches;
  padding: 22px;
}

.section-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.track-list,
.match-list {
  display: grid;
  gap: 12px;
}

.track-row,
.match-card {
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff7e7;
}

.track-row {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 14px;
  padding: 14px;
}

.track-row span,
.match-card span,
.recommend-row small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.track-row p,
.match-card p {
  color: var(--muted);
  margin-top: 4px;
}

.match-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.recommend-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  align-items: center;
  gap: 10px;
}

.recommend-row button,
.pipeline-actions button,
.search-row button,
.search-result button {
  min-height: 38px;
  background: var(--red);
  color: #fff7e7;
  box-shadow: 3px 3px 0 var(--line);
}

.recommendation-box,
.song-search {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px dashed var(--line);
  border-radius: 6px;
  background: rgba(239, 230, 211, 0.72);
}

.recommendation-box p {
  color: var(--muted);
  font-size: 0.9rem;
}

.pipeline-actions,
.search-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.song-search label {
  font-size: 0.86rem;
}

.song-search input {
  min-width: 0;
  padding: 10px 12px;
  border-width: 2px;
}

.song-search small,
.handle-line {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-result {
  display: grid;
  grid-template-columns: 1fr 86px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid rgba(42, 36, 31, 0.55);
  border-radius: 6px;
  background: #fff7e7;
}

.search-result span {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-result p {
  color: var(--muted);
  font-size: 0.78rem;
}

.text-button {
  width: fit-content;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-decoration: underline;
  box-shadow: none;
}

@media (max-width: 860px) {
  .login-stage,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .login-stage {
    padding: 22px;
  }

  .main-grid {
    grid-template-areas:
      "player"
      "history"
      "matches";
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .cassette {
    min-height: 280px;
  }
}
