:root {
  --bg: #000000;
  --surface: #171717;
  --surface-soft: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.96);
  --text-soft: rgba(255, 255, 255, 0.74);
  --text-muted: rgba(255, 255, 255, 0.58);
  --line: rgba(255, 255, 255, 0.35);
  --pill-text: rgba(0, 0, 0, 0.7);
  --new: rgba(0, 188, 255, 0.86);
  --shadow: rgba(255, 255, 255, 0.12);
  --card-min: 148px;
  --content-max: 1280px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  min-height: 100vh;
}

body.body-locked {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top center, rgba(18, 68, 48, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(16, 16, 16, 0.96), rgba(0, 0, 0, 1) 140px);
}

.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(0, 0, 0, 0.78);
}

.topbar {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 10px 12px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topbar-spacer {
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.lang-select {
  min-height: 40px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
}

.icon-button.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  padding: 0;
}

.icon-button svg {
  width: 24px;
  height: 24px;
}

.lang-select {
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
}

.search-mode {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-shell {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.search-shell svg {
  width: 22px;
  height: 22px;
  color: var(--text);
  flex: 0 0 auto;
}

.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  height: 40px;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  appearance: none;
  display: none;
}

.screen {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 10px 12px 32px;
}

.hero-copy {
  padding: 14px 4px 6px;
}

.login-prompt {
  padding: 14px 0 8px;
}

.login-prompt-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.login-prompt-copy {
  margin: 0;
  flex: 1 1 420px;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.login-prompt-button {
  flex: 0 0 220px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.login-prompt-button-small {
  flex-basis: 120px;
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 900;
}

.hero-subtitle {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--text-soft);
  line-height: 1.55;
  font-size: 1rem;
}

.section {
  margin-top: 22px;
}

.section-title {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.04em;
  line-height: 0.96;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.84);
}

.section-rule {
  height: 1px;
  background: var(--line);
  margin-bottom: 14px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min), 1fr));
  gap: 12px 16px;
}

.album-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.album-card.is-placeholder .cover-wrap {
  display: grid;
  place-items: center;
}

.show-more-cover-text {
  padding: 20px;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text);
}

.album-link {
  display: flex;
  flex-direction: column;
  gap: 0;
  color: inherit;
}

.album-link-button {
  width: 100%;
  padding: 0;
  text-align: left;
}

.album-link-static {
  width: 100%;
}

.cover-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 10px var(--shadow);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    #111;
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 12px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.02em;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

.album-meta {
  padding: 6px 4px 0;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 21px;
  margin-bottom: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1;
  white-space: nowrap;
}

.pill-release {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--pill-text);
  background: rgba(255, 255, 255, 0.62);
}

.pill-new {
  flex: 0 0 auto;
  margin-left: auto;
  color: #fff;
  background: var(--new);
}

.album-title {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 1.03rem;
  line-height: 1.08;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.album-artist {
  margin: 2px 0 0;
  font-size: 1rem;
  line-height: 1.08;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-empty,
.loading-state,
.error-state {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px 12px;
}

.loading-state.is-compact {
  min-height: 240px;
}

.empty-copy,
.error-copy {
  max-width: 460px;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-line;
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: rgba(255, 255, 255, 0.92);
  animation: spin 1s linear infinite;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px 28px;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.footer-copy {
  max-width: 720px;
  margin: 0;
  line-height: 1.5;
}

.footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-link-button {
  padding: 0;
  color: inherit;
}

.footer-links a:hover,
.footer-link-button:hover,
.icon-button:hover,
.lang-select:hover,
.album-link:hover .cover-wrap {
  opacity: 0.9;
}

.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.overlay-sheet {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.overlay-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.overlay-title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
}

.overlay-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
}

.overlay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min), 1fr));
  gap: 12px 16px;
}

.overlay-sentinel {
  height: 1px;
}

.overlay-footer-loading {
  display: grid;
  place-items: center;
  padding: 18px 0 8px;
}

.overlay-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-soft);
  padding: 24px 12px;
  white-space: pre-line;
}

.auth-backdrop {
  z-index: 70;
}

