/* =============================================
   ESCUTA EXCLUSIVA — Styles
   Dark, intimate listening room aesthetic
   ============================================= */

:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-input: #1a1a1a;
  --text: #e8e8e8;
  --text-muted: #666666;
  --text-dim: #444444;
  --accent: #e63946;
  --accent-glow: rgba(230, 57, 70, 0.15);
  --border: #222222;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

[hidden] {
  display: none !important;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 9999;
}

/* ---- Screens ---- */

.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---- Token Screen ---- */

.token-container {
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.token-icon {
  font-size: 48px;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.token-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.token-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.token-input-group {
  display: flex;
  gap: 8px;
}

#token-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.05em;
  outline: none;
  transition: border-color 0.2s;
}

#token-input:focus {
  border-color: var(--accent);
}

#token-input::placeholder {
  color: var(--text-dim);
}

#token-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 24px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

#token-btn:hover {
  opacity: 0.85;
}

#token-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.token-error {
  color: var(--accent);
  font-size: 13px;
  margin-top: 16px;
}

.token-loading {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 16px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---- Player Screen ---- */

.player-container {
  max-width: 440px;
  width: 100%;
  padding: 16px 0;
}

/* Album art */
.album-art-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 32px;
  border-radius: 8px;
  overflow: hidden;
}

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

.album-art-glow {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: 0 20px 80px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.04) inset;
  pointer-events: none;
}

/* Album info */
.album-info {
  margin-bottom: 32px;
}

.album-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.album-artist {
  font-size: 15px;
  color: var(--text-muted);
}

/* Player controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
  flex-shrink: 0;
}

.play-btn:hover {
  transform: scale(1.05);
}

.play-btn:active {
  transform: scale(0.97);
}

/* Timeline */
.timeline-wrapper {
  flex: 1;
  min-width: 0;
}

.timeline-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.timeline-progress {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s linear;
}

.timeline-times {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Tracklist */
.tracklist {
  margin-bottom: 36px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.tracklist-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.tracklist ul {
  list-style: none;
}

.tracklist li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: color 0.3s;
}

.tracklist li .track-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  width: 28px;
  flex-shrink: 0;
}

.tracklist li .track-name {
  flex: 1;
}

.tracklist li .track-start {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.tracklist li.active {
  color: var(--text);
}

.tracklist li.active .track-num,
.tracklist li.active .track-start {
  color: var(--accent);
}

/* Page message */
.page-message {
  text-align: center;
  padding-top: 8px;
}

.page-heading {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.page-subtext {
  font-size: 12px;
  color: var(--text-dim);
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
  .screen {
    padding: 16px;
    align-items: flex-start;
    padding-top: 15vh;
  }

  #screen-player .screen,
  #screen-player {
    align-items: flex-start;
    padding-top: 24px;
  }

  .token-title {
    font-size: 24px;
  }

  .album-title {
    font-size: 20px;
  }

  .play-btn {
    width: 48px;
    height: 48px;
  }

  .play-btn svg {
    width: 24px;
    height: 24px;
  }
}

/* ---- Disable right-click on player ---- */
#screen-player {
  -webkit-user-select: none;
  user-select: none;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
