/* Iso Cycles: stage, rail, line-up and drawer extras. Builds on house-style.css. */

/* ---------- Stage ---------- */
.iso-stage { aspect-ratio: 16 / 9; background: #0e0f15; touch-action: none; user-select: none; }
.iso-stage canvas#floor { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.stage-badges { grid-area: badges; display: flex; gap: 7px; align-items: center; }
.glass-badge {
  display: inline-flex; align-items: center; height: 36px; padding: 0 10px;
  border: 1px solid var(--glass-line); border-radius: 4px; background: var(--glass);
  backdrop-filter: blur(10px); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.glass-badge b { color: var(--accent); font-weight: 400; margin-right: 6px; }

.stage-bottom {
  position: absolute; inset: auto 18px 16px; display: flex; justify-content: space-between; align-items: end;
  gap: 12px; pointer-events: none;
}
.stage-bottom > * { pointer-events: auto; }
.cycle-row {
  display: flex; gap: 2px; padding: 2px;
  border: 1px solid var(--glass-line); border-radius: 5px; background: var(--glass); backdrop-filter: blur(10px);
}
.cycle-row button { min-height: 30px; padding: 5px 10px; border-radius: 3px; font-size: 11px; }
.cycle-row button[aria-pressed='true'] { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

.compass { display: grid; grid-template-columns: repeat(2, 40px); gap: 4px; transform: rotate(0deg); }
.compass button {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--glass-line); border-radius: 4px; background: var(--glass); backdrop-filter: blur(10px);
}
.compass svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.compass button[aria-pressed='true'] { color: var(--accent); border-color: var(--accent); }

.stage-hint {
  position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); margin: 0;
  font-size: 11px; color: var(--muted); white-space: nowrap; pointer-events: none;
  text-shadow: 0 1px 6px #000; transition: opacity 0.6s;
}
.stage-hint.gone { opacity: 0; }
.iso-stage:fullscreen { aspect-ratio: auto; width: 100vw; height: 100vh; }

/* ---------- Rail: heroes ---------- */
.rail-item .swatch { image-rendering: pixelated; }
.rail-item canvas.face { margin-left: auto; width: 34px; height: 34px; image-rendering: pixelated; }
.rail-item .px { font-variant-numeric: tabular-nums; }

.cycle-card .card-head { display: flex; justify-content: space-between; align-items: baseline; }
.cycle-card canvas#strip { display: block; width: 100%; height: auto; margin: 14px 0 4px; image-rendering: pixelated; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cycle-card p { margin: 10px 0 0; line-height: 1.6; }

/* ---------- Line-up ---------- */
.lineup { padding: 56px 0 72px; border-top: 1px solid var(--rule); margin-top: 48px; }
.lineup-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.lineup h2 { margin: 0; font: 400 clamp(34px, 3.4vw, 52px) / 1 'Instrument Serif', serif; letter-spacing: -0.02em; }
.cycle-tabs { display: flex; gap: 8px; }
.cycle-tabs button { min-height: 40px; padding: 8px 16px; border: 1px solid var(--rule); background: var(--panel); font-size: 12px; }
.cycle-tabs button[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); }
.cycle-tabs button:hover { border-color: var(--accent); }
.lineup-grid { display: grid; grid-template-columns: 150px repeat(4, minmax(0, 1fr)); gap: 6px; }
.lg-corner { }
.lg-col { padding: 0 0 8px; font-size: 11px; letter-spacing: 0.13em; color: var(--accent); }
.lg-col small { display: block; margin-top: 4px; letter-spacing: 0; font-size: 10px; color: var(--muted); }
.lg-name { display: flex; flex-direction: column; justify-content: center; padding-right: 10px; }
.lg-name strong { font: 400 26px / 1 'Instrument Serif', serif; letter-spacing: -0.01em; }
.lg-name small { margin-top: 6px; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-cell { display: grid; place-items: center; min-height: 176px; background: #0e0f15; border: 1px solid var(--rule); overflow: hidden; }
.lg-cell canvas { display: block; image-rendering: pixelated; }
.lineup-note { margin: 16px 0 0; font-size: 12px; color: var(--muted); max-width: 68ch; }

/* ---------- Drawer extras ---------- */
.drawer-body a { color: var(--accent); }
.drawer-body code { font: 12px ui-monospace, 'SF Mono', Menlo, monospace; color: var(--ink); }
.route { margin: 0; padding: 0 0 0 20px; font-size: 13px; line-height: 1.7; color: var(--muted); max-width: 72ch; }
.route li { margin-bottom: 8px; }
.route strong { color: var(--ink); font-weight: 600; }
.making-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 26px 0 0; }
.making-figures figure { margin: 0; }
.making-figures img, .making-figures video { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #0e0f15; border: 1px solid var(--rule); image-rendering: pixelated; }
.making-figures figcaption { margin-top: 8px; font-size: 10px; color: var(--muted); letter-spacing: 0.05em; }
.step img[src*='step3'], .step img[src*='step4'], .step img[src*='step5'], .mistake img { image-rendering: pixelated; background: #0e0f15; }

.costs { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 12px; }
.costs th { text-align: left; font-weight: 400; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); }
.costs td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.costs td:last-child, .costs th:last-child { text-align: right; }
.costs tfoot td { color: var(--accent); border-bottom: 0; }

.prompt-cards { display: grid; gap: 10px; }
.prompt-card { border: 1px solid var(--rule); background: var(--panel); }
.prompt-card header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.prompt-card header strong { font-size: 13px; font-weight: 600; }
.prompt-card header small { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.prompt-card pre { margin: 0; padding: 14px; border-left: 2px solid var(--accent); font: 12px / 1.6 ui-monospace, 'SF Mono', Menlo, monospace; white-space: pre-wrap; color: var(--ink); }
.copy { flex: none; min-height: 32px; padding: 6px 12px; border: 1px solid var(--rule); font-size: 11px; }
.copy:hover { border-color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .making-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .iso-stage { aspect-ratio: 4 / 5; }
  .stage-top .shortcut-row { position: static; transform: none; grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
  .stage-top { grid-template-columns: 1fr auto; grid-template-areas: 'badges tools' 'shortcuts shortcuts'; }
  .stage-bottom { inset: auto 12px 12px; }
  .stage-hint { bottom: auto; top: 108px; }
  .lineup-head { flex-direction: column; align-items: start; }
  .lineup-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg-corner { display: none; }
  .lg-name { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; align-items: baseline; gap: 10px; padding: 14px 0 2px; }
  .lg-name small { margin: 0; }
  .lg-cell { min-height: 110px; }
}
@media (max-width: 480px) {
  .glass-badge { display: none; }
  .cycle-row button { padding: 5px 7px; font-size: 10px; }
  .compass { grid-template-columns: repeat(2, 36px); }
  .compass button { width: 36px; height: 36px; }
  .cycle-tabs { width: 100%; }
  .cycle-tabs button { flex: 1; padding: 8px 4px; }
  .making-figures { grid-template-columns: 1fr 1fr; }
  .shortcut-row button span { display: none; }
}
@media (max-height: 460px) and (orientation: landscape) {
  .iso-stage { aspect-ratio: auto; height: calc(100vh - 24px); }
}

/* Touch screens: no keyboard, so show the words instead of the keycaps */
@media (hover: none) {
  .shortcut-row kbd { display: none; }
  .shortcut-row button span { display: inline !important; }
}

/* ---------- Grid first, playground second ---------- */
.lineup.lineup-first { margin-top: 0; padding: 30px 0 56px; border-top: 0; }
.playground { padding: 48px 0 72px; border-top: 1px solid var(--rule); }
.playground h2 { margin: 0; font: 400 clamp(34px, 3.4vw, 52px) / 1 'Instrument Serif', serif; letter-spacing: -0.02em; }
.play-help { margin: 0; max-width: 46ch; font-size: 12px; line-height: 1.6; color: var(--muted); }
button.lg-cell { padding: 0; cursor: pointer; transition: border-color 0.2s; }
button.lg-cell:hover { border-color: var(--accent); }
button.lg-cell.current { border-color: var(--accent); }

.making-film { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 6px 0 26px; background: #0e0f15; border: 1px solid var(--rule); }

/* Shared exploration footer (navigation, cookie settings, Create with links). */
:root { --exploration-footer-bg: #15161d; --exploration-footer-ink: #a9afbd; --exploration-footer-border: #393d4c; }
.site-foot { margin-top: 24px; }
.making-pdf { margin: -8px 0 22px; font-size: 13px; }
.making-pdf a { color: var(--ink); text-underline-offset: 3px; }
/* Keep the way back to the gallery readable on phones, not just the logo. */
@media (max-width: 480px) {
  .brand img { width: 84px; height: 21px; }
  .brand span { display: inline; margin-left: 2px; }
}
/* showModal() can focus the dialog itself; its close button carries the accent ring instead. */
dialog.drawer:focus, dialog.drawer:focus-visible { outline: none; }
