:root {
  color-scheme: dark;
  --background: #0e0d12;
  --surface: #17151d;
  --surface-soft: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #faf7f4;
  --muted: #a8a2ad;
  --accent: #ff6b35;
  --accent-2: #f2328a;
  --danger: #ff7b82;
  --success: #72e7ad;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 107, 53, 0.13), transparent 34rem),
    var(--background);
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
}

.brand-mark i {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.brand-mark i:nth-child(1) { height: 40%; }
.brand-mark i:nth-child(2) { height: 100%; }
.brand-mark i:nth-child(3) { height: 65%; }
.brand-mark i:nth-child(4) { height: 85%; }

main {
  flex: 1;
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding-bottom: 56px;
}

.hero {
  padding: 28px 0 24px;
  text-align: center;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 5.2vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0;
  font-size: 1.2rem;
}

h3 {
  margin: 24px 0 8px;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
}

.lead {
  max-width: 34rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}

.card {
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.tab {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.tab.is-active {
  background: var(--text);
  color: #141217;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.15s;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--line-strong);
  outline: none;
}

::placeholder {
  color: #6f6976;
}

.counter {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.93rem;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: none;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.primary {
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(95deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  transition: filter 0.15s, transform 0.05s;
}

.primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.primary:active:not(:disabled) {
  transform: translateY(1px);
}

.primary:disabled {
  opacity: 0.55;
  cursor: progress;
}

.wide {
  width: 100%;
}

.ghost {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 0.92rem;
}

.ghost:hover {
  border-color: var(--line-strong);
}

.ghost.danger {
  color: var(--danger);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:disabled {
  text-decoration: none;
  cursor: default;
  opacity: 0.7;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 62vw;
}

#account-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  font-weight: 700;
  font-size: 0.85rem;
}

.notice {
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 159, 46, 0.4);
  border-radius: 14px;
  background: rgba(255, 159, 46, 0.09);
}

.notice.is-error {
  border-color: rgba(255, 123, 130, 0.45);
  background: rgba(255, 123, 130, 0.09);
}

.error {
  margin: 0 0 14px;
  color: var(--danger);
  font-size: 0.92rem;
}

.progress-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.badge {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.bar {
  height: 6px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.bar span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.2s ease;
}

.song {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.song-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.song-title {
  margin: 0;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.song-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.track {
  position: relative;
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.track-name {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.track audio {
  display: block;
  width: 100%;
  height: 40px;
}

.track-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 8px;
  font-size: 0.88rem;
}

.track.is-locked .track-body {
  filter: blur(5px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

.fake-player {
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.track-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  text-align: center;
  font-size: 0.92rem;
}

.track-lock .primary {
  padding: 9px 18px;
  font-size: 0.9rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.facts div {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.facts dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.facts dd {
  margin: 4px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.history {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.history .plus {
  color: var(--success);
}

.cabinet-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 16px 32px;
  color: var(--muted);
  font-size: 0.85rem;
}

.modal {
  width: min(100% - 24px, 420px);
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #1a1820;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(6, 5, 9, 0.72);
  backdrop-filter: blur(4px);
}

.modal h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.modal .hint {
  margin-bottom: 18px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
}

.modal-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.code-input {
  font-size: 1.6rem !important;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
}

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 24px 0;
}

.page h1 {
  font-size: 1.8rem;
  text-align: left;
}

.page h2 {
  margin: 28px 0 8px;
}

.button-link {
  display: inline-block;
  text-decoration: none;
}

.page p,
.page li {
  color: var(--muted);
}

@media (max-width: 520px) {
  .card {
    padding: 18px;
  }

  .composer-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .composer-footer .hint {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
