/* Layout: full-screen portrait arena with overlays centered. Black outer space.
   Brand colours (2026-11-13, the user's call): the logo's three rings, blue #3fa9f5 first (every
   "do this" button), then green #8bd94a and yellow #f8d020; white; dark #121212. */
:root{
  --ink:#fff; --stone:#0b1d30; --accent:#f8d020; --blue:#3fa9f5; --blue-edge:#1f74bd; --green:#8bd94a; --green-edge:#4e9a22; --dark:#121212; --panel:#14233a;
  --display:"Rubik",system-ui,-apple-system,sans-serif; /* one plain font everywhere since 2026-11-13, the games' canvases included (the user's call; Lilita One, the cartoony one, is gone) */
  --body:"Rubik",system-ui,-apple-system,sans-serif;
  color-scheme:dark;
}
[hidden]{display:none!important} /* .overlay sets display:flex, which would otherwise beat the hidden attribute */
html,body{height:100%;margin:0;overflow:hidden;overscroll-behavior:none}
body{background:var(--dark);color:var(--ink);font-family:var(--body);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#wrap{position:relative;height:100%;width:100%}
#c{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
#debug{position:absolute;left:0;right:0;bottom:0;padding:4px 8px;font:11px/1.3 ui-monospace,Menlo,Consolas,monospace;
  color:#7dffb2;background:rgba(0,0,0,.6);pointer-events:none}
/* Overlays scroll on screens too short for everything, and center their content otherwise (margin:auto). */
.overlay{position:absolute;inset:0;display:flex;flex-direction:column;overflow-y:auto;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));
  background:rgba(0,0,0,.72);backdrop-filter:blur(3px);text-align:center}
#start{background:radial-gradient(130% 55% at 50% 0%,#12304f 0%,var(--dark) 70%) var(--dark);backdrop-filter:none} /* the home screen is the brand's dark with a faint blue glow at the top, not the game showing through */
.menu{display:flex;flex-direction:column;align-items:center;gap:18px;width:100%;max-width:360px;margin:auto;
  padding:max(18px,env(safe-area-inset-top,0px)) 0 max(18px,env(safe-area-inset-bottom,0px))}
/* The logo: the two phones over "silly" (text) and ".games", all cut from the brand sheet (scripts/brand.py). */
h1{display:flex;flex-direction:column;align-items:center;gap:8px;margin:0;line-height:0}
h1 .logo{height:clamp(150px,44vw,190px);width:auto}
/* Faces are the top layer of every screen: their own canvas over the whole page, touches
   passing through. A .faces-row holds the room for a row of them; render.js sizes it. */
#faces{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:7}
.faces-row{display:block;flex:none}
button{font-family:var(--display);font-weight:700;font-size:26px;letter-spacing:0;color:var(--stone);background:var(--blue);border:0;border-radius:999px;
  padding:14px 44px;box-shadow:0 5px 0 var(--blue-edge);cursor:pointer}
button:active{transform:translateY(3px);box-shadow:0 2px 0 var(--blue-edge)}
button:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
button.ghost{font-size:18px;padding:10px 26px;background:transparent;color:var(--ink);box-shadow:inset 0 0 0 2px var(--ink)}
button.ghost:active{transform:none;box-shadow:inset 0 0 0 2px var(--blue)}
.icon{width:1.25em;height:1.25em;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.note{font-size:13px;opacity:.7;max-width:290px;line-height:1.4}
/* Basketball and Worms are played sideways: held upright, the game hides behind this. */
#turn{background:var(--dark);backdrop-filter:none;z-index:4}
#turnText{font-family:var(--display);font-weight:700;font-size:clamp(32px,9vw,48px);margin:0;color:var(--accent);text-wrap:balance}
.phone{width:96px;height:96px;fill:none;stroke:var(--ink);stroke-width:3;stroke-linecap:round;stroke-linejoin:round;
  animation:turn-phone 2.4s ease-in-out infinite}
@keyframes turn-phone{0%,25%{transform:rotate(0)}55%,85%{transform:rotate(-90deg)}100%{transform:rotate(0)}}
@media (prefers-reduced-motion:reduce){.phone{animation:none;transform:rotate(-90deg)}}
#winner{font-family:var(--display);font-weight:700;font-size:clamp(38px,11vw,60px);margin:0;color:var(--ink)}
#listen{position:absolute;left:50%;bottom:max(24px,env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:5;
  font-size:20px;padding:12px 28px;white-space:nowrap}
