html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #101c20;
}
#c {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: grab;
}
/* first-time controls tip: bottom left, above the online pill (fades on first move) */
#hint {
  position: fixed;
  left: 18px;
  bottom: 52px;
  max-width: calc(100vw - 36px);
  box-sizing: border-box;
  font: 500 12px/1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(20, 28, 38, 0.45);
  padding: 8px 14px;
  border-radius: 12px;
  pointer-events: none;
  transition: opacity 1.2s;
  line-height: 1.35;
}
#hint.gone { opacity: 0; }
#voiceActive { position: fixed; top: 18px; right: 18px; z-index: 5; max-width: min(260px, 60vw); display: none; padding: 7px 10px; border-radius: 7px; color: #fff; background: rgba(10,18,22,.72); font: 600 12px/1.2 system-ui, sans-serif; pointer-events: none; }
#voiceActive.on { display: block; }
/* players online: bottom left, always there */
#sqOnline {
  position: fixed; left: 18px; bottom: 18px; z-index: 5; pointer-events: none; display: flex; align-items: center; gap: 7px;
  font: 600 12px/1 system-ui, sans-serif; color: #fff; background: rgba(10,12,16,.55); padding: 7px 11px; border-radius: 999px;
}
#sqOnline i { width: 8px; height: 8px; border-radius: 50%; background: #46d17a; box-shadow: 0 0 6px #46d17a; }
#getup {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  padding: 9px 14px; border-radius: 9px; background: rgba(9, 20, 24, .82); color: #fff;
  font: 600 14px/1 system-ui, sans-serif; pointer-events: none; opacity: 0; transition: opacity .2s;
}
#getup.on { opacity: 1; }
#getup kbd { font: 800 13px/1 system-ui, sans-serif; border: 1px solid #7fe8c5; border-radius: 4px; padding: 2px 5px; margin: 0 2px; color: #7fe8c5; }

#cross {
  position: fixed; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.45);
  pointer-events: none; opacity: 0; transition: opacity .15s;
}
#cross.on { opacity: .9; }
#ammo {
  position: fixed; right: 18px; bottom: 16px; font: 600 15px/1 ui-monospace, monospace;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); pointer-events: none; opacity: 0; transition: opacity .2s;
}
#ammo.on { opacity: .85; }
#blood {
  position: fixed; left: 18px; bottom: 52px; display: flex; align-items: center; gap: 8px;
  font: 600 13px/1 ui-monospace, monospace; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6);
  pointer-events: none; opacity: 0; transition: opacity .4s;
}
#blood.on { opacity: .9; }
/* ---- the menu (Esc / ☰): one card. Resume stands out; the photo booth and speedruns are tiles; the settings are
   rows that show their value; host controls (owner only) sit at the bottom in amber. ---- */
