:root {
  color-scheme: dark;
  --ink: #f7f3ec;
  --muted: #bcb4a8;
  --panel: #151515;
  --panel-2: #20201f;
  --line: rgba(255, 255, 255, 0.12);
  --green: #1ed760;
  --rose: #ff4d8d;
  --amber: #ffb23f;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 15%, rgba(30, 215, 96, 0.2), transparent 28rem),
    radial-gradient(circle at 78% 20%, rgba(255, 77, 141, 0.17), transparent 26rem),
    linear-gradient(135deg, #080908 0%, #15100f 42%, #101317 100%);
}

button,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(360px, 1fr);
  gap: 36px;
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  padding: 36px 0;
}

.control-panel {
  align-self: start;
  padding: 28px;
  background: rgba(21, 21, 21, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.brand-block p,
.story-card header p {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-block h1 {
  margin: 0 0 28px;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.form-grid {
  display: grid;
  gap: 18px;
}

label,
legend {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input {
  width: 100%;
  margin-top: 8px;
  padding: 14px 15px;
  color: var(--ink);
  background: #0b0b0b;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 215, 96, 0.15);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.segmented label {
  display: grid;
  min-height: 44px;
  place-items: center;
  color: var(--ink);
  background: #0b0b0b;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented label:has(input:checked) {
  color: #071008;
  background: var(--green);
  border-color: var(--green);
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

button {
  min-height: 46px;
  padding: 0 16px;
  color: #071008;
  font-weight: 900;
  background: var(--green);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button[type="button"] {
  color: var(--ink);
  background: #2a2a2a;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status {
  min-height: 44px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.workspace {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 18px;
  min-width: 0;
}

.story-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tab {
  min-height: 38px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line);
}

.tab.is-active {
  color: #071008;
  background: var(--green);
  border-color: var(--green);
}

.phone-frame {
  width: min(430px, 100%);
  aspect-ratio: 9 / 16;
  padding: 10px;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 32px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.story-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(30, 215, 96, 0.18), transparent 28%),
    linear-gradient(340deg, rgba(255, 77, 141, 0.26), transparent 34%),
    #121212;
  border-radius: 24px;
}

.story-glow {
  position: absolute;
  inset: auto -20% -14% -20%;
  height: 44%;
  background: radial-gradient(ellipse, rgba(30, 215, 96, 0.55), transparent 62%);
  filter: blur(12px);
}

.story-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  padding: clamp(24px, 7%, 34px);
}

.story-card h2 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(2.35rem, 9vw, 4.9rem);
  line-height: 0.86;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.story-body {
  align-self: center;
  min-width: 0;
}

.empty {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.45;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.stat {
  position: relative;
  min-height: 88px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.stat strong {
  display: block;
  font-size: clamp(1.05rem, 4.6vw, 1.55rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.numeric-stat strong {
  font-size: clamp(1.75rem, 7vw, 2.25rem);
}

.text-stat strong {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  overflow: hidden;
  font-size: clamp(1rem, 4vw, 1.32rem);
  line-height: 1.06;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.stat span {
  position: relative;
  z-index: 1;
}

.album-stat {
  padding-left: 72px;
}

.stat-art {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.stat span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rank-list {
  display: grid;
  gap: 11px;
}

.rank-item {
  display: grid;
  grid-template-columns: 34px 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.rank {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #071008;
  font-size: 0.9rem;
  font-weight: 900;
  background: var(--green);
  border-radius: 50%;
}

.rank-art {
  width: 54px;
  height: 54px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.rank-art.art-logo {
  object-fit: contain;
  padding: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(7, 7, 7, 0.58);
}

.rank-copy {
  min-width: 0;
}

.rank-copy strong,
.rank-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-copy strong {
  font-size: 1rem;
}

.rank-copy span,
.plays {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
}

.genre-cloud {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 10px;
}

.genre-pill {
  padding: 12px 14px;
  color: #070707;
  font-size: var(--size);
  font-weight: 900;
  line-height: 1;
  background: var(--color);
  border-radius: 999px;
}

.personality-layout {
  display: grid;
  align-content: center;
  gap: 18px;
}

.personality-card {
  display: grid;
  gap: 16px;
}

.personality-kicker {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.personality-line {
  margin: 0;
  font-size: clamp(2.15rem, 7vw, 3.2rem);
  font-weight: 900;
  line-height: 0.92;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.personality-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

.personality-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.personality-tags span {
  padding: 9px 11px;
  color: #071008;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  background: var(--green);
  border-radius: 999px;
}

.overview-layout {
  display: grid;
  align-content: center;
  gap: 18px;
}

.overview-hero {
  display: grid;
  gap: 8px;
}

.kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-name {
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.art-fallback {
  display: grid;
  place-items: center;
  color: #071008;
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 55%),
    var(--green);
}

.story-card footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
}

.story-artists {
  background:
    linear-gradient(150deg, rgba(255, 178, 63, 0.36), transparent 30%),
    linear-gradient(330deg, rgba(34, 211, 238, 0.28), transparent 40%),
    #14110d;
}

.story-albums {
  background:
    linear-gradient(150deg, rgba(34, 211, 238, 0.34), transparent 32%),
    linear-gradient(330deg, rgba(255, 178, 63, 0.32), transparent 40%),
    #101414;
}

.story-tracks {
  background:
    linear-gradient(160deg, rgba(139, 92, 246, 0.34), transparent 32%),
    linear-gradient(335deg, rgba(30, 215, 96, 0.28), transparent 36%),
    #0f1116;
}

.story-genres {
  background:
    linear-gradient(145deg, rgba(255, 77, 141, 0.36), transparent 35%),
    linear-gradient(320deg, rgba(255, 178, 63, 0.28), transparent 38%),
    #130f13;
}

.story-personality {
  background:
    linear-gradient(145deg, rgba(255, 77, 141, 0.34), transparent 34%),
    linear-gradient(315deg, rgba(34, 211, 238, 0.24), transparent 42%),
    #131018;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(540px, calc(100% - 28px));
    padding: 18px 0 28px;
  }

  .control-panel {
    padding: 22px;
  }

  .phone-frame {
    width: min(430px, 96vw);
  }
}
