:root {
  --sky: #38bdf8;
  --sky-dark: #0284c7;
  --blue: #2563eb;
  --orange: #fb923c;
  --yellow: #facc15;
  --red: #ef4444;
  --border: #bae6fd;
  --soft: #f0f9ff;
  --muted: #64748b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
  margin: 0;
  color: #1f2937;
  background: var(--soft);
  font-family: Nunito, "Arial Rounded MT Bold", system-ui, sans-serif;
}
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.page-sky {
  min-height: 100vh;
  padding: 26px 16px 64px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #bae6fd, #e0f2fe 50%, #fff);
}
.page-sky::before, .page-sky::after {
  content: "";
  position: fixed;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  filter: blur(45px);
  opacity: .42;
  pointer-events: none;
}
.page-sky::before { top: 80px; left: 3%; background: #fde047; }
.page-sky::after { top: 330px; right: 3%; background: #fdba74; }
.container { width: min(980px, 100%); margin: 0 auto; position: relative; z-index: 1; }

.page-title { text-align: center; margin-bottom: 28px; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 18px;
  border: 3px solid #fff;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--sky), var(--blue));
  box-shadow: 0 14px 28px rgba(37,99,235,.24);
  transform: rotate(-2deg);
}
.brand-mark span:last-child { display: grid; text-align: left; line-height: 1; }
.brand-mark strong { font-size: 1.25rem; font-weight: 1000; }
.brand-mark small { margin-top: 4px; font-weight: 900; text-transform: uppercase; letter-spacing: .16em; }
.brand-note { color: var(--yellow); font-size: 2.2rem; font-weight: 1000; }
.title-pill {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 0 auto 10px;
  padding: 14px 26px;
  border: 4px solid var(--border);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 18px 35px rgba(14,116,144,.16);
}
.title-pill > span { color: var(--orange); font-size: 2.2rem; font-weight: 1000; }
.title-pill h1 { margin: 0; color: var(--sky-dark); font-size: clamp(1.7rem, 5vw, 2.8rem); font-weight: 1000; }
.page-title > p { margin: 0; color: #0ea5e9; font-size: 1.15rem; font-weight: 900; }

.card {
  overflow: hidden;
  border: 4px solid var(--border);
  border-radius: 32px;
  background: #fff;
  box-shadow: 0 24px 50px rgba(14,116,144,.16);
}
.stripe-warm { height: 13px; background: linear-gradient(90deg, var(--yellow), var(--orange), var(--red)); }
.request-content { padding: clamp(18px, 4vw, 32px); }

.search-form {
  padding: 20px;
  border: 3px solid var(--border);
  border-radius: 24px;
  background: var(--soft);
}
.search-form label, .submit-card label, .request-modal-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--sky-dark);
  font-weight: 1000;
}
.search-row { display: flex; gap: 12px; }
.search-row input, .input {
  width: 100%;
  min-width: 0;
  padding: 14px 17px;
  border: 3px solid var(--border);
  border-radius: 18px;
  color: #334155;
  background: #fff;
  font-weight: 800;
  outline: none;
}
.search-row input:focus, .input:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(56,189,248,.17);
}
.primary-button, .submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  box-shadow: 0 12px 23px rgba(251,146,60,.24);
  font-weight: 1000;
  white-space: nowrap;
}
.list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 2px 12px;
}
.list-meta p { margin: 0; color: var(--muted); font-weight: 900; }
.random-button {
  padding: 10px 15px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, var(--sky), var(--blue));
  font-weight: 1000;
}