#menu {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: 12px; box-sizing: border-box; background: rgba(8, 12, 16, 0.5); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .15s;
  --pink: #ee789e; --teal: #1f7a66; --mint: #7fe8c5; --amber: #e8b04a; --card: rgba(16, 22, 26, .94);
}
#menu.on { opacity: 1; pointer-events: auto; }
#menu [hidden] { display: none !important; }
.menu-card {
  width: min(440px, 100%); max-height: 100%; overflow-y: auto; box-sizing: border-box; padding: 16px;
  display: flex; flex-direction: column; gap: 12px; border-radius: 16px; background: var(--card);
  border: 1px solid rgba(255,255,255,.1); box-shadow: 0 18px 50px rgba(0,0,0,.5); color: #fff;
  font: 500 14px/1.3 system-ui, sans-serif; overscroll-behavior: contain;
}
.menu-head { display: flex; align-items: center; gap: 10px; color: var(--pink); }
.menu-head svg { width: 54px; height: 15px; }
.menu-head b { color: #fff; font: 800 18px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
#menu button { font: 600 15px/1.1 system-ui, sans-serif; color: #fff; cursor: pointer; border: 0; border-radius: 10px; transition: background .1s, transform .1s; }
#menu button:active { transform: translateY(1px); }
#menu button:disabled { opacity: .35; cursor: default; transform: none; }
#menu button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.menu-main { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.menu-main button { padding: 15px 10px; background: rgba(255,255,255,.1); }
.menu-main button:hover { background: rgba(255,255,255,.16); }
#menu .menu-main .primary { background: var(--pink); color: #1d0b12; font-weight: 800; font-size: 17px; letter-spacing: .04em; }
#menu .menu-main .primary:hover { background: #f494b4; }
.menu-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#menu .tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; text-align: left; border: 1px solid; }
#menu .tile b { font: 700 15px/1.1 system-ui, sans-serif; }
#menu .tile small { font: 500 12px/1.25 system-ui, sans-serif; opacity: .75; }
#menu .tile.booth { background: rgba(238,120,158,.14); border-color: rgba(238,120,158,.55); }
#menu .tile.booth:hover { background: rgba(238,120,158,.24); }
#menu .tile.runs { background: rgba(31,122,102,.22); border-color: rgba(127,232,197,.5); }
#menu .tile.runs:hover { background: rgba(31,122,102,.34); }
.menu-group { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 0; border-top: 1px solid rgba(255,255,255,.1); }
.menu-group h3, .menu-group summary, #host h3 {
  margin: 6px 0 4px; font: 700 11px/1 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55);
}
#menu .setting { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 10px; background: transparent; text-align: left; font-weight: 500; }
#menu .setting:hover { background: rgba(255,255,255,.07); }
#menu .setting em { font: 700 12px/1 system-ui, sans-serif; font-style: normal; padding: 5px 9px; border-radius: 999px; background: var(--teal); color: #eafff7; min-width: 28px; text-align: center; }
#menu .setting.off em { background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); }
.controls summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.controls summary::-webkit-details-marker { display: none; }
.controls summary::after { content: '+'; font-size: 14px; }
.controls[open] summary::after { content: '−'; }
.keys, .touch-keys { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin: 4px 0 6px; align-items: center; }
.keys dt, .touch-keys dt { font: 700 12px/1 system-ui, sans-serif; padding: 4px 7px; border-radius: 5px; background: rgba(255,255,255,.12); justify-self: start; }
.keys dd, .touch-keys dd { margin: 0; font-size: 13px; opacity: .85; }
.touch-keys, html.touch .keys { display: none; }
html.touch .touch-keys { display: grid; }
/* Speedruns open: the board takes the card's place */
#menu.boards-on .menu-card > :not(.menu-tiles):not(#leaderboard):not(.menu-head),
#menu.boards-on .menu-tiles > :not(#speedruns) { display: none; }
#menu.boards-on .menu-tiles { grid-template-columns: 1fr; }
#voicePanel { box-sizing: border-box; width: 100%; color: #fff; font: 500 12px/1.3 system-ui, sans-serif; }
#voiceStatus:empty { display: none; }
#voiceStatus { padding: 5px 8px; color: #ffd36e; text-align: center; }
#voiceUsers { display: grid; gap: 4px; max-height: 145px; overflow-y: auto; }
#voiceUsers p { margin: 2px 0; text-align: center; opacity: .7; }
.vc-user { display: flex; align-items: center; gap: 7px; min-height: 27px; padding: 3px 7px; border-radius: 6px; background: rgba(10,18,22,.72); }
.vc-user i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #718078; }
.vc-user.speaking i { background: #63e5a4; box-shadow: 0 0 8px #63e5a4; }
.vc-user span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#menu .vc-user button { width: auto; padding: 5px 8px; border-radius: 5px; font-size: 11px; background: rgba(255,255,255,.14); }
#leaderboard { display: none; color: #fff; }
#menu.boards-on #leaderboard { display: block; }
#leaderboard .leaderboard-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 12px; }
#menu #leaderboard .leaderboard-tabs button { flex: 1 1 28%; padding: 9px 5px; font-size: 12px; background: rgba(255,255,255,.1); }
#menu #leaderboard .leaderboard-tabs button.on { background: #1f7a66; color: #fff; }
#leaderboard-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
#leaderboard-list li { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 5px 10px; border-radius: 7px; background: rgba(10,18,22,.72); font: 600 13px/1.2 system-ui, sans-serif; }
#leaderboard-list .rank { color: #7fe8c5; width: 22px; font: 700 12px/1 ui-monospace, monospace; }
#leaderboard-list .runner { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: #fff; text-decoration: none; }
#leaderboard-list .runner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#leaderboard-list .runner img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #5f736a; }
#leaderboard-list .result { display: flex; flex-direction: column; align-items: flex-end; color: #7fe8c5; font: 700 15px/1.1 ui-monospace, monospace; }
#leaderboard-list .result small { margin-top: 3px; color: #d5dfdb; font: 500 11px/1 system-ui, sans-serif; }
#leaderboard-list li.earned .runner { color: #7fe8c5; }
#leaderboard-status { margin: 0; padding: 15px; text-align: center; color: #fff; font: 500 13px/1.3 system-ui, sans-serif; }
#leaderboard-status:empty { display: none; }
#blood i {
  display: block; width: 120px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.35);
  box-shadow: 0 1px 2px rgba(0,0,0,.4); position: relative; overflow: hidden;
}
#blood i::after {
  content: ''; position: absolute; inset: 0; width: var(--f, 100%); background: #b3121c; border-radius: 3px;
}

