/* Songless — Heardle-style dark UI */
:root {
  --songless-pink: #f0a8c4;
  --songless-pink-hover: #f5b8d0;
  --songless-pink-muted: #c888a4;
}

.songless-body,
.songless-body button,
.songless-body input,
.songless-body .result-modal {
  text-transform: none;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

.songless-body {
  background: #121212 !important;
  color: #fff;
  min-height: 100vh;
}

.songless-body .top-nav {
  background: rgba(18, 18, 18, 0.95);
  border-bottom: 1px solid #2a2a2a;
}

.songless-body .top-nav a {
  color: #fff;
}

.songless-body .top-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.songless-body .top-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.songless-body .top-nav a.active::after {
  background: var(--songless-pink);
}

.songless-body .top-nav .nav-toggle {
  color: #fff;
  background: #2a2a2a;
  border-color: #444;
}

.songless-body .top-nav .nav-toggle:hover {
  background: #3a3a3a;
}

.songless-body .top-nav .nav-dropdown {
  background: #1e1e1e;
  border-color: #444;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.songless-body .top-nav .nav-dropdown a {
  color: #fff;
}

.songless-body .top-nav .nav-dropdown a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.songless-body .top-nav .nav-dropdown a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.songless-app {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px 32px;
  box-sizing: border-box;
}

.songless-header {
  text-align: center;
  margin-bottom: 28px;
}

.songless-title {
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: #fff;
}

.category-tabs {
  display: flex;
  gap: 0;
  background: #1e1e1e;
  border-radius: 10px;
  padding: 4px;
  border: 1px solid #333;
}

.category-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: #aaa;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 10px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.category-tab:hover {
  color: #fff;
}

.category-tab.is-active {
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
}

.songless-loading,
.songless-error {
  text-align: center;
  color: #888;
  padding: 48px 16px;
}

.btn-retry {
  margin-top: 12px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: var(--songless-pink);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.guess-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guess-slot {
  min-height: 52px;
  border-radius: 6px;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  padding: 8px 16px;
  text-align: center;
  box-sizing: border-box;
}

.guess-slot.is-empty {
  background: transparent;
  border: 2px solid #2a2a2a;
  color: transparent;
}

.guess-slot.is-skipped {
  color: #fff;
}

.guess-slot.is-wrong {
  background: #ef4444;
}

.guess-slot.is-artist {
  background: #eab308;
  color: #111;
}

.guess-slot.is-correct {
  background: var(--songless-pink);
  color: #fff;
}

.timeline-wrap {
  position: relative;
  margin-bottom: 28px;
}

.timeline-pointer-row {
  position: relative;
  height: 14px;
  margin-bottom: 10px;
}

.timeline-pointer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #fff;
  transform: translateX(-50%);
  transition: left 0.05s linear;
  z-index: 3;
}

.timeline-bar {
  display: flex;
  position: relative;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #3a3a3a;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  min-width: 0;
  background: var(--songless-pink);
  border-radius: 0;
  z-index: 2;
  pointer-events: none;
  transition: width 0.05s linear;
}

.timeline-seg {
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  background: transparent;
  border-right: 1px solid rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.timeline-seg:last-child {
  border-right: none;
}

.timeline-seg.is-past,
.timeline-seg.is-active,
.timeline-seg.is-future {
  background: transparent;
}

.timeline-label-row {
  position: relative;
  height: 1.25rem;
  margin-top: 10px;
}

.timeline-label-active {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: #aaa;
  white-space: nowrap;
  transition: left 0.05s linear;
}

/* Segment widths proportional to clip length */
.timeline-bar .timeline-seg:nth-child(2) {
  flex: 0.5;
}
.timeline-bar .timeline-seg:nth-child(3) {
  flex: 2;
}
.timeline-bar .timeline-seg:nth-child(4) {
  flex: 4;
}
.timeline-bar .timeline-seg:nth-child(5) {
  flex: 8;
}
.timeline-bar .timeline-seg:nth-child(6) {
  flex: 15;
}

.playback-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 32px;
}

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