.alert-backdrop {
  z-index: 90;
}

.auth-sheet {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: auto;
}

.auth-header {
  position: sticky;
  top: 0;
  z-index: 2;
}

.auth-body {
  max-width: 390px;
  margin: 0 auto;
  padding: 28px 12px 40px;
}

.auth-logo {
  display: block;
  width: 80px;
  height: 80px;
  margin: 10px auto 22px;
  object-fit: contain;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-label {
  color: var(--text);
  font-size: 0.82rem;
}

.auth-input-shell,
.auth-select-shell {
  display: flex;
  align-items: center;
  min-height: 48px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-input,
.auth-select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 14px;
  min-height: 48px;
  font-weight: 800;
}

.auth-select {
  appearance: none;
}

.auth-eye-button {
  flex: 0 0 40px;
  margin-right: 6px;
}

.auth-validation {
  color: #ff7878;
  font-size: 0.82rem;
  padding: 0 12px;
}

.auth-action-button {
  width: 100%;
  flex: none;
}

.auth-action-button.is-disabled {
  opacity: 0.6;
}

.auth-or {
  text-align: center;
  font-weight: 800;
  color: var(--text);
}

.auth-link-button {
  color: var(--text);
  text-decoration: underline;
  text-align: center;
  font-weight: 800;
  padding-top: 6px;
}

.auth-terms {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: var(--text);
  padding-top: 6px;
}

.auth-terms-check {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
}

.auth-terms-check svg {
  width: 30px;
  height: 30px;
}

.auth-terms-copy {
  font-size: 0.92rem;
  line-height: 1.25;
  text-decoration: underline;
}

.auth-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
}

.alert-sheet {
  width: min(100%, 420px);
  margin: auto 12px;
  border-radius: 20px;
  background: #111;
  padding: 20px 16px 16px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}

.alert-title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  line-height: 1.1;
  font-weight: 800;
}

.alert-message {
  margin: 0 0 18px;
  color: var(--text-soft);
  line-height: 1.45;
  white-space: pre-line;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.menu-sheet {
  position: absolute;
  top: 64px;
  right: 12px;
  width: min(220px, calc(100vw - 24px));
  padding: 8px;
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 8px;
}

.album-menu-sheet {
  position: fixed;
  z-index: 81;
  width: min(260px, calc(100vw - 24px));
  padding: 8px;
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 8px;
}

.menu-item {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  text-align: left;
  font-weight: 800;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.album-menu-group-label {
  padding: 2px 6px 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.album-menu-ratings {
  display: grid;
  gap: 8px;
}

.album-rating-item {
  text-align: center;
  letter-spacing: 0.08em;
}

.confirm-actions {
  display: grid;
  gap: 10px;
}

.favorites-backdrop {
  z-index: 75;
}

.artist-details-backdrop {
  z-index: 78;
}

.artist-details-header {
  position: sticky;
  top: 0;
  z-index: 2;
}

.artist-details-follow {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(0, 0, 0, 0.68);
  font-size: 0.86rem;
  font-weight: 700;
}

.artist-details-body {
  position: relative;
}

.artist-details-content {
  max-width: 980px;
  margin: 0 auto;
}

.artist-details-name {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 0.96;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.82);
}

.artist-details-cover {
  width: 100%;
  margin-bottom: 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 10px var(--shadow);
  background: #111;
}

.artist-details-cover img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.artist-details-section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.artist-details-external {
  margin-top: 12px;
}

.artist-details-external-copy {
  margin: 0 0 10px;
  color: var(--text-soft);
  line-height: 1.45;
  white-space: pre-line;
}

.artist-details-links {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
}

.artist-details-link-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}

.artist-details-link-logo img {
  display: block;
  height: 30px;
  width: auto;
}

.artist-details-loading-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.42);
}

.artist-details-error {
  min-height: 320px;
  display: grid;
  place-items: center;
  gap: 16px;
  text-align: center;
  padding: 24px 12px;
}

.artist-details-retry {
  width: min(240px, 100%);
}

.legal-backdrop {
  z-index: 79;
}

.legal-body {
  padding-bottom: 24px;
}

