/* Tween Studio (information-technology/tween-studio.php). The shared parts are in studio.css. On a laptop or desktop:
   the stage (16:9, as large as fits) with the timeline under it on the left, the challenge and controls on the
   right. On smaller screens they stack. Theme tokens only (the timeline's: --tw-key and --tw-tween purple,
   --tw-hold grey, --tw-drawn gold); the stage itself is a light drawing surface in both themes, like paper, so its
   colours are in tween-studio.js (STAGE). */

:root{--tw-key:var(--viz-4);--tw-tween:var(--viz-4-tint);--tw-hold:var(--line);--tw-drawn:var(--viz-7-tint)}

.tw-work{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,360px);gap:10px}
.tw-stage-panel{gap:6px}
.tw-play{gap:6px}
.tw-check{display:inline-flex;align-items:center;gap:5px;font:600 12.5px/1.2 var(--font-display);color:var(--ink-soft);cursor:pointer;padding:0 4px}
.tw-check input{width:16px;height:16px;accent-color:var(--accent)}
.tw-stage-box{flex:1;min-height:0;container-type:size;display:flex;align-items:center;justify-content:center}
.tw-stage{display:block;width:min(100cqw,100cqh * 16 / 9);height:auto;aspect-ratio:16/9;border-radius:6px;border:1px solid var(--line-strong);cursor:grab;touch-action:none}
.tw-stage.tw-draw{cursor:crosshair}
.tw-timeline-wrap{flex:none}
.tw-tl-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:4px;flex-wrap:wrap}
.tw-frame-no{font:600 12px/1 var(--font-mono);color:var(--ink)}
.tw-legend{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.tw-legend i{display:inline-block;width:12px;height:12px;border-radius:3px;border:1px solid var(--line-strong);margin-left:6px}
.tw-legend i.k{background:var(--tw-key)}
.tw-legend i.t{background:var(--tw-tween)}
.tw-legend i.h{background:var(--tw-hold)}
.tw-legend i.d{background:var(--tw-drawn)}
.tw-legend i.e{background:var(--panel)}
.tw-timeline{display:grid;grid-template-columns:repeat(var(--n),minmax(12px,1fr));gap:2px;overflow-x:auto;padding:2px 2px 4px}
.tw-cell{position:relative;height:34px;border:1px solid var(--line-strong);border-radius:3px;background:var(--panel);cursor:pointer;padding:0;min-width:12px}
.tw-cell span{position:absolute;left:0;right:0;bottom:1px;font:600 9.5px/1 var(--font-mono);color:var(--muted);text-align:center;pointer-events:none}
.tw-cell.tween{background:var(--tw-tween)}
.tw-cell.tween.eased{background:linear-gradient(90deg,var(--tw-tween),var(--panel-2))}
.tw-cell.hold,.tw-cell.after{background:repeating-linear-gradient(45deg,var(--tw-hold) 0 4px,var(--panel) 4px 8px)}
.tw-cell.key::before{content:"";position:absolute;left:50%;top:8px;width:10px;height:10px;margin-left:-5px;border-radius:50%;background:var(--tw-key)}
.tw-cell.drawn{background:var(--tw-drawn)}
.tw-cell.now{outline:2px solid var(--accent);outline-offset:1px;z-index:1}
.tw-cell:focus-visible{outline:2px solid var(--focus);outline-offset:1px}
.tw-cap{flex:none;min-height:2.9em}

.tw-side{padding:10px 12px}
.tw-side-in{display:flex;flex-direction:column;gap:12px}
.tw-group{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:10px}
.tw-challenge{display:flex;flex-direction:column;gap:6px;padding:10px;border-radius:8px;background:var(--panel-2);border:1px solid var(--line)}
.tw-challenge .st-head{margin:0}
.tw-challenge .st-task h3{margin:0 0 4px;font-size:15px}
.tw-challenge .st-task p{font-size:13.5px;margin:0}
.tw-challenge .st-pip{min-width:26px;height:26px}
.tw-presets .btn{padding:3px 7px}
.tw-colours button{padding:5px 8px}
.tw-colours i{display:block;width:18px;height:18px;border-radius:50%;border:2px solid var(--line-strong)}
.tw-colours button[aria-pressed="true"]{background:var(--accent-tint);border-color:var(--accent);outline:2px solid var(--accent)}
#keyProps{display:flex;flex-direction:column;gap:8px}
#keyProps.tw-off{opacity:.45}
#segEase{margin-top:4px}

@media (min-width:901px) and (max-height:700px){
  .tw-cap{min-height:0;font-size:12.5px}
  .tw-cell{height:28px}
}
@media (max-width:900px){
  .tw-work{display:flex;flex-direction:column}
  .tw-stage-box{flex:none;container-type:normal;display:block}
  .tw-stage{width:100%}
  .tw-side .st-scroll{overflow:visible;flex:none}
  .tw-cell{height:40px}
  .tw-check{min-height:40px}
  .tw-challenge .st-pip{min-width:40px;height:40px}
  .tw-cap{min-height:0}
}
.tw-side table.st-read td.n{white-space:normal;text-align:right}
.tw-side table.st-read td:first-child{color:var(--ink-soft);width:42%}
