/* Rock Layer Detective: the cliff face, its letter chips and magnifier, and the controls inside the practice shell's stage.
 * The cliff is a picture of real rock in sunlight, so it stays light in dark mode; chips and tags keep dark text on white. */
.rld { position: absolute; inset: 0; display: grid; gap: 8px; padding: 8px 12px 10px; }
.rld--seq, .rld--pick, .rld--datewhich, .rld--correlate { grid-template-rows: minmax(0, 1fr) auto; }
.rld--bracket, .rld--halflife, .rld--clock { grid-template-columns: minmax(0, 1fr) 300px; }
.rld-top { position: relative; min-height: 0; min-width: 0; }
.rld-top > .rld-sec { position: absolute; inset: 0; }
.rld-sec { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.rld-title { font-weight: 800; font-size: 16px; margin: 0 0 4px; }
.rld-face { position: relative; flex: none; border-radius: var(--tlg-radius-lg); overflow: hidden; border: 2px solid #6b5642; background: #e6ecf1; box-shadow: 0 2px 10px rgb(0 0 0 / .12); touch-action: manipulation; }
.rld-cv, .rld-ov, .rld-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rld-ov, .rld-fx { pointer-events: none; }
.rld-chips { position: absolute; inset: 0; pointer-events: none; }
html .rld-chip { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; padding: 0; border-radius: 50%; pointer-events: auto;
  display: grid; place-items: center; font: 800 18px/1 var(--tlg-font, system-ui, sans-serif); color: #1b1f24; background: rgb(255 255 255 / .93);
  border: 2px solid #3a2a1a; box-shadow: 0 1px 4px rgb(0 0 0 / .35); cursor: pointer; }
html .rld-chip--fault, html .rld-chip--erode, html .rld-chip--dike { background: #fff6dc; }
html .rld-chip--tilt, html .rld-chip--fold { border-style: dashed; background: #f3ece2; }
html .rld-chip:focus-visible { outline: 3px solid var(--tlg-focus, #2563eb); outline-offset: 2px; }
html .rld-chip.is-hl { box-shadow: 0 0 0 4px #ffd84a, 0 1px 4px rgb(0 0 0 / .35); }
html .rld-chip.is-sel { background: var(--ps-accent, #8a4b14); color: #fff; border-color: #fff; box-shadow: 0 0 0 4px #ffc400, 0 2px 6px rgb(0 0 0 / .4); }
html .rld-chip.is-ok { box-shadow: 0 0 0 4px #1e9650; }
html .rld-chip.is-ok::after { content: "✓"; position: absolute; right: -12px; top: -12px; width: 20px; height: 20px; border-radius: 50%; background: #1e9650; color: #fff; font-size: 14px; display: grid; place-items: center; }
html .rld-chip.is-bad { box-shadow: 0 0 0 4px #c0281c; }
html .rld-chip.is-bad::after { content: "✗"; position: absolute; right: -12px; top: -12px; width: 20px; height: 20px; border-radius: 50%; background: #c0281c; color: #fff; font-size: 14px; display: grid; place-items: center; }
html .rld-chip.is-index { outline: 3px dashed #1e9650; outline-offset: 4px; }
html .rld-chip:disabled { cursor: default; }
html .rld-chip.is-future { opacity: .2; }
.rld-tag { position: absolute; transform: translate(0, -50%); padding: 1px 7px; border-radius: 7px; background: #fff8e6; border: 1.5px solid #8a4b14; color: #1b1f24;
  font-size: 16px; font-weight: 700; white-space: nowrap; pointer-events: none; box-shadow: 0 1px 3px rgb(0 0 0 / .25); }
.rld-tag.is-left { transform: translate(-100%, -50%); }
.rld-tag--grains { background: #eef3ff; border-color: #3a5a9a; }
.rld-tag--free { transform: translate(-50%, 0); }
.rld-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the magnifier */
.rld-loupe { position: absolute; z-index: 6; width: 148px; pointer-events: none; display: none; }
.rld-loupe.is-on { display: block; }
.rld-loupe canvas { width: 148px; height: 148px; display: block; border-radius: 50%; border: 6px solid #3a2a1a; box-shadow: 0 0 0 2px #c9a46a, 0 6px 16px rgb(0 0 0 / .4); background: #ddd; }
.rld-loupe::before { content: ""; position: absolute; left: 118px; top: 124px; width: 14px; height: 44px; border-radius: 7px; background: #5a3a1a; transform: rotate(-45deg); transform-origin: top center; }
.rld-loupe-t { margin-top: 6px; width: 250px; padding: 4px 8px; border-radius: 8px; background: rgb(255 255 255 / .96); color: #1b1f24; font-size: 16px; line-height: 1.25; box-shadow: 0 2px 8px rgb(0 0 0 / .3); }
/* the build-up timeline */
.rld-timeline { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px;
  max-width: calc(100% - 24px); padding: 6px 12px; border-radius: 12px; background: rgb(24 20 16 / .82); color: #fff; font-size: 16px; }
.rld-timeline[hidden] { display: none; }
.rld-tl-h { font-weight: 700; opacity: .8; }
.rld-tl-steps { display: flex; align-items: center; gap: 4px; }
.rld-tl-steps i { font-style: normal; opacity: .6; }
.rld-tl-s { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2px solid rgb(255 255 255 / .5); font-weight: 800; }
.rld-tl-s.is-done { background: #1e9650; border-color: #1e9650; }
.rld-tl-s.is-now { background: #ffc400; border-color: #ffc400; color: #1b1f24; transform: scale(1.12); }
.rld-tl-s.is-bad { background: #c0281c; border-color: #fff; }
.rld-tl-cap { flex-basis: 100%; margin: 0; text-align: center; font-weight: 700; }
.rld-timeline.is-done { padding: 4px 12px; }
.rld-timeline.is-done .rld-tl-h, .rld-timeline.is-done .rld-tl-steps { display: none; }
/* the oldest → youngest chain */
.rld-bottom { min-height: 0; }
.rld .pcb { gap: 6px; }
.rld .pcb-slot { min-height: 82px; }
.rld .pcb-slot .pcb-chip { flex: 0 0 auto; min-height: 44px; }
.rld .pcb-card { min-height: 44px; padding: 3px 10px 3px 5px; }
.rld .pcb-card-ico, .rld .pcb-card-ico svg { width: 32px; height: 32px; }
.rld .pcb-tray { gap: 6px; min-height: 48px; }
.rld .pcb-tray-h { margin: 0; }
.rld .rld-cardhl, .rld .pcb-slot.rld-cardhl { box-shadow: 0 0 0 3px #ffd84a; border-color: #b8860b; }
/* tap answers */
.rld-pickbar { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 16px; padding: 4px 12px;
  border-radius: var(--tlg-radius-sm); border: 2px dashed var(--tlg-border-strong); background: var(--tlg-surface); }
.rld-pick-l { font-weight: 700; color: var(--tlg-text-muted); }
.rld-pick-v { font-size: 18px; }
.rld-pick-e { color: var(--tlg-text-muted); }
.rld-pair { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); min-height: 0; }
.rld-paircol { position: relative; min-height: 0; min-width: 0; }
.rld-paircol > .rld-sec { position: absolute; inset: 0; }
.rld-gap { display: grid; place-items: center; font-weight: 800; font-size: 16px; color: var(--tlg-text-muted); background: repeating-linear-gradient(90deg, var(--tlg-border-strong) 0 6px, transparent 6px 12px) center / 100% 2px no-repeat; }
.rld-gap span { background: var(--tlg-bg); padding: 2px 4px; }
/* dating */
.rld-left { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.rld-sechost { flex: 1 1 auto; min-height: 0; position: relative; }
.rld-sechost > .rld-sec { position: absolute; inset: 0; }
.rld-panel { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; padding: 2px; }
.rld-hgrow { display: flex; align-items: center; gap: 14px; justify-content: center; flex: none; }
.rld-hg { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rld-hg-cap { font-size: 16px; font-weight: 700; text-align: center; max-width: 280px; }
.rld-hgleg p { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.rld-hgleg .rld-hgnote { color: var(--tlg-text-muted); }
.rld-dot { width: 14px; height: 14px; border-radius: 50%; background: #e0682a; border: 1.5px solid #7a2a0a; display: inline-block; }
.rld-sq { width: 13px; height: 13px; background: #3a6aa8; border: 1.5px solid #173a66; display: inline-block; }
.rld-br-q, .rld-br-u { margin: 0; font-size: 18px; }
.rld-br-row { display: flex; align-items: center; gap: 8px; }
.rld-br-and { font-size: 18px; font-weight: 700; }
html .rld-field { min-width: 104px; min-height: 54px; padding: 4px 10px; border-radius: var(--tlg-radius-sm); border: 2px solid var(--tlg-border-strong); background: var(--tlg-surface);
  color: var(--tlg-text); font: 700 26px/1.2 var(--tlg-font, system-ui, sans-serif); font-variant-numeric: tabular-nums; cursor: text; }
html .rld-field.is-empty { color: var(--tlg-text-muted); }
html .rld-field.is-active { border-color: var(--ps-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ps-accent) 35%, transparent); }
html .rld-field.is-right { outline: 3px solid var(--tlg-status-done-fg); outline-offset: 2px; }
html .rld-field.is-wrong { outline: 3px solid #b42318; outline-offset: 2px; }
.rld-padhost .pn-label, .rld-padhost .pn-display { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rld-padhost { position: relative; }
.rld-clocks { display: grid; gap: 8px; }
html .rld-clock { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 66px; padding: 6px 12px; text-align: left;
  border-radius: var(--tlg-radius-sm); border: 2px solid var(--tlg-border-strong); background: var(--tlg-surface); color: var(--tlg-text); font: inherit; cursor: pointer; }
.rld-clock b { font-size: 18px; }
.rld-clock small { font-size: 16px; color: var(--tlg-text-muted); }
.rld-clock:hover:not(:disabled) { background: var(--tlg-surface-2); }
.rld-clock[aria-checked="true"] { border-color: var(--ps-accent); background: color-mix(in srgb, var(--ps-accent) 10%, var(--tlg-surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ps-accent) 35%, transparent); }
.rld-clock[aria-checked="true"] b::before { content: "● "; }
.rld-clock:disabled { cursor: default; }
.rld-clock.is-right { outline: 3px solid var(--tlg-status-done-fg); outline-offset: 2px; }
.rld-clock.is-right b::after { content: " ✓"; }
.rld-clock.is-wrong { outline: 3px solid #b42318; outline-offset: 2px; }
.rld-clock.is-wrong b::after { content: " ✗"; }
/* briefing example + start art */
.rld-ex { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.rld-ex .rld-sec { width: 100%; }
.rld-ex-cap { margin: 0; font-size: 16px; }
.ps-start-art:has(.rld-start) { position: relative; }
.rld-start { position: absolute; inset: 0; }
.rld-start .rld-sec { position: absolute; inset: 0; }
.rld-start .rld-face { border-radius: 18px; }
.rld-start-mag { position: absolute; right: 2%; bottom: 2%; width: 46%; height: 46%; filter: drop-shadow(0 4px 8px rgb(0 0 0 / .35)); }
/* the assignment card normally sits bottom-right of the stage while playing; the tray is there, so it moves to the foot of the customer column */
@media (min-width: 901px) {
  html.ps-locked:has(.rld) .lga-card { right: auto; left: 12px; }
  html.ps-locked:has(.rld):has(.lga-card) .ps-side { padding-bottom: 84px; }
}
@media (max-width: 900px) {
  .rld { position: static; grid-template-rows: auto auto !important; grid-template-columns: 1fr !important; }
  .rld-top, .rld-sechost, .rld-paircol { height: 44vh; min-height: 260px; }
  .rld-pair { grid-template-columns: 1fr; gap: 8px; } .rld-gap { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rld-tl-s.is-now { transform: none; } }