#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.nameTag {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font: 600 12px/1 system-ui, sans-serif; color: #fff; padding: 3px 6px; border-radius: 4px;
  background: rgba(0,0,0,.35); text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
#mpBanner {
  position: fixed; bottom: 86px; left: 18px; z-index: 5;
  max-width: calc(100vw - 64px); font: 600 13px/1.3 system-ui, sans-serif; color: #fff; background: rgba(20,20,24,.8);
  padding: 8px 14px; border-radius: 6px; pointer-events: none;
}
#mpDebug {
  position: fixed; top: 8px; left: 8px; margin: 0; z-index: 5; pointer-events: none;
  font: 11px/1.35 ui-monospace, monospace; color: #cfe; background: rgba(0,0,0,.55); padding: 6px 8px; border-radius: 4px;
}

/* ---- Squid Game HUD ---- */
#sqTop {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); pointer-events: none;
  font: 700 30px/1 ui-monospace, "Courier New", monospace; letter-spacing: .06em; color: #ff5a36;
  background: rgba(5,5,5,.78); padding: 6px 14px; border-radius: 6px; opacity: 0; transition: opacity .3s;
}
#sqTop.on { opacity: 1; }
#sqLight {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%); pointer-events: none;
  font: 800 22px/1 system-ui, sans-serif; letter-spacing: .12em; padding: 7px 16px; border-radius: 6px;
  opacity: 0; transition: opacity .15s, background .15s;
}
#sqLight.on { opacity: 1; }
#sqLight.green { background: rgba(31,122,102,.9); color: #eafff7; }
#sqLight.red { background: rgba(200,30,40,.92); color: #fff; }
#sqLight.sky { background: rgba(20,20,24,.88); color: #f3e2b0; font-size: 18px; }
#sqLight.race { background: rgba(123,92,255,.9); color: #fff; font-size: 18px; }
#sqMe {
  position: fixed; left: 18px; top: 14px; pointer-events: none; display: flex; align-items: center; gap: 10px;
  font: 600 13px/1 system-ui, sans-serif; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); text-transform: uppercase; letter-spacing: .06em;
}
#sqMe b {
  font: 800 20px/1 "Arial Narrow", Arial, sans-serif; color: #111; background: #f4f2ec; padding: 5px 8px 4px;
  border-radius: 3px; border: 3px solid #1f7a66; text-shadow: none; letter-spacing: .02em;
}
#sqCount {
  position: fixed; right: 18px; top: 18px; pointer-events: none;
  font: 700 15px/1 ui-monospace, monospace; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