#listen:active{transform:translateX(-50%) translateY(3px)}
#lost{position:absolute;left:50%;top:max(14px,env(safe-area-inset-top,0px));transform:translateX(-50%);z-index:5;
  padding:6px 14px;border-radius:999px;background:rgba(180,40,40,.85);font-weight:700;font-size:14px;white-space:nowrap;pointer-events:none}
/* Camera and microphone: on/off toggles with their icon (never crossed out, the user's call); when on,
   a green ring and a green check, so it's plainly good (the user's call). */
:root{--good:var(--green)}
.setup{display:flex;flex-direction:column;gap:10px;align-items:stretch;width:min(340px,100%)}
.setup button{display:flex;align-items:center;justify-content:center;gap:10px;padding:10px 20px}
/* Section headings on the home screen (2026-11-13): what to do first, then the games, both 28px (the user's call). */
.menu h2{margin:0 0 -4px;font:700 19px/1.2 var(--display);color:var(--ink);text-wrap:balance}
.menu h2.pick{font-size:28px}
.menu #setupTitle{font-size:clamp(14px,4.6vw,21px);white-space:nowrap} /* one line (the user's call) */
.menu h2.pick{margin-top:24px}
/* Room under the games and under Send feedback (the user's call, 2026-11-13). */
.games{margin-bottom:26px}
#feedback,#feedbackForm{margin-bottom:26px}
/* Camera and microphone (2026-11-13, the user's design): two tiles side by side. Off: a yellow ring
   on a see-through yellow, icon over "Turn Camera On", breathing gently so a newcomer sees what to
   tap first. On: green, and the tile shrinks to one line, icon, "Camera On" and a check. */
.av{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:start}
.setup .toggle.big{flex-direction:column;gap:6px;padding:14px 8px 12px;border-radius:20px;font-size:18px;line-height:1.1;
  position:relative;background:rgba(248,208,32,.18);color:var(--ink);box-shadow:inset 0 0 0 2.5px var(--accent);opacity:1;
  animation:nudge 2.6s ease-in-out infinite;transition:padding .25s ease,background-color .25s ease}
