/* Crater Crew - the menus and the controls on top of the picture. Big enough
   for thumbs, and laid out for a phone held sideways first. */
:root {
  --ink: #f4f7fc;
  --muted: #a9b8cf;
  --panel: rgba(14, 22, 36, 0.88);
  --line: rgba(255, 255, 255, 0.09);
  --button: #2b3c58;
  --button-hi: #36496a;
  --accent: #ffaf2e;
  --accent-ink: #2a1a00;
  --danger: #e2574a;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #121c2c; color: var(--ink);
  font-family: "Trebuchet MS", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
canvas#view { position: fixed; left: 0; top: 0; display: block; touch-action: none; }
/* 2.3.3: nothing of a match can be selected, offered to copy or dragged - an iPhone did all three on a held button although
   the page as a whole said so (now every button and everything in the match say it themselves) */
#hud, #hud * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }

button {
  font: inherit; font-weight: 700; color: var(--ink); background: var(--button); border: 0; border-radius: 14px;
  padding: 10px 16px; min-height: 46px; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  touch-action: manipulation; letter-spacing: 0.02em;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none;
}
button:hover { background: var(--button-hi); }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
button.accent { background: var(--accent); color: var(--accent-ink); }
button.accent:hover { background: #ffc15a; }
button.danger { background: var(--danger); }
button:disabled { opacity: 0.45; cursor: default; transform: none; }
input, select {
  font: inherit; color: var(--ink); background: #0d1626; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; min-height: 40px; -webkit-user-select: text; user-select: text; touch-action: manipulation;
}
input[type=range] { padding: 0; accent-color: var(--accent); }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }

/* --- screens ---------------------------------------------------------------- */
.screen {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l));
  overflow-y: auto; touch-action: pan-y;
}
.screen.on { display: flex; }
.screen.dim { background: rgba(5, 10, 18, 0.55); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 20px;
  width: 100%; max-width: 580px; max-height: 100%; overflow-y: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.card.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.card.narrow { max-width: 340px; }
.card.narrow .big { width: 100%; }
h2 { margin: 0 0 10px; font-size: 1.45em; letter-spacing: 0.02em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.row > button { flex: 1 1 auto; }
.row.end { justify-content: flex-end; }
.row.end > button { flex: 0 0 auto; min-width: 110px; }
/* a card's last buttons (Start, Back, Done) stay in sight while the card scrolls */
.card > .row.end { position: sticky; bottom: -16px; z-index: 2; margin: 10px -20px -16px; padding: 10px 20px 14px;
  background: linear-gradient(rgba(16, 24, 39, 0), rgb(16, 24, 39) 26%); border-radius: 0 0 18px 18px; }
.row.center-row { justify-content: center; }
.note { color: var(--muted); font-size: 0.9em; line-height: 1.35; margin: 8px 0; }
.foot a, .note a { color: var(--accent); }   /* 2.6.2: the privacy page and the rules */
.status { margin: 0 0 10px; color: var(--muted); }
.status.ok { color: #7fe08a; }
.status.bad { color: #ff9a8e; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; margin: 8px 0; }
.form label, label.full { display: flex; flex-direction: column; gap: 4px; font-size: 0.86em; color: var(--muted); }
label.full { margin: 6px 0; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 0.95em; min-height: 40px; }
.settings { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
fieldset.songs { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 12px; margin: 2px 0; padding: 4px 12px 6px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 12px; }
fieldset.songs legend { color: var(--muted); font-size: 0.86em; padding: 0 6px; }

/* --- the title ---------------------------------------------------------------- */
#s-title { background: linear-gradient(180deg, rgba(10, 18, 30, 0.15), rgba(10, 18, 30, 0.55)); }
.title-wrap { display: flex; align-items: center; justify-content: center; gap: 36px; width: 100%; max-width: 920px; flex-wrap: wrap; }
.logo { text-align: center; }
.logo h1 {
  margin: 0; font-size: clamp(44px, 9vw, 92px); line-height: 0.88; letter-spacing: 0.04em; font-weight: 900;
  color: #fff4d9; text-shadow: 0 4px 0 #b4541c, 0 7px 0 #6b2c0c, 0 12px 24px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; transform: rotate(-3deg);
}
.logo h1 span:last-child { color: #ffd166; margin-left: 0.6em; }
.tag { margin: 18px 0 0; color: #fff; font-weight: 700; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.menu { display: flex; flex-direction: column; gap: 9px; width: min(340px, 100%); }
.menu .big { font-size: 1.12em; min-height: 52px; }
.menu .row { margin: 0; }
.foot { color: #e8eef8; font-size: 0.8em; text-align: center; margin: 4px 0 0; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }

/* --- setup ---------------------------------------------------------------------- */
#setup-teams { display: flex; flex-direction: column; gap: 8px; }
.team-row { display: flex; align-items: center; gap: 8px; }
.team-row .dot { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.team-row .face { width: 46px; height: 30px; flex: 0 0 auto; border-radius: 8px; background: rgba(255, 255, 255, 0.07); }
.team-row select.crew { flex: 0 0 auto; }
.crewpick { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.crewpick > b { color: var(--muted); font-size: 0.9em; font-weight: 600; margin-right: 2px; }
.crewpick button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 10px 3px; min-height: 0; border: 2px solid transparent; }
.crewpick button canvas { width: 58px; height: 34px; display: block; }
.crewpick button span { font-size: 0.82em; }
.crewpick button.sel { border-color: var(--accent); background: rgba(255, 255, 255, 0.12); }
/* 2.10.0: the looks of a crew - one row that scrolls sideways */
.skinpick { flex-wrap: nowrap; overflow-x: auto; touch-action: pan-x; overscroll-behavior: contain; margin-top: -4px; padding-bottom: 3px; }
.skinpick > b { flex: 0 0 auto; }
.skinpick button { flex: 0 0 auto; padding: 3px 6px 2px; }
.skinpick button canvas { width: 30px; height: 30px; }
.skinpick button[data-skin="-1"] canvas { width: 46px; }
.skinpick button span { font-size: 0.7em; white-space: nowrap; }
.team-row select.skin { max-width: 9.5em; }
.team-row input { flex: 1 1 auto; min-width: 0; }
.team-row select { flex: 0 0 auto; }
.team-row .remove { min-height: 40px; padding: 6px 12px; }
.add-team { align-self: flex-start; min-height: 40px; }
/* 2.8.0: a side's letter - A light, B dark, C grey (told apart by lightness too, not by a colour alone) */
.sidechip { flex: 0 0 auto; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; font-weight: 800; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; border: 2px solid rgba(255, 255, 255, 0.85); }
.sidechip.side0 { background: #f4f7fb; color: #142033; }
.sidechip.side1 { background: #142033; color: #f4f7fb; }
.sidechip.side2 { background: #9aa6b8; color: #10151f; }
.sidechip:disabled { opacity: 1; cursor: default; }
#over-stats .sidechip { width: 22px; height: 22px; font-size: 11px; border-width: 1.5px; }

/* --- the map gallery and the editor -------------------------------------------------- */
.mapbox { margin: 10px 0 4px; }
.maps-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.maps-head b { font-size: 0.95em; }
.map-name { color: var(--muted); font-size: 0.85em; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.mini { min-height: 32px; padding: 4px 10px; font-size: 0.8em; border-radius: 10px; }
.maprow { display: flex; gap: 8px; overflow-x: auto; padding: 3px 2px 8px; touch-action: pan-x; scroll-snap-type: x proximity; }
.maprow.locked .mapcard { cursor: default; }
.mapcard {
  position: relative; flex: 0 0 auto; width: 112px; min-height: 0; padding: 4px 4px 5px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; scroll-snap-align: start; background: #22324c;
}
.mapcard canvas { width: 104px; height: 52px; border-radius: 8px; display: block; }
.mapcard span { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.mapcard.sel { box-shadow: 0 0 0 3px var(--accent), 0 3px 0 rgba(0, 0, 0, 0.35); background: #2e4468; }
.mapcard.new { background: #1e3a2c; }
.mapcard i { position: absolute; top: 6px; font-style: normal; font-size: 10px; font-weight: 800; background: rgba(10, 16, 28, 0.82);
  border-radius: 8px; padding: 2px 6px; line-height: 1.3; }
.mapcard i.ed { left: 6px; }
.mapcard i.rm { right: 6px; font-size: 12px; }

/* 2.12.0, the map editor: a bar at the top, the tools on the left, what to draw with under the map, zoom on the right (maps.js
   E.fit puts the side bars under the top one and the map between them all) */
#s-editor { padding: 0; display: none; background: #0d1522; }
#s-editor.on { display: block; }
#ed-view { position: absolute; left: 0; top: 0; touch-action: none; cursor: crosshair; }
#ed-view.pan { cursor: grab; }
.ed-top, .ed-side, .ed-opts, .ed-zoom { position: absolute; z-index: 2; background: rgba(13, 21, 34, 0.93); border: 1px solid var(--line); }
.ed-top { left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-width: 0 0 1px;
  padding: calc(6px + var(--safe-t)) calc(8px + var(--safe-r)) 6px calc(8px + var(--safe-l)); }
.ed-top input { flex: 1 1 110px; min-width: 70px; max-width: 220px; min-height: 38px; }
.ed-top select { min-height: 38px; max-width: 150px; }
.ed-gap { flex: 1 1 0; }
#s-editor button { box-shadow: none; }
#s-editor button:active { transform: translateY(1px); }
.ed-ic { min-height: 38px; min-width: 38px; padding: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.ed-ic svg { width: 22px; height: 22px; }
.ed-txt { min-height: 38px; padding: 4px 14px; border-radius: 10px; }
.ed-ic:disabled { opacity: 0.35; cursor: default; }
.ed-tog.on, .ed-tool.on { background: var(--accent); color: var(--accent-ink); }
.ed-side { left: calc(6px + var(--safe-l)); top: 64px; display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 14px; }
.ed-tool { min-height: 0; width: 58px; padding: 5px 2px 4px; border-radius: 10px; display: flex; flex-direction: column; align-items: center;
  gap: 1px; font-size: 10px; letter-spacing: 0; }
.ed-tool svg { width: 22px; height: 22px; }
.ed-zoom { right: calc(6px + var(--safe-r)); top: 64px; display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 14px; }
.ed-opts { left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; border-width: 1px 0 0;
  padding: 6px calc(10px + var(--safe-r)) calc(6px + var(--safe-b)) calc(10px + var(--safe-l)); }
.ed-mats { display: flex; gap: 4px; overflow-x: auto; flex: 1 1 auto; min-width: 0; scrollbar-width: thin; touch-action: pan-x; }
.ed-mat { min-height: 0; flex: 0 0 auto; padding: 3px 5px 2px; border-radius: 9px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 9.5px; letter-spacing: 0; background: transparent; border: 2px solid transparent; }
.ed-mat:hover { background: rgba(255, 255, 255, 0.07); }
.ed-mat canvas { width: 28px; height: 28px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); background: #0b111b; }
.ed-mat.on { border-color: var(--accent); background: rgba(255, 175, 46, 0.14); }
.ed-size { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--muted); font-size: 0.82em; }
.ed-size input { width: 120px; accent-color: var(--accent); }
.ed-size b { color: var(--ink); min-width: 2.2em; }
#ed-note { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: 76px; margin: 0; max-width: min(620px, 80vw);
  background: rgba(12, 18, 30, 0.86); border-radius: 10px; padding: 5px 12px; font-size: 0.82em; color: #dbe4f2; text-align: center; pointer-events: none; }
#ed-note:empty, #ed-info:empty { display: none; }
#ed-info { position: absolute; z-index: 3; left: 80px; top: 64px; margin: 0; font-size: 0.74em; color: #c7d3e6;
  background: rgba(12, 18, 30, 0.72); border-radius: 8px; padding: 3px 9px; pointer-events: none; }
.ed-optnote { flex: 1 1 auto; color: var(--muted); font-size: 0.82em; padding: 6px 2px; }
@media (max-width: 520px) {
  .ed-opts { flex-wrap: wrap; row-gap: 4px; }
  .ed-mats { flex: 1 1 100%; }
  .ed-size { flex: 1 1 100%; }
  .ed-size input { flex: 1 1 auto; }
}

/* --- accounts, friends, history ------------------------------------------------------ */
.form.acct { grid-template-columns: 1fr 1fr; }
.acct-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 8px; }
.acct-bar .who { flex: 1 1 auto; color: var(--muted); font-size: 0.92em; }
.acct-bar .who b { color: var(--ink); }
.badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 0.8em; line-height: 18px; }
.note.or { text-align: center; margin: 6px 0; }
.card h3 { margin: 12px 0 6px; font-size: 0.95em; color: var(--muted); }
.add-friend { display: flex; gap: 10px; }
.add-friend input { flex: 1; min-width: 0; }
.flist, .hlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flist li, .hlist li { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 7px 10px; }
.flist .dot { width: 11px; height: 11px; border-radius: 50%; background: #5d6b80; flex: 0 0 auto; }
.flist .dot.on { background: #6ee07a; box-shadow: 0 0 0 3px rgba(110, 224, 122, 0.2); }
/* 2.5.0: not online, but its phone gets notifications - it can be invited */
.flist .dot.push { background: #e8c35a; box-shadow: 0 0 0 3px rgba(232, 195, 90, 0.18); }
/* 2.5.0: the switch of notifications (Play Online), and "Online as" on the title */
.pushbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 2px; padding: 7px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.05); }
.pushbox svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--accent); }
.pushbox .pushtext { flex: 1 1 200px; min-width: 0; color: var(--muted); font-size: 0.86em; line-height: 1.3; }
.presence { display: flex; align-items: center; justify-content: center; gap: 7px; }
.presence .dot { width: 9px; height: 9px; border-radius: 50%; background: #6ee07a; box-shadow: 0 0 0 3px rgba(110, 224, 122, 0.25); }
.flist .nm { font-weight: 700; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.flist .st { color: var(--muted); font-size: 0.82em; }
.flist button, .hlist button { min-height: 34px; padding: 4px 12px; font-size: 0.85em; }
/* 2.6.0: Send link - a friend who is not online gets the room's link; on a narrow phone its row keeps the buttons, the dot
   says the rest */
.flist button.link { white-space: nowrap; }
@media (max-width: 520px) { .flist li:has(> button.link) .st { display: none; } }
/* 2.6.0: Share invite pointed at - Send link on a phone that opens the share sheet only for a tap of its own */
#b-share.pulse { animation: ccpulse 0.9s ease-in-out infinite; box-shadow: 0 0 0 3px var(--accent); }
@keyframes ccpulse { 50% { transform: scale(1.07); } }
.hlist .res { font-weight: 800; min-width: 44px; }
.hlist .res.won { color: #7fe08a; }
.hlist .res.lost { color: #ff9a8e; }
.hlist .what { flex: 1 1 auto; min-width: 0; font-size: 0.9em; }
.hlist .when { color: var(--muted); font-size: 0.8em; white-space: nowrap; }
.row.spread { justify-content: space-between; }
.row.spread > button { flex: 0 0 auto; }
#invite { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 60; background: var(--panel);
  border: 2px solid var(--accent); border-radius: 16px; padding: 10px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); text-align: center; max-width: 92vw; }
#invite p { margin: 0 0 4px; font-weight: 700; }
#invite .row { justify-content: center; margin-top: 6px; }
/* 2.13.0: report and block */
#who { position: fixed; inset: 0; z-index: 70; background: rgba(4, 8, 16, 0.6); display: flex; align-items: center; justify-content: center;
  padding: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l)); }
#who .whobox { background: var(--panel); border: 2px solid var(--accent); border-radius: 16px; padding: 12px 16px; width: min(440px, 100%);
  max-height: 100%; overflow-y: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
#who h3 { margin: 0 0 4px; overflow-wrap: anywhere; }
#who .note { margin: 4px 0 8px; }
#who .whobtns, #who .whys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 8px; }
#who .whys button { min-height: 40px; font-size: 0.9em; }
#who .whys button.on { background: var(--accent); color: #10203a; }
#who input#who-note { width: 100%; box-sizing: border-box; }
#who .check { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; }
#who .check input { width: 20px; height: 20px; }
#who .row { margin-top: 6px; }
.chatlog b.who { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
#l-players .whobtn { flex: 0 0 auto; min-height: 0; padding: 4px 10px; font-size: 0.95em; line-height: 1; }
#l-players .blockedtag { flex: 0 0 auto; color: #ff9a8e; font-size: 0.8em; font-weight: 700; }

/* --- online ---------------------------------------------------------------------- */
.online-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.online-actions .join { grid-column: 1 / -1; display: flex; gap: 10px; }
.online-actions .join input { flex: 1; text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-weight: 700; font-size: 1.15em; }
.code { color: var(--accent); letter-spacing: 0.18em; font-family: ui-monospace, Consolas, monospace; }
#l-players { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#l-players li { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 8px 12px; }
#l-players .dot { width: 14px; height: 14px; border-radius: 50%; }
#l-players .face { width: 46px; height: 28px; flex: 0 0 auto; }
#l-players .crewname { color: var(--muted); font-size: 0.85em; }
#l-players .tagx { margin-left: auto; color: var(--muted); font-size: 0.85em; }
/* 2.9.0: Add friend beside a player who is not my friend yet (Asked, Accept, Friend) */
#l-players .roomfriend { flex: 0 0 auto; min-height: 0; padding: 5px 10px; font-size: 0.8em; }
#l-players .friendtag { flex: 0 0 auto; color: #7fe08a; font-size: 0.8em; font-weight: 700; }
#l-invite { margin: 0 0 10px; }
#l-invite h3 { margin-top: 4px; }
#l-invite .note { margin: 4px 0 0; }
/* 2.4.0: the room's chat - in the room (newest at the bottom) and in a match (the field on top, newest under it: a phone's
   keyboard covers the lower part of the screen) */
.chatlog { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); border-radius: 10px; padding: 5px 9px; font-size: 14px; line-height: 1.3; }
.chatlog p { margin: 0; overflow-wrap: anywhere; }
.chatlog b { margin-right: 6px; }
.chatlog .emote { font-style: italic; color: #dbe4f2; }
.chatlog .empty { color: var(--muted); }
.chatrow { display: flex; gap: 8px; }
.chatrow input { flex: 1 1 auto; min-width: 0; font-size: 16px; }
.chatrow button { flex: 0 0 auto; }
#l-chat { margin: 0 0 10px; }
#l-chat h3 { margin-top: 4px; }
#l-chat-log { height: 104px; margin-bottom: 6px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.howto p { margin: 0 0 9px; line-height: 1.4; font-size: 0.93em; color: #dbe4f2; }
#over-stats { border-collapse: collapse; margin: 6px 0 4px; font-size: 0.95em; }
#over-stats th, #over-stats td { padding: 5px 10px; text-align: center; }
#over-stats th { color: var(--muted); font-weight: 600; font-size: 0.85em; }
#over-stats td:first-child { text-align: left; font-weight: 700; }

/* --- the controls in a match ------------------------------------------------------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud #weapons, #hud #talk, #hud #stick { pointer-events: auto; }
.hud-top {
  position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) 0 calc(10px + var(--safe-l));
}
button.round { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; background: rgba(16, 26, 42, 0.72); font-size: 20px; }
/* the quick switches for music and sound effects, beside the menu: crossed out when off */
button.round.quick { position: relative; width: 40px; height: 40px; flex: 0 0 auto; }
button.round.quick svg { width: 21px; height: 21px; display: block; margin: auto; }
button.round.quick.off { opacity: 0.55; }
button.round.quick.off::after { content: ""; position: absolute; left: 9px; right: 9px; top: 50%; height: 2.5px; background: #ff7a6b;
  transform: rotate(-45deg); border-radius: 2px; box-shadow: 0 0 0 1.5px rgba(16, 26, 42, 0.9); }
#teambars { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.tbar { background: rgba(10, 16, 28, 0.62); border-radius: 9px; padding: 3px 8px 4px; min-width: 76px; max-width: 150px; flex: 0 1 auto; }
.tbar .nm { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.tbar .hp { height: 5px; background: rgba(255, 255, 255, 0.15); border-radius: 3px; overflow: hidden; margin-top: 2px; }
.tbar .hp i { display: block; height: 100%; border-radius: 3px; transition: width 0.4s; }
.tbar.turn { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8); }
.tbar.out { opacity: 0.35; }
/* 2.8.0: in sides, the side's letter before a team's name */
.tbar .nm b.side { display: inline-block; min-width: 1.35em; margin-right: 4px; padding: 0 2px; border-radius: 4px; text-align: center;
  background: #f4f7fb; color: #142033; font-weight: 800; }
.tbar.side1 .nm b.side { background: #142033; color: #f4f7fb; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8); }
.tbar.side2 .nm b.side { background: #9aa6b8; color: #10151f; }
/* 2.7.0: five or six teams - smaller bars in two rows of three, no taller than the clock beside them (a wide screen: one row) */
#teambars.many { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 4px; max-width: 390px; }
#teambars.many .tbar { min-width: 0; max-width: none; padding: 1px 6px 2px; border-radius: 7px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 3px; align-items: center; }
#teambars.many .tbar .nm { font-size: 9.5px; line-height: 1.2; }
#teambars.many .tbar .score { font-size: 9px; margin-left: 0; }
#teambars.many .tbar .hp { grid-column: 1 / -1; height: 4px; margin-top: 1px; }
#teambars.many .tbar.turn { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
@media (min-width: 1100px) { #teambars.many { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: 820px; } }
#clock {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(16, 26, 42, 0.78); border: 3px solid #fff; font-size: 21px; flex: 0 0 auto;
}
#clock.low { border-color: #ff6a5a; color: #ffb4aa; }
#clock { position: relative; }
/* walking left in this turn (when a match limits it) */
.tbar .score { font-size: 11px; color: #ffd24a; margin-left: 4px; white-space: nowrap; }
#walkbar { position: absolute; left: 6px; right: 6px; bottom: -9px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
#walkbar > i { display: block; height: 100%; width: 100%; background: #7fe08a; border-radius: 3px; transition: width 0.15s; }
#walkbar.low > i { background: #ffb347; }
#walkbar.fuel > i { background: #ff9a3a; }
#walkbar.fuel.low > i { background: #ff5a48; }
#clock.idle { opacity: 0.45; }
/* 2.2.1: online, the ping - small, at the top right under the wind: green, yellow, red */
#ping { position: absolute; top: calc(66px + var(--safe-t)); right: calc(10px + var(--safe-r)); display: flex; flex-direction: column;
  align-items: flex-end; gap: 2px; font-size: 10px; line-height: 1.3; pointer-events: none; }
#ping[hidden] { display: none; }
#ping b { font-weight: 700; background: rgba(10, 16, 28, 0.62); border-radius: 5px; padding: 0 5px; color: #dbe4f2; white-space: nowrap; }
#ping b.ok { color: #7fe08a; }
#ping b.meh { color: #ffd24a; }
#ping b.bad { color: #ff7a6b; }
#wind { display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(16, 26, 42, 0.72); border-radius: 10px; padding: 6px 8px 3px; }
#wind small { font-size: 9px; color: var(--muted); letter-spacing: 0.15em; }
#wind-bar { width: 88px; height: 8px; background: rgba(255, 255, 255, 0.15); border-radius: 4px; position: relative; overflow: hidden; }
#wind-bar i { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; background: linear-gradient(90deg, #8fd3ff, #4aa5ff); }
#wind-bar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: #fff; transform: translateX(-1px); }
#banner {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(0.9); opacity: 0;
  background: rgba(12, 18, 30, 0.82); border-radius: 16px; padding: 10px 22px; font-size: 1.25em; font-weight: 800;
  text-align: center; transition: opacity 0.25s, transform 0.25s; white-space: nowrap; max-width: 92vw;
  border: 2px solid rgba(255, 255, 255, 0.15);
}
#banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner small { display: block; font-size: 0.62em; font-weight: 600; color: var(--muted); margin-top: 2px; }
#hint, #waitnote {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100px + var(--safe-b)); background: rgba(12, 18, 30, 0.75);
  border-radius: 12px; padding: 7px 14px; font-size: 0.92em; display: none; text-align: center; max-width: 80vw;
}
#hint.on, #waitnote.on { display: block; }
#waitnote { bottom: auto; top: calc(70px + var(--safe-t)); color: #dbe4f2; }
/* the hint stands at the top too, where it covers no character (it is shown only in my turn, the note only in others') */
#hint { bottom: auto; top: calc(70px + var(--safe-t)); }

#controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l)); }
#controls.off { display: none; }
/* 2.8.0: all at once, a team's part of the turn done - only the weapon button (a weapon for the next round) */
#controls.pick .left-pad, #controls.pick #stick { visibility: hidden; }
.ctl.weapon.later { border-style: dashed; border-color: rgba(255, 214, 120, 0.85); }
.ctl.weapon.later #w-ammo { color: #ffd678; }
.pad { display: flex; align-items: flex-end; gap: 10px; }
.ctl {
  width: 62px; height: 62px; min-height: 0; padding: 0; border-radius: 50%; font-size: 22px;
  background: rgba(20, 32, 52, 0.62); border: 2px solid rgba(255, 255, 255, 0.28); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.ctl.held, .ctl:active { background: rgba(255, 175, 46, 0.55); }
.ctl.small-text { font-size: 13px; }
.ctl.weapon { margin-bottom: 4px; }
/* the aiming stick: the knob follows the thumb, the ring fills with the power */
#stick {
  position: relative; flex: 0 0 auto; width: 132px; height: 132px; border-radius: 50%; touch-action: none; cursor: pointer;
  background: radial-gradient(closest-side, rgba(20, 32, 52, 0.38) 70%, rgba(20, 32, 52, 0.7) 71%);
  border: 2px solid rgba(255, 255, 255, 0.3); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
#stick::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.16); pointer-events: none; }
#stick-ring {
  position: absolute; inset: -2px; border-radius: 50%; pointer-events: none;
  -webkit-mask: radial-gradient(closest-side, transparent 85%, #000 86%); mask: radial-gradient(closest-side, transparent 85%, #000 86%);
}
#stick-knob {
  position: absolute; left: 27%; top: 27%; width: 46%; height: 46%; border-radius: 50%; pointer-events: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; letter-spacing: 0.06em;
  background: rgba(226, 70, 52, 0.9); border: 2px solid rgba(255, 220, 200, 0.75); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
#stick.held { border-color: rgba(255, 205, 130, 0.75); }
#stick.held #stick-knob { background: rgba(255, 140, 40, 0.95); }
.ctl.weapon { width: auto; min-width: 96px; height: 62px; border-radius: 18px; padding: 4px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
#w-icon svg { width: 28px; height: 22px; display: block; }
#w-name { font-size: 11px; }
#w-ammo { font-size: 10px; color: var(--muted); }

#weapons {
  position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(156px + var(--safe-b)); background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 10px; width: min(380px, 94vw); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  /* 2.9.0: never above the top of the screen (a weapon there could not be touched) - it scrolls instead */
  max-height: calc(100% - 164px - var(--safe-b) - var(--safe-t)); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
}
.wgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.wgrid button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; min-height: 62px; font-size: 11px; border-radius: 12px; }
.wgrid button svg { width: 34px; height: 26px; }
.wgrid button small { color: var(--muted); font-size: 10px; font-weight: 600; }
.wgrid button.sel { box-shadow: 0 0 0 2px var(--accent); }
.wgrid button.none { opacity: 0.35; }
#w-tip { margin: 8px 2px 0; font-size: 0.82em; color: var(--muted); min-height: 2.4em; }
/* 2.9.0: as tall for every weapon's text (a panel that grew under the pointer moved its buttons) */
@media (pointer: fine) { #w-tip { min-height: 3.75em; } }
/* 2.4.0: the chat in a match - its panel under the speech bubble at the top right, with the quick phrases (emotes); what is
   said while it is shut shows for some seconds at the lower left; a dot on the bubble: something new */
#talk { position: absolute; right: calc(10px + var(--safe-r)); top: calc(62px + var(--safe-t)); width: min(360px, 62vw);
  display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  max-height: max(170px, calc(100% - 214px - var(--safe-t) - var(--safe-b))); }   /* never down over the aiming stick: its lines give way */
#talk > .chatrow, #emotes { flex: 0 0 auto; }
#hud.talking #hint, #hud.talking #waitnote { display: none; }   /* while the chat is open the hint under it waits */
#hud #talk input { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }   /* typed in: iOS takes no typing in a field that may not be selected */
#talk .chatrow input, #talk .chatrow button { min-height: 38px; }
#talk-log { flex: 0 1 auto; max-height: 84px; min-height: 30px; }
#emotes { display: flex; flex-wrap: wrap; gap: 5px; }
#emotes button { min-height: 32px; padding: 3px 9px; font-size: 0.8em; border-radius: 10px; }
#talk-dot { position: absolute; top: 2px; right: 2px; width: 11px; height: 11px; border-radius: 50%; background: #ff5a48; box-shadow: 0 0 0 2px rgba(16, 26, 42, 0.9); }
#chatfeed { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(82px + var(--safe-b)); max-width: min(420px, 46vw);
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; pointer-events: none; }
#chatfeed p { margin: 0; background: rgba(10, 16, 28, 0.7); border-radius: 8px; padding: 3px 8px; font-size: 13px; line-height: 1.3;
  overflow-wrap: anywhere; transition: opacity 0.6s; }
#chatfeed p.going { opacity: 0; }
#chatfeed b { margin-right: 6px; }
#chatfeed .emote { font-style: italic; }

#toast {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%) translateY(30px); opacity: 0;
  background: rgba(12, 18, 30, 0.92); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; max-width: 90vw;
  transition: opacity 0.25s, transform 0.25s; pointer-events: none; text-align: center; z-index: 50;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#rotate { position: fixed; left: 50%; top: calc(8px + var(--safe-t)); transform: translateX(-50%); background: rgba(12, 18, 30, 0.85); border-radius: 10px; padding: 6px 12px; font-size: 0.8em; z-index: 40; pointer-events: none; }

/* phones held sideways: everything a little smaller */
@media (max-height: 480px) {
  .title-wrap { gap: 18px; flex-wrap: nowrap; }
  .logo h1 { font-size: 56px; }
  .tag { margin-top: 12px; font-size: 0.9em; }
  .menu { gap: 6px; }
  .menu .big { min-height: 42px; font-size: 1em; }
  button { min-height: 40px; padding: 7px 12px; }
  .card { padding: 12px 16px; }
  .card > .row.end { bottom: -12px; margin: 8px -16px -12px; padding: 8px 16px 10px; }
  h2 { font-size: 1.2em; margin-bottom: 6px; }
  .ctl { width: 54px; height: 54px; font-size: 19px; }
  #stick { width: 118px; height: 118px; }
  #stick-knob { font-size: 14px; }
  .ctl.weapon { height: 54px; min-width: 86px; }
  #clock { width: 44px; height: 44px; font-size: 18px; }
  #ping { top: calc(56px + var(--safe-t)); }
  button.round { width: 40px; height: 40px; }
  /* 2.9.0: seven a row (the Water Rifle made 19: three rows, as eighteen were), never above the top of the screen */
  #weapons { bottom: calc(140px + var(--safe-b)); width: min(560px, 76vw); padding: 8px;
    max-height: calc(100% - 148px - var(--safe-b) - var(--safe-t)); }
  .wgrid { grid-template-columns: repeat(7, 1fr); gap: 5px; }
  .wgrid button { min-height: 50px; padding: 4px 2px; font-size: 10px; }
  .wgrid button svg { width: 28px; height: 20px; }
  #w-tip { min-height: 0; margin-top: 6px; font-size: 0.78em; }
  .mapcard { width: 96px; }
  .mapcard canvas { width: 88px; height: 44px; }
  .mapbox { margin: 6px 0 2px; }
  /* 2.12.0: the editor's bars slimmer, the tools without their words (their names are their titles) */
  .ed-top { padding-top: calc(4px + var(--safe-t)); padding-bottom: 4px; gap: 4px; }
  .ed-ic { min-height: 32px; min-width: 32px; }
  .ed-ic svg { width: 19px; height: 19px; }
  .ed-txt, .ed-top select, .ed-top input { min-height: 32px; }
  .ed-txt { padding: 2px 10px; }
  .ed-side, .ed-zoom { padding: 3px; gap: 2px; }
  .ed-tool { width: 38px; padding: 4px 2px; }
  .ed-tool span { display: none; }
  .ed-tool svg { width: 20px; height: 20px; }
  .ed-opts { padding-top: 3px; padding-bottom: calc(3px + var(--safe-b)); gap: 6px; }
  .ed-mat { padding: 1px; }
  .ed-mat span { display: none; }
  .ed-mat canvas { width: 26px; height: 26px; }
  #talk { top: calc(56px + var(--safe-t)); max-height: max(170px, calc(100% - 194px - var(--safe-t) - var(--safe-b))); }
  #l-chat-log { height: 84px; }
  /* 2.10.0: six crews in one row, the looks smaller (Quick match and Create a room stay on the screen) */
  .crewpick { gap: 6px; margin-bottom: 6px; }
  .crewpick button { padding: 2px 6px 1px; }
  .crewpick button canvas { width: 46px; height: 27px; }
  .crewpick button span { font-size: 0.74em; }
  .skinpick button canvas { width: 25px; height: 25px; }
  .skinpick button[data-skin="-1"] canvas { width: 38px; }
}
/* phones held upright */
@media (max-width: 520px) {
  .title-wrap { flex-direction: column; gap: 22px; }
  #controls { padding-left: calc(8px + var(--safe-l)); padding-right: calc(8px + var(--safe-r)); }
  .pad { gap: 6px; }
  .ctl { width: 48px; height: 48px; font-size: 17px; }
  .ctl.small-text { font-size: 11px; }
  #stick { width: 106px; height: 106px; }
  #stick-knob { font-size: 12px; }
  .ctl.weapon { min-width: 62px; height: 48px; padding: 2px 6px; }
  #w-name { font-size: 9px; }
  #w-icon svg { width: 22px; height: 17px; }
  #rotate { top: calc(64px + var(--safe-t)); }
  #hint, #waitnote { top: calc(104px + var(--safe-t)); max-width: 92vw; }
  #ping { top: calc(84px + var(--safe-t)); }
  #wind-bar { width: 60px; }
  .hud-top { gap: 6px; }
  button.round.quick { width: 34px; height: 34px; }
  button.round.quick svg { width: 18px; height: 18px; }
  .tbar { min-width: 60px; }
  /* 2.7.0: five or six teams on a phone held upright - the bars a row of their own under the buttons, as wide as the
     screen; what stands under the top moves down by that row */
  #hud.many-teams .hud-top { flex-wrap: wrap; row-gap: 5px; }
  #hud.many-teams #teambars { order: 9; flex: 1 1 100%; max-width: none; }
  #hud.many-teams ~ #rotate { top: calc(116px + var(--safe-t)); }
  #hud.many-teams #hint, #hud.many-teams #waitnote { top: calc(156px + var(--safe-t)); }
  #hud.many-teams #ping { top: calc(118px + var(--safe-t)); }
  #hud.many-teams #talk { top: calc(150px + var(--safe-t)); max-height: max(170px, calc(100% - 276px - var(--safe-t) - var(--safe-b))); }
  .online-actions { grid-template-columns: 1fr; }
  .form.acct { grid-template-columns: 1fr; }
  .team-row { flex-wrap: wrap; }
  .team-row input { flex: 1 1 120px; }
  .crewpick button { padding: 3px 7px 2px; }
  /* 2.9.0: four a row (19 weapons: five rows - seven of three did not fit a small phone held upright) */
  .wgrid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .wgrid button { padding: 6px 2px; }
  #talk { left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); width: auto; top: calc(100px + var(--safe-t));
    max-height: max(170px, calc(100% - 226px - var(--safe-t) - var(--safe-b))); }
  #chatfeed { bottom: calc(68px + var(--safe-b)); max-width: 56vw; }
}
@media (pointer: fine) {
  .ctl { opacity: 0.85; }
}

/* --- 2.12.0: the character window (crewwin.js); 2.17.0 anew (the owner: "Remake the charchters selection the top window that
   shows the charchter is to big Make it smaller ... we want it perfect and easy to use"; asked, he chose "Small stage + swipe
   rows"): a small stage - a quarter of a phone held upright, a third of one held sideways - with Show and Surprise me on it, and
   three rows to swipe sideways, all in view: Crew, Look, Luxury */
#s-crew { padding: 0; background: rgba(12, 18, 30, 0.97); overflow: hidden; }
#s-crew.on { display: flex; }
.cw { display: flex; flex-direction: column; width: 100%; height: 100%; max-width: 980px; margin: 0 auto;
  padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) calc(8px + var(--safe-b)) calc(10px + var(--safe-l)); }
.cw-head { display: flex; align-items: center; gap: 10px; }
.cw-head h2 { flex: 1 1 auto; margin: 0; text-align: center; font-size: 1.15em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-head button { min-height: 38px; padding: 4px 14px; }
.cw-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cw-stagebox { flex: 0 0 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cw-stagewrap { position: relative; height: clamp(120px, 24vh, 230px); }
#cw-stage { display: block; width: 100%; height: 100%; border-radius: 16px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); touch-action: none; cursor: pointer; }
.cw-pill { position: absolute; top: 8px; min-height: 34px; padding: 4px 13px; border-radius: 999px; font-size: 0.88em; color: #fff;
  background: rgba(14, 20, 34, 0.74); border: 1px solid rgba(255, 255, 255, 0.35); box-shadow: none; display: flex; align-items: center; gap: 5px; }
.cw-show { right: 8px; }
.cw-show span { font-size: 0.8em; }
.cw-dice { left: 8px; padding: 4px 9px; }
.cw-dice svg { width: 18px; height: 18px; }
.cw-what { margin: 0; text-align: center; font-weight: 700; color: var(--ink); font-size: 0.95em; }
/* 2.15.0: what only a luxury look has, under its name */
.cw-perks { margin: 0 6px; text-align: center; font-size: 12px; line-height: 1.3; color: #ffe9a6; }
.cw-side { flex: 1 1 auto; min-height: 0; min-width: 0; overflow-y: auto; background: var(--panel); border-radius: 16px; padding: 8px 10px;
  touch-action: pan-y; display: flex; flex-direction: column; gap: 6px; }
.cw-name { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 0.9em; }
.cw-name input { flex: 1 1 auto; min-width: 0; min-height: 36px; }
.cw-row { min-width: 0; }
.cw-row h3 { margin: 0 0 3px; font-size: 0.85em; color: var(--muted); }
/* a row to swipe sideways: as many as fit, the rest a swipe away (a fade at its end says there is more) */
.cw-strip { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; touch-action: pan-x;
  padding: 2px 2px 5px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cw-strip::-webkit-scrollbar { display: none; }
.cw-strip.more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), rgba(0, 0, 0, 0.2)); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), rgba(0, 0, 0, 0.2)); }
.cw-strip button { flex: 0 0 auto; scroll-snap-align: start; width: 74px; min-height: 0; padding: 4px 3px 3px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-size: 0.74em; line-height: 1.12; letter-spacing: 0; border: 2px solid transparent; white-space: normal; }
.cw-strip button span { display: block; max-width: 100%; }
.cw-strip button canvas { width: 56px; height: 34px; }
.cw-looks button canvas { width: 40px; height: 34px; }
.cw-looks button[data-skin="-1"] canvas { width: 56px; }
.cw-strip button.sel { border-color: var(--accent); background: #3c4c6a; }
/* 2.14.0: the luxury looks - gold edged, a lock and the price on those not this account's; the bar that asks for one */
.cw-lux-h { color: #f2c94c !important; }
.cw-lux-h span { color: var(--muted); font-weight: 700; font-size: 0.95em; }
.cw-lux button { position: relative; background: linear-gradient(180deg, #3a2a58, #241a3c); border-color: rgba(242, 201, 76, 0.55); }
.cw-lux button.sel { border-color: #f2c94c; background: linear-gradient(180deg, #4b3a72, #2e2250); }
.cw-lux .lk { position: absolute; top: 3px; right: 4px; width: 12px; height: 14px; display: none; }
.cw-lux button.locked .lk { display: block; }
.cw-lux button.asked .lk { opacity: 0.45; }
.cw-lux .lk-txt { font-size: 0.9em; color: #f2c94c; font-weight: 700; line-height: 1; min-height: 1em; }
.cw-lux button.locked canvas { opacity: 0.88; }
.cw-buy { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 6px 8px; border-radius: 12px;
  background: linear-gradient(180deg, #3a2a58, #241a3c); border: 1px solid rgba(242, 201, 76, 0.6); }
.cw-buy[hidden] { display: none; }
.cw-buy span { font-weight: 700; color: #ffe9a8; }
.cw-buy input { flex: 1 1 100%; order: 3; min-width: 0; min-height: 34px; padding: 4px 8px; font-size: 0.85em; }   /* a row of its own: its words whole */
.cw-buy button { min-height: 36px; padding: 4px 14px; }
/* a tall phone held upright: room for larger buttons in the rows */
@media (orientation: portrait) and (min-height: 740px) {
  .cw-strip button { width: 84px; font-size: 0.78em; }
  .cw-strip button canvas { width: 62px; height: 38px; }
  .cw-looks button canvas { width: 46px; height: 38px; }
  .cw-looks button[data-skin="-1"] canvas { width: 62px; }
}
/* held sideways (or a wide screen): the stage on the left - a third -, the rows beside it */
@media (orientation: landscape) and (min-width: 560px) {
  .cw-main { flex-direction: row; gap: 10px; }
  .cw-stagebox { flex: 0 0 38%; }
  .cw-stagewrap { flex: 1 1 auto; height: auto; min-height: 120px; max-height: 420px; }
  .cw-side { flex: 1 1 auto; justify-content: flex-start; }
}
.crewcard { display: flex; align-items: center; gap: 10px; width: 100%; margin: 2px 0 8px; padding: 6px 10px; text-align: left; min-height: 0; }
.crewcard canvas { width: 64px; height: 40px; flex: 0 0 auto; }
.cc-txt { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.cc-txt small { color: var(--muted); font-weight: 700; }
.cc-txt b { font-size: 1.05em; }
.cc-txt em { font-style: normal; color: var(--muted); font-size: 0.85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-go { flex: 0 0 auto; background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 4px 10px; font-size: 0.85em; }
.team-row .face-btn { min-height: 0; padding: 3px 6px; display: flex; align-items: center; gap: 6px; text-align: left; border-radius: 12px; }
.face-btn .fb-txt { display: flex; flex-direction: column; line-height: 1.15; font-size: 0.78em; min-width: 0; }
.face-btn .fb-txt small { color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 7.5em; }
@media (max-height: 480px) {
  .cw { padding-top: calc(5px + var(--safe-t)); padding-bottom: calc(5px + var(--safe-b)); }
  .cw-head button { min-height: 32px; padding: 3px 12px; }
  .cw-head h2 { font-size: 1.0em; }
  .cw-main { margin-top: 5px; gap: 8px; }
  .cw-side { padding: 5px 8px; gap: 3px; }
  .cw-name input { min-height: 32px; }
  .cw-row h3 { margin: 0 0 2px; font-size: 0.8em; }
  .cw-strip { padding-bottom: 3px; }
  .cw-strip button { width: 66px; padding: 2px 2px 2px; font-size: 0.68em; }
  .cw-strip button canvas { width: 48px; height: 29px; }
  .cw-looks button canvas { width: 34px; height: 29px; }
  .cw-looks button[data-skin="-1"] canvas { width: 48px; }
  .cw-buy { padding: 3px 6px; gap: 4px; }
  .cw-buy input, .cw-buy button { min-height: 30px; }
  .cw-pill { min-height: 30px; top: 6px; }
  .crewcard { margin: 0 0 4px; padding: 3px 8px; }
  .crewcard canvas { width: 52px; height: 32px; }
}

/* 2.16.0: the settings of a match as buttons; the game's box with the ready-made games; sides by dragging; the room's head */
select.chosen { display: none; }
.form .opt { display: flex; flex-direction: column; gap: 6px; font-size: 0.86em; color: var(--muted); }
.form.opts { grid-template-columns: 1fr; gap: 12px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { min-height: 34px; padding: 5px 13px; border-radius: 999px; font-size: 1em; font-weight: 700; color: var(--ink);
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: none; }
.choice.on { color: #21170a; background: linear-gradient(180deg, #ffd96a, #f2a92c); border-color: #ffe39a; box-shadow: 0 0 0 2px rgba(255, 210, 92, 0.22); }
.choice:disabled { opacity: 0.5; cursor: default; }
.choice.on:disabled { opacity: 0.85; }
.roomhead { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.roomhead h2 { margin: 0; }
.roombtns { display: flex; gap: 6px; }
.gamebox { margin: 10px 0 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255, 210, 92, 0.4);
  background: linear-gradient(135deg, rgba(255, 210, 92, 0.14), rgba(120, 96, 255, 0.12)); }
.gb-head { display: flex; align-items: center; gap: 8px; }
.gb-head .mini { margin-left: auto; }
.gb-tag { font-size: 0.7em; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #ffe08a; }
.gb-head b { font-size: 1.15em; }
.gb-line { margin: 4px 0 8px; font-size: 0.9em; line-height: 1.35; }
.gb-how { margin: 8px 0 0; font-size: 0.85em; line-height: 1.35; color: var(--muted); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 0; padding: 7px 16px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); }
.preset b { font-size: 1em; }
.preset small { font-size: 0.74em; font-weight: 600; color: var(--muted); }
.preset.on { background: rgba(255, 210, 92, 0.24); border-color: #ffd25c; }
.players { margin: 10px 0; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#l-players.sided, #setup-teams.sided { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
#setup-teams.sided > .add-team { grid-column: 1 / -1; }
.sidebox { min-height: 64px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 2px dashed rgba(255, 255, 255, 0.16); }
.sidebox.over { border-color: #ffd25c; background: rgba(255, 210, 92, 0.1); }
.sb-head { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 700; }
.sb-head .sidechip { width: 26px; height: 26px; font-size: 13px; }
.plist:empty::after { content: attr(data-empty); display: block; padding: 10px; text-align: center; font-size: 0.85em; color: var(--muted); }
.grip { flex: 0 0 auto; align-self: stretch; width: 16px; min-height: 28px; margin: -2px 0; touch-action: none; cursor: grab; border-radius: 6px;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.6) 1.5px, transparent 1.9px); background-size: 8px 7px; background-position: center; }
.draggable { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dragging { opacity: 0.35; }
.ghost { position: fixed; z-index: 1000; margin: 0; pointer-events: none; opacity: 0.94; transform: rotate(-1.5deg); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55); }
/* in a side's box its letter is the box's (not on every card); a card that is too wide for the box wraps its buttons */
.sidebox li > .sidechip, .sidebox .team-row > .sidechip { display: none; }
/* a team in a side's box (boxes side by side on a phone held sideways): its row wraps - the name a line with the crew, Player /
   Computer under them - so that nothing is squeezed or sticks out of the box (game_android_manager found it in 2.16.0) */
.sidebox .team-row { flex-wrap: wrap; row-gap: 6px; }
.sidebox .team-row input { flex: 1 1 110px; }
.sidebox .team-row .face-btn { flex: 0 1 auto; min-width: 0; }
#l-players li { flex-wrap: wrap; row-gap: 6px; }
#l-players .dot, #l-players .grip { flex: 0 0 auto; }
#l-players .nm { min-width: 0; overflow-wrap: anywhere; }