.song-list { display: grid; overflow: hidden; border: 2px solid var(--border); border-radius: 22px; transition: opacity .18s; }
.song-list.is-loading { min-height: 160px; opacity: .45; }
.song-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 11px 14px;
  border-bottom: 1px solid #e0f2fe;
  background: #fff;
  transition: .16s;
}
.song-row:last-child { border-bottom: 0; }
.song-row:nth-child(even) { background: #f8fdff; }
.song-row:hover { background: #fff7ed; }
.song-row.is-selected { background: #dcfce7; box-shadow: inset 5px 0 #22c55e; }
.song-info { min-width: 0; }
.song-info strong, .song-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-info strong { color: var(--sky-dark); font-weight: 1000; }
.song-info span { margin-top: 2px; color: #475569; font-size: .92rem; font-weight: 800; }
.song-row time { padding: 6px 9px; border-radius: 999px; color: var(--sky-dark); background: #e0f2fe; font-size: .82rem; font-weight: 1000; }
.choose-button {
  padding: 9px 13px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--red));
  font-weight: 1000;
}
.preview-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #0d9488);
  font-weight: 1000;
  white-space: nowrap;
}
.preview-button.is-loading { background: #94a3b8; cursor: wait; }
.preview-button.is-playing { background: linear-gradient(135deg, var(--red), var(--orange)); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 22px; }
.pagination strong { color: var(--sky-dark); }
.page-button {
  padding: 11px 16px;
  border: 2px solid var(--border);
  border-radius: 16px;
  color: var(--sky-dark);
  background: #fff;
  font-weight: 1000;
}

.selected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 20px 24px;
  border-color: #86efac;
  background: #f0fdf4;
}
.selected-card div { min-width: 0; }
.selected-card strong, .selected-card span { display: block; }
.selected-card strong { margin: 3px 0; color: #166534; font-size: 1.15rem; }
.selected-card span:not(.eyebrow) { overflow: hidden; color: #15803d; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.eyebrow { color: #22c55e; font-size: .78rem; font-weight: 1000; letter-spacing: .08em; text-transform: uppercase; }
.selected-card button { flex: 0 0 auto; padding: 10px 14px; border-radius: 14px; color: #166534; background: #dcfce7; font-weight: 1000; }

.submit-card { margin-top: 20px; padding: clamp(20px, 4vw, 30px); }
.submit-card h2 { margin: 0; color: var(--sky-dark); font-size: 1.6rem; }
.submit-card > p { margin: 5px 0 20px; color: var(--muted); font-weight: 800; }
.submit-button { width: 100%; margin-top: 14px; padding: 16px 20px; font-size: 1.08rem; }

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15,23,42,.65);
  backdrop-filter: blur(8px);
}
.modal-card {
  position: relative;
  width: min(420px, 100%);
  padding: 30px;
  border: 4px solid var(--border);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  text-align: center;
}
.modal-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--yellow), var(--orange)); font-size: 1.8rem; }
.modal-card h2 { margin: 0; color: var(--sky-dark); }
.modal-card p { margin: 10px 0 20px; color: #475569; font-weight: 800; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #64748b;
  background: #e0f2fe;
  font-size: 1.6rem;
  font-weight: 1000;
  line-height: 1;
}
.request-modal-card form { text-align: left; }
.modal-song {
  display: grid;
  gap: 3px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 2px solid #fed7aa;
  border-radius: 18px;
  background: #fff7ed;
  text-align: left;
}
.modal-song span { color: var(--orange); font-size: .76rem; font-weight: 1000; letter-spacing: .06em; text-transform: uppercase; }
.modal-song strong { overflow: hidden; color: #9a3412; text-overflow: ellipsis; white-space: nowrap; }
.modal-song small { overflow: hidden; color: #475569; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.modal-song .selected-duration { margin: 5px 0 8px; color: var(--sky-dark); font-size: .88rem; font-weight: 1000; }
.modal-song .preview-button { width: 100%; margin-top: 3px; }

@media (max-width: 640px) {
  .page-sky { padding: 14px 10px 40px; }
  .search-row { flex-direction: column; }
  .search-row .primary-button { width: 100%; }
  .list-meta { align-items: flex-start; flex-direction: column; }
  .song-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .song-row time { display: none; }
  .song-row .preview-button { padding: 9px 10px; font-size: .82rem; }
  .choose-button { padding: 9px 10px; }
  .pagination { gap: 7px; }
  .page-button { padding: 10px 9px; font-size: .82rem; }
  .selected-card { align-items: flex-start; flex-direction: column; }
}
