/* Groups on the phone (phone/groups.js): the tab, a group's page, its sheets and the host's strip.
   In the house's own colours, light or dark, from phone.css's variables. */

.g-tab { padding-bottom: 12px; }
.g-wide { display: block; width: 100%; margin-top: 10px; text-align: center; text-decoration: none; }
.g-intro { text-align: center; }
.g-intro p { margin: 10px 0 0; color: var(--ink); font-size: 16px; }
.g-intro-row { display: flex; justify-content: center; gap: 10px; }
.g-note { color: var(--dim); font-size: 13px; margin: 10px 0 0; line-height: 1.5; }
.g-fault { color: var(--wrong); font-weight: 700; text-align: center; margin: 8px 0 0; min-height: 1.2em; }
.g-danger { color: var(--wrong) !important; }
.g-badge { flex: 0 0 auto; display: block; }

/* My groups */
.g-list { display: grid; gap: 8px; }
.g-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.g-row:active { transform: scale(.99); }
.g-row-text { display: grid; flex: 1; min-width: 0; }
.g-row-text b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-row-text small { color: var(--dim); }
.g-row-go { color: var(--dim); font-size: 24px; }
:dir(rtl) .g-row-go { transform: scaleX(-1); }
.g-chip { flex: 0 0 auto; padding: 3px 10px; border-radius: 999px; background: var(--wash2); color: var(--dim); font-size: 12px; font-weight: 700; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-chip.on { background: var(--right); color: #fff; }

.g-code h2 { margin: 0 0 8px; font-size: 17px; }
.g-code-row { display: flex; gap: 8px; }
.g-code-in, .g-name-in, .g-when-in, .g-select {
  flex: 1; min-width: 0; box-sizing: border-box; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--field); color: var(--ink); font: inherit; font-size: 18px;
}
.g-code-in { letter-spacing: .25em; text-transform: uppercase; font-weight: 800; }
.g-name-in, .g-when-in, .g-select { width: 100%; font-size: 16px; color-scheme: dark light; }

/* A group's head */
.g-head { display: grid; justify-items: center; text-align: center; gap: 6px; }
.g-head h1 { margin: 6px 0 0; font-size: 26px; line-height: 1.25; color: var(--hi); }
.g-head-text small { color: var(--dim); }
.g-codecard { width: 100%; min-width: 0; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 10px; border-radius: 16px; background: var(--wash); }
.g-codecol { flex: 1; display: grid; gap: 6px; justify-items: start; min-width: 0; }
.g-codecol small { color: var(--dim); }
.g-tiles { display: flex; gap: 3px; }
.g-tiles span {
  display: grid; place-items: center; width: 26px; height: 36px; border-radius: 7px; background: var(--tile), var(--bg2);
  font-size: 20px; font-weight: 900; color: var(--hi); font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.g-code-do { display: flex; flex-wrap: wrap; gap: 6px; }
.p-ghost.small { padding: 6px 12px; font-size: 14px; border-width: 1.5px; border-radius: 10px; color: var(--ink); }
.g-qr { width: 80px; height: 80px; flex: 0 0 auto; border-radius: 8px; overflow: hidden; line-height: 0; }
.g-qr svg { width: 100%; height: 100%; display: block; }
.g-codecard-wrap .g-codecard { margin-top: 0; }
.g-join { width: 100%; }

/* The quiz card */
.g-quiz { text-align: center; }
.g-quiz h2 { margin: 6px 0 4px; font-size: 21px; color: var(--hi); }
.g-quiz.live { border-color: var(--right); box-shadow: 0 0 0 1px var(--right) inset; }
.g-in { margin: 4px 0; font-size: 18px; font-weight: 800; color: var(--right); }
.g-do { display: grid; gap: 4px; justify-items: center; }
.g-start { background: var(--right); color: #fff; }
.g-tv { margin-top: 8px; }
a.p-ghost.g-wide { color: var(--ink); }
.g-faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px 0; }
.g-face { display: grid; justify-items: center; gap: 2px; width: 62px; }
.g-face small { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--dim); }
.g-face .gq-face, .g-rows .gq-face { width: 40px; height: 40px; }
.g-lobby { display: grid; justify-items: center; gap: 4px; }
.g-lobby h2 { margin: 8px 0 0; font-size: 20px; }

/* Boards and lists */
.g-board-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.g-board h2, .g-people h2, .g-past h2 { margin: 0; font-size: 18px; }
.g-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--wash2); gap: 2px; }
.g-seg button { border: 0; background: none; color: var(--dim); padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.g-seg button.on { background: var(--accent); color: var(--accent-ink); }
.g-seg.wide { display: flex; width: 100%; }
.g-seg.wide button { flex: 1; font-size: 14px; padding: 9px 6px; }
.g-rows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.g-rows li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--wash); }
.g-rows li.me { background: var(--accent-soft); }
.g-place { width: 1.8em; text-align: center; font-weight: 900; color: var(--accent); }
.g-who { flex: 1; display: grid; min-width: 0; }
.g-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-who small { color: var(--dim); font-size: 12px; }
.g-pts { font-weight: 900; color: var(--hi); white-space: nowrap; }
.g-acts { display: flex; gap: 2px; }
.g-acts .p-link { font-size: 12px; }
.g-pastlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.g-pastlist li { padding: 8px 10px; border-radius: 12px; background: var(--wash); }
.g-pastlist small { color: var(--dim); }
.g-podium { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; font-size: 14px; }
.g-podium .me { color: var(--accent); font-weight: 800; }
.g-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-top: 14px; }

