/* Join flow: one centred card on a soft page, full bleed on phones. Page class jpg goes on the full shell. */
:root { --jk-tint: 16%; --j-glow: 45%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --jk-tint: 26%; --j-glow: 22%; } }
:root[data-theme="dark"] { --jk-tint: 26%; --j-glow: 22%; }
.full.jpg { background: radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--pc) var(--j-glow), transparent), transparent 72%), var(--surface-2); }
.full.jpg > .topbar { background: color-mix(in srgb, var(--surface-2) 86%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.full.jpg .phone-col { width: min(496px, 100%); min-height: calc(100% - 57px); padding: 40px 16px 32px; gap: 12px; align-content: safe center; }

.jcard { width: 100%; min-width: 0; min-height: 0; display: grid; gap: 16px; align-content: start; padding: 32px 32px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-1); }
.jcard.qp-join { min-height: 0; }
.jcard > .brand { justify-self: center; margin-bottom: 4px; }
.jcard .btn.wide { height: 48px; }
.jcard .banner { margin: 0; }
.jcard .fold .f-t { flex: 1; min-width: 0; }
.jcard > .empty { padding: 8px 0; }
.jcard .empty-acts .btn { height: 44px; }

.jhead { display: grid; justify-items: center; text-align: center; gap: 4px; min-width: 0; }
.jhead .jmark { margin-bottom: 8px; }
.jhead h1 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.jhead p { margin: 0; color: var(--ink-3); }

/* One tint per code type, from the shared status tokens, so light and dark follow the theme. */
.jk-game { --jk: var(--st-violet); }
.jk-team { --jk: var(--st-sky); }
.jk-exam { --jk: var(--st-emerald); }
.jk-buzz { --jk: var(--st-pink); }
.jk-routine { --jk: var(--st-amber); }
.jk-audience { --jk: var(--gold); }
.jmark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--jk) var(--jk-tint), var(--surface)); color: color-mix(in srgb, var(--jk) 78%, var(--ink)); }
.jmark svg.lucide { width: 20px; height: 20px; }
.jmark.l { width: 64px; height: 64px; border-radius: 20px; }
.jmark.l svg.lucide { width: 32px; height: 32px; }
.jchip { background: color-mix(in srgb, var(--jk) var(--jk-tint), var(--surface)); color: color-mix(in srgb, var(--jk) 70%, var(--ink)); }
.jchip svg.lucide { width: 14px; height: 14px; }
.jlink > svg.lucide { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; color: color-mix(in srgb, var(--jk) 78%, var(--ink)); }

.jdiv { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; color: var(--ink-3); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; }
.jdiv::before, .jdiv::after { content: ""; flex: 1 1 0; height: 1px; background: var(--line); }
.jways { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.jway { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 96px; min-width: 0; padding: 12px 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500; line-height: 16px; text-align: center; text-decoration: none; }
.jway:hover { background: var(--surface-2); border-color: var(--outline); }
.jway:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.jway > span:last-child { overflow-wrap: anywhere; }
.jwt { display: grid; gap: 2px; min-width: 0; }
.jwt b { font-weight: 500; }
.jwt small { color: var(--ink-3); font-size: 12px; line-height: 16px; }

.jfoot { display: flex; justify-content: center; }
.jfoot .btn { min-height: 44px; }
.jfoot .help { margin: 0; text-align: center; }

@media (max-width: 599.98px) {
  .full.jpg, .full.jpg > .topbar { background: var(--surface); }
  .full.jpg .phone-col { width: 100%; padding: 8px 0 24px; gap: 4px; }
  .jcard { border: 0; border-radius: 0; box-shadow: none; padding: 16px; }
  .jfoot { padding: 0 16px; }
  .jways.jw4 { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .jcard .codein { gap: 6px; }
  .jcard .codein span { width: 44px; height: 54px; flex: 0 1 44px; min-width: 0; }
  .jway { min-height: 88px; }
}

/* Full screen hides the status bar, so every phone player header gets its own top room; normal mode is unchanged. */
:fullscreen :is(.full.qp-pg, .full.bz-ppg, .full.rp-pg, .qs-page) > .topbar { padding-top: max(24px, env(safe-area-inset-top, 0px)); min-height: calc(56px + max(24px, env(safe-area-inset-top, 0px))); }
:-webkit-full-screen :is(.full.qp-pg, .full.bz-ppg, .full.rp-pg, .qs-page) > .topbar { padding-top: max(24px, env(safe-area-inset-top, 0px)); min-height: calc(56px + max(24px, env(safe-area-inset-top, 0px))); }
@media (display-mode: standalone), (display-mode: fullscreen) {
  :is(.full.qp-pg, .full.bz-ppg, .full.rp-pg, .qs-page) > .topbar { padding-top: max(24px, env(safe-area-inset-top, 0px)); min-height: calc(56px + max(24px, env(safe-area-inset-top, 0px))); }
}

/* Short landscape phones: a compact header in normal and full screen so the question keeps the height. */
@media (orientation: landscape) and (max-height: 500px) {
  :root:root :is(.full.qp-pg, .full.bz-ppg, .full.rp-pg, .qs-page) > .topbar { padding-top: max(env(safe-area-inset-top, 0px), 6px); padding-bottom: 0; min-height: 52px; gap: 6px; }
  :root:root :is(.full.qp-pg, .full.bz-ppg, .full.rp-pg, .qs-page) > .topbar .jmark { width: 36px; height: 36px; border-radius: 10px; margin-left: 0; }
  :root:root :is(.full.qp-pg, .full.bz-ppg, .full.rp-pg, .qs-page) > .topbar .tt { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  :root:root :is(.full.qp-pg, .full.bz-ppg, .full.rp-pg, .qs-page) > .topbar .tt small { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Narrow phone header: title shrinks with an ellipsis, the status chip becomes a dot, no sideways scroll. */
:is(.full.qp-pg, .full.bz-ppg) > .topbar { min-width: 0; max-width: 100%; }
:is(.full.qp-pg, .full.bz-ppg) > .topbar .tt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 340px) {
  :is(.full.qp-pg, .full.bz-ppg) > .topbar { gap: 4px; padding-right: 4px; }
  :is(.full.qp-pg, .full.bz-ppg) > .topbar .jmark { margin-left: 0; }
  :is(.full.qp-pg, .full.bz-ppg) > .topbar .chip { width: 12px; min-width: 12px; height: 12px; padding: 0; font-size: 0; line-height: 0; overflow: hidden; border-radius: 50%; background: var(--ink-3); }
  :is(.full.qp-pg, .full.bz-ppg) > .topbar .chip.ok { background: var(--ok); }
  :is(.full.qp-pg, .full.bz-ppg) > .topbar .chip.bad { background: var(--danger); }
}