.setup .toggle.big span{text-wrap:balance}
.setup .toggle.big .icon:not(.check){width:34px;height:34px;stroke-width:2;color:var(--accent)}
.setup .toggle.big:active{transform:none;background:rgba(248,208,32,.3)}
.setup .toggle.big.on{flex-direction:row;gap:6px;padding:9px 8px;border-radius:999px;font-size:clamp(13px,4.2vw,16px);white-space:nowrap;
  background:#16290f;box-shadow:inset 0 0 0 2.5px var(--good);animation:none}
.setup .toggle.big.on .icon:not(.check){width:22px;height:22px;color:var(--good)}
.setup .toggle.big.on span{white-space:nowrap;text-wrap:nowrap}
.setup .toggle.big .check{width:18px;height:18px;padding:3px;border-radius:50%;background:var(--good);color:var(--dark);box-sizing:border-box}
.setup .toggle.big.note{background:#3a1414;box-shadow:inset 0 0 0 2px #ff8a7a;animation:none;font-size:15px}
@keyframes nudge{0%,100%{box-shadow:inset 0 0 0 2.5px var(--accent),0 0 0 0 rgba(248,208,32,0)}50%{box-shadow:inset 0 0 0 2.5px var(--accent),0 0 0 6px rgba(248,208,32,.18)}}
@media (prefers-reduced-motion:reduce){.setup .toggle.big{animation:none;transition:none}}
/* Your name (2026-11-13, the user's design): drawn under your face in the faces row, "Mike" with a
   pencil over "(You)"; this see-through button covers your face and name to open the box. */
#people{position:relative}
.name-hit{position:absolute;padding:0;margin:0;background:transparent;box-shadow:none;border-radius:16px}
.name-hit:active{transform:none;box-shadow:none;background:rgba(63,169,245,.15)}
/* The pitch under the logo (2026-11-13, the user's ask: inviting friends
   must be obvious, and so must the video chat that sets this apart). */
.tagline{margin:-6px 0 0;max-width:320px;font:500 16px/1.35 var(--body);color:rgba(255,255,255,.82);text-wrap:balance}
.tagline b{color:var(--accent);font-weight:700}
/* The invite in the home row (the user's design, 2026-11-13; main.js places #seats from render.js's
   seatsSpot). Alone ("big"): an empty seat, a dashed circle beside your face, with a round green
   button inside reading "Invite friends" under the icon. With friends ("small"): just a small round
   green button after the last face. */
.seats{position:absolute;display:flex;align-items:center;justify-content:center;box-sizing:border-box;border-radius:50%}
.seats.big{border:2.5px dashed rgba(255,255,255,.4);background:radial-gradient(circle at 50% 40%,rgba(255,255,255,.07),rgba(255,255,255,0) 70%)}
.seats button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:0 0 calc(12% - 4px);border-radius:50%;
  width:80%;height:80%;font-size:14px;line-height:1.05;background:var(--green);color:#132a08;box-shadow:0 4px 0 var(--green-edge)}
.seats button:active{box-shadow:0 1px 0 var(--green-edge)}
.seats button .icon{width:34%;height:auto;aspect-ratio:1}
.seats.small button{width:100%;height:100%;padding:0}
.seats.small button .icon{width:28px;height:28px}
.seats.small button span{display:none}
/* Typing your own name: the name button turns into this box and a Save button. */
.name-form{display:flex;gap:8px;align-items:stretch;width:min(300px,100%);margin-top:-8px}
.name-form input{flex:1;min-width:0;font:600 17px var(--body);padding:8px 16px;border-radius:999px;border:0;
  background:var(--panel);color:var(--ink);box-shadow:inset 0 0 0 2px rgba(255,247,236,.5)}
.name-form input:focus{outline:none;box-shadow:inset 0 0 0 2px var(--blue)}
.name-form button{padding:8px 18px;font-size:17px}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.toggle:not(.on):not(.big){opacity:.75}
.toggle.on{box-shadow:inset 0 0 0 2px var(--good)}
.toggle .check{display:none;color:var(--good);stroke-width:3}
.toggle.on .check{display:block}
.toggle.on .icon:not(.check){color:var(--good)}
.toggle.note{opacity:1;box-shadow:inset 0 0 0 2px #ff8a7a;font-size:15px} /* the reason it would not start, for a few seconds */
/* Always there in a game, top left: back to the home screen in one tap. */
#back{position:absolute;z-index:6;top:max(10px,env(safe-area-inset-top,0px));left:max(10px,env(safe-area-inset-left,0px));
  width:46px;height:46px;padding:0;display:flex;align-items:center;justify-content:center;border-radius:50%;
  background:rgba(12,24,40,.7);color:var(--ink);box-shadow:inset 0 0 0 2px rgba(255,247,236,.7)}
#back .icon{width:26px;height:26px;stroke-width:2.6}
#back:active{transform:none;background:rgba(12,24,40,.95)}
/* The games: two tiles a row, more rows as games are added. Icon above the name. */
.games{display:grid;grid-template-columns:1fr 1fr;gap:12px;width:min(340px,100%)}
/* Each tile is a picture of its game (img/games/*.svg, 2026-11-13), its name on a shade along the bottom. */
.games > button{position:relative;display:block;padding:0;aspect-ratio:4/3;overflow:hidden;border-radius:18px;background:#222;
  box-shadow:0 4px 0 #000,inset 0 0 0 2px rgba(255,255,255,.12)}
.games > button:active{transform:translateY(3px);box-shadow:0 1px 0 #000}
.games .art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.games > button > span{position:absolute;left:0;right:0;bottom:0;padding:22px 6px 8px;font-size:19px;line-height:1.05;color:#fff;
  text-shadow:0 2px 0 rgba(0,0,0,.55);background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.72) 55%);text-wrap:balance}
.games > button::after{position:absolute;top:7px;right:7px;font-family:var(--body);font-weight:700;font-size:11px;text-transform:uppercase;
  letter-spacing:.06em;line-height:1}
.games > button.live{box-shadow:0 4px 0 #000,inset 0 0 0 3px var(--accent)}
.games > button.live::after{content:"on now";padding:5px 8px;border-radius:999px;background:var(--accent);color:var(--stone)}
/* Downhill's circuits: a row under its tile, shown by tapping it (main.js fills it in). */
.games .circuits{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:10px;border-radius:22px;box-shadow:inset 0 0 0 2px var(--blue)}
.games .circuits p{grid-column:1/-1;margin:0;text-align:center;font-weight:700;font-size:14px;color:var(--ink)}
/* Each circuit is a picture tile like the games' (img/games/circuit1.svg, circuit2.svg: its four looks), name and races along the bottom. */
.games .circuits button{position:relative;display:block;padding:0;aspect-ratio:4/3;overflow:hidden;border-radius:16px;background:#222;
  box-shadow:0 4px 0 #000,inset 0 0 0 2px rgba(255,255,255,.12)}
.games .circuits button:active{transform:translateY(3px);box-shadow:0 1px 0 #000}
.games .circuits button > span{position:absolute;left:0;right:0;bottom:0;padding:18px 4px 6px;font-size:17px;line-height:1.05;color:#fff;
  text-shadow:0 2px 0 rgba(0,0,0,.55);background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.78) 45%)}
.games .circuits small{display:block;margin-top:3px;font-family:var(--body);font-weight:600;font-size:11px;line-height:1.25}
.games button.soon::after{content:"soon"}
.games button.soon{background:transparent;color:var(--ink);opacity:.45;box-shadow:inset 0 0 0 2px rgba(255,247,236,.5);cursor:default}
@media (max-height:700px){.menu{gap:12px}.setup .toggle.big:not(.on){padding:10px 8px 9px}.setup .toggle.big:not(.on) .icon:not(.check){width:28px;height:28px}h1 .logo{height:96px}} /* fit the faces and every button on short screens */

/* The game-over screen on a phone held sideways (after a sideways game): the faces in one row,
   the winner under them, and both buttons side by side, so nothing is below the fold (the user's call). */
@media (orientation:landscape) and (max-height:540px){
  #over .menu{flex-direction:row;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px 16px;max-width:min(760px,100%);
    padding:max(8px,env(safe-area-inset-top,0px)) 0 max(8px,env(safe-area-inset-bottom,0px))}
  #over #winner{flex-basis:100%;font-size:clamp(26px,9vh,38px);line-height:1.1}
  #over button{font-size:20px;padding:9px 30px;box-shadow:0 4px 0 var(--blue-edge)}
  #over button.ghost{font-size:16px;padding:9px 22px;box-shadow:inset 0 0 0 2px var(--ink)}
}

/* Opened inside another app's browser, where cameras often fail: how to get out, on the home screen only then. */
.inapp{display:flex;flex-direction:column;align-items:center;gap:10px;width:min(320px,100%);padding:14px 16px;border-radius:16px;
  background:#2a1220;box-shadow:inset 0 0 0 2px #ff8a7a;box-sizing:border-box}
.inapp p{margin:0;font-size:15px;line-height:1.4}
.inapp button{font-size:19px;padding:10px 26px}
.inapp button.ghost{font-size:16px;padding:8px 20px}
/* Send feedback (2026-11-13): a quiet button under the game tiles that opens a box to type in,
   an optional email for a reply, and Send. Then Privacy and Terms, small, at the very bottom. */
button.small{display:flex;align-items:center;gap:8px;font-size:16px;padding:8px 20px;opacity:.85}
.feedback-form{display:flex;flex-direction:column;gap:10px;width:min(320px,100%)}
.feedback-form textarea,.feedback-form input{font:500 16px/1.4 var(--body);padding:10px 14px;border-radius:14px;border:0;
  background:var(--panel);color:var(--ink);box-shadow:inset 0 0 0 2px rgba(255,247,236,.5);resize:vertical;
  -webkit-user-select:text;user-select:text}
.feedback-form input{border-radius:999px}
.feedback-form textarea:focus,.feedback-form input:focus{outline:none;box-shadow:inset 0 0 0 2px var(--blue)}
.feedback-form .note{margin:0;align-self:center}
.feedback-form h2{margin:0;font-size:22px}
.feedback-form .sub{margin:-6px 0 2px;font-size:15px;line-height:1.4;opacity:.8;text-wrap:balance}
.feedback-form .trap{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
.feedback-buttons{display:flex;gap:10px;justify-content:center}
.feedback-buttons button{padding:8px 22px;font-size:17px}
#feedbackSend{background:var(--blue);color:var(--stone);box-shadow:none}
#feedbackDone{margin:0}
.legal{display:flex;gap:8px;font-size:13px;opacity:.6}
.legal a{color:var(--ink);text-decoration:none;padding:4px}
.legal a:active{color:var(--accent)}