/* Sheets */
/* One column that never grows past the card: a wide child (the badges, a field) shrinks to it
   instead of pushing the whole sheet out sideways (his phone, 2026-11-23). */
.g-sheet .p-card { max-height: 86vh; overflow-y: auto; overflow-x: hidden; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.g-sheet h2 { margin: 0 0 4px; }
.g-label { display: block; margin-top: 10px; font-size: 14px; font-weight: 800; color: var(--dim); }
.g-badges { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.g-badges button { min-width: 0; }
.g-badges button svg { width: 100%; max-width: 44px; height: auto; }
.g-badges button, .g-colours button { border: 2px solid transparent; background: none; border-radius: 999px; padding: 2px; cursor: pointer; display: grid; place-items: center; }
.g-badges button.on { border-color: var(--hi); }
.g-colours { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-top: 8px; justify-items: center; }
.g-colours button { width: 100%; max-width: 34px; aspect-ratio: 1; height: auto; }
.g-colours button.on { border-color: var(--hi); box-shadow: 0 0 0 2px var(--bg) inset; }
.g-rules { display: flex; flex-wrap: wrap; gap: 6px; }
.g-rules button, .g-chips button {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px;
  padding: 7px 11px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.g-rules button.on, .g-chips button.on { border-color: var(--accent); background: var(--accent-soft); }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.g-chips button { display: inline-flex; align-items: center; gap: 6px; }
.g-chips button b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; }
.g-chips button small { color: var(--dim); font-size: 11px; font-weight: 600; }
.g-chips button:disabled { opacity: .4; cursor: default; }
.g-setup { display: grid; gap: 6px; }

/* The host's strip over a group's quiz under way, and its note that the quiz is held */
.g-strip {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 55; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--surface, rgba(11, 17, 22, .9));
  border-top: 1px solid var(--line); backdrop-filter: blur(8px); zoom: var(--fit, 1);
}
.g-strip.held { border-top-color: var(--accent); }
.g-strip-note { font-weight: 800; color: var(--accent); }
.g-strip-do { display: flex; gap: 8px; }
.g-strip button { border: 0; border-radius: 12px; padding: 9px 14px; font: inherit; font-size: 14px; font-weight: 800; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.g-strip button.end { background: var(--wash2); color: var(--ink); }
.g-strip button:disabled { opacity: .5; }
body:has(.g-strip) main { padding-bottom: 76px; }
/* The reactions row sits over the strip, not under it. */
body:has(.g-strip) .p-cheer { bottom: calc(58px * var(--fit, 1) + env(safe-area-inset-bottom)); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
body:has(.g-strip).has-cheer main { padding-bottom: calc(210px + env(safe-area-inset-bottom)); }

/* The easy sheet (2026-11-23): ready cards, the change page, the order of the rounds */
.g-presets { display: grid; gap: 8px; }
.g-preset {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; padding: 11px 12px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; position: relative;
}
.g-preset.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.g-picon { font-size: 24px; line-height: 1; width: 30px; text-align: center; }
.g-ptext { display: grid; gap: 2px; min-width: 0; }
.g-ptext b { font-size: 16px; }
.g-ptext small { color: var(--dim); font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-pmin { font-size: 12px; font-weight: 800; color: var(--dim); white-space: nowrap; }
.g-preset.on .g-pmin { color: var(--ink); }
.g-shuffle {
  grid-column: 2 / 4; justify-self: start; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.g-shuffle::after { content: attr(title); margin-inline-start: 6px; font-size: 12px; font-weight: 700; color: var(--dim); }
.g-sum { margin: 6px 0 0; text-align: center; font-weight: 800; font-size: 14px; }
.g-change { margin-top: 2px; }
.g-back { justify-self: start; }
.g-setup-foot { display: grid; gap: 6px; margin-top: 6px; }
.g-setup-foot.sticky { position: sticky; bottom: -16px; z-index: 2; background: linear-gradient(var(--card), var(--card)), var(--bg); padding: 8px 0 12px; border-top: 1px solid var(--line); }
.g-seg.wide button { display: grid; gap: 1px; justify-items: center; }
.g-seg button small { font-size: 11px; font-weight: 600; opacity: .8; }
.g-label small { font-weight: 600; font-size: 12px; }
.g-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; touch-action: none; user-select: none; }
.g-order li {
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: grab;
}
.g-order li.drag { border-color: var(--accent); background: var(--accent-soft); cursor: grabbing; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.g-order b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; }
.g-grip { color: var(--dim); font-size: 16px; }
.g-oname { font-weight: 700; }
.g-ox { border: 0; background: none; color: var(--dim); font-size: 15px; cursor: pointer; padding: 2px 6px; }
