:root {
  color-scheme: dark;
  --bg: #07120f;
  --surface: #10231c;
  --surface-strong: #17352a;
  --surface-soft: rgba(16, 35, 28, 0.86);
  --text: #f3fbf7;
  --muted: #a9c2b8;
  --accent: #52d273;
  --accent-strong: #8df0a0;
  --accent-soft: rgba(82, 210, 115, 0.16);
  --danger-soft: rgba(255, 196, 87, 0.14);
  --border: rgba(243, 251, 247, 0.12);
  --shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 50% 0%, rgba(82, 210, 115, 0.13), transparent 34rem),
    linear-gradient(160deg, rgba(23, 53, 42, 0.38), transparent 44rem),
    var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 1rem;
  padding: 1.25rem;
}

.performance-shell {
  grid-template-rows: auto 1fr auto;
}

.screen {
  width: min(100%, 68rem);
  margin: 0 auto;
  display: none;
  align-self: center;
}

.screen.is-active {
  display: block;
}

.screen-centered {
  max-width: 34rem;
  text-align: center;
}

.panel {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

.panel.narrow {
  width: min(100%, 32rem);
  margin: 0 auto;
}

.hero-panel {
  align-content: center;
}

.brand-stack {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  padding: 2rem 0;
}

.brand-line,
.screen-header {
  display: flex;
  align-items: center;
}

.screen-header {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.brand-line {
  gap: 0.75rem;
  color: var(--text);
  font-weight: 700;
}

.brand-mark {
  width: 4rem;
  height: 4rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(82, 210, 115, 0.45);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 700;
}

.brand-mark.small {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.95rem;
}

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1;
}

h2 {
  font-size: 1.15rem;
}

.intro,
.hint,
.app-status {
  color: var(--muted);
  line-height: 1.5;
}

.hint {
  font-size: 0.9rem;
}

.app-status {
  width: min(100%, 68rem);
  margin: 0 auto;
  font-size: 0.8rem;
  text-align: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.actions.vertical {
  display: grid;
}

.compact-actions {
  justify-content: flex-end;
  gap: 0.5rem;
}

.button {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(243, 251, 247, 0.05);
  color: var(--text);
  text-decoration: none;
}

.button-primary {
  border-color: rgba(82, 210, 115, 0.5);
  background: var(--accent);
  color: #06100d;
  font-weight: 700;
}

.button-ghost {
  background: transparent;
}

.button-danger {
  border-color: rgba(255, 196, 87, 0.38);
  background: rgba(255, 196, 87, 0.12);
  color: #ffd48a;
}

.icon-button {
  width: 3rem;
  padding-inline: 0.5rem;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(82, 210, 115, 0.35);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.check-list,
.list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
}

.check-list {
  list-style: none;
}

.check-list li,
.list-item,
.notice {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(243, 251, 247, 0.04);
}

.check-list li {
  padding: 0.8rem 1rem;
}

.check-list li::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.65rem;
  border-radius: 50%;
  background: var(--accent);
}

.notice {
  padding: 1rem;
  background: var(--danger-soft);
  color: var(--muted);
}

.info-grid,
.home-grid {
  display: grid;
  gap: 1rem;
}

.info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-grid > div {
  display: grid;
  gap: 0.3rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(243, 251, 247, 0.04);
}

.label {
  color: var(--muted);
  font-size: 0.78rem;
}

.form {
  display: grid;
  gap: 1rem;
}

.form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  background: rgba(7, 18, 15, 0.8);
  color: var(--text);
}

.form textarea {
  min-height: 18rem;
  resize: vertical;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.search-form {
  display: grid;
  gap: 0.45rem;
}

.search-form label {
  color: var(--muted);
  font-size: 0.9rem;
}

.search-form input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  background: rgba(7, 18, 15, 0.8);
  color: var(--text);
}

.home-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
}

.home-grid .hero-panel {
  grid-row: span 2;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
}

.list-item span {
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.song-card {
  color: var(--text);
  text-decoration: none;
}

.song-card .button {
  align-self: center;
  flex: 0 0 auto;
}

.song-card span,
.song-link span {
  display: grid;
  gap: 0.25rem;
}

.song-card small,
.song-link small {
  color: var(--muted);
}

.song-link {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text);
  text-decoration: none;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
}

.song-view {
  align-content: start;
}

.performance-screen {
  width: min(100%, 76rem);
  align-self: stretch;
}

.performance-header {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: -0.5rem 0 0.75rem;
  padding: 0.5rem 0;
  background: linear-gradient(180deg, var(--bg) 74%, rgba(7, 18, 15, 0));
}

.performance-view {
  display: grid;
  gap: 1rem;
}

.song-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.55fr);
  gap: 1rem;
  align-items: end;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.song-hero h1 {
  margin-top: 0.35rem;
}

.key-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.key-strip > div {
  display: grid;
  gap: 0.35rem;
  min-height: 4.5rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(243, 251, 247, 0.04);
}

.key-strip strong {
  color: var(--accent-strong);
  font-size: 1.35rem;
  line-height: 1;
}

.cifra-box {
  overflow: auto;
  max-width: 100%;
  min-height: 20rem;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(7, 18, 15, 0.82);
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.performance-cifra {
  min-height: 68vh;
  padding: 1.25rem;
  line-height: 1.65;
  tab-size: 4;
}

.song-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dev-nav {
  width: min(100%, 68rem);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(7, 18, 15, 0.72);
}

.dev-nav button {
  min-height: 2rem;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  background: transparent;
  color: var(--muted);
}

.dev-nav button.is-active {
  border-color: rgba(82, 210, 115, 0.4);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

@media (max-width: 760px) {
  .app-shell {
    padding: 1rem;
  }

  .home-grid,
  .info-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .home-grid .hero-panel {
    grid-row: auto;
  }

  .screen-header,
  .section-head {
    align-items: flex-start;
  }

  .section-head {
    display: grid;
  }

  .performance-shell {
    padding: 0.75rem;
  }

  .performance-header {
    display: grid;
    gap: 0.75rem;
  }

  .compact-actions {
    justify-content: stretch;
  }

  .compact-actions .button {
    flex: 1 1 auto;
  }

  .song-card,
  .song-link {
    display: grid;
  }

  .song-hero,
  .key-strip {
    grid-template-columns: 1fr;
  }

  .song-hero h1 {
    font-size: 2rem;
    line-height: 1.08;
  }

  .performance-cifra {
    min-height: 64vh;
    padding: 1rem;
    line-height: 1.6;
  }
}
