/* Create By Asking: styles for the advanced projects (beat maker, 3D solar system, fluid simulation).
   Loaded after style.css and tools.css; reuses their tokens, .score, .chip-dark and .icon-btn. */

.adv-shell { background: var(--screen); border-radius: 18px; padding: clamp(12px, 2.5vw, 22px); color: #F2ECFF; display: grid; gap: 14px; position: relative; }
.adv-shell [hidden] { display: none !important; }
.adv-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adv-bar .sp { flex: 1; }
.adv-shell .btn { background: #FFC93C; color: #1C0F3F; }
.adv-shell .btn-ghost { background: rgba(255, 255, 255, 0.08); color: #F2ECFF; border: 0; }
.adv-shell .btn:disabled { opacity: 0.5; cursor: default; }
.adv-label { font: 600 0.68rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #A597CC; }
.adv-range { display: flex; align-items: center; gap: 8px; font-size: var(--step--1); color: #CBBFE8; }
.adv-range input { accent-color: #FFC93C; width: 120px; }
.adv-range output { font: 600 0.8rem/1 var(--mono); color: #fff; min-width: 3.2em; }
.adv-note { margin: 0; font-size: var(--step--1); color: #A597CC; }
.adv-msg { min-height: 1.4em; margin: 0; font-size: var(--step--1); color: #FFC93C; }
.adv-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- beat maker ---------- */
.bm-transport { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.bm-play { display: inline-flex; align-items: center; gap: 12px; border: 0; cursor: pointer; border-radius: 999px; padding: 14px 28px 14px 18px; background: #FFC93C; color: #1C0F3F; font: 800 1.35rem/1 var(--display); box-shadow: 0 0 0 0 rgba(255, 201, 60, 0.6), 0 8px 24px -8px rgba(255, 201, 60, 0.7); transition: transform 0.1s, background 0.15s; }
.bm-play:hover { transform: translateY(-1px); }
.bm-play:active { transform: scale(0.97); }
.bm-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.bm-play-icon { width: 34px; height: 34px; border-radius: 50%; background: #1C0F3F; position: relative; flex: none; }
.bm-play-icon::after { content: ""; position: absolute; left: 13px; top: 10px; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent #FFC93C; }
.bm-play[aria-pressed="true"] { background: #FF2E7E; color: #fff; }
.bm-play[aria-pressed="true"] .bm-play-icon::after { left: 11px; top: 11px; border: 0; width: 12px; height: 12px; background: #FF2E7E; border-radius: 2px; }
.bm-play.pulse { animation: bm-pulse 0.35s ease-out; }
@keyframes bm-pulse { from { box-shadow: 0 0 0 0 rgba(255, 46, 126, 0.7), 0 8px 24px -8px rgba(255, 46, 126, 0.7); } to { box-shadow: 0 0 0 14px rgba(255, 46, 126, 0), 0 8px 24px -8px rgba(255, 46, 126, 0.7); } }
.bm-knobs { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; flex: 1; }
.bm-bpm { display: grid; gap: 6px; }
.bm-bpm-row { display: flex; align-items: center; gap: 8px; }
.bm-bpm-row strong { font: 800 1.8rem/1 var(--display); color: #fff; min-width: 2.2em; text-align: center; font-variant-numeric: tabular-nums; }
.bm-bpm-row small { font: 600 0.7rem/1 var(--mono); color: #A597CC; margin-right: 4px; }
.bm .adv-range { display: grid; grid-template-columns: auto auto; gap: 6px 8px; align-items: center; }
.bm .adv-range .adv-label { grid-column: 1 / -1; }
.bm-quick { display: flex; gap: 8px; }
.bm-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bm-screen { position: relative; }
.bm-vis { width: 100%; height: 64px; display: block; border-radius: 10px; background: rgba(0, 0, 0, 0.28); }
.bm-chords { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); pointer-events: none; }
.bm-chords span { display: grid; place-items: center; font: 800 1.1rem/1 var(--display); color: rgba(242, 236, 255, 0.35); border-left: 1px solid rgba(255, 255, 255, 0.06); transition: color 0.15s, text-shadow 0.15s; }
.bm-chords span:first-child { border-left: 0; }
.bm-chords span.now { color: #fff; text-shadow: 0 0 14px #FF6FD8; }
.bm-grid { display: grid; gap: 4px; user-select: none; -webkit-user-select: none; touch-action: none; }
.bm-row { display: grid; grid-template-columns: 82px repeat(16, minmax(0, 1fr)); gap: 4px; align-items: stretch; }
.bm-sep { font: 600 0.68rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #A597CC; padding: 8px 0 2px; }
.bm-label { border: 0; background: none; color: #CBBFE8; font: 600 0.78rem/1 var(--body); text-align: left; padding: 0 4px 0 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-label::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.bm-label:hover { color: #fff; }
.bm-label .s { display: none; }
.bm-cell { border: 0; padding: 0; height: clamp(16px, 2.6vw, 26px); border-radius: 6px; background: rgba(255, 255, 255, 0.07); cursor: pointer; transition: background 0.08s, box-shadow 0.15s, transform 0.08s; position: relative; }
.bm-cell.beat { background: rgba(255, 255, 255, 0.13); }
.bm-cell:hover { background: rgba(255, 255, 255, 0.22); }
.bm-cell.on { background: color-mix(in srgb, var(--c) 72%, #1C0F3F); box-shadow: 0 0 8px -2px var(--c); }
.bm-cell.acc { background: var(--c); box-shadow: 0 0 14px 0 var(--c); }
.bm-cell.acc::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: #fff; }
.bm-cell.now { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: -2px; }
.bm-cell.on.hit { animation: bm-hit 0.22s ease-out; }
@keyframes bm-hit { from { transform: scale(1.18); box-shadow: 0 0 22px 4px var(--c); filter: brightness(1.5); } to { transform: none; } }
.bm-cell:focus-visible { outline: 2px solid #FFC93C; outline-offset: 1px; }
.bm-sound { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.bm-select { background: rgba(255, 255, 255, 0.08); color: #fff; border: 0; border-radius: 999px; padding: 7px 12px; font: 600 var(--step--1)/1 var(--body); max-width: 100%; }
.bm-select option { background: #1C0F3F; }
.bm .adv-note kbd { font: 600 0.75rem/1 var(--mono); background: rgba(255, 255, 255, 0.1); border-radius: 5px; padding: 2px 6px; color: #fff; }
.bm .adv-note b { color: #F2ECFF; }
@media (max-width: 560px) {
  .bm-play { padding: 12px 22px 12px 14px; font-size: 1.15rem; }
  .bm-row { grid-template-columns: 46px repeat(16, minmax(0, 1fr)); gap: 2px; }
  .bm-grid { gap: 2px; }
  .bm-label { font-size: 0.64rem; }
  .bm-label::before { display: none; }
  .bm-label .l { display: none; }
  .bm-label .s { display: inline; }
  .bm-cell { border-radius: 3px; height: 18px; }
  .bm-cell.acc::after { width: 3px; height: 3px; margin: -1.5px; }
  .bm-chords span { font-size: 0.9rem; }
  .adv-range input { width: 90px; }
}

/* ---------- 3D solar system ---------- */
.ss-main { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; }
.ss-stage { position: relative; border-radius: 12px; overflow: hidden; background: #0B0620; aspect-ratio: 16 / 10; }
.ss-stage:fullscreen { aspect-ratio: auto; border-radius: 0; }
.ss-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.ss-stage canvas:active { cursor: grabbing; }
.ss-date { position: absolute; left: 12px; top: 10px; font: 600 0.8rem/1 var(--mono); color: #FFC93C; background: rgba(11, 6, 32, 0.7); padding: 6px 9px; border-radius: 7px; pointer-events: none; }
.ss-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.ss-tools .icon-btn { background: rgba(11, 6, 32, 0.75); }
.ss-hint { position: absolute; left: 12px; bottom: 10px; font-size: 0.72rem; color: #A597CC; pointer-events: none; }
.ss-side { display: grid; gap: 12px; align-content: start; }
.ss-info { background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 14px; font-size: var(--step--1); color: #CBBFE8; min-height: 200px; }
.ss-info h3 { font: 800 1.4rem/1.1 var(--display); color: #fff; margin-bottom: 8px; }
.ss-info p { margin: 8px 0 0; }
.ss-info dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; }
.ss-info dt { font: 600 0.66rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: #A597CC; }
.ss-info dd { margin: 0; color: #fff; }
.ss-planets { display: flex; flex-wrap: wrap; gap: 6px; }
.ss-planets .chip-dark { padding: 6px 10px; }
@media (max-width: 820px) {
  .ss-main { grid-template-columns: 1fr; }
  .ss-stage { aspect-ratio: 4 / 3.4; }
  .ss-info { min-height: 0; }
}

/* ---------- fluid simulation ---------- */
.fl-stage { position: relative; border-radius: 12px; overflow: hidden; background: #0A0519; aspect-ratio: 16 / 9; }
.fl-stage:fullscreen { aspect-ratio: auto; border-radius: 0; }
.fl-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.fl-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font: 600 0.85rem/1 var(--body); color: #fff; background: rgba(10, 5, 25, 0.6); padding: 9px 14px; border-radius: 99px; pointer-events: none; animation: fl-bob 2s ease-in-out infinite; white-space: nowrap; }
@keyframes fl-bob { 50% { transform: translate(-50%, -4px); } }
.fl-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.fl-tools .icon-btn { background: rgba(10, 5, 25, 0.6); }
.fl-fail { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: #CBBFE8; background: #0A0519; }
.fl-fail h3 { font: 800 var(--step-2)/1.1 var(--display); color: #FFC93C; margin-bottom: 8px; }
.adv-shell .btn-ghost[aria-pressed="true"] { background: #FFC93C; color: #1C0F3F; }
@media (hover: none) { .adv-shell [data-hover] { display: none; } } /* phones and tablets have no mouse to hover with */
.fl-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
@media (max-width: 600px) { .fl-stage { aspect-ratio: 4 / 4.4; } }

/* ---------- "Advanced" tag on cards ---------- */
.tag-adv { background: #1C0F3F; color: #FFC93C; }
