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

:root {
  --plastic: #d8d4c8;
  --plastic-dark: #b4b0a2;
  --plastic-edge: #8e8a7c;
  --accent: #2e7d4f;
  --accent-soft: #e59aa0;
  --lcd-bg: #9db88a;
  --lcd-ink: #23331c;
  --paper: #f2ecd9;
}

body {
  min-height: 100vh;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  background: #1d2b22;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(229, 154, 160, 0.12), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(120, 180, 120, 0.15), transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.12) 3px 4px);
  color: var(--paper);
  display: flex;
  justify-content: center;
}

.stage {
  width: min(430px, 100%);
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.masthead {
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}
.masthead span { color: var(--accent-soft); }

/* ---------- walkman body ---------- */

.walkman {
  position: relative;
  width: 100%;
  padding: 34px 24px 26px;
  border-radius: 28px;
  background: linear-gradient(160deg, #eceade 0%, var(--plastic) 35%, var(--plastic-dark) 100%);
  border: 2px solid var(--plastic-edge);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    inset 0 -6px 12px rgba(0, 0, 0, 0.18),
    0 18px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #3a392e;
}

.screws i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5f2e6, #7d7a6d);
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.6);
}
.screws i::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 4px;
  height: 1.5px;
  background: rgba(40, 40, 30, 0.7);
  transform: rotate(40deg);
}
.screws i:nth-child(1) { top: 10px; left: 12px; }
.screws i:nth-child(2) { top: 10px; right: 12px; }
.screws i:nth-child(3) { bottom: 10px; left: 12px; }
.screws i:nth-child(4) { bottom: 10px; right: 12px; }

.brand-plate {
  position: absolute;
  top: 9px;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: #6d6a5c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ---------- CD ---------- */

.cd-window {
  position: relative;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  padding: 10px;
  background: linear-gradient(180deg, #a9a598, #8f8b7d);
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.55);
}

.cd {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  animation: spin 3.2s linear infinite;
  animation-play-state: paused;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
.cd.playing { animation-play-state: running; }

.cd-label {
  position: absolute;
  inset: 0;
  background: url("/cover.png") center / cover no-repeat;
}

.cd-sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    rgba(255, 255, 255, 0) 0deg,
    rgba(255, 255, 255, 0.25) 40deg,
    rgba(255, 255, 255, 0) 90deg,
    rgba(255, 255, 255, 0) 180deg,
    rgba(255, 255, 255, 0.18) 220deg,
    rgba(255, 255, 255, 0) 270deg
  );
  mix-blend-mode: screen;
  pointer-events: none;
}

.cd-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #efece0 0 55%, #c8c4b6 55% 100%);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cd-hole {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #14140f;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9);
}

.window-glass {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28) 0%, transparent 40%);
  pointer-events: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- LCD ---------- */

.lcd {
  width: 100%;
  border-radius: 8px;
  padding: 8px 12px;
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.05) 2px 3px),
    var(--lcd-bg);
  border: 2px solid #55604a;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
  color: var(--lcd-ink);
  font-family: "Courier New", monospace;
  font-weight: bold;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.lcd-track { font-size: 1.3rem; }
.lcd-title {
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
.lcd-time { font-size: 0.75rem; }

/* ---------- controls ---------- */

.seek {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.transport {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  width: 56px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid var(--plastic-edge);
  background: linear-gradient(180deg, #f4f1e4, #c9c5b7);
  box-shadow: 0 4px 0 #8e8a7c, inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 1.05rem;
  color: #3a392e;
  cursor: pointer;
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #8e8a7c, inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.btn-play {
  width: 72px;
  height: 52px;
  font-size: 1.35rem;
  background: linear-gradient(180deg, #8fc7a4, var(--accent));
  border-color: #1d5637;
  box-shadow: 0 4px 0 #1d5637, inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: #f4fff7;
}
.btn-play:active { box-shadow: 0 1px 0 #1d5637, inset 0 1px 0 rgba(255, 255, 255, 0.5); }

.volume {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.vol-label {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: #6d6a5c;
}
.volume input {
  width: 76px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- tracklist sleeve ---------- */

.sleeve {
  width: 100%;
  background: var(--paper);
  color: #2c2a22;
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(46, 125, 79, 0.18) 27px 28px);
}

.sleeve-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  font-weight: bold;
  color: var(--accent);
}

.btn-download {
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: bold;
  letter-spacing: 0;
  text-decoration: none;
  color: #f4fff7;
  background: linear-gradient(180deg, #8fc7a4, var(--accent));
  border: 2px solid #1d5637;
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 3px 0 #1d5637;
  white-space: nowrap;
}
.btn-download:active { transform: translateY(2px); box-shadow: 0 1px 0 #1d5637; }

.tracklist { list-style: none; }
.tracklist li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 4px 6px;
  line-height: 20px;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}
.tracklist li:hover { background: rgba(46, 125, 79, 0.12); }
.tracklist li.current {
  background: var(--accent);
  color: #f4fff7;
}
.tracklist .num {
  font-family: "Courier New", monospace;
  font-weight: bold;
  color: var(--accent-soft);
}
.tracklist li.current .num { color: #ffd9dc; }
.tracklist .artist { font-weight: bold; }
.tracklist .title { opacity: 0.85; }

.logout {
  color: rgba(242, 236, 217, 0.55);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-decoration: none;
}
.logout:hover { color: var(--paper); }

/* ---------- login ---------- */

.login-page { align-items: center; }

.login-card {
  width: min(320px, 90vw);
  padding: 32px 28px;
  border-radius: 22px;
  background: linear-gradient(160deg, #eceade 0%, var(--plastic) 35%, var(--plastic-dark) 100%);
  border: 2px solid var(--plastic-edge);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 18px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #3a392e;
  text-align: center;
}
.login-brand {
  font-size: 1.4rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.login-vol { color: var(--accent); font-weight: bold; margin-top: -10px; }
.login-card input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid #55604a;
  background: var(--lcd-bg);
  font-family: "Courier New", monospace;
  font-weight: bold;
  color: var(--lcd-ink);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}
.login-card input:focus { outline: 2px solid var(--accent); }
.login-card button {
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #1d5637;
  background: linear-gradient(180deg, #8fc7a4, var(--accent));
  box-shadow: 0 4px 0 #1d5637;
  color: #f4fff7;
  font-weight: bold;
  letter-spacing: 0.2em;
  cursor: pointer;
}
.login-card button:active { transform: translateY(3px); box-shadow: 0 1px 0 #1d5637; }
.login-error {
  visibility: hidden;
  font-size: 0.75rem;
  color: #a03340;
  font-weight: bold;
}

@media (max-width: 380px) {
  .cd-window { width: 200px; height: 200px; }
  .volume input { width: 56px; }
}
