/* Stjärnfärden only (spel-stjarnfarden.html).
   Split out of css/style.css so pages do not download rules they cannot use; tests/css-scope.test.js checks the scope. */

/* ---- Stjärnfärden (spel-stjarnfarden.html) ---- */
.sf-stage .adv-btns { grid-template-areas: "capsule" "charge"; grid-template-columns: auto; }
.sf-stage .adv-btn.glow { box-shadow: 0 0 0 5px rgba(255, 201, 60, .7), 0 5px 0 rgba(0,0,0,.25); }
.sf-stage .adv-hud { max-width: 40%; }
.sf-drag { position: absolute; left: 0; top: 0; bottom: 0; width: 66%; z-index: 1; touch-action: none; }
.sf-stage canvas { touch-action: none; }
.sf-q { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; background: rgba(255,255,255,.96); border-radius: 18px; padding: 4px 22px 6px; text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,.18); pointer-events: none; color: var(--ink); }
.sf-q[hidden] { display: none; }
.sf-stage .adv-sign { top: auto; bottom: 14px; }
.sf-prog { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); width: 28%; height: 8px; border-radius: 5px; background: rgba(255,255,255,.6); z-index: 2; overflow: hidden; pointer-events: none; }
.sf-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #9a7cf2, #ff8fb1); border-radius: 5px; }
.sf-down { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(31, 35, 72, .35); }
.sf-down[hidden] { display: none; }
.sf-down .card { max-width: 380px; text-align: center; }
.sf-shop { z-index: 8; }
.sf-shop-card { max-width: 460px; text-align: left; }
.sf-shop-card h2, .sf-shop-card .sf-parts { text-align: center; }
.sf-part { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sf-dots { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.sf-dots i { width: 12px; height: 12px; border-radius: 50%; background: #e2dcf2; }
.sf-dots i.on { background: #ffc93c; }
.sf-max { font-weight: 900; color: var(--mint, #2ec4a0); }
.sf-turn { display: none; position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 2; background: rgba(255,255,255,.9); border-radius: 12px; padding: 4px 12px; font-weight: 800; font-size: .85rem; pointer-events: none; }
.sf-portrait .sf-turn { display: block; }
body:not(.game-play) .sf-turn { display: none; }
@media (max-width: 760px), (max-height: 500px) {
  .sf-q { padding: 2px 14px 4px; top: 6px; }
}
.sf-portrait .sf-q { top: 116px; }
.sf-turn[hidden] { display: none !important; }
/* v2: level select, ship colours, manual fire, reversed questions, portrait readability */
.sf-levels { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 6px 0 2px; }
.sf-levels .btn[disabled] { opacity: .65; }
.sf-shop-card { width: min(520px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 24px); overflow-y: auto; box-sizing: border-box; }
.sf-shop { place-items: center; }
.sf-col-h { margin: 14px 0 2px; text-align: center; }
.sf-col-note { font-size: .85rem; margin: 0 0 8px; text-align: center; }
.sf-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sf-color { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; min-width: 0; border: 2px solid var(--line); border-radius: 14px; background: #fff; font: inherit; cursor: pointer; min-height: 44px; color: var(--ink); }
.sf-color i { width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.12); }
.sf-color small { font-size: .72rem; font-weight: 800; }
.sf-color small.sf-req { color: var(--ink-soft); font-weight: 600; line-height: 1.2; text-align: center; }
.sf-color.on { border-color: #9a7cf2; box-shadow: 0 0 0 3px rgba(154, 124, 242, .35); }
.sf-color[disabled] { cursor: default; background: #f6f4fb; }
.sf-color[disabled] i { filter: grayscale(.7) opacity(.6); }
.sf-unlock { font-weight: 800; margin: 6px 0; }
.sf-stage.sf-manual .adv-btns { grid-template-areas: "capsule capsule" "fire charge"; grid-template-columns: auto auto; }
.sf-q.rev b { color: #5b3fc4; }
.sf-q { max-width: calc(100% - 20px); }
.sf-portrait .sf-q b { font-size: 2.3rem; }
.sf-portrait .sf-keys { display: none; }
.sf-portrait .sf-q small { font-size: .9rem; }
.sf-portrait .adv-hud .chip { font-size: 1rem; }
@media (max-width: 640px) {
  .sf-colors { grid-template-columns: repeat(2, 1fr); }
}
.sf-portrait .adv-title { top: 72%; }

/* ===================== Music (js/music.js) ================================ */
/* Stjärnfärden v3: Stjärnkartan (level map), nose loadouts, decals, master level dot */
.sf-pick { font-weight: 700; align-self: center; }
.sf-map-card { width: min(640px, calc(100% - 24px)); }
.sf-map-box { position: relative; height: clamp(220px, 46vh, 330px); margin: 6px 0 10px; border-radius: 18px; background: radial-gradient(circle at 20% 80%, #ffe3f1 0, transparent 40%), radial-gradient(circle at 85% 20%, #fff3c4 0, transparent 35%), linear-gradient(160deg, #cfe8ff, #e3d9ff 55%, #c3b8f0); overflow: hidden; }
.sf-map-box svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sf-map-box polyline { fill: none; stroke: #fff; stroke-width: 1.2; stroke-dasharray: 2.4 2.4; vector-effect: non-scaling-stroke; stroke-width: 4px; opacity: .85; }
.sf-planet { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 44px; min-height: 44px; padding: 2px 6px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.sf-planet i { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-style: normal; font-size: 1.6rem; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.15), inset 0 0 0 3px #e7defc; }
.sf-planet small { font-size: .75rem; color: #b7791f; font-weight: 800; }
.sf-planet.on i { box-shadow: 0 0 0 4px #9a7cf2, 0 4px 0 rgba(0,0,0,.15); }
.sf-planet[disabled] { cursor: default; }
.sf-planet[disabled] i { filter: grayscale(.8); opacity: .7; }
.sf-planet[disabled] small { color: var(--ink-soft); }
.sf-ico { font-size: 1.6rem; line-height: 38px; height: 38px; }
.sf-dots i.m { box-shadow: inset 0 0 0 2px #9a7cf2; }
.sf-part small.sf-req { display: block; color: var(--ink-soft); font-size: .78rem; }
@media (max-width: 640px) {
  .sf-planet b { font-size: .7rem; }
  .sf-planet i { width: 44px; height: 44px; font-size: 1.35rem; }
}
.sf-part > div > small { display: block; }
