:root{color-scheme:dark;font-family:system-ui,-apple-system,"Noto Sans KR",sans-serif;color:#eef8ff;background:#071b2a}*{box-sizing:border-box}body{margin:0;min-height:100dvh;overflow-x:hidden}#ambient{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none}.shell{position:relative;isolation:isolate;width:min(100vw,56.25dvh);aspect-ratio:9/16;height:auto;margin:0 auto;overflow:hidden;padding:clamp(9px,2.4%,18px);display:flex;flex-direction:column;background:#050b1a}.shell> :not(#ambient){position:relative;z-index:1}.shell .panel{overflow-y:auto;min-height:0}.shell header{flex-shrink:0}.shell footer{flex-shrink:0}header{text-align:center;padding:15px 0 22px}.brand{font-size:10px;letter-spacing:3px;color:#91c7dd}.brand b{color:#e9f5fb}h1{margin:12px 0 4px;font-size:clamp(42px,11vw,64px);letter-spacing:-2px;font-weight:950}h1 span{color:#48ea92;text-shadow:0 0 18px #24d77a66}.tagline{margin:0;color:#a4c5d2;font-size:14px}.panel{background:#0d2b3ce8;border:1px solid #41657a85;box-shadow:0 14px 50px #0006,inset 0 1px #ffffff10;border-radius:20px;padding:21px;backdrop-filter:blur(7px)}.hidden{display:none!important}h2{margin:0 0 18px;font-size:22px}label{display:block;font-size:13px;margin-bottom:8px;color:#a7c7d8}input{width:100%;padding:15px 14px;border:1px solid #476c80;background:#082231;color:#fff;border-radius:11px;font-size:16px;outline:0}input:focus{border-color:#55eaa1}button{font:inherit;cursor:pointer;border:0;border-radius:11px;padding:14px 16px;background:#244a62;color:#fff;font-weight:750;touch-action:manipulation}button:disabled{opacity:.43;cursor:default}.primary{background:linear-gradient(130deg,#37e68f,#16ab77);color:#04241a;width:100%;box-shadow:0 5px 20px #18ca8240}.actions{margin-top:15px}.divider{text-align:center;color:#8caebb;font-size:12px;margin:23px 0 14px}.joinrow{display:flex;gap:8px}.joinrow input{min-width:0;flex:1}.hint{color:#93afbe;text-align:center;font-size:12px;line-height:1.6}.row{display:flex;justify-content:space-between;align-items:center}.row h2{margin:0 0 12px}.pill{border:1px solid #47758a;color:#b9e6f0;border-radius:999px;padding:6px 12px;font-size:12px}.roomlabel{background:#09202e;border:1px solid #294e60;border-radius:13px;padding:12px;display:flex;align-items:center;gap:8px;font-size:12px}.roomlabel strong{font-size:21px;color:#4deb9f;letter-spacing:2px;margin-right:auto}.mini{padding:8px;font-size:11px}.players{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0}.player{padding:12px 9px;background:#15394a;border:1px solid #305d6e;border-radius:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.player.me{border-color:#39e99b}.quiet{background:transparent;color:#a4c0cc;width:100%;margin-top:10px}.game-caption{text-align:center;font-weight:800;font-size:19px;margin:20px 0 14px;min-height:30px}.timer-track{height:8px;background:#1e4554;border-radius:999px;overflow:hidden;margin-bottom:20px}#timerFill{background:#4be69b;height:100%;width:0%}.board{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;max-width:340px;margin:0 auto;aspect-ratio:1}.cell{padding:0;background:#687680;border-radius:15px;box-shadow:inset 0 -5px 0 #263945,0 4px 14px #0005;border:2px solid #90a1ac30;transition:background .07s}.cell.active{background:#42f28e;box-shadow:0 0 25px #40ee91b0,inset 0 -5px 0 #119851;border-color:#c0ffda;animation:glow .22s infinite alternate}.cell:disabled{opacity:1}.status{min-height:45px;text-align:center;color:#a4cbd9;font-size:14px;margin-top:21px}@keyframes glow{to{filter:brightness(1.18)}}.result-icon{text-align:center;font-size:55px}.result-icon+h2{text-align:center}#resultText{text-align:center;font-size:22px;font-weight:800;line-height:1.5}footer{text-align:center;color:#628797;font-size:11px;padding:24px 0 12px;margin-top:auto}#notice:not(:empty){margin-top:12px;padding:10px;text-align:center;background:#6b3034;border-radius:8px;font-size:13px}@media(max-height:710px){header{padding:3px 0 12px}h1{font-size:44px}.shell{padding-top:8px}.panel{padding:15px}.board{max-width:min(320px,43dvh)}}@media(prefers-reduced-motion:reduce){.cell.active{animation:none}}
/* Room discovery and setup */
.room-list{display:flex;flex-direction:column;gap:10px;max-height:360px;overflow-y:auto;margin:14px 0 19px;min-height:84px}
.room-entry{width:100%;display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left;padding:16px;background:linear-gradient(135deg,#143949,#0c293c);border:1px solid #418b9a;border-radius:14px;box-shadow:inset 0 1px #ffffff12,0 7px 17px #0004;transition:border-color .15s,transform .15s}
.room-entry:not(:disabled):active{transform:scale(.985);border-color:#55f3b1}
.room-entry strong{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-entry span{font-size:12px;color:#a7cfd9;white-space:nowrap}
.room-entry:disabled{opacity:.45}
#createForm label,#joinForm label{margin-top:16px}
#createForm .primary,#joinForm .primary{margin-top:22px}
select{width:100%;padding:14px;background:#082231;border:1px solid #476c80;border-radius:11px;color:#fff;font-size:15px}
.room-title{font-weight:850;font-size:19px;color:#74ffc3;text-align:center;margin:4px 0 13px;overflow-wrap:anywhere}

/* Portrait game viewport: preserve 9:16 on desktop and mobile. */
body{min-height:100dvh;display:grid;place-items:center;background:#020512}
@media (max-aspect-ratio:9/16){.shell{width:100vw;height:calc(100vw * 16 / 9)}}
@media (min-aspect-ratio:9/16){.shell{height:100dvh;width:calc(100dvh * 9 / 16)}}
@media(max-height:750px){.shell{padding:10px}header{padding:2px 0 8px}h1{font-size:clamp(32px,7dvh,50px)}.panel{padding:14px}.room-list{max-height:28dvh}.board{max-width:min(320px,38dvh)}}

/* 250ms success touch flash, ripple and sparks. */
.board{position:relative}
.touch-burst{position:absolute;width:0;height:0;z-index:5;pointer-events:none}
.burst-flash{position:absolute;left:-38px;top:-38px;width:76px;height:76px;border-radius:50%;background:radial-gradient(circle,#fff 0%,#b8ffe5 18%,#46ffa9aa 43%,transparent 72%);animation:burstFlash .25s ease-out both}
.burst-ring{position:absolute;left:-25px;top:-25px;width:50px;height:50px;border:3px solid #a8ffdc;border-radius:50%;box-shadow:0 0 14px #39fba1aa;animation:burstRing .25s ease-out both}
.burst-spark{position:absolute;left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:#d1fff0;box-shadow:0 0 8px #62ffc0;animation:burstSpark .25s ease-out both}
@keyframes burstFlash{0%{opacity:.95;transform:scale(.55)}35%{opacity:.95;transform:scale(1.2)}100%{opacity:0;transform:scale(1.65)}}
@keyframes burstRing{0%{opacity:1;transform:scale(.35)}100%{opacity:0;transform:scale(3.15)}}
@keyframes burstSpark{0%{opacity:1;transform:translate(0,0) scale(1)}100%{opacity:0;transform:translate(var(--tx),var(--ty)) scale(.25)}}
@media(prefers-reduced-motion:reduce){.touch-burst{display:none}}


/* Platform menu layout — shared stylesheet. */

:root{color-scheme:dark;font-family:system-ui,-apple-system,"Noto Sans KR",sans-serif;background:#031322;color:#effaff}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:#031322}
body{overflow-x:hidden}
.menu-shell{position:relative;isolation:isolate;margin:0 auto;width:min(100vw,56.25dvh);min-height:min(100dvh,177.7778vw);aspect-ratio:9/16;overflow:hidden;display:flex;flex-direction:column;align-items:center;padding:0 3.2% 2%;background:radial-gradient(ellipse at 50% 38%,#092841 0%,#05192b 60%,#020d1b 100%)}
.menu-shell>header,.menu-shell>.menu-panel,.menu-shell>footer{position:relative;z-index:3}
.menu-shell header{flex:none;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;margin:3% 0 5%;padding:0}
.menu-logo{display:block;width:91%;height:auto;aspect-ratio:2/1;object-fit:contain}
.menu-slogan{margin:-1% 0 0;font-size:clamp(11px,2.6vw,15px);color:#c6dce8;text-align:center}
.menu-panel{width:100%;height:auto;min-height:0;flex:none;position:relative;display:flex;flex-direction:column;align-items:stretch;padding:5.5% 6% 7%;background:rgba(8,58,48,.12);border-radius:22px}
.menu-panel::before{content:"";position:absolute;inset:0;border:2px solid #36ffba;border-radius:22px;box-shadow:0 0 11px #36ffba,inset 0 0 9px #36ffba;opacity:.3;pointer-events:none}
.menu-panel>*{position:relative;z-index:1}
.menu-header-image{display:block;object-fit:fill;width:100%;height:auto;flex:none;margin:0 0 2.2%}
.menu-games{display:flex;flex-direction:column;align-items:stretch;width:100%;padding:0;min-width:0;margin:0;overflow:visible}
.menu-card{position:relative;display:flex;align-items:center;width:100%;height:auto;flex-shrink:0;min-width:0;margin:0;padding:4% 14% 4% 5%;gap:4%;color:#effaff;text-decoration:none;border:0;background:transparent;isolation:isolate}
.menu-card::before{content:"";position:absolute;inset:0;z-index:-1;background:url('./assets/menu/game_card_green_arrow_panel_1536x512.webp') center /100% 100% no-repeat}
.menu-card.quiz::before{background-image:url('./assets/menu/game_card_blue_arrow_panel_1536x512.webp')}
.menu-icon{width:26%;height:auto;max-height:76%;aspect-ratio:1;object-fit:contain;flex:none}
.menu-label{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}
.menu-label strong{font-size:clamp(15px,4.2vw,22px);font-weight:850;white-space:nowrap}
.menu-label small{font-size:clamp(9px,2.35vw,12px);color:#bed9e6;line-height:1.35}
.menu-card:active:not(.disabled){transform:scale(.99)}
.menu-card:focus-visible{outline:2px solid #a9ffe5;outline-offset:-4px}
.menu-card.disabled{opacity:.5;pointer-events:none}
.menu-card.disabled::before{background-image:url('./assets/menu/game_card_blue_arrow_panel_1536x512.webp');filter:grayscale(1)}
.menu-card.disabled>.menu-icon{display:grid;place-items:center;font-size:clamp(22px,6vw,32px)}
.menu-footer{margin:3% 0 0;font-size:10px;color:#7b9eaf;text-align:center;flex:none}
#menuBubbles{position:absolute;inset:0;z-index:2;overflow:hidden;pointer-events:none}
.menu-bubble{position:absolute;bottom:-18%;height:auto;opacity:var(--alpha);animation:bubbleRise var(--duration) linear var(--delay) infinite}
@keyframes bubbleRise{from{transform:translate3d(0,0,0)}to{transform:translate3d(var(--drift),-130vh,0)}}
@media(prefers-reduced-motion:reduce){.menu-bubble{animation:none;bottom:auto;top:var(--restY)}}
@media(max-width:340px){.menu-label strong{font-size:14px}.menu-label small{font-size:9px}}

/* All common room/game UI definitions are in the unified section below. */
.hottouch-page #ambient{display:none}

/* === Speed Quiz gameplay-only rules (formerly quiz.css) === */
.qback{display:block;text-align:center;color:#9ecbdc;text-decoration:none;margin-top:18px}.shell{height:100dvh;aspect-ratio:auto}.shell header{padding:12px 0 14px}.shell .panel{flex:1}.qquestion{background:#092331;border:1px solid #41687a;border-radius:15px;padding:25px 14px;text-align:center;font-size:21px;font-weight:850;line-height:1.55;margin:16px 0;min-height:125px;display:grid;place-items:center}.qanswers{display:grid;grid-template-columns:1fr 1fr;gap:10px}.qanswers button{min-height:110px;font-size:20px;background:#1b5365;border:2px solid #498eaa}.qanswers button:disabled{opacity:.55}.qscores{margin:18px 0;font-size:13px;line-height:2;color:#a6cfda}#qTimer{height:100%;width:100%;background:#40e69b}#qNotice{color:#ffb98a;text-align:center;font-size:13px}#qPasswordLabel{margin-top:12px}select{background:#082231;color:white;border:1px solid #476c80;border-radius:10px;padding:12px;width:100%;margin-bottom:10px}#qRooms{margin:10px 0}.qroom{display:block;width:100%;text-align:left;margin:8px 0;background:#153c4f}.qroom small{display:block;font-weight:400;color:#a7c6d1}.qroom:disabled{opacity:.5}

/* === SHARED GAME UI : FINAL OVERRIDES (formerly game-ui.css) === */
/* STIMPACK GAME LAB / HOT TOUCH WEB GAME UI
 * Shared presentation layer for index.html, hottouch.html and quiz.html.
 * Load AFTER style.css and BEFORE each game's small, gameplay-only stylesheet.
 * Keep JS IDs and game rules outside this file.
 */
:root {
  --sg-bg:#031322; --sg-text:#effaff; --sg-muted:#a6cbd8;
  --sg-green:#34f2a6; --sg-cyan:#45d7f8;
  --sg-inset:clamp(14px,4.4%,21px);
  --sg-gap:12px; --sg-field:48px; --sg-action:66px;
  --sg-panel:rgba(7,36,54,.86); --sg-radius:19px;
}
html,body {margin:0; min-height:100%; background:#031322; color:var(--sg-text)}
body{display:block;overflow-x:hidden}
.shell.ui-shell{
  position:relative;isolation:isolate;margin:0 auto;
  width:min(100vw,56.25dvh);height:100dvh;min-height:0;
  aspect-ratio:auto;max-width:100%;padding:0 3.2% 2%;
  background:radial-gradient(ellipse at 50% 38%,#092841 0%,#05192b 62%,#020d1b 100%);
  display:flex;flex-direction:column;align-items:center;overflow:hidden;
}
.shell.ui-shell>.ui-header{
  width:100%;margin:0;padding:10px 0 12px;flex:none;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;z-index:3;
}
.shell.ui-shell .ui-logo{display:block;width:91%;height:auto;aspect-ratio:2/1;object-fit:contain}
.shell.ui-shell .ui-slogan{
  margin:-2% 0 0;color:#c6dce8;text-align:center;
  font-size:clamp(11px,2.6vw,14px);line-height:1.5;
}
.shell.ui-shell>.panel{
  display:block;position:relative;z-index:3;width:100%;max-width:100%;
  min-height:0;overflow-y:auto;overscroll-behavior:contain;
  padding:var(--sg-inset);background:var(--sg-panel);
  border:1px solid rgba(54,255,186,.33);border-radius:var(--sg-radius);
  box-shadow:0 0 12px rgba(32,231,166,.16),inset 0 0 8px rgba(54,255,186,.07);
  backdrop-filter:none;scrollbar-width:thin;
}
/* Highlight the playing-area boundary without changing layout dimensions. */
.shell.ui-shell>.panel{
 border-color:rgba(64,255,192,.82);
 box-shadow:0 0 0 1px rgba(64,255,192,.22),0 0 18px rgba(25,223,177,.26),inset 0 0 13px rgba(49,255,207,.10);
}
.shell.ui-shell>.panel.hidden{display:none!important}
.shell.ui-shell .panel h2{font-size:clamp(19px,4.8vw,22px);margin:0 0 15px;color:#f2ffff}
.shell.ui-shell .panel .row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.shell.ui-shell .panel .row h2{margin:0}
.shell.ui-shell .panel .hint{color:var(--sg-muted);font-size:12px;line-height:1.6}
.shell.ui-shell .panel label{display:block;margin:13px 0 7px;font-size:13px;color:#c3e7ef;text-align:left}
.shell.ui-shell .panel :is(input,select){
  box-sizing:border-box;width:100%;height:var(--sg-field);min-height:var(--sg-field);
  padding:0 13px;border:1px solid rgba(62,165,191,.7);border-radius:11px;
  background:rgba(4,29,45,.9);color:#f4ffff;font-size:15px;
  box-shadow:inset 0 0 8px rgba(0,170,213,.10);
}
.shell.ui-shell .panel input::placeholder{color:#83a8b8;opacity:1}
.shell.ui-shell .panel :is(input,select):focus-visible{outline:1px solid var(--sg-green);border-color:var(--sg-green)}
.shell.ui-shell .panel :is(button,.mode-link,.qback){
  font-family:inherit;cursor:pointer;touch-action:manipulation;
}
.shell.ui-shell .panel button.primary,
.shell.ui-shell .panel button.quiet,
.shell.ui-shell .panel .ui-image-button{
  display:flex;align-items:center;justify-content:center;
  width:100%;height:var(--sg-action);min-height:var(--sg-action);
  margin:8px 0 0;
  color:white;font-weight:850;font-size:clamp(14px,3.7vw,19px);
  border:0;border-radius:0;box-shadow:none;text-shadow:0 0 8px #58f4ce;
  background:transparent url('./assets/menu/game_card_green_arrow_panel_1536x512.webp') center/100% 100% no-repeat;
}
.shell.ui-shell .panel button.quiet,
.shell.ui-shell .panel .ui-image-button.secondary{
  background-image:url('./assets/menu/game_card_blue_arrow_panel_1536x512.webp');
  text-shadow:0 0 8px #65dcff;
}
.shell.ui-shell .panel button:disabled{opacity:.5;cursor:default}
.shell.ui-shell .panel button:focus-visible,
.shell.ui-shell .panel a:focus-visible{outline:2px solid #90ffe1;outline-offset:2px}
.shell.ui-shell .panel .room-list{display:flex;flex-direction:column;gap:9px;min-height:75px;max-height:28dvh;overflow-y:auto;margin:13px 0 14px}
.shell.ui-shell .panel .room-list :is(.room-entry,.qroom){
  background:rgba(12,58,77,.9);border:1px solid #38879e;
  color:#f4ffff;border-radius:11px;box-shadow:none;padding:13px;
  width:100%;text-align:left;min-height:51px;
}
.shell.ui-shell .panel .roomlabel{
  display:flex;align-items:center;gap:7px;min-height:52px;padding:8px 10px;
  border:1px solid #357c95;border-radius:11px;background:rgba(4,30,47,.88);
}
.shell.ui-shell .panel .roomlabel strong{margin-right:auto;color:#55fbb2;letter-spacing:1px;font-size:20px}
.shell.ui-shell .panel .mini{
  min-height:32px;padding:5px 8px;border:1px solid #3387a7;border-radius:9px;
  background:#14445f;color:white;font-size:11px;box-shadow:none;
}
.shell.ui-shell .panel .players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:14px 0}
.shell.ui-shell .panel .player{
  min-width:0;padding:10px;background:rgba(11,57,75,.85);
  border:1px solid #32788c;border-radius:9px;color:white;
}
.shell.ui-shell .panel .player.me{border-color:#4cffb8}
.shell.ui-shell .panel .pill{font-size:12px}
.shell.ui-shell .panel .joinrow{display:flex;gap:8px;align-items:center}
.shell.ui-shell .panel .joinrow input{flex:1;min-width:0}
.shell.ui-shell .panel .joinrow>button{
  width:auto;min-width:65px;height:var(--sg-field);min-height:var(--sg-field);
  background:#145575;border:1px solid #31add0;border-radius:10px;padding:0 12px;
}
.shell.ui-shell .panel .divider{margin:12px 0 9px;color:#9ec0cb;font-size:12px;text-align:center}
.shell.ui-shell .panel .mode-nav{display:block;margin:0 0 12px}
.shell.ui-shell .panel .mode-nav .mode-link,
.shell.ui-shell .panel .qback{
  display:flex;justify-content:center;align-items:center;text-decoration:none;
  min-height:var(--sg-action);height:var(--sg-action);border:0;border-radius:0;
  color:#f1ffff;background:transparent url('./assets/menu/game_card_blue_arrow_panel_1536x512.webp') center/100% 100% no-repeat;
  font-weight:850;font-size:clamp(13px,3.5vw,17px);
  box-shadow:none;margin:0 0 8px;padding:0 14% 0 5%;
}
.shell.ui-shell .panel .qback{margin-top:8px}
.shell.ui-shell #home,.shell.ui-shell #qHome{display:flex;flex-direction:column}
.shell.ui-shell #home #roomList,.shell.ui-shell #qHome #qRooms{flex:1 1 auto}
.shell.ui-shell #createForm,.shell.ui-shell #joinForm,
.shell.ui-shell #qForm,.shell.ui-shell #lobby,.shell.ui-shell #qLobby,
.shell.ui-shell #result,.shell.ui-shell #qResult{flex:0 1 auto}
.shell.ui-shell :is(#menuBubbles,#gameBubbles,#quizBubbles){
  position:absolute;inset:0;z-index:1;pointer-events:none;overflow:hidden;
}
.shell.ui-shell :is(.menu-bubble,.game-bubble,.quiz-bubble){
  display:block;position:absolute;bottom:-15%;height:auto;pointer-events:none;
  opacity:calc(var(--alpha,.45) * .35);
  animation:bubbleRise var(--duration,14s) linear var(--delay,0s) infinite;
}
.shell.ui-shell>.ui-header,.shell.ui-shell>.panel,.shell.ui-shell>footer{z-index:3;position:relative}
.shell.ui-shell footer{margin-top:auto;padding:12px 0 8px;font-size:10px}
@media(max-height:710px){
  .shell.ui-shell>.ui-header{padding:3px 0 6px}
  .shell.ui-shell .ui-logo{width:76%}
  .shell.ui-shell>.panel{padding:13px}
  .shell.ui-shell .panel .room-list{max-height:22dvh}
  :root{--sg-action:58px}
}
@media(prefers-reduced-motion:reduce){
  .shell.ui-shell :is(.menu-bubble,.game-bubble,.quiz-bubble){animation:none;bottom:auto;top:var(--restY,30%)}
}


/* === Editor and bubble layer === */
.ui-shell>.menu-bubbles,.ui-shell>.game-bubbles,.ui-shell>#quizBubbles{z-index:8!important;pointer-events:none!important}
.ui-shell .menu-bubble,.ui-shell .game-bubble,.ui-shell .quiz-bubble{opacity:calc(var(--alpha,.45) * .85)!important;filter:brightness(1.35);pointer-events:none}
.ui-shell .menu-bubbles img,.ui-shell .game-bubbles img,.ui-shell #quizBubbles img{pointer-events:none}
body.ui-editing [data-ui-edit]{outline:1px dashed #ffcb69!important;outline-offset:2px;cursor:move!important}
body.ui-editing [data-ui-edit].ui-selected{outline:2px solid #ffe16b!important;outline-offset:3px}
#ui-editor-tools{position:fixed;right:6px;bottom:6px;z-index:99999;display:flex;gap:4px;flex-wrap:wrap;max-width:min(98vw,500px);background:#031927f2;padding:7px;border:1px solid #32d9ef;border-radius:10px}
#ui-editor-tools button{padding:6px 9px;background:#165170;color:#fff;font-size:12px;border:1px solid #3292b0}
#ui-editor-tools input{width:70px;min-height:30px;height:30px;padding:4px;color:#fff;background:#12384b}

#ui-editor-tools[hidden]{display:none!important}

/* Editor: eight independent resize handles, drag edges/corners with mouse */
#ui-resize-overlay{position:absolute;z-index:99998;border:2px solid #ffe16b;pointer-events:none;box-sizing:border-box}
#ui-resize-overlay[hidden]{display:none!important}
#ui-resize-overlay .ui-resize-handle{position:absolute;width:13px;height:13px;background:#ffe16b;border:2px solid #102736;border-radius:3px;box-sizing:border-box;pointer-events:auto;touch-action:none}
.ui-resize-n{top:-8px;left:calc(50% - 7px);cursor:n-resize}
.ui-resize-s{bottom:-8px;left:calc(50% - 7px);cursor:s-resize}
.ui-resize-e{right:-8px;top:calc(50% - 7px);cursor:e-resize}
.ui-resize-w{left:-8px;top:calc(50% - 7px);cursor:w-resize}
.ui-resize-ne{right:-8px;top:-8px;cursor:ne-resize}
.ui-resize-nw{left:-8px;top:-8px;cursor:nw-resize}
.ui-resize-se{right:-8px;bottom:-8px;cursor:se-resize}
.ui-resize-sw{left:-8px;bottom:-8px;cursor:sw-resize}

/* Independent layout editing: all UI objects retain their own size/position. */
body.ui-editing .ui-shell [data-ui-edit]{outline:1px dashed rgba(255,211,89,.7)!important;outline-offset:1px;cursor:move!important}
body.ui-editing .ui-shell [data-ui-edit].ui-selected{outline:2px solid #ffe16b!important}
body.ui-editing .ui-shell [data-ui-edit]{touch-action:none}
body.ui-editing .ui-shell{overflow:visible}
body.ui-editing .ui-shell .panel{overflow:visible}
body.ui-editing #ui-resize-overlay{box-sizing:border-box;z-index:99998}

/* Detached HotTouch notifications never participate in game-shell flex layout. */
body.hottouch-page > #notice{
 position:fixed!important;
 top:54px!important;
 left:50%!important;
 transform:translateX(-50%)!important;
 width:max-content!important;
 max-width:min(90vw,400px)!important;
 height:auto!important;
 min-height:0!important;
 z-index:100000!important;
 margin:0!important;
 padding:0!important;
 pointer-events:none!important;
 box-sizing:border-box!important;
}
body.hottouch-page > #notice:not(:empty){
 padding:9px 12px!important;
 background:rgba(107,48,52,.96)!important;
 border-radius:9px!important;
 color:#fff!important;
 text-align:center!important;
 font-size:13px!important;
 box-shadow:0 4px 18px #0008;
}
body.hottouch-page > #notice:empty{display:none!important}

/* Coordinates of selected object in the visual UI editor */
#ui-editor-coordinates{display:inline-flex;align-items:center;white-space:nowrap;font:600 12px/1.4 ui-monospace,Consolas,monospace;color:#ffdf75;background:#092a3d;border:1px solid #55727d;border-radius:6px;padding:5px 7px;font-variant-numeric:tabular-nums}

/* Room layout hierarchy (JSON room-screen intent): independent sibling groups.
   Action buttons -> room-code row -> heading -> list. No cross-row translate hacks. */
.shell.ui-shell :is(#home,#qHome) {display:flex;flex-direction:column;align-items:stretch;gap:10px}
.shell.ui-shell :is(#home,#qHome) > :is(.ui-room-actions,.ui-room-join,.ui-room-heading,.room-list,.hint,.divider){
  flex:0 0 auto;min-width:0;width:100%;margin-left:0;margin-right:0
}
.shell.ui-shell .ui-room-actions {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:center}
.shell.ui-shell .ui-room-actions .mode-nav {min-width:0;margin:0}
.shell.ui-shell .ui-room-actions :is(.mode-link,button.primary) {
  display:flex;align-items:center;justify-content:center;box-sizing:border-box;
  width:100%;min-width:0;height:40px;min-height:40px;
  margin:0;padding:0 6px;font-size:13px
}
.shell.ui-shell .ui-room-join {display:block;min-width:0}
.shell.ui-shell .ui-room-join .joinrow {display:grid;grid-template-columns:minmax(0,1fr) 71px;gap:8px;align-items:center}
.shell.ui-shell .ui-room-join .joinrow input {
  box-sizing:border-box;min-width:0;width:100%;max-width:100%;height:40px;min-height:40px
}
.shell.ui-shell .ui-room-join .joinrow>button {
  box-sizing:border-box;width:71px;min-width:0;height:40px;min-height:40px;margin:0
}
.shell.ui-shell .ui-room-heading {min-width:0;display:flex;align-items:center;justify-content:space-between;gap:8px}
.shell.ui-shell .ui-room-heading h2 {min-width:0;margin:0}
.shell.ui-shell :is(#roomList,#qRooms){min-width:0;width:100%;max-width:100%;flex:1 1 auto}



/* Fixed positions measured from the UI editor's .ui-shell origin.
   Panel: (65,298) 495x780. Button positions are translated to panel-local
   coordinates because the panel starts at (65,298). */
.shell.ui-shell {overflow:hidden;scrollbar-width:none;}
.shell.ui-shell > .panel {
 position:absolute!important;
 flex:none!important;
 left:65px!important;
 top:298px!important;
 margin:0!important;
 translate:none!important;
 width:495px!important;
 min-width:495px!important;
 max-width:none!important;
 height:780px!important;
 min-height:780px!important;
 max-height:none!important;
 box-sizing:border-box;
}
.shell.ui-shell > .panel.hidden {display:none!important;}
/* Room navigation/actions: shell positions (88,313) and (319,313). */
.shell.ui-shell :is(#home,#qHome) .ui-room-actions {
 position:static;
 display:block;
 width:auto;
 height:auto;
}
.shell.ui-shell :is(#home,#qHome) .ui-room-actions .mode-nav {margin:0;}
.shell.ui-shell :is(#home,#qHome) :is(#homeNavigation > a,#qHomeNavigation > a,#createOpen,#qCreateOpen) {
 position:absolute!important;
 top:15px!important;
 margin:0!important;
 translate:none!important;
 width:221px!important;
 min-width:221px!important;
 max-width:221px!important;
 height:40px!important;
 min-height:40px!important;
 max-height:40px!important;
 box-sizing:border-box;
}
.shell.ui-shell :is(#homeNavigation > a,#qHomeNavigation > a) {left:23px!important;}
.shell.ui-shell :is(#createOpen,#qCreateOpen) {left:254px!important;}
/* Action row: shell Y960 = panel-local Y662. */
.shell.ui-shell :is(#cancelCreate,#cancelJoin,#leaveLobby,#leaveResult,#qCancel,#qLeaveLobby,#qLeaveGame,#qLeaveResult,
#create,#confirmJoin,#start,#again,#qSubmit,#qStart,#qRestart) {
 position:absolute!important;
 top:662px!important;
 bottom:auto!important;
 margin:0!important;
 translate:none!important;
 width:221px!important;
 min-width:221px!important;
 max-width:221px!important;
 height:40px!important;
 min-height:40px!important;
 max-height:40px!important;
 box-sizing:border-box;
}
.shell.ui-shell :is(#cancelCreate,#cancelJoin,#leaveLobby,#leaveResult,#qCancel,#qLeaveLobby,#qLeaveGame,#qLeaveResult) {left:23px!important;right:auto!important;}
.shell.ui-shell :is(#create,#confirmJoin,#start,#again,#qSubmit,#qStart,#qRestart) {left:254px!important;right:auto!important;}


/* Shared precise UI-editor coordinates; origin is .ui-shell top-left.
   The room panel is (65,298), so child coordinates subtract (65,298). */
.shell.ui-shell :is(#home,#qHome) :is(#homeJoinArea,#qHomeJoinArea,#homeJoinRow,#qHomeJoinRow,#homeHeading,#qHomeHeading) {position:static!important;transform:none!important;translate:none!important;}
.shell.ui-shell :is(#roomCode,#qCode,#join,#qCodeJoin,#homeHeading > h2,#qHomeHeading > h2,#refreshRooms,#qRefreshRooms,#homeDescription,#qHomeDescription,#roomList,#qRooms) {
 position:absolute!important;
 box-sizing:border-box!important;
 margin:0!important;
 translate:none!important;
 flex:none!important;
 max-width:none!important;
 min-width:0!important;
 max-height:none!important;
}
.shell.ui-shell :is(#roomCode,#qCode){left:26px!important;top:61px!important;width:365px!important;height:40px!important;min-height:40px!important;}
.shell.ui-shell :is(#join,#qCodeJoin){left:402px!important;top:61px!important;width:71px!important;height:40px!important;min-height:40px!important;padding:0!important;}
.shell.ui-shell :is(#homeHeading > h2,#qHomeHeading > h2){left:26px!important;top:110px!important;width:191px!important;height:29px!important;min-height:0!important;line-height:29px!important;}
.shell.ui-shell :is(#homeHeading > h2,#qHomeHeading > h2){font-size:17px!important;white-space:nowrap!important;overflow:visible!important;}
.shell.ui-shell :is(#refreshRooms,#qRefreshRooms){left:410px!important;top:110px!important;width:62px!important;height:32px!important;min-height:32px!important;padding:0!important;}
.shell.ui-shell :is(#homeDescription,#qHomeDescription){left:22px!important;top:148px!important;width:451px!important;height:19px!important;min-height:0!important;}
.shell.ui-shell :is(#roomList,#qRooms){left:22px!important;top:180px!important;width:451px!important;height:553px!important;min-height:0!important;max-height:none!important;overflow-y:auto;}
.shell.ui-shell > footer {
 position:absolute!important;
 left:220px!important;
 top:1033px!important;
 width:186px!important;
 height:34px!important;
 min-height:0!important;
 margin:0!important;
 padding:0!important;
 box-sizing:border-box!important;
 translate:none!important;
 display:flex;align-items:center;justify-content:center;
}


/* Shared fixed full-page background (image exists at the deployed assets path).
   Keep all game panel geometry and foreground controls unchanged. */
html,body {
 background-color:#020d1b;
 background-image:url('./assets/HotTouch_Neon_Arcade_Background.webp');
 background-repeat:no-repeat;
 background-position:center center;
 background-size:cover;
 background-attachment:fixed;
}
.shell.ui-shell {
 background-color:transparent;
 background-image:url('./assets/HotTouch_Neon_Arcade_Background.webp');
 background-repeat:no-repeat;
 background-position:center center;
 background-size:cover;
 background-attachment:fixed;
}

/* Fixed room-screen design geometry must be scaled as ONE unit.
   The room panel ends at x560/y1078; the full reference canvas is 606x1078.
   room-viewport-fit.js supplies the zoom factor for narrow/short viewports. */
body:is(.hottouch-page,.quiz-page) > .shell.ui-shell{
 width:606px!important;
 min-width:606px!important;
 max-width:606px!important;
 height:1078px!important;
 min-height:1078px!important;
 max-height:1078px!important;
 aspect-ratio:606/1078!important;
 box-sizing:border-box!important;
 margin:0 auto!important;
 flex:none!important;
}
body:is(.hottouch-page,.quiz-page){
 overflow-x:hidden!important;
}
