/* TodoHub shell, November 2026 redesign, in the TwoDay Studio palette.
   One brand red for actions and selection, one mint for "ready". The gameplay
   preview is the loudest thing on screen. Performance rules: no animated or
   glowing backgrounds and no backdrop-filter. The only filter is a single
   static blur on each desktop card's backdrop image, which is painted once. */
@font-face{font-family:Fredoka;src:url(/todo-hub/assets/fredoka.woff2) format('woff2');font-weight:300 700;font-display:swap}
:root{
  /* TwoDay Studio tokens, taken from the studio site's dark theme. */
  --night:#0b0c10;--surface:#141721;--surface-2:#1c202d;--surface-3:#252b3d;--line:#ffffff14;--line-strong:#ffffff29;
  --ink:#fcfbfa;--muted:#b0b8c6;--faint:#7d8696;
  --brand:#ff006c;--brand-hover:#ff2d87;--brand-press:#b8004c;--mint:#4ef0b8;--mint-ink:#03261a;
  --accent:var(--brand);--accent-ink:#fff;--pink:var(--brand);
  --hub-sidebar-width:232px;--hub-topbar-height:72px;--hub-mobile-nav-height:0px;
  --display:Fredoka,ui-rounded,'Arial Rounded MT Bold',system-ui,sans-serif;
  --body:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:var(--body);color:var(--ink);background:var(--night);-webkit-font-smoothing:antialiased;overflow:hidden}
