:root {
  --bg: #0f172a;
  --surface: #111827;
  --surface-2: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #7c3aed;
  --card: #14233f;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.12), transparent 20%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

body {
  line-height: 1.6;
}

.hero {
  padding: 4rem 1.5rem 2rem;
  text-align: center;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  margin: 0;
  font-size: clamp(2.75rem, 4vw, 4rem);
  letter-spacing: -0.05em;
}

p {
  color: var(--muted);
}

.search-box {
  margin-top: 1.75rem;
}

input[type="search"] {
  width: min(520px, 100%);
  padding: 1rem 1.15rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

input[type="search"]::placeholder {
  color: var(--muted);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.pinned-section {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.pinned-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.pinned-header h2 {
  margin: 0;
}

.clear-pinned-btn {
  padding: 0.5rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(124, 58, 237, 0.12);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 150ms ease;
}

.clear-pinned-btn:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.5);
}

.hints-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.hints-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.hint-card {
  background: rgba(15, 23, 42, 0.8);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.hint-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 1.1rem;
}

.hint-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.hint-card li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.hint-card li strong {
  color: var(--accent-2);
  font-weight: 600;
}

.section-intro {
  margin-bottom: 1.5rem;
}

.progression-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.progression-section h2 {
  margin-top: 0;
  color: var(--accent-2);
}

.progression-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.progression-tools label {
  color: var(--text);
  font-weight: 600;
}

.progression-tools select {
  min-width: 220px;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
}

.progression-results {
  display: grid;
  gap: 1rem;
}

.prog-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 18px;
  padding: 1.2rem;
}

.prog-card h3 {
  margin: 0 0 0.75rem;
  color: var(--accent);
}

.prog-card p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.prog-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
}

.chord-container {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.chord-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
}

.chord-item strong {
  color: var(--accent);
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.chord-item .diagram {
  transform: scale(0.8);
  transform-origin: top center;
}

.chord-item .string {
  height: 120px;
  width: 20px;
}

.chord-item .string-labels {
  justify-content: space-around;
  font-size: 0.7rem;
  margin-top: 0.2rem;
}

.hint-text {
  margin: 0;
  color: var(--muted);
}

.chord-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease;
  cursor: pointer;
  position: relative;
}

.card.pinned {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.15), rgba(88, 28, 208, 0.12));
  border-color: rgba(124, 58, 237, 0.4);
}

.pin-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  display: none;
  font-size: 1rem;
  transition: all 150ms ease;
  align-items: center;
  justify-content: center;
}

.card:hover .pin-button {
  display: flex;
}

.pin-button:hover {
  background: rgba(148, 163, 184, 0.3);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #f8fafc;
}

.diagram {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
  margin: 1.2rem 0 0.75rem;
}

.string {
  width: 100%;
  height: 140px;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  position: relative;
  display: flex;
  justify-content: center;
}

.fret {
  position: absolute;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
}

.fret-line {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.nut {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 0 0 8px 8px;
}

.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: bold;
  color: white;
}

.string-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-summary {
  margin-top: 2rem;
}

.detail-card {
  width: min(720px, 100%);
  background: var(--surface);
  border-radius: 28px;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow);
}

.diagram-large {
  margin: 1.5rem 0;
}

.string-marker {
  position: absolute;
  top: -20px;
  width: 100%;
  height: 18px;
  display: grid;
  place-items: center;
}

.open-string {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-radius: 50%;
}

.muted-string {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.footer {
  text-align: center;
  padding: 1.25rem 0 2rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .hints-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hints-section {
    margin: 1rem 0;
    padding: 1rem;
  }

  .hint-card {
    padding: 1rem;
  }

  .chord-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.85rem;
  }

  .card {
    padding: 0.9rem;
  }

  .card h3 {
    font-size: 1rem;
  }

  .diagram {
    gap: 0.2rem;
  }

  .string {
    height: 100px;
  }

  .dot {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }

  .string-labels {
    font-size: 0.85rem;
  }

  .pin-button {
    display: flex !important;
    opacity: 1;
    z-index: 2;
    top: 0.65rem;
    right: 0.65rem;
  }

  .card:hover .pin-button {
    display: flex;
  }

  .string-marker {
    top: -16px;
  }
}
