/* Cosmic Zoom Sort: the work order and controls beside the planetarium dome (and its zoom reel), inside the practice
 * shell's stage. Text >= 16px as rendered; colour is never the only signal (✓ / ✗ marks, solid vs dashed borders). */
.cz { position: absolute; inset: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; padding: 8px 12px; color: var(--tlg-text, #172c38); }
.cz-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 2px; }

/* the work order */
.cz-ticket { padding: 8px 12px 10px; border-radius: var(--tlg-radius-lg, 14px); border: 2px solid #8f93d6; background: #f3f2fd; color: #1c1d44; }
.cz-ticket-k { margin: 0 0 4px; font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: var(--tlg-tracking-caps, .08em); color: #3b3f9e; }
.cz-rule { margin: 4px 0 0; font-size: 16px; font-weight: 600; line-height: 1.35; }
.cz-rule.is-big { font-size: 19px; font-weight: 800; }
html[data-theme="dark"] .cz-ticket { background: #1d1e3a; color: #e8e8ff; border-color: #5a5fb8; }
html[data-theme="dark"] .cz-ticket-k { color: #b9bcff; }

/* object cards */
.cz-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.cz-field legend, .cz-legend { padding: 0; margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.cz-tray { display: grid; grid-template-columns: 1fr; gap: 6px; }
.cz-card, .cz-choice, .cz-slot { position: relative; font: inherit; cursor: pointer; color: var(--tlg-text, #172c38); background: var(--tlg-surface, #fff);
  border: 2px solid var(--tlg-border, #a5b6c1); border-radius: 12px; box-shadow: 0 2px 0 rgba(0, 0, 0, .1); touch-action: manipulation; }
.cz-card { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 4px 10px 4px 5px; min-height: 54px; text-align: left; touch-action: none; }
.cz-card-i svg, .cz-slot-i svg, .cz-choice-i svg { display: block; width: 100%; height: 100%; }
.cz-card-i { width: 46px; height: 46px; }
.cz-card-t { display: flex; flex-direction: column; min-width: 0; }
.cz-card-n { font-size: 17px; font-weight: 800; line-height: 1.15; }
.cz-card-c { font-size: 16px; font-weight: 500; line-height: 1.2; color: var(--tlg-text-muted, #44515a); }
.cz-card-on { font-size: 16px; font-weight: 800; color: #3b3f9e; }
.cz-card:hover:not(:disabled), .cz-choice:hover:not(:disabled), .cz-slot:hover:not(:disabled) { border-color: #3b3f9e; }
.cz-card.is-placed { opacity: .55; border-style: dashed; box-shadow: none; }
html[data-theme="dark"] .cz-card-on { color: #b9bcff; }
html[data-theme="dark"] .cz-card-c { color: #c6cbe0; }

/* word-bank choices */
.cz-choices { display: grid; gap: 8px; }
.cz-choices.is-two { grid-template-columns: 1fr 1fr; }
.cz-choice { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 26px 6px 10px; min-height: 52px; text-align: left; }
.cz-choices.is-two .cz-choice { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 8px 6px; }
.cz-choices.is-two .cz-choice-i { width: 64px; height: 64px; }
.cz-choice-i { width: 34px; height: 34px; color: #3b3f9e; }
.cz-choice-l { font-size: 17px; font-weight: 700; line-height: 1.25; }
html[data-theme="dark"] .cz-choice-i.is-clock { color: #b9bcff; }
.cz-choice[aria-pressed="true"] { border-color: #3b3f9e; border-width: 3px; background: #ecebfd; box-shadow: 0 0 0 3px rgba(59, 63, 158, .25); }
.cz-choice[aria-pressed="true"] .cz-choice-l::before { content: '● '; color: #3b3f9e; }
html[data-theme="dark"] .cz-choice[aria-pressed="true"] { background: #26285a; border-color: #b9bcff; }
html[data-theme="dark"] .cz-choice[aria-pressed="true"] .cz-choice-l::before { color: #b9bcff; }
.cz-card:disabled, .cz-choice:disabled, .cz-slot:disabled { cursor: default; }
.cz-choice:disabled { opacity: 1; }

/* number entry */
.cz-num-row { display: flex; align-items: center; gap: 10px; }
.cz-num input { width: 170px; font: inherit; font-size: 24px; font-weight: 800; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--tlg-border, #a5b6c1);
  background: var(--tlg-surface, #fff); color: var(--tlg-text, #172c38); font-variant-numeric: tabular-nums; }
.cz-num input:focus-visible { outline: 3px solid #3b3f9e; outline-offset: 2px; }
.cz-unit { font-size: 19px; font-weight: 800; }
.cz-num input.is-ok { border-color: #2e8b57; border-width: 3px; }
.cz-num input.is-bad { border-color: #b42318; border-width: 3px; border-style: dashed; }

/* ✓ / ✗ after Check (practice only) */
.cz-choice.is-ok, .cz-slot.is-ok { border-color: #2e8b57; border-width: 3px; }
.cz-choice.is-bad, .cz-slot.is-bad { border-color: #b42318; border-style: dashed; border-width: 3px; }
.cz-mark { position: absolute; top: 2px; right: 6px; font-size: 18px; font-weight: 900; }
.is-ok > .cz-mark { color: #1d6b40; }
.is-bad > .cz-mark { color: #b42318; }
html[data-theme="dark"] .is-ok > .cz-mark { color: #8fe0ad; }
html[data-theme="dark"] .is-bad > .cz-mark { color: #ffb4a8; }

.cz-msg { margin: 0; font-size: 16px; font-weight: 700; color: #8a3b12; }
.cz-msg:empty { display: none; }
html[data-theme="dark"] .cz-msg { color: #ffbf8a; }
.cz-about { font-size: 16px; line-height: 1.45; }
.cz-about summary { cursor: pointer; font-weight: 700; }
.cz-about p { margin: 6px 0 0; }

/* the dome */
.cz-view { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cz-scene { position: relative; width: 100%; aspect-ratio: 720 / 400; border-radius: var(--tlg-radius-lg, 14px); overflow: hidden; border: 2px solid #2b2f55; user-select: none; -webkit-user-select: none; background: #05081a; flex: none; }
.cz-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cz-schem { position: absolute; right: 10px; bottom: 6px; font-size: 16px; font-weight: 600; font-style: italic; color: #cdd5f0; pointer-events: none; }
.cz-t { font-family: var(--tlg-font-body, system-ui, sans-serif); fill: #eef1ff; }
.cz-t-desk { font-size: 17px; font-weight: 800; fill: #cfd6e3; letter-spacing: .08em; }
.cz-t-title { font-size: 21px; font-weight: 800; fill: #f5f6ff; paint-order: stroke; stroke: #05081a; stroke-width: 4px; }
.cz-t-dsub { font-size: 18px; font-weight: 600; fill: #cdd5f0; }
.cz-t-head { font-size: 20px; font-weight: 800; fill: #fde68a; }
.cz-t-lad { font-size: 18px; font-weight: 800; fill: #f5f6ff; paint-order: stroke; stroke: #05081a; stroke-width: 4px; }
.cz-t-sub { font-size: 16px; font-weight: 700; fill: #c7d2fe; paint-order: stroke; stroke: #05081a; stroke-width: 4px; }
.cz-t-step { font-size: 17px; font-weight: 800; fill: #fde68a; }
.cz-t-dist { font-size: 22px; font-weight: 800; fill: #fde68a; paint-order: stroke; stroke: #05081a; stroke-width: 4px; }
.cz-t-clock { font-size: 22px; font-weight: 800; fill: #0b1230; font-variant-numeric: tabular-nums; }
.cz-t-call { font-size: 18px; font-weight: 800; fill: #fde68a; paint-order: stroke; stroke: #05081a; stroke-width: 4px; }
.cz-t-or { font-size: 22px; font-weight: 800; fill: #9fb3d9; }
.cz-t-big { font-size: 48px; font-weight: 900; fill: #0b1230; }
.cz-step { stroke: #fde68a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cz-path { stroke: #9fb3d9; stroke-width: 2.5; stroke-dasharray: 8 8; fill: none; opacity: .7; }
.cz-clock { fill: #fef3c7; stroke: #f59e0b; stroke-width: 3; }
.cz-spot { fill: #1d2a55; fill-opacity: .55; stroke: #5c6fa8; stroke-width: 2; }
.cz-spot.is-empty { stroke-dasharray: 10 8; }
.cz-frame { fill: #0e1840; fill-opacity: .7; stroke: #5c6fa8; stroke-width: 2.5; }
.cz-frame.is-chosen { stroke: #fde68a; stroke-width: 5; stroke-dasharray: 14 7; }
.cz-pick { cursor: pointer; }
.cz.is-locked .cz-pick { cursor: default; }
.cz-disc { stroke-width: 3; }
.cz-disc.is-a { fill: #c7d2fe; stroke: #4f46e5; }
.cz-disc.is-b { fill: #fcd9a8; stroke: #c2410c; fill-opacity: .85; }

/* the zoom reel */
.cz-reel { display: flex; align-items: stretch; gap: 6px; width: 100%; padding: 8px 10px; border-radius: 14px; background: linear-gradient(#2a2d38, #17181f);
  border: 2px solid #3b3f4c; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .05); }
.cz-reel-end { align-self: center; font-size: 16px; font-weight: 800; color: #fde68a; writing-mode: vertical-rl; transform: rotate(180deg); }
.cz-reel-end:last-child { transform: none; }
.cz-slot { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 4px 6px; min-height: 104px;
  background: #0b1230; color: #eef1ff; border-color: #5c6fa8; border-style: dashed; touch-action: none; }
.cz-slot.is-filled { border-style: solid; background: #111c45; }
.cz-slot.is-over { border-color: #fde68a; border-width: 3px; }
.cz-slot-n { position: absolute; left: 7px; top: 3px; font-size: 16px; font-weight: 900; color: #fde68a; }
.cz-slot-i { width: 54px; height: 54px; }
.cz-slot-l { font-size: 16px; font-weight: 800; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.cz-slot-e { font-size: 16px; font-weight: 600; color: #9fb3d9; font-style: italic; }
.cz-slot:focus-visible, .cz-card:focus-visible, .cz-choice:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.cz-slot.is-ok { border-color: #34d399; }
.cz-slot.is-bad { border-color: #f87171; }
.cz-slot.is-ok > .cz-mark { color: #6ee7b7; }
.cz-slot.is-bad > .cz-mark { color: #fca5a5; }
.cz-ghost { position: fixed; z-index: 1000; width: 64px; height: 64px; margin: -32px 0 0 -32px; pointer-events: none; border-radius: 14px; box-shadow: 0 8px 18px rgba(0, 0, 0, .4); }
.cz-ghost svg { width: 100%; height: 100%; display: block; }

/* reveal badge (top of the dome) */
.cz-badge { position: absolute; left: 2%; right: 2%; top: 2%; padding: 7px 12px; border-radius: 10px; font-size: 17px; font-weight: 700; line-height: 1.3; pointer-events: none;
  background: rgba(255, 255, 255, .97); color: #10202c; border: 3px solid #3b3f9e; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); animation: cz-pop .25s ease-out; }
.cz-badge.is-ok { border-color: #1d6b40; }
.cz-badge.is-bad { border-color: #b42318; }
@keyframes cz-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* briefing + start */
.cz-example-svg { display: block; width: 100%; height: auto; max-height: 460px; }
.cz-start-svg { display: block; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) { .cz-badge { animation: none; } }
@media (max-width: 1100px) { .cz { grid-template-columns: 300px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .cz { position: static; grid-template-columns: 1fr; }
  .cz-panel { overflow: visible; }
  .cz-view { order: -1; }
  .cz-scene { width: 100% !important; }
  .cz-slot { min-height: 92px; }
  .cz-slot-i { width: 40px; height: 40px; }
}