#sqLobby {
  position: fixed; top: 110px; left: 50%; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  font: 600 15px/1 system-ui, sans-serif; color: #fff; background: rgba(20,24,30,.6); padding: 8px 14px; border-radius: 999px;
  opacity: 0; transition: opacity .3s;
}
#sqLobby.on { opacity: 1; }
#sqBig {
  position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); pointer-events: none; text-align: center;
  color: #fff; opacity: 0; transition: opacity .4s; max-width: min(92vw, 640px);
}
#sqBig.on { opacity: 1; }
#sqBig b { display: block; font: 900 clamp(30px, 7vw, 64px)/1.05 system-ui, sans-serif; letter-spacing: .04em; text-shadow: 0 3px 16px rgba(0,0,0,.55); }
#sqBig span { display: block; margin-top: 10px; font: 500 16px/1.45 system-ui, sans-serif; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
#sqBig.dead b { color: #ff4a4a; }
#sqBig.pass b { color: #7fe8c5; }
#sqAnnounce {
  position: fixed; left: 50%; top: 24%; transform: translate(-50%, -50%); z-index: 7;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-sizing: border-box; max-width: min(90vw, 720px); padding: 11px 16px;
  border: 2px solid; border-radius: 10px; background: rgba(8, 18, 20, .9);
  box-shadow: 0 8px 30px rgba(0,0,0,.4); color: #fff;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  font: 700 clamp(17px, 2.6vw, 28px)/1.15 system-ui, sans-serif;
}
#sqAnnounce.on { opacity: 1; }
#sqAnnounce.pass { border-color: #68d6ad; }
#sqAnnounce.dead { border-color: #ff6666; }
#sqAnnounce.first { border-color: #ffd36e; }
#sqAnnounce b { color: #f4f2ec; font: 900 1.15em/1 ui-monospace, monospace; }
#sqAnnounce > span { color: #a9b9b4; }
#sqAnnounce strong { font-size: .82em; letter-spacing: .04em; }
#sqAnnounce.pass strong { color: #7fe8c5; }
#sqAnnounce.dead strong { color: #ff7777; }
#sqAnnounce.first strong { color: #ffd36e; }
#sqAnnounce .playerName { min-width: 0; font-weight: 700; }
#sqAnnounce .playerName img { width: 30px; height: 30px; }
@media (max-width: 600px) { #sqAnnounce { top: 25%; width: 90vw; flex-wrap: wrap; gap: 5px 8px; } }
@media (max-width: 600px) { #hint { white-space: normal; width: calc(100vw - 32px); text-align: center; } }

/* host controls (project owner only), in the Esc menu */
#host { display: none; flex-direction: column; gap: 8px; padding: 4px 10px 10px; border-radius: 10px; border: 1px solid rgba(232,176,74,.45); background: rgba(232,176,74,.07); }
#host.on { display: flex; }
#host h3 { color: var(--amber); }
#host .row { display: flex; flex-wrap: wrap; gap: 6px; }
#menu #host > button { padding: 11px; background: rgba(255,255,255,.1); }
#menu #host .row button { flex: 1 1 30%; padding: 9px 6px; font-size: 13px; background: rgba(255,255,255,.1); }
#menu #host .row button.on { background: #1f7a66; color: #fff; }
#menu #host #hostEnd { background: rgba(200, 40, 50, .9); color: #fff; }

/* who just passed (O) / was eliminated (X) */
#sqFeed, #sqPlayerFeed { position: fixed; right: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; }
#sqFeed { bottom: 58px; }
#sqPlayerFeed { top: 44px; z-index: 6; }
#sqFeed div, #sqPlayerFeed div { font: 700 15px/1 ui-monospace, monospace; color: #fff; background: rgba(10,12,16,.55); padding: 4px 8px; border-radius: 4px; display: flex; gap: 7px; align-items: center; transition: opacity .9s; }
#sqFeed div.gone, #sqPlayerFeed div.gone { opacity: 0; }
#sqFeed i, #sqPlayerFeed i { font-style: normal; font-weight: 900; }
#sqFeed .o i, #sqPlayerFeed .o i { color: #6fe0b8; }
#sqFeed .x i, #sqPlayerFeed .x i { color: #ff4a4a; }
#sqPlayerFeed .player { max-width: min(390px, calc(100vw - 36px)); background: rgba(10,18,22,.84); font: 700 13px/1.15 system-ui, sans-serif; }
#sqPlayerFeed .player strong { font-size: 11px; letter-spacing: .04em; }
#sqPlayerFeed .o strong { color: #7fe8c5; }
#sqPlayerFeed .x strong { color: #ff7777; }
#sqPlayerFeed .first i, #sqPlayerFeed .first strong { color: #ffd36e; }
#sqPlayerFeed .playerName { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sqPlayerFeed .playerName img { width: 18px; height: 18px; }
.playerName { display: inline-flex; align-items: center; gap: 5px; color: #fff; text-decoration: none; pointer-events: auto; }
.playerName img { flex: none; border-radius: 50%; object-fit: cover; background: #5f736a; }

.nameTag.self { background: rgba(31, 122, 102, .55); }
/* a hit bot's health, over its head for a few seconds */
.hpBar { position: absolute; left: 0; top: 0; width: 48px; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(0,0,0,.55); box-shadow: 0 0 0 1px rgba(255,255,255,.55); }
.hpBar > i { display: block; height: 100%; transition: width .15s; }

/* the dolls' song: on the light's line (empty during jump rope); above the buttons on phones */
#sqLyric { position: fixed; left: 50%; top: 68px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  font: 600 18px/1 system-ui, sans-serif; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.7); opacity: 0; transition: opacity .3s; }
#sqLyric.on { opacity: .95; }
#sqLyric::before { content: '\266A  '; color: #ffd36e; }

/* Tug of War: the rope's middle between the two edges, and your heave */
#sqTug {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%); pointer-events: none; opacity: 0; transition: opacity .3s;
  display: grid; grid-template-columns: auto 280px auto; gap: 4px 10px; align-items: center;
  background: rgba(5,5,5,.72); padding: 7px 12px; border-radius: 6px; font: 800 12px/1 system-ui, sans-serif; letter-spacing: .12em; color: #f2efe6;
}
#sqTug.on { opacity: 1; }
#sqTug .bar { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #c8323c 0 6%, #3a3f46 6% 94%, #c8323c 94% 100%); }
#sqTug .bar::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: #f2efe6; opacity: .5; }
#sqTug .mk { position: absolute; top: -4px; width: 8px; height: 18px; margin-left: -4px; border-radius: 3px; background: #e8c547; box-shadow: 0 0 6px rgba(232,197,71,.8); transition: left .1s linear; }
#sqTug .call { grid-column: 1 / 4; text-align: center; font-size: 11px; opacity: .45; }
#sqTug .call.on { opacity: 1; color: #ffd36e; font-size: 15px; text-shadow: 0 0 8px rgba(255,211,110,.7); }

/* ---- touch screens (touch.js) ---- */
html.touch, html.touch body { touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#tLayer { position: fixed; inset: 0; z-index: 4; touch-action: none; }
#tStick { position: fixed; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); background: rgba(10,12,16,.25); display: none; pointer-events: none; }
#tStick.on { display: block; }
#tStick i { position: absolute; left: 32px; top: 32px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.8); }
#tLayer button, #tTop button {
  position: fixed; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; color: #fff; background: rgba(10,12,16,.45);
  font: 800 13px/1 system-ui, sans-serif; letter-spacing: .05em; touch-action: none; -webkit-tap-highlight-color: transparent;
}
#tLayer button.down, #tTop button.down { background: rgba(255,255,255,.35); }
#tJump { right: 20px; bottom: 28px; width: 92px; height: 92px; font-size: 15px; }
#tPunch { right: 124px; bottom: 36px; width: 70px; height: 70px; }
#tKick { right: 128px; bottom: 116px; width: 62px; height: 62px; font-size: 12px; }
#tGetUp, #tGlassL, #tGlassR { display: none; border-radius: 14px !important; height: 52px; }
#tGetUp.on, #tGlassL.on, #tGlassR.on { display: block; }
#tGetUp { right: 20px; bottom: 206px; width: 110px; background: rgba(31,122,102,.8) !important; }
#tGlassL { right: 112px; bottom: 136px; width: 96px; background: rgba(40,90,140,.75) !important; }
#tGlassR { right: 10px; bottom: 136px; width: 96px; background: rgba(40,90,140,.75) !important; }
/* Tug of War: a big button to tap as fast as you can */
#tPull { display: none; right: 142px; bottom: 124px; width: 136px; height: 136px; font-size: 22px !important; background: rgba(200,50,60,.72) !important; }
#tPull.on { display: block; }
#tLayer #tPull.down { background: rgba(255,120,120,.85) !important; }
#tTop { position: fixed; left: 14px; top: 58px; z-index: 6; }
#tTop button { position: static; width: 44px; height: 44px; margin-right: 8px; font-size: 18px; border-radius: 12px; }
/* phone layout: row 1 number · timer · alive, row 2 the ☰ ✌ buttons with the online count on the right, row 3 the
   light / race call; the hint sits above the action buttons and the connection notice clear of them */
html.touch #sqOnline { top: 64px; bottom: auto; left: auto; right: 14px; }
html.touch #sqLight { top: 112px; white-space: nowrap; }
html.touch #sqLobby { top: 156px; white-space: normal; max-width: calc(100vw - 28px); text-align: center; box-sizing: border-box; }
html.touch #mpBanner { bottom: auto; top: 160px; left: 14px; }
html.touch #getup { display: none !important; }
html.touch #sqFeed { bottom: 270px; right: 14px; }
html.touch #sqFeed div { font-size: 13px; }
html.touch #sqPlayerFeed { top: 156px; right: 14px; }
html.touch #hint { bottom: 200px; left: 14px; max-width: calc(100vw - 28px); }
html.touch #sqLyric { top: auto; bottom: 200px; }
@media (max-width: 600px) { #sqTop { font-size: 24px; padding: 5px 10px; } #sqCount { font-size: 12px; } }
/* desktop windows too narrow for the hint beside the online pill: the hint goes above it */

/* ---- the photo booth (booth.js) ---- */
#booth {
  position: fixed; right: 12px; top: 12px; bottom: 12px; width: min(360px, calc(100vw - 24px)); z-index: 15; display: none; flex-direction: column;
  background: rgba(14,16,22,.9); border: 2px solid #e58fb5; border-radius: 14px; color: #fff; font: 600 13px/1.2 system-ui, sans-serif;
}
#booth.on { display: flex; }
#booth header { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px 6px; }
#booth header b { font-size: 18px; color: #ffb3d4; }
#booth header span { color: #7dffb5; font-size: 12px; }
#booth .scroll { overflow-y: auto; padding: 0 14px 8px; flex: 1; }
#booth h4 { margin: 10px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.6); }
#booth .opts { display: flex; flex-wrap: wrap; gap: 5px; }
#booth .opts button { font: 600 12px/1 system-ui, sans-serif; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 7px; padding: 7px 9px; cursor: pointer; text-transform: capitalize; }
#booth .opts button.on { background: #e58fb5; border-color: #ffd1e5; color: #1a0d14; }
#booth .opts button.sw { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); }
#booth .opts button.sw.on { border: 3px solid #fff; box-shadow: 0 0 0 2px #e58fb5; }
#booth footer { display: flex; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid rgba(255,255,255,.12); }
#booth footer button { flex: 1; font: 700 13px/1 system-ui, sans-serif; padding: 11px; border-radius: 9px; border: 0; cursor: pointer; background: rgba(255,255,255,.14); color: #fff; }
#booth footer button.save { background: #1f9e6a; }
html.touch #booth { width: min(300px, 46vw); }
#tPoses { position: fixed; left: 14px; top: 160px; z-index: 6; display: none; flex-direction: column; gap: 6px; }
#tPoses.on { display: flex; }
#tPoses button { position: static !important; border-radius: 10px !important; padding: 10px 12px; font: 700 12px/1 system-ui, sans-serif; color: #fff; background: rgba(10,12,16,.7); border: 2px solid rgba(255,255,255,.5); }
#booth header button { font: 700 12px/1 system-ui, sans-serif; color: #fff; background: rgba(255,255,255,.14); border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
#booth .opts button.shot { background: #1f7a66; border-color: #7dffb5; }
/* (in the booth: the game's own controls and hints out of the way) */
html.booth-open #tLayer, html.booth-open #hint, html.booth-open #tags, html.booth-open #tPoses, html.booth-open #sqLobby { display: none !important; }

/* Static inline artwork is available before the engine, models, or room connect. */
#loadStatus { gap:18px; overflow:hidden; }
#loadStatus .splash-art { width:min(300px,72vw); height:auto; }
#loadStatus #loadMessage { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
#loadStatus.load-error #loadMessage { position:static; width:auto; height:auto; clip-path:none; font-size:13px; color:#bac9c5; }
#loadStatus button { padding:10px 24px; border:1px solid #ee789e; border-radius:6px; background:transparent; color:#f5f0e6; cursor:pointer; font:inherit; }
#loadStatus button[hidden] { display:none; }

#physicsDebug[hidden] { display:none; }

#round-results { position:fixed; z-index:220; left:50%; top:50%; transform:translate(-50%,-50%); width:min(470px,calc(100vw - 32px)); max-height:78vh; box-sizing:border-box; padding:22px; border:1px solid rgba(127,232,197,.3); border-radius:14px; color:#fff; background:rgba(10,18,22,.94); box-shadow:0 16px 60px #0009; font:600 13px/1.3 system-ui,sans-serif; pointer-events:auto; }
#round-results[hidden] { display:none; }
#round-results h2 { margin:0; font-size:22px; }
#round-results .round-caption { margin:6px 0 16px; color:#7fe8c5; font-size:11px; letter-spacing:.16em; }
#round-results ol { margin:0; padding:0; list-style:none; display:grid; gap:5px; max-height:48vh; overflow:auto; }
#round-results li { display:flex; align-items:center; gap:9px; min-height:42px; padding:6px 10px; border-radius:7px; background:rgba(255,255,255,.05); }
#round-results li.own { background:rgba(31,122,102,.32); outline:1px solid #7fe8c555; }
#round-results .rank { color:#7fe8c5; width:22px; flex-shrink:0; font:700 12px ui-monospace,monospace; }
#round-results .runner { display:flex; align-items:center; gap:8px; flex:1; min-width:0; }
#round-results .runner > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#round-results .number { color:#a9bbb4; font:600 11px ui-monospace,monospace; }
#round-results img { width:26px; height:26px; border-radius:50%; object-fit:cover; background:#5f736a; }
#round-results .result { display:flex; flex-direction:column; align-items:flex-end; color:#7fe8c5; font:700 15px ui-monospace,monospace; white-space:nowrap; }
#round-results .out .result { color:#d7a5a5; font-size:12px; }
#round-results .result small { margin-top:3px; color:#d5dfdb; font:500 11px system-ui,sans-serif; }
#round-results .round-next { margin:16px 0 0; color:#b6c9c1; text-align:center; font-size:12px; }

/* ---- final death (death.js): the screen fades to black, the run's stats roll past like end credits ---- */
#deathScreen {
  position: fixed; inset: 0; z-index: 400; overflow: hidden; background: #000;
  opacity: 0; transition: opacity 1.6s ease; pointer-events: none;
}
#deathScreen.on { opacity: 1; }
#deathScreen .roll {
  position: absolute; left: 50%; top: 0; width: min(680px, 92vw);
  transform: translate(-50%, 100vh); will-change: transform;
  color: #fff; text-align: center; font: 500 16px/1.5 system-ui, sans-serif;
}
#deathScreen .roll h1 { margin: 0 0 6px; font: 900 clamp(34px, 7vw, 64px)/1.05 system-ui, sans-serif; letter-spacing: .14em; }
#deathScreen .roll .over { margin: 0 0 46px; font: 800 clamp(20px, 4vw, 32px)/1 system-ui, sans-serif; letter-spacing: .5em; text-indent: .5em; }
#deathScreen .roll .stats { display: grid; gap: 13px; margin: 0 auto; max-width: 460px; }
#deathScreen .roll .stats h2 { margin: 22px 0 2px; font: 700 12px/1 system-ui, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.55); }
#deathScreen .roll .row { display: flex; align-items: baseline; gap: 10px; text-align: left; }
#deathScreen .roll .row span { flex: none; font: 500 14px/1.3 system-ui, sans-serif; color: rgba(255,255,255,.72); }
#deathScreen .roll .row i { flex: 1; border-bottom: 1px dotted rgba(255,255,255,.28); transform: translateY(-4px); }
#deathScreen .roll .row b { flex: none; font: 700 17px/1.2 ui-monospace, "Courier New", monospace; letter-spacing: .03em; }
#deathScreen .roll .end { margin: 70px 0 0; font: 900 clamp(30px, 6vw, 52px)/1 system-ui, sans-serif; letter-spacing: .3em; text-indent: .3em; }
#deathScreen .roll .bye { margin: 26px 0 140px; font: 500 14px/1.5 system-ui, sans-serif; color: rgba(255,255,255,.55); opacity: 0; transition: opacity .8s; }
#deathScreen .roll .bye.on { opacity: 1; }
#retryButton {
  position: fixed; left: 50%; top: 53%; transform: translate(-50%, -50%); z-index: 8;
  display: none; flex-direction: column; align-items: center; gap: 5px; min-width: 190px;
  padding: 15px 22px; border: 2px solid #7fe8c5; border-radius: 12px;
  background: #102d27; color: #fff; box-shadow: 0 10px 35px rgba(0,0,0,.45); cursor: pointer;
}
#retryButton.on { display: flex; }
#retryButton:hover { background: #1f7a66; }
#retryButton:disabled { cursor: default; opacity: .75; }
#retryButton b { font: 800 20px/1 system-ui, sans-serif; }
#retryButton small { font: 500 12px/1.2 system-ui, sans-serif; color: #d6eee6; }
