:root {
  --bg: #17171b;
  --surface: #201f26;
  --surface-2: #29282f;
  --text: #f2f0ea;
  --text-muted: #9a98a6;
  --border: #35333d;
  --accent: #e8b34e;
  --accent-ink: #1c1608;
  --radius: 14px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "Space Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

a { color: inherit; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 28px 20px 48px;
  display: flex;
  flex-direction: column;
}

.app-header { margin-bottom: 40px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  display: block;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  display: block;
  margin-top: 2px;
}

.view { flex: 1; display: flex; flex-direction: column; }
.hidden { display: none !important; }

.concept {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 10px;
}

.sub {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 32px;
}

.upload-slot {
  display: flex;
  align-items: stretch;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.upload-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 40px 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.upload-option:hover,
.upload-option:focus-within {
  color: var(--accent-fg, var(--accent));
  background-color: var(--surface);
}

.upload-divider {
  width: 1px;
  background: var(--border);
}

.upload-icon { color: currentColor; }

.upload-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.hint a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.hint a:hover { color: var(--accent-fg, var(--text)); }

.meta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent-fg, var(--text)); }

.dot-sep {
  color: var(--border);
  font-size: 12px;
}

.install-hint {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}

/* pagina privacy */

.policy-page { max-width: 640px; }

.policy h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  margin: 0 0 8px;
}

.policy-updated {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 32px;
}

.policy h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 32px 0 10px;
}

.policy p,
.policy li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 12px;
}

.policy ul { margin: 0 0 12px; padding-left: 20px; }
.policy a { color: var(--accent-fg, var(--text)); }
.policy strong { font-weight: 600; }

.policy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.close-btn {
  font-size: 28px;
  line-height: 1;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 10px;
}
.close-btn:hover { color: var(--accent-fg, var(--text)); }

/* loading */

#loading-view {
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 60vh;
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 40px;
}

.eq span {
  width: 6px;
  border-radius: 3px;
  background: var(--accent-fg, var(--accent));
  animation: eq-bounce 0.9s ease-in-out infinite;
}
.eq span:nth-child(1) { animation-delay: 0s; }
.eq span:nth-child(2) { animation-delay: 0.15s; }
.eq span:nth-child(3) { animation-delay: 0.3s; }
.eq span:nth-child(4) { animation-delay: 0.45s; }

@keyframes eq-bounce {
  0%, 100% { height: 10px; }
  50% { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .eq span { animation: none; height: 24px; }
}

.mono-status {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.mono-status.error { color: var(--text); }

/* result */

.result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.result-photo-wrap {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--accent-fg, var(--border));
}

#result-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mood-line {
  flex: 1;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.track-list {
  list-style: none;
  margin: 24px 0 8px;
  padding: 0;
}

@keyframes track-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.track {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  opacity: 0;
  animation: track-in 0.5s ease forwards;
}
.track:last-child { border-bottom: 1px solid var(--border); }

@media (prefers-reduced-motion: reduce) {
  .track { animation: none; opacity: 1; }
}

.track-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.track-art {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.track-art-placeholder {
  border: 1px solid var(--border);
}

.track-body {
  flex: 1;
  min-width: 0;
}

.track-number {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent-fg, var(--text-muted));
}

.track-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 6px 0 2px;
}

.track-artist {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.track-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-fg, var(--border));
  color: var(--accent-fg, var(--text-muted));
}

.btn-spotify {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  background: var(--accent, var(--text));
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 999px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.btn-primary {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent, var(--text));
  color: var(--accent-ink);
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
}

.btn-ghost {
  align-self: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--text-muted); }

#error-view { align-items: center; justify-content: center; text-align: center; min-height: 50vh; gap: 4px; }

.feedback-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.feedback-link:hover { color: var(--accent-fg, var(--text)); }

.why-section {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.why-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 400;
  margin: 0 0 14px;
}

.why-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-fg, var(--accent));
  outline-offset: 2px;
}
