/* Page 5 · Levels (/levels). Shares the app shell (header, tab bar, labels) from home.css.
   Mobile-first: level card on top, winding map below; desktop: map left, card right (sticky). */

.levels { padding-top: 8px; padding-bottom: 24px; }
.levels-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.levels-head h1 { font-size: 1.6rem; }
.star-total { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rule { margin-top: 2px; font-size: 0.85rem; color: var(--muted); }

.clef-tabs { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.clef-tabs button { min-height: 44px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: 0.88rem; color: var(--muted); padding: 0 6px; }
.clef-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }

.levels-grid { display: grid; gap: 8px; margin-top: 16px; }

/* Selected level card */
.level-card { padding: 18px; border-radius: var(--radius); background: var(--ink); color: #fff; outline: none; }
.level-card.locked { background: var(--paper-2); color: var(--ink); }
.card-eyebrow { color: var(--gold); }
.level-card.locked .card-eyebrow { color: var(--muted); }
.level-card h2 { font-size: 1.25rem; margin-top: 2px; }
.card-stars { margin-top: 4px; font-size: 1.05rem; letter-spacing: 2px; }
.card-stars:empty { display: none; }
.card-meta { margin-top: 4px; font-size: 0.85rem; color: #c9cbe0; }
.level-card.locked .card-meta { color: var(--ink-2); }
.card-actions { display: flex; gap: 8px; margin-top: 14px; }
.card-actions .btn { flex: 1; padding-inline: 10px; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.card-hint { margin-top: 10px; font-size: 0.8rem; color: #c9cbe0; }
.level-card.locked .card-hint { color: var(--ink-2); font-size: 0.88rem; margin-top: 6px; }

/* Map */
.map { position: relative; }
.map-path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-path path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.map-path .trail { stroke: var(--line); stroke-width: 4; }
.map-path .walked { stroke: var(--ok); stroke-width: 4; opacity: 0.55; }
.map-nodes { list-style: none; margin: 0; padding: 0; position: relative; }
.map-nodes li { position: absolute; transform: translate(-50%, -50%); }
.node {
  width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  font-size: 1.15rem; font-weight: 800; background: var(--ink); color: #fff; position: relative;
}
.node.open { background: var(--card); color: var(--ink); border: 2px solid var(--ink); }
.node.current { background: var(--accent); width: 62px; height: 62px; font-size: 1.3rem; box-shadow: 0 0 0 7px rgba(226, 118, 58, 0.22); }
.node.locked { background: #ece7dd; color: #9a9fb8; font-size: 1rem; }
.node.locked svg { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--card); color: #9a9fb8; border: 1px solid var(--line); }
.node[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 4px; }
.node.current[aria-pressed="true"] { outline-color: var(--ink); }
.node-label { position: absolute; top: 50%; transform: translateY(-50%); width: max-content; max-width: 150px; font-size: 0.85rem; line-height: 1.25; pointer-events: none; }
.node-label.right { left: calc(100% + 12px); }
.node-label.left { right: calc(100% + 12px); text-align: right; }
.node-label b { display: block; font-weight: 800; }
.node-label .st { display: block; letter-spacing: 1px; color: var(--gold); }
.node-label .st i { font-style: normal; color: #d8d2c6; }
.node-label .tag { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; background: var(--accent-soft); color: var(--accent-ink); }
.node-label .note { display: block; font-size: 0.75rem; color: var(--muted); }
.is-locked .node-label b { color: #9a9fb8; font-weight: 700; }

@media (min-width: 420px) {
  .node-label { max-width: 190px; }
}
@media (min-width: 900px) {
  .levels { padding-top: 32px; max-width: 1040px; }
  .levels-head h1 { font-size: 2rem; }
  .clef-tabs { max-width: 520px; }
  .levels-grid { grid-template-columns: 1fr 380px; gap: 40px; align-items: start; margin-top: 24px; }
  .level-card { order: 2; position: sticky; top: 80px; }
  .map-wrap { order: 1; }
  .node-label { max-width: 220px; }
}

/* Plus levels on the Free plan (assets/plan.js) */
.level-card.plus .card-eyebrow { color: var(--gold); }
.plus-box { margin-top: 12px; }
.plus-box .btn { width: 100%; }
.map-nodes li.is-plus .node { opacity: 0.75; }