.legal-content {
  max-width: 820px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.6;
}

.legal-content h1,
.legal-content h2,
.legal-content h3 {
  margin: 0 0 12px;
  color: var(--text);
  line-height: 1.1;
}

.legal-content h1 {
  font-size: 1.65rem;
  font-weight: 900;
}

.legal-content h2 {
  margin-top: 26px;
  font-size: 1.18rem;
  font-weight: 800;
}

.legal-content h3 {
  margin-top: 18px;
  font-size: 1.05rem;
  font-weight: 800;
}

.legal-content p,
.legal-content ul,
.legal-content ol {
  margin: 0 0 14px;
}

.legal-content ul,
.legal-content ol {
  padding-left: 20px;
}

.legal-content li {
  margin-bottom: 8px;
}

.legal-content a {
  color: #79b8ff;
}

.legal-content hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin: 28px 0;
}

.about-content {
  max-width: 820px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.7;
}

.about-lead,
.about-paragraph {
  margin: 0;
}

.about-lead {
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.about-rule {
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  margin: 18px 0 20px;
}

.about-paragraph + .about-paragraph {
  margin-top: 16px;
}

.about-link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.profile-backdrop {
  z-index: 77;
}

.profile-body {
  position: relative;
}

.profile-form {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-terms-link {
  color: var(--text);
  text-decoration: underline;
  text-align: center;
  font-size: 0.9rem;
  padding-top: 6px;
}

.profile-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  margin-top: 8px;
}

.profile-delete-button {
  margin-top: 8px;
}

.favorites-sheet {
  z-index: 1;
}

.favorites-group {
  margin-bottom: 22px;
}

.favorites-group-title {
  margin: 0 0 8px;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
}

.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
  gap: 12px 16px;
}

#openArtistsSearch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-1px);
}

.artist-card {
  min-width: 0;
}

.artist-card-button {
  width: 100%;
  padding: 0;
  text-align: left;
}

.artist-cover-wrap {
  aspect-ratio: 1 / 1;
}

.artist-name {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.08;
  font-weight: 500;
}

.favorites-search-top {
  padding: 10px 12px 0;
}

.artist-search-results {
  display: flex;
  flex-direction: column;
}

.artist-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.artist-row-cover {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.artist-row-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.artist-row-name {
  min-width: 0;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.15;
  font-weight: 500;
}

.artist-row-action {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(0, 0, 0, 0.68);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.artist-row-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.18);
  border-top-color: rgba(0, 0, 0, 0.72);
  animation: spin 0.9s linear infinite;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (min-width: 768px) {
  :root {
    --card-min: 172px;
  }

  .topbar {
    padding: 10px 16px;
  }

  .screen {
    padding: 14px 16px 42px;
  }

  .overlay-backdrop {
    padding: 24px;
    align-items: flex-start;
  }

  .overlay-sheet {
    width: min(100%, 980px);
    min-height: min(86vh, 980px);
    max-height: 86vh;
    border-radius: 20px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  }

  .overlay-body {
    padding: 12px 16px 18px;
  }

  .auth-sheet {
    width: min(100%, 520px);
    min-height: auto;
    max-height: 86vh;
    border-radius: 22px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  }

  .auth-backdrop {
    align-items: center;
  }

  .auth-body {
    padding-bottom: 32px;
  }

  .menu-sheet {
    top: 72px;
    right: 24px;
  }

  .artist-details-backdrop {
    padding: 24px;
    align-items: center;
  }

  .artist-details-sheet {
    width: min(900px, 100%);
    min-height: min(86vh, 920px);
    max-height: 86vh;
    border-radius: 20px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  }

  .artist-details-cover {
    max-width: 420px;
  }
}

@media (min-width: 1100px) {
  :root {
    --card-min: 186px;
  }
}

@media (max-width: 640px) {
  .login-prompt-copy {
    font-size: 1.05rem;
    line-height: 1.18;
    flex-basis: 100%;
  }

  .login-prompt-button {
    flex-basis: 100%;
  }

  .brand-name {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .lang-select {
    max-width: 74px;
  }

  .hero-copy {
    padding-top: 8px;
  }
}