button,input{font:inherit;color:inherit}
button{border:0;background:none;cursor:pointer;padding:0;-webkit-tap-highlight-color:transparent}
button:disabled{opacity:.4;cursor:default}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
.studio-wordmark{height:auto!important}
svg{width:22px;height:22px;display:block;stroke:currentColor;stroke-width:1.9;fill:none;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
:focus-visible{outline:3px solid #ff7fb5;outline-offset:3px}
kbd{font:600 11px/1 var(--body);padding:3px 6px;border:1px solid var(--line-strong);border-bottom-width:2px;border-radius:6px;color:var(--muted)}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip-link{position:fixed;left:8px;top:-80px;padding:14px 18px;background:var(--surface);border-radius:12px;z-index:200;opacity:0;pointer-events:none}.skip-link:focus-visible{top:calc(8px + env(safe-area-inset-top,0px));opacity:1;pointer-events:auto}
[hidden]{display:none!important}

/* ---------- Sidebar ---------- */
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--hub-sidebar-width);z-index:5;display:flex;flex-direction:column;padding:22px 14px 18px;background:#0e1016;border-right:1px solid var(--line);overflow-y:auto}
.brand{display:flex;align-items:center;gap:9px;padding:4px 10px 26px}
.brand img{width:36px;height:36px;object-fit:contain}
.brand-word{font:600 30px/1 var(--display);letter-spacing:-.03em;color:#fff}.brand-word b{font-weight:600;color:var(--brand)}
.main-nav{display:grid;gap:4px}
.main-nav button,.studio-link{position:relative;display:flex;align-items:center;gap:14px;min-height:48px;padding:10px 14px;border-radius:14px;color:#d5dae3;font:500 16px/1 var(--display);text-align:left}
.main-nav button:hover,.studio-link:hover{background:#ffffff0d;color:#fff}
.main-nav button.selected{background:color-mix(in srgb,var(--accent) 18%,transparent);color:#fff}
.main-nav button.selected svg{color:var(--accent);stroke-width:2.3}
.count{margin-left:auto;min-width:22px;padding:3px 7px;border-radius:99px;background:#ffffff14;font:600 11px/1.2 var(--body);text-align:center}
.sidebar-bottom{margin-top:auto;display:grid;gap:14px}
.studio-link{flex-direction:column;align-items:flex-start;gap:8px;padding:14px;border:1px solid var(--line);background:#ffffff06}
.studio-link .studio-wordmark{width:132px;filter:brightness(0) invert(1)}
.studio-link .studio-mark{display:none;width:30px;height:30px;object-fit:contain;filter:brightness(0) invert(1)}
.studio-link .nav-label{font:500 12px/1.3 var(--body);color:var(--muted)}
.sidebar-foot{display:flex;flex-wrap:wrap;gap:4px 12px;padding:0 12px;font-size:11px;color:#7d8696}
.sidebar-foot a:hover{color:#fff}

/* ---------- Top bar ---------- */
main{position:relative;z-index:1;margin-left:var(--hub-sidebar-width);height:100dvh;display:flex;flex-direction:column;min-height:0}
.topbar{flex:0 0 var(--hub-topbar-height);display:flex;align-items:center;gap:22px;padding:0 28px;border-bottom:1px solid var(--line)}
.mobile-brand{display:none}
.feed-tabs{display:flex;gap:4px;padding:4px;border-radius:14px;background:#ffffff0b}
.feed-tabs button{min-height:38px;padding:0 16px;border-radius:10px;color:var(--muted);font:500 15px/1 var(--display)}
.feed-tabs button[aria-selected=true]{background:#fff;color:#0b0c10}
.genre-bar{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none}
.genre-bar::-webkit-scrollbar{display:none}
.genre-bar button{min-height:36px;padding:0 14px;border:1px solid var(--line-strong);border-radius:99px;color:#e3e7ee;font-size:13px;font-weight:600;white-space:nowrap}
.genre-bar button:hover{border-color:#ffffff66}
.genre-bar button.active{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 22%,transparent);color:#fff}
.topbar-end{margin-left:auto;display:flex;align-items:center;gap:12px}
.search-launch{display:flex;align-items:center;gap:10px;width:min(300px,26vw);min-height:42px;padding:0 10px 0 14px;border:1px solid var(--line-strong);border-radius:14px;background:#ffffff08;color:var(--muted);font-size:14px}
.search-launch:hover{border-color:#ffffff55;color:#fff}.search-launch svg{width:18px;height:18px}.search-launch kbd{margin-left:auto}
.mobile-search{display:none}
.avatar{width:42px;height:42px;padding:8px;border-radius:50%;background:#ffffff10;border:1px solid var(--line-strong)}
.avatar img{width:100%;height:100%;object-fit:contain}

/* ---------- Workspace ---------- */
.workspace{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:28px;padding:22px 28px 18px}
.feed-column{position:relative;display:flex;flex-direction:column;min-height:0;min-width:0}
.feed-wrap{position:relative;flex:1;min-height:0;width:calc(100% - 72px);max-width:1240px;margin:0 auto 0 max(0px,calc((100% - 72px - 1240px)/2))}
#feed{position:relative;height:100%;overflow-y:auto;scroll-snap-type:y mandatory;scrollbar-width:none;overscroll-behavior-y:contain;border-radius:28px;background:#08090d;border:1px solid var(--line-strong)}
#feed::-webkit-scrollbar{display:none}
#feed:focus{outline:none}#feed:focus-visible{outline:3px solid #ff7fb5;outline-offset:4px}
.initial-loading,.empty-feed{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:32px;text-align:center;color:var(--muted)}
.initial-loading img{width:64px}
.empty-feed h2{margin:0;font:500 30px/1.1 var(--display);color:#fff}.empty-feed p{max-width:36ch;line-height:1.6}
.empty-feed button{min-height:48px;padding:0 22px;border-radius:14px;background:var(--brand);color:#fff;font:600 15px/1 var(--display)}

.page-controls{position:absolute;left:calc(100% + 16px);top:50%;transform:translateY(-50%);display:flex;flex-direction:column;align-items:center;gap:10px}
.page-controls button{display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:#ffffff10;border:1px solid var(--line-strong);color:#fff}
.page-controls button:hover:not(:disabled){background:color-mix(in srgb,var(--accent) 35%,transparent)}
.page-controls svg{width:20px;height:20px}
.feed-position{font:600 12px/1 var(--body);color:var(--muted);font-variant-numeric:tabular-nums}
.feed-foot{flex:0 0 auto;display:flex;justify-content:center;gap:8px;padding-top:12px;width:calc(100% - 72px);color:#8a93a3;font-size:12px}
.feed-foot kbd{margin:0 1px}
.mobile-feed-tip,.feed-dots,.swipe-hint{display:none}

/* ---------- Reel ---------- */
.reel{position:relative;height:100%;scroll-snap-align:start;scroll-snap-stop:always;overflow:hidden;isolation:isolate;background:#08090d;color:#fff}
.reel-preview{position:absolute;inset:0;overflow:hidden;cursor:pointer}
.reel-preview>.cover-backdrop{position:absolute;inset:-60px;width:calc(100% + 120px);height:calc(100% + 120px);max-width:none;object-fit:cover;filter:blur(40px) brightness(.5)}
.reel-preview>img.cover,.reel-preview>video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:transparent}
.reel-preview:after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,#08090d9e 0%,#08090d00 18%,#08090d00 45%,#08090dcc 74%,#08090d 100%);pointer-events:none}
.reel-top{position:absolute;z-index:2;top:18px;right:20px;display:flex}
.sound-button{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#08090db8;border:1px solid var(--line-strong)}
.sound-button svg{width:17px;height:17px}
.like-burst{position:absolute;z-index:3;left:50%;top:44%;width:120px;height:120px;margin:-60px 0 0 -60px;color:var(--accent);opacity:0;pointer-events:none}
.like-burst svg{width:100%;height:100%;fill:currentColor;stroke:#fff;stroke-width:.8}
.like-burst.go{animation:like-pop .8s cubic-bezier(.2,1.6,.4,1) forwards}
@keyframes like-pop{0%{opacity:0;transform:scale(.3) rotate(-14deg)}25%{opacity:1;transform:scale(1.1) rotate(4deg)}70%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1.3) translateY(-30px)}}

.reel-details{position:absolute;inset:0;z-index:2;pointer-events:none}
.reel-content{position:absolute;left:36px;right:120px;bottom:34px;max-width:640px;display:flex;flex-direction:column;align-items:flex-start;gap:10px;pointer-events:auto}
.maker{display:flex;align-items:center;gap:8px}
.maker .studio-wordmark{width:104px}
.maker .verified{display:inline-grid;place-items:center;width:16px;height:16px;padding:3px;border-radius:50%;background:#fff;color:#0b0c10}
.maker .verified svg{width:100%;height:100%;stroke-width:2.6}
.reel-content h2{margin:0;font:600 clamp(38px,4.2vw,64px)/.98 var(--display);letter-spacing:-.035em;text-wrap:balance;text-shadow:0 2px 16px #0009}
.reel-content .description{margin:0;max-width:48ch;font-size:16px;line-height:1.45;color:#eef1f5;text-shadow:0 1px 10px #000b}
.tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
.tags>span{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:99px;background:#08090db3;border:1px solid #ffffff26;font-size:12px;font-weight:600}
.ready-chip svg{width:13px;height:13px}
.ready-chip[data-state=ready]{background:color-mix(in srgb,var(--accent) 30%,#08090d);border-color:var(--accent);color:#fff}
.ready-chip[data-state=ready] svg{fill:var(--accent);stroke:var(--accent)}
.play-button{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-width:240px;min-height:60px;margin-top:10px;padding:0 34px;border-radius:18px;background:var(--accent);color:var(--accent-ink);font:600 20px/1 var(--display);letter-spacing:-.01em;box-shadow:0 6px 0 color-mix(in srgb,var(--accent) 50%,#000);transition:transform .08s,box-shadow .08s}
.play-button svg{width:22px;height:22px;fill:currentColor;stroke:none}
.play-button:hover{filter:brightness(1.06)}
.play-button:active{transform:translateY(5px);box-shadow:0 1px 0 color-mix(in srgb,var(--accent) 50%,#000)}
.play-button:focus-visible{outline:3px solid #fff;outline-offset:4px}

.reel-actions{position:absolute;right:24px;bottom:34px;display:flex;flex-direction:column;gap:16px;pointer-events:auto}
.reel-actions button{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:58px;font-size:12px;font-weight:600;text-shadow:0 1px 8px #000}
.reel-actions .icon-circle{display:grid;place-items:center;width:54px;height:54px;border-radius:50%;background:#08090db8;border:1px solid var(--line-strong)}
.reel-actions svg{width:23px;height:23px}
.reel-actions button:hover .icon-circle{border-color:#ffffff70}
.reel-actions button[aria-pressed=true] .icon-circle{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.reel-actions button[aria-pressed=true] svg{fill:currentColor}
.reel-actions button:focus-visible{outline:none}.reel-actions button:focus-visible .icon-circle{outline:3px solid #fff;outline-offset:3px}
.sponsor{display:grid;place-items:center;text-align:center;background:#f6f0e5;color:#35251d}

/* ---------- Right rail ---------- */
.right-rail{min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:14px;padding-right:4px;scrollbar-width:thin}
.rail-title{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:4px 4px 0}
.rail-title h2{margin:0;font:600 22px/1.1 var(--display)}
.rail-hint{font-size:12px;color:var(--muted)}
#up-next{display:grid;gap:8px}
.queue-item{display:flex;align-items:center;gap:12px;width:100%;padding:8px;border-radius:16px;border:1px solid transparent;text-align:left}
.queue-item:hover{background:#ffffff0b;border-color:var(--line)}
.queue-item>img{width:54px;height:72px;object-fit:cover;border-radius:11px;background:var(--surface-2);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 60%,transparent)}
.queue-item>span:first-of-type{min-width:0;flex:1}
.queue-item strong{display:block;font:500 16px/1.15 var(--display);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.queue-item small{display:block;margin-top:5px;font-size:12px;color:var(--muted)}
.queue-state{flex:none;padding:5px 9px;border-radius:99px;background:#ffffff10;font-size:11px;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums}
.queue-state:empty{display:none}
.queue-state[data-state=ready]{background:var(--accent);color:var(--accent-ink)}
.queue-state[data-state=preparing]{color:#fff}
.studio-feature{margin-top:auto;padding:20px;border-radius:20px;background:#ffffff08;border:1px solid var(--line)}
.studio-feature .studio-wordmark{width:150px;filter:brightness(0) invert(1)}
.studio-feature p{margin:14px 0 6px;font-size:13px;line-height:1.55;color:var(--muted)}
.studio-feature button{display:inline-flex;align-items:center;gap:8px;min-height:40px;font:500 15px/1 var(--display);color:#fff}
.studio-feature button svg{width:16px;height:16px;color:var(--accent)}
.rail-fine{margin:0;padding:0 4px 4px;font-size:12px;line-height:1.7;color:#7d8696}.rail-fine a:hover{color:#fff}
.mobile-nav{display:none}

/* ---------- Panels, toast ---------- */
dialog{width:min(540px,calc(100% - 28px));max-height:86dvh;padding:26px;border:1px solid var(--line-strong);border-radius:26px;background:#141721;color:var(--ink)}
dialog::backdrop{background:#08050ccc}
.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}
.dialog-head h2{margin:0;font:600 26px/1.15 var(--display)}
.dialog-head button{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#ffffff12}
.dialog-head svg{width:18px;height:18px}
#panel-body p{font-size:14px;line-height:1.65;color:var(--muted)}
#panel-body .search-input{width:100%;min-height:52px;padding:0 16px;margin-bottom:14px;border:1px solid var(--line-strong);border-radius:14px;background:#ffffff0a;color:#fff;font-size:16px;caret-color:var(--brand)}
#panel-body .search-input:focus{outline:2px solid var(--accent);outline-offset:1px}
.panel-primary{display:block;margin-top:18px;padding:15px;border-radius:14px;background:var(--brand);color:#fff;text-align:center;font:600 16px/1 var(--display)}
.controls-copy{padding:16px;border-radius:14px;background:#ffffff0a;color:#fff!important}
.studio-panel-intro{display:flex;flex-direction:column;gap:8px;margin-bottom:8px}
.studio-panel-intro .studio-wordmark{width:200px;filter:brightness(0) invert(1)}
.no-results{padding:30px 8px;text-align:center;color:var(--muted)}
.lab-status{padding:16px;border-radius:16px;background:#ffffff0a;font-size:13px;line-height:1.7;color:var(--muted)}
.lab-status strong{color:#fff}.lab-status p{margin:6px 0}
.lab-section-title{display:flex;justify-content:space-between;gap:16px;margin:22px 0 6px;font:600 16px/1.3 var(--display)}
.lab-row{padding:14px 0;border-bottom:1px solid var(--line);font-size:13px}
.lab-row>div{display:flex;justify-content:space-between;gap:12px}
.lab-row>div>span{color:var(--muted);font-size:12px;white-space:nowrap}
.lab-row small{display:block;margin:6px 0;font-size:12px;color:var(--muted)}
.lab-track{height:4px;margin-top:8px;border-radius:4px;background:#ffffff14;overflow:hidden}
.lab-track i{display:block;height:100%;background:var(--accent)}
.lab-controls{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.lab-controls button{min-height:42px;padding:0 14px;border:1px solid var(--line-strong);border-radius:12px;font-size:13px;font-weight:600}
.lab-controls button.active{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 22%,transparent)}
.lab-engines{list-style:none;margin:0;padding:0}
.lab-engines li{display:flex;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid var(--line);font-size:12px}
.lab-file-details summary{cursor:pointer;padding:12px 0;font-size:13px}
.lab-empty{padding:12px 16px;border-radius:12px;background:#ffffff0a}
#panel-body .queue-item>img{height:64px}
#toast{position:fixed;left:50%;bottom:28px;z-index:1000;max-width:calc(100% - 32px);padding:14px 20px;border-radius:99px;background:#fff;color:#0b0c10;font-size:14px;font-weight:600;opacity:0;transform:translate(-50%,20px);transition:opacity .2s,transform .2s;pointer-events:none;text-align:center}
#toast.visible{opacity:1;transform:translate(-50%,0)}

/* ---------- Player (player.css owns the mechanics) ---------- */
.runtime{border-color:var(--line-strong);box-shadow:none}
.runtime-loading{background:#0e1016}
.runtime-loading .launch-cover{opacity:.22}
.launch-card{border-radius:26px;background:#0b0c10;border-color:var(--line-strong)}
.runtime-loading .launch-icon{width:84px;height:84px;border-radius:22px;box-shadow:0 0 0 3px var(--accent)}
.runtime-loading strong{font-family:var(--display)}
.launch-progress i{background:var(--accent)}
.player-dock{background:#0b0c10;border-top-color:var(--line)}
.player-return{border-radius:14px;background:#ffffff10;border-color:var(--line-strong)}
.player-return:hover,.player-return:focus-visible{background:color-mix(in srgb,var(--accent) 30%,transparent)}
.player-action[aria-pressed=true][data-action=like]{color:var(--accent)}

/* ---------- Mid widths: icon rail ---------- */
@media(max-width:1399px) and (min-width:761px){
  :root{--hub-sidebar-width:84px}
  .sidebar{padding:18px 10px}
  .brand{justify-content:center;padding:4px 0 22px}.brand-word{display:none}
  .main-nav button{flex-direction:column;gap:6px;min-height:62px;padding:8px 4px;justify-content:center;font:600 11px/1 var(--body)}
  .main-nav .count{position:absolute;top:6px;right:10px;margin:0;min-width:18px;padding:2px 5px;font-size:10px}
  .studio-link{align-items:center;padding:10px 4px;border:0;background:none}
  .studio-link .studio-wordmark,.studio-link .nav-label{display:none}.studio-link .studio-mark{display:block}
  .sidebar-foot{display:none}
}
@media(max-width:1180px) and (min-width:761px){
  .workspace{grid-template-columns:minmax(0,1fr)}
  .right-rail,.genre-bar{display:none}
}
@media(max-width:980px) and (min-width:761px){
  .search-launch{width:auto}.search-launch .search-text,.search-launch kbd{display:none}
  .reel-content{left:24px;right:100px;bottom:26px}
  .reel-content h2{font-size:40px}
  .play-button{min-width:200px;min-height:54px;font-size:18px}
}
@media(min-width:761px) and (max-height:760px){
  :root{--hub-topbar-height:64px}
  .workspace{padding-top:14px;padding-bottom:12px}
  .reel-content{bottom:24px;gap:8px}
  .reel-content h2{font-size:clamp(32px,3.4vw,48px)}
  .reel-content .description{font-size:14px}
  .play-button{min-height:52px;font-size:18px}
  .reel-actions{bottom:24px;gap:10px}.reel-actions .icon-circle{width:46px;height:46px}
  .feed-foot{display:none}
}

/* ---------- Phones: an immersive, full-screen feed ---------- */
@media(max-width:760px){
  :root{--hub-sidebar-width:0px;--hub-topbar-height:calc(56px + env(safe-area-inset-top,0px));--hub-mobile-nav-height:calc(62px + env(safe-area-inset-bottom,0px))}
  .sidebar,.genre-bar,.search-launch,.avatar,.right-rail,.feed-foot,.page-controls{display:none}
  main{margin:0}
  .topbar{position:fixed;inset:0 0 auto;z-index:10;height:var(--hub-topbar-height);gap:16px;padding:env(safe-area-inset-top,0px) max(10px,env(safe-area-inset-right,0px)) 0 max(16px,env(safe-area-inset-left,0px));border:0;background:linear-gradient(180deg,#08090dd9,#08090d00);pointer-events:none}
  .topbar>*{pointer-events:auto}
  .mobile-brand{display:block;font:600 22px/1 var(--display);letter-spacing:-.03em;color:#fff;text-shadow:0 1px 10px #0008}.mobile-brand span{color:var(--brand)}
  .feed-tabs{margin-left:auto;gap:14px;padding:0;background:none}
  .feed-tabs button{position:relative;min-height:40px;padding:0;background:none!important;color:#ffffffb0;font-size:16px;text-shadow:0 1px 10px #000a}
  .feed-tabs button[aria-selected=true]{color:#fff}
  .feed-tabs button[aria-selected=true]:after{content:'';position:absolute;left:50%;bottom:4px;width:22px;height:3px;margin-left:-11px;border-radius:3px;background:#fff}
  .topbar-end{margin-left:0;gap:0}
  .mobile-search{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;color:#fff}
  .workspace{display:block;padding:0}
  .feed-column{height:calc(100dvh - var(--hub-mobile-nav-height))}
  .feed-wrap{width:100%;margin:0;max-width:none}
  #feed{border:0;border-radius:0}
  .reel-preview>.cover-backdrop{display:none}
  .reel-preview>img.cover,.reel-preview>video{object-fit:cover}
  .reel-preview:after{background:linear-gradient(180deg,#08090db3 0%,#08090d00 20%,#08090d00 48%,#08090dd9 78%,#08090d 100%)}
  .reel-top{top:calc(var(--hub-topbar-height) + 6px);right:max(14px,env(safe-area-inset-right,0px))}
  .sound-button{width:38px;height:38px}
  .reel-content{left:max(16px,env(safe-area-inset-left,0px));right:max(16px,env(safe-area-inset-right,0px));bottom:16px;max-width:none;gap:8px}
  .maker,.reel-content h2,.reel-content .description,.tags{padding-right:70px}
  .maker .studio-wordmark{width:88px}
  .reel-content h2{font-size:clamp(32px,9vw,42px)}
  .reel-content .description{font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .tags>span{padding:5px 9px;font-size:11px}
  .play-button{width:100%;min-width:0;min-height:56px;margin-top:6px;font-size:19px}
  .reel-actions{right:max(10px,env(safe-area-inset-right,0px));bottom:100px;gap:14px}
  .reel-actions button{min-width:52px;font-size:11px}
  .reel-actions .icon-circle{width:48px;height:48px}
  .feed-dots{display:flex;flex-direction:column;gap:5px;position:absolute;z-index:4;right:5px;top:calc(var(--hub-topbar-height) + 64px);pointer-events:none}
  .feed-dots i{width:4px;height:4px;border-radius:4px;background:#ffffff66}
  .feed-dots i.on{height:16px;background:#fff}
  .swipe-hint{position:absolute;z-index:5;left:50%;top:36%;transform:translateX(-50%);width:max-content;display:flex;flex-direction:column;align-items:center;pointer-events:none;color:#fff}
  .swipe-hint svg{width:34px;height:34px;stroke-width:2.6;margin-bottom:-14px;animation:swipe-up 1.4s ease-in-out infinite}
  .swipe-hint span:nth-child(2) svg{animation-delay:.15s;opacity:.6}
  .swipe-hint strong{margin-top:20px;padding:9px 14px;border-radius:99px;background:#08090dd9;font:500 15px/1 var(--display);white-space:nowrap}
  @keyframes swipe-up{0%{transform:translateY(14px);opacity:0}40%{opacity:1}100%{transform:translateY(-14px);opacity:0}}
  .mobile-nav{display:flex;position:fixed;z-index:10;left:0;right:0;bottom:0;height:var(--hub-mobile-nav-height);padding:0 env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);background:#08090d;border-top:1px solid var(--line)}
  .mobile-nav button,.mobile-nav .studio-home{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:44px;color:#98a1b0}
  .mobile-nav svg{width:22px;height:22px}
  .mobile-nav small{font-size:11px;font-weight:600}
  .mobile-nav .selected{color:#fff}
  .mobile-nav .selected svg{color:var(--accent);stroke-width:2.4}
  #toast{bottom:calc(var(--hub-mobile-nav-height) + 14px)}
  body.player-open .mobile-nav,body.player-open .topbar{display:none}
  .runtime{top:0;z-index:30}
  .runtime:not(:fullscreen):not(.is-expanded) .player-viewport{top:env(safe-area-inset-top,0px)}
  dialog{width:100%;max-width:none;max-height:88dvh;margin:auto 0 0;border-radius:26px 26px 0 0;padding:22px 18px calc(22px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:360px){.feed-tabs{gap:10px}.feed-tabs button{font-size:15px}.mobile-brand{font-size:20px}}
@media(max-width:760px) and (max-height:680px){
  .reel-content h2{font-size:30px}
  .reel-content .description{-webkit-line-clamp:1;font-size:13px}
  .play-button{min-height:50px;font-size:17px}
  .reel-actions{bottom:86px;gap:10px}.reel-actions .icon-circle{width:44px;height:44px}
}
@media(max-width:760px) and (max-height:580px){
  .tags,.reel-actions button>span:not(.icon-circle){display:none}
}
/* Landscape phones: short and wide. */
@media(max-width:940px) and (max-height:480px) and (orientation:landscape){
  :root{--hub-sidebar-width:0px;--hub-topbar-height:48px;--hub-mobile-nav-height:0px}
  .sidebar,.right-rail,.feed-foot,.genre-bar,.search-launch,.mobile-nav,.page-controls,.avatar{display:none}
  main{margin:0}
  .topbar{position:fixed;inset:0 0 auto;z-index:10;height:48px;padding:0 14px;border:0;background:linear-gradient(180deg,#08090dd9,#08090d00)}
  .mobile-brand{display:block;font:600 20px/1 var(--display);color:#fff}.mobile-brand span{color:var(--brand)}
  .feed-tabs{margin-left:auto;background:none}.mobile-search{display:grid;place-items:center;width:44px;height:44px}
  .workspace{display:block;padding:0}.feed-column{height:100dvh}.feed-wrap{width:100%;margin:0}
  #feed{border:0;border-radius:0}
  .reel-top{top:54px}
  .reel-content{left:18px;right:18px;bottom:12px;gap:4px}
  .reel-content .description,.tags,.maker{display:none}
  .reel-content h2{font-size:26px;padding-right:0}
  .play-button{width:auto;min-width:200px;min-height:46px;font-size:17px}
  .reel-actions{flex-direction:row;bottom:14px;right:18px;gap:10px}
  .reel-actions button>span:not(.icon-circle){display:none}.reel-actions .icon-circle{width:44px;height:44px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* ---------- Studio palette: one brand colour, one ready colour ---------- */
.main-nav button.selected{background:var(--surface-2)}
.main-nav button.selected svg,.mobile-nav .selected svg{color:var(--brand)}
.genre-bar button.active{border-color:#fff;background:#fff;color:var(--night)}
.genre-bar button:hover{border-color:#ffffff55}
.page-controls button:hover:not(:disabled){background:var(--surface-3)}
.play-button{background:var(--brand);color:#fff;box-shadow:0 5px 0 var(--brand-press)}
.play-button:hover{background:var(--brand-hover);filter:none}
.play-button:active{transform:translateY(4px);box-shadow:0 1px 0 var(--brand-press)}
.ready-chip[data-state=ready]{background:#4ef0b81f;border-color:#4ef0b866;color:var(--mint)}
.ready-chip[data-state=ready] svg{fill:var(--mint);stroke:var(--mint)}
.ready-chip[data-state=preparing]{color:#fff}
.queue-state[data-state=ready]{background:#4ef0b81f;color:var(--mint)}
.queue-item>img{box-shadow:none;outline:1px solid var(--line)}
.queue-item.is-next{background:var(--surface);border-color:var(--line)}
.reel-actions button[aria-pressed=true] .icon-circle{background:var(--brand);border-color:var(--brand);color:#fff}
.like-burst{color:var(--brand)}
.lab-track i{background:var(--brand)}
.lab-controls button.active{border-color:#fff;background:#fff;color:var(--night)}
#panel-body .search-input:focus{outline:2px solid var(--brand)}
.studio-feature button svg{color:var(--brand)}
.runtime-loading .launch-icon{box-shadow:none}
.launch-progress i{background:var(--brand)}
.player-return:hover,.player-return:focus-visible{background:var(--surface-3)}
.player-action[aria-pressed=true][data-action=like]{color:var(--brand)}

/* ---------- Game sheet (swipe left, long press, "i") ---------- */
#panel.is-sheet{width:min(560px,calc(100% - 28px));padding:0;overflow:hidden auto}
#panel.is-sheet .dialog-head{position:absolute;z-index:2;top:12px;right:12px;margin:0}
#panel.is-sheet .dialog-head h2{display:none}
#panel.is-sheet .dialog-head button{background:#08090dcc}
.game-sheet-cover{position:relative;height:220px;overflow:hidden;background:var(--night)}
.game-sheet-cover img{width:100%;height:100%;object-fit:cover;object-position:center 30%}
.game-sheet-cover:after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,#14172100 40%,#141721)}
.game-sheet-body{position:relative;margin-top:-56px;padding:0 22px 22px}
.game-sheet-body h3{margin:0 0 6px;font:600 34px/1.05 var(--display);letter-spacing:-.03em}
.game-sheet-body .tags{margin:10px 0 14px}
.game-sheet-body>p{margin:0 0 16px;color:var(--muted);font-size:15px;line-height:1.55}
.sheet-howto{margin:0 0 18px;padding:14px 16px;border-radius:14px;background:var(--surface-2)}
.sheet-howto strong{display:block;margin-bottom:4px;font:500 15px/1.3 var(--display)}
.sheet-howto span{color:var(--muted);font-size:14px;line-height:1.55}
.sheet-actions{display:grid;grid-template-columns:1fr auto auto;gap:8px}
.sheet-actions .play-button{width:100%;min-width:0;margin:0;min-height:54px;font-size:18px}
.sheet-actions .sheet-btn{display:grid;place-items:center;width:54px;height:54px;border-radius:16px;background:var(--surface-2);border:1px solid var(--line)}
.sheet-actions .sheet-btn[aria-pressed=true]{background:var(--brand);border-color:var(--brand)}
.sheet-actions .sheet-btn[aria-pressed=true] svg{fill:currentColor}
.sheet-gestures{margin:16px 0 0;font-size:12px;color:var(--faint);text-align:center}
/* A reel that is being swiped sideways follows the finger a little. */
.reel.is-dragging .reel-details{transform:translateX(var(--drag-x,0px));transition:none}
.reel .reel-details{transition:transform .2s ease}
@media(max-width:760px){
  #panel.is-sheet{width:100%;max-width:none}
  .game-sheet-cover{height:200px}
}
#feed{touch-action:pan-y}
.reel-preview img,.reel-preview video{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}
.swipe-hint small{margin-top:8px;font-size:12px;font-weight:600;color:#ffffffcc}
/* Desktop player: the running game takes the whole area beside the sidebar
   and under the top bar, as one surface. No floating window over the feed. */
@media(min-width:761px){
  .runtime{inset:var(--hub-topbar-height) 0 0 var(--hub-sidebar-width);width:auto;height:auto;max-width:none;max-height:none;margin:0;border:0;border-radius:0;z-index:40;background:var(--night)}
  .runtime .player-stage,.runtime .player-viewport{background:var(--night)}
}

/* Instant play: the next game boots hidden, then freezes until Play. */
.runtime.is-warm{visibility:hidden!important;pointer-events:none!important}
.runtime.is-warm .player-dock{display:none}
.runtime.is-frozen .player-viewport{content-visibility:hidden}
/* Long-press on a reel must not select or tint the card on phones. */
#feed,#feed *{-webkit-tap-highlight-color:transparent}
#feed .reel{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
/* Double-tap like: a heart pops where the finger landed. */
.tap-heart{position:absolute;z-index:6;width:104px;height:104px;margin:-52px 0 0 -52px;color:var(--brand);pointer-events:none;will-change:transform,opacity;animation:tap-heart .8s cubic-bezier(.2,1.3,.4,1) forwards}
.tap-heart svg{width:100%;height:100%;fill:currentColor;stroke:#fff;stroke-width:.9;filter:drop-shadow(0 4px 10px rgba(0,0,0,.35))}
@keyframes tap-heart{0%{opacity:0;transform:rotate(var(--r)) scale(.2)}16%{opacity:1;transform:rotate(var(--r)) scale(1.22)}30%{transform:rotate(var(--r)) scale(.9)}44%{transform:rotate(var(--r)) scale(1.04)}58%{opacity:1;transform:rotate(var(--r)) scale(1)}100%{opacity:0;transform:rotate(var(--r)) translateY(-70px) scale(.6)}}
