@font-face{font-family:Modelica;src:url('../fonts/BwModelica-Regular.otf');font-display:swap}
@font-face{font-family:Modelica;src:url('../fonts/BwModelica-Bold.otf');font-weight:700;font-display:swap}
:root{--ground:#0B1220;--panel:#111a2c;--line:#24324d;--text:#e8edf6;--muted:#93a1b8;--blue:#5B9BE8;--gold:#E0A845;--strip:150px}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0;height:100%;background:#000;color:var(--text);font:14px/1.4 Modelica,system-ui,-apple-system,Segoe UI,sans-serif;overflow:hidden}
button,input{font:inherit;color:inherit}
button{background:#1a2540;border:1px solid var(--line);border-radius:8px;padding:6px 10px;cursor:pointer}
button:hover{border-color:var(--blue)}
button:focus-visible,input:focus-visible,.strip-handle:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
kbd{font:11px ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--muted);border:1px solid var(--line);border-radius:4px;padding:0 4px;margin-left:4px}

.stage{position:fixed;inset:0;bottom:0;display:grid;place-items:center;background:#000}
body.strip-open .stage{bottom:var(--strip)}
.slide{display:block;max-width:100%;max-height:100%;opacity:0;transition:opacity .12s}
body.ready .slide{opacity:1}
.zone{position:absolute;top:0;bottom:0;background:transparent;border:0;border-radius:0;padding:0;cursor:default}
.zone:hover{border:0}
.zone-prev{left:0;width:30%}.zone-next{right:0;width:70%}
body.ready .zone-next{cursor:pointer}body.ready .zone-prev{cursor:w-resize}
body:not(.ready) .zone{display:none}

.message{position:absolute;display:flex;gap:10px;align-items:center;color:var(--muted);max-width:560px;padding:24px;text-align:center;line-height:1.5}
.message a{color:var(--blue)}
body.ready .message{display:none}
.spinner{width:16px;height:16px;border:2px solid var(--line);border-top-color:var(--blue);border-radius:50%;animation:spin .8s linear infinite;flex:none}
body.error .spinner{display:none}
@keyframes spin{to{transform:rotate(360deg)}}

.controls{position:fixed;top:10px;left:50%;transform:translateX(-50%);display:flex;gap:16px;align-items:center;padding:6px 8px;
  background:rgba(11,18,32,.88);border:1px solid var(--line);border-radius:12px;backdrop-filter:blur(8px);z-index:5;transition:opacity .25s;white-space:nowrap}
/* While a deck is showing, the bar stays out of the slide until the pointer reaches the top edge. */
body.ready:not(.show-controls) .controls{opacity:0;pointer-events:none;transform:translate(-50%,-12px)}
.controls{transition:opacity .2s,transform .2s}
body:not(.ready) .controls .cluster:first-child,body:not(.ready) #deckLabel,body:not(.ready) #thumbToggle,body:not(.ready) #fullscreen{display:none}
body.idle,body.idle .zone{cursor:none!important}
.cluster{display:flex;gap:6px;align-items:center}
.icon{width:32px;height:32px;padding:0;font-size:20px;line-height:1}
.counter{display:flex;align-items:center;gap:6px;color:var(--muted);padding:0 4px}
.counter input{width:44px;text-align:center;background:#0b1220;border:1px solid var(--line);border-radius:6px;padding:5px 4px}
.counter b{color:var(--text);font-weight:400}
.deck-label{color:var(--muted);font-size:12px;max-width:260px;overflow:hidden;text-overflow:ellipsis}
#thumbToggle[aria-pressed=true]{border-color:var(--blue);color:#fff}

.strip{position:fixed;left:0;right:0;bottom:0;height:var(--strip);background:var(--ground);border-top:1px solid var(--line);z-index:4;display:flex;flex-direction:column}
.strip-handle{height:10px;flex:none;cursor:ns-resize;display:grid;place-items:center;margin-top:-5px;touch-action:none}
.strip-handle span{width:44px;height:4px;border-radius:2px;background:var(--line)}
.strip-handle:hover span,.strip.dragging .strip-handle span{background:var(--blue)}
.thumbs{list-style:none;margin:0;padding:4px 12px 10px;display:flex;gap:10px;overflow-x:auto;overflow-y:hidden;flex:1;align-items:stretch;scrollbar-color:var(--line) transparent}
.thumbs li{flex:none;height:100%;display:flex;flex-direction:column;gap:3px}
.thumbs button{padding:0;border:2px solid transparent;border-radius:6px;background:#060a12;height:calc(100% - 17px);aspect-ratio:var(--aspect,16/9);overflow:hidden;display:block}
.thumbs button:hover{border-color:var(--line)}
.thumbs li.current button{border-color:var(--gold)}
.thumbs img{width:100%;height:100%;object-fit:contain;display:block}
.thumbs .num{font:11px ui-monospace,Menlo,monospace;color:var(--muted);text-align:center;line-height:14px}
.thumbs li.current .num{color:var(--gold)}

.jump{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(11,18,32,.92);border:1px solid var(--blue);border-radius:12px;padding:14px 22px;font-size:28px;z-index:6}

.deck-dialog{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:14px;width:min(560px,92vw);padding:18px 20px}
.deck-dialog::backdrop{background:rgba(0,0,0,.6)}
.dialog-head{display:flex;justify-content:space-between;align-items:center;margin:0}
.dialog-head h2,.deck-dialog h3{margin:0;font-size:17px}.deck-dialog h3{font-size:14px;margin-top:18px;color:var(--muted);font-weight:400}
.small{color:var(--muted);font-size:12.5px}
.replace{margin-top:10px;padding:12px;border:1px dashed var(--line);border-radius:10px}
.file-button{display:inline-block;background:var(--blue);color:#06101f;border-radius:8px;padding:8px 14px;cursor:pointer;font-weight:700}
.file-button input{display:none}
.file-button.disabled{opacity:.5;pointer-events:none}
.upload-status{font-size:13px;margin-top:6px;min-height:18px}
.upload-status[data-state=error]{color:#ff8b8b}.upload-status[data-state=ok]{color:#7fd6a0}
progress{width:100%;accent-color:var(--blue)}
.versions{list-style:none;margin:6px 0 0;padding:0;max-height:220px;overflow:auto}
.versions li{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:7px 0;border-top:1px solid var(--line);font-size:13px}
.versions li span{color:var(--muted)}
.versions .live{color:#7fd6a0;font-size:12px}

@media (max-width:760px){.deck-label,kbd{display:none}.controls{gap:8px}}