.play-btn:hover:not(:disabled),
.stats-btn:hover:not(:disabled) {
  transform: scale(1.04);
  background: var(--songless-pink-hover);
}

.play-btn:disabled,
.stats-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.play-btn .play-icon {
  font-size: 1.5rem;
}

.play-btn .fa-play {
  margin-left: 3px;
}

.play-btn .fa-pause {
  margin-left: 0;
}

.stats-btn[hidden] {
  display: none;
}

.stats-btn {
  font-size: 1.35rem;
}

.bottom-bar {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.search-wrap {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 14px 14px 40px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #1e1e1e;
  color: #fff;
  font-size: 1rem;
  outline: none;
}

.search-input:focus {
  border-color: #666;
}

.search-input:disabled {
  opacity: 0.5;
}

.search-results {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  z-index: 10;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
}

.search-results li {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid #2a2a2a;
  font-size: 0.95rem;
  color: #fff;
}

.search-results li:last-child {
  border-bottom: none;
}

.search-results li:hover,
.search-results li.is-focused {
  background: #2a2a2a;
}

.search-results .result-artist {
  font-weight: 700;
}

.skip-btn {
  flex-shrink: 0;
  padding: 0 22px;
  border: none;
  border-radius: 6px;
  background: #e8e8e8;
  color: #111;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.skip-btn:hover:not(:disabled) {
  background: #fff;
}

.skip-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Result modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-backdrop[hidden] {
  display: none;
}

.result-modal {
  width: 100%;
  max-width: 520px;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #333;
}

.result-header {
  background: #dc2626;
  color: #fff;
  text-align: center;
  font-weight: 800;
  font-size: 1.35rem;
  padding: 18px 20px;
}

.result-header.is-win {
  background: var(--songless-pink-muted);
}

.result-body {
  padding: 26px 28px 28px;
}

.result-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #888;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.result-song {
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #121212;
}

.dist-title {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #888;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.dist-chart {
  margin-bottom: 22px;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: #aaa;
}

.dist-row .dist-label {
  width: 20px;
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

.dist-row .dist-bar-wrap {
  position: relative;
  flex: 1;
  height: 28px;
  background: #2a2a2a;
  border-radius: 4px;
  overflow: hidden;
}

.dist-row .dist-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  box-sizing: border-box;
  height: 100%;
  padding-right: 6px;
  background: #3a3a3a;
  min-width: 0;
  border-radius: 2px;
  transition: width 0.3s;
}

.dist-row .dist-bar:has(.dist-count) {
  min-width: 2.25rem;
}

.dist-count {
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.dist-count--empty {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
}

.dist-row.is-highlight .dist-bar {
  background: var(--songless-pink);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn-share,
.btn-download,
.btn-clear,
.btn-back,
.btn-next {
  border: none;
  cursor: pointer;
}

.btn-icon-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 12px;
  font-size: 1.25rem;
}

.btn-share {
  background: #6366f1;
  color: #fff;
}

.btn-share:hover {
  background: #818cf8;
}

.btn-download {
  background: #16a34a;
  color: #fff;
}

.btn-download:hover {
  background: #22c55e;
}

.btn-share.is-copied,
.btn-share.is-flash {
  background: #4f46e5;
}

.btn-download.is-downloaded,
.btn-download.is-flash {
  background: #15803d;
}

.btn-clear {
  background: #dc2626;
  color: #fff;
}

.btn-clear:hover {
  background: #ef4444;
}

.btn-back,
.btn-next {
  background: var(--songless-pink);
  color: #fff;
}

.btn-back:hover,
.btn-next:hover {
  background: var(--songless-pink-hover);
}

@media (max-width: 400px) {
  .category-tab {
    font-size: 0.72rem;
    padding: 8px 4px;
  }
}
