/* Layout: full-screen portrait arena with overlays centered. Black outer space.
   Brand colours (the user's sheet, docs/brand/): gold #f5c518, purple #8b5cf6, white, dark #121212. */
:root{
  --ink:#fff; --stone:#121212; --accent:#f5c518; --purple:#8b5cf6; --dark:#121212;
  --display:"Lilita One","Arial Rounded MT Bold",system-ui,sans-serif;
  --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%,#211938 0%,var(--dark) 70%) var(--dark);backdrop-filter:none} /* the home screen is the brand's dark with a faint purple 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-size:26px;letter-spacing:.03em;color:var(--stone);background:var(--accent);border:0;border-radius:999px;
  padding:14px 44px;box-shadow:0 5px 0 #b98a10;cursor:pointer}
button:active{transform:translateY(3px);box-shadow:0 2px 0 #b98a10}
button:focus-visible{outline:3px solid var(--purple);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(--accent)}
.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-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-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, microphone and share: icon left of the text. Camera and microphone are on/off toggles:
   dimmed with a slash through the icon when off; when on, a green ring and a green check after
   the text, so it's plainly good (the user's call). */
:root{--good:#4ade80}
.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. */
.menu h2{margin:0 0 -4px;font:400 19px/1.2 var(--display);letter-spacing:.03em;color:var(--ink);text-wrap:balance}
.menu h2.pick{margin-top:6px}
/* Camera and microphone (2026-11-13, for new players): two big tiles side by side. Off, they're
   the gold of every "do this" button, breathing gently, so a newcomer sees what to tap first;
   on, they go dark with a green ring and a green check. The slash shows on the icon while off. */
.av{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.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:var(--accent);color:var(--stone);box-shadow:0 4px 0 #b98a10;opacity:1;animation:nudge 2.6s ease-in-out infinite}
.setup .toggle.big span{text-wrap:balance}
.setup .toggle.big .icon:not(.check){width:34px;height:34px;stroke-width:2}
.setup .toggle.big:active{transform:translateY(3px);box-shadow:0 1px 0 #b98a10}
.setup .toggle.big.on{background:#13291b;color:var(--ink);box-shadow:inset 0 0 0 2px var(--good);animation:none}
.setup .toggle.big.on:active{transform:none}
.setup .toggle.big .check{position:absolute;top:8px;right:8px;width:22px;height:22px;padding:3px;border-radius:50%;
  background:var(--good);color:var(--dark);box-sizing:border-box}
.setup .toggle.big.note{background:#3a1414;color:var(--ink);box-shadow:inset 0 0 0 2px #ff8a7a;animation:none;font-size:15px}
@keyframes nudge{0%,100%{box-shadow:0 4px 0 #b98a10,0 0 0 0 rgba(245,197,24,0)}50%{box-shadow:0 4px 0 #b98a10,0 0 0 6px rgba(245,197,24,.18)}}
@media (prefers-reduced-motion:reduce){.setup .toggle.big{animation:none}}
/* Your name: reads like a field you can change, the name big, "Change" at its end. */
.setup .name-row{justify-content:flex-start;gap:12px;padding:8px 8px 8px 16px;border-radius:18px;text-align:left;
  background:#1d1830;color:var(--ink);box-shadow:inset 0 0 0 2px rgba(139,92,246,.6)}
.setup .name-row:active{transform:none;background:#261f40}
.name-row > .icon{width:26px;height:26px;opacity:.85}
.name-row .who{display:flex;flex-direction:column;flex:1;min-width:0;gap:2px}
.name-row small{font:600 12px/1 var(--body);letter-spacing:.06em;text-transform:uppercase;opacity:.65}
.name-row b{font-weight:400;font-size:21px;line-height:1.1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.name-row .edit{display:flex;align-items:center;gap:5px;flex:none;padding:8px 12px;border-radius:999px;font-size:16px;
  background:var(--purple);color:#fff}
.name-row .edit .icon{width:16px;height:16px}
/* Share and sound effects: a quieter row under the rest. */
.extras{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.extras button.small{flex:1 1 auto;justify-content:center;font-size:15px;padding:9px 14px;opacity:1}
/* Typing your own name: the name button turns into this box and a Save button. */
.name-form{display:flex;gap:8px;align-items:stretch}
.name-form input{flex:1;min-width:0;font:600 17px var(--body);padding:8px 16px;border-radius:999px;border:0;
  background:#1d1830;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(--purple)}
.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 .slash{display:none}
.toggle:not(.on) .slash{display:block}
.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(20,16,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(20,16,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(--accent)}
.games .circuits p{grid-column:1/-1;margin:0;text-align:center;font-weight:700;font-size:14px;color:var(--ink)}
.games .circuits button{font-size:18px;padding:12px 6px 10px;border-radius:16px}
.games .circuits small{font-family:var(--body);font-weight:600;font-size:12px;line-height:1.35}
.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{padding:10px 8px 9px}.setup .toggle.big .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 #b98a10}
  #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:#1d1830;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(--purple)}
.feedback-form .note{margin:0;align-self:center}
.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(--accent);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)}
