/* Starsketch · Draw together (two devices, one picture). Entry = "Draw together" button (menu row, or top bar on narrow screens) → sheet; the bar shows only inside a room. */
.togetherBtn{display:flex;align-items:center;gap:7px;min-height:44px;padding:0 14px;margin-right:8px;border-radius:22px;border:1px solid rgba(34,230,255,.7);background:linear-gradient(135deg,rgba(34,230,255,.24),rgba(255,61,242,.22));color:#e6f1ff;font:800 14px system-ui,-apple-system,sans-serif;cursor:pointer;white-space:nowrap;flex:none;touch-action:manipulation;transition:transform .12s ease,filter .12s ease}
.togetherBtn svg{flex:none}
.togetherBtn:hover{filter:brightness(1.18)}
.togetherBtn:active{transform:scale(.95)}
.togetherBtn:focus-visible{outline:2px solid #22e6ff;outline-offset:2px}
.togetherBtn.live{border-color:#7dff9a;box-shadow:0 0 12px rgba(125,255,154,.45)}
.togetherBtn .dot{width:9px;height:9px;border-radius:50%;background:#7dff9a;box-shadow:0 0 8px #7dff9a;display:none}
.togetherBtn.live .dot{display:block;animation:togPulse 1.6s ease-in-out infinite}
@keyframes togPulse{50%{opacity:.35}}
/* menu-row placement (wider than 860 px): 34 px pill, invisible ::before stretches the touch target to 44 px */
.togetherBtn.inMenu{position:relative;min-height:0;height:30px;margin:0 10px 0 6px;padding:0 14px;font-size:13px;box-shadow:0 0 10px rgba(34,230,255,.35)}
.togetherBtn.inMenu::before{content:"";position:absolute;left:-4px;right:-4px;top:-8px;bottom:-8px}
.togetherBtn.inMenu svg{width:18px;height:18px}
.togetherBtn.inMenu.live{border-color:#7dff9a;box-shadow:0 0 12px rgba(125,255,154,.5)}
@media (max-width:1000px){.togetherBtn.inMenu .lblL{display:none}.togetherBtn.inMenu .lblS{display:inline}}
.togetherBtn .lblS{display:none}
@media (max-width:860px){#topbar > .togetherBtn{order:0}}
@media (max-width:520px){.togetherBtn{padding:0 10px;font-size:12px;gap:5px;margin-right:4px}.togetherBtn .lblL{display:none}.togetherBtn .lblS{display:inline}}

/* sheet */
#splitSheet{position:fixed;inset:0;z-index:950;display:grid;place-items:center;padding:16px;background:rgba(2,4,14,.66);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
#splitSheet[hidden]{display:none}
#splitSheet .card{position:relative;width:min(440px,100%);max-height:calc(100% - 8px);overflow:auto;padding:22px 20px 18px;border-radius:18px;background:rgba(12,18,42,.97);border:1px solid rgba(34,230,255,.45);box-shadow:0 0 28px rgba(34,230,255,.25),0 20px 60px rgba(0,0,0,.6);color:#e6f1ff;font:15px/1.45 system-ui,-apple-system,sans-serif;animation:sheetIn .18s ease-out}
@keyframes sheetIn{from{opacity:0;transform:translateY(10px) scale(.98)}}
#splitSheet h2{margin:0 48px 6px 0;font-size:22px;letter-spacing:.2px}
#splitSheet .lead{margin:0 0 14px;color:#b9c9e6}
#splitSheet .x{position:absolute;top:10px;right:10px;width:44px;height:44px;border-radius:12px;border:1px solid rgba(120,170,255,.3);background:rgba(26,36,74,.6);color:#e6f1ff;font-size:18px;cursor:pointer}
#splitSheet .big{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:52px;margin:6px 0;border-radius:14px;border:0;background:linear-gradient(135deg,#0fb8d6,#c42fd8);color:#fff;font:800 17px system-ui,-apple-system,sans-serif;cursor:pointer;text-decoration:none;box-shadow:0 0 14px rgba(255,61,242,.4);touch-action:manipulation}
#splitSheet .big:active,#splitSheet .room:active,#splitSheet .joinRow button:active,#splitSheet .row2 button:active{transform:scale(.97)}
#splitSheet button:disabled{opacity:.55;cursor:wait}
#splitSheet .room{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:52px;margin:6px 0;padding:0 14px;border-radius:14px;border:1px solid #7dff9a;background:rgba(125,255,154,.12);color:#e6f1ff;font:700 16px system-ui,-apple-system,sans-serif;cursor:pointer;text-align:left;touch-action:manipulation}
#splitSheet .room b{color:#7dff9a;font-size:14px;white-space:nowrap}
#splitSheet .or{margin:14px 0 6px;color:#8fa3c8;font-size:13px;text-align:center}
#splitSheet .joinRow{display:flex;gap:8px}
#splitSheet .joinRow input{flex:1;min-width:0;min-height:52px;padding:0 14px;border-radius:14px;border:1px solid rgba(120,170,255,.45);background:#0a1030;color:#fff;font:800 20px ui-monospace,Menlo,monospace;letter-spacing:3px;text-transform:uppercase}
#splitSheet .joinRow input::placeholder{color:#4d5f86;letter-spacing:3px}
#splitSheet .joinRow input:focus{outline:2px solid #22e6ff;outline-offset:1px}
#splitSheet .joinRow button{min-width:96px;min-height:52px;border-radius:14px;border:1px solid #22e6ff;background:rgba(34,230,255,.16);color:#e6f1ff;font:800 16px system-ui,-apple-system,sans-serif;cursor:pointer;touch-action:manipulation}
#splitSheet .msg{margin:12px 0 4px;color:#ffd166;font-weight:600}
#splitSheet .msg:empty{display:none}
#splitSheet .codeBig{margin:8px 0 4px;padding:14px;border-radius:14px;background:#0a1030;border:1px dashed #22e6ff;text-align:center;font:900 34px ui-monospace,Menlo,monospace;letter-spacing:6px;color:#fff;user-select:all;-webkit-user-select:all}
#splitSheet .hint{margin:4px 0 10px;color:#b9c9e6;text-align:center}
#splitSheet .row2{display:flex;gap:8px}
#splitSheet .row2 button{flex:1;min-height:48px;border-radius:12px;border:1px solid rgba(120,170,255,.45);background:rgba(26,36,74,.7);color:#e6f1ff;font:700 15px system-ui,-apple-system,sans-serif;cursor:pointer;touch-action:manipulation}
#splitSheet details{margin-top:12px;color:#b9c9e6;font-size:14px}
#splitSheet summary{cursor:pointer;min-height:40px;display:flex;align-items:center;color:#22e6ff;font-weight:700}
#splitSheet ul{margin:4px 0 0;padding-left:20px}
#splitSheet li{margin:3px 0}

/* in-room bar */
#splitBar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:6px 60px 6px 12px;background:linear-gradient(90deg,rgba(34,230,255,.14),rgba(255,61,242,.12)),#0d1430;color:#e6f1ff;border-bottom:1px solid rgba(34,230,255,.35);font:600 14px system-ui,-apple-system,sans-serif;z-index:4;position:relative}
#splitBar[hidden]{display:none}
#splitBar button{min-height:44px;padding:0 14px;border:1px solid rgba(120,170,255,.5);border-radius:10px;background:rgba(26,36,74,.85);color:inherit;font:700 14px system-ui,-apple-system,sans-serif;cursor:pointer;touch-action:manipulation}
#splitBar button:active{transform:scale(.96)}
#splitBar button:disabled{opacity:.5;cursor:wait}
#splitBar .code{display:flex;align-items:center;gap:6px;font:600 13px system-ui,-apple-system,sans-serif;border-style:dashed;border-color:#22e6ff;background:#0a1030}
#splitBar .code b{font:900 18px ui-monospace,Menlo,monospace;letter-spacing:2px;color:#fff}
#splitBar .side{color:#ff8fc7;font-weight:800}
#splitBar .partner{color:#8fa3c8}
#splitBar .partner.on{color:#7dff9a}
#splitBar #splitStatus{flex:1;min-width:110px;color:#b9c9e6;font-weight:500}
#splitBar #splitStatus.warn{color:#ffd166;font-weight:700}
#splitBar #splitLeave{border-color:rgba(255,120,120,.6)}
#splitBar .sm{display:none}
@media (max-width:700px){#splitBar{gap:6px;padding:5px 54px 5px 8px;font-size:13px}#splitBar button{padding:0 10px;font-size:13px}#splitBar .side{display:none}#splitBar .lg{display:none}#splitBar .sm{display:inline}#splitBar #splitStatus{flex:1 1 auto;min-width:0}}

#main{height:calc(100% - 56px - 34px - var(--split-bar-height,0px))}
