:root {
    color-scheme: light;
    --ink: #17181d;
    --ink-soft: #2a2c33;
    --paper: #f3f4f6;
    --white: #ffffff;
    --line: #d9dce2;
    --muted: #676b76;
    --yellow: #ffd43b;
    --yellow-deep: #e9b914;
    --blue: #3157e0;
    --teal: #10a7a2;
    --coral: #ef5d56;
    --green: #149b67;
    --danger: #c83b3b;
    --dark: #17181d;
    --dark-panel: #22242b;
    --tv-blue: #1167e8;
    --tv-teal: #087c78;
    --tv-red: #c23b36;
    --tv-yellow: #f4bd19;
    --shadow: 0 18px 45px rgba(23, 24, 29, 0.12);
    --navy: #080d23;
    --navy-soft: #111936;
    --electric: #6c5cff;
    --violet: #8b5cf6;
    --cyan: #19d3df;
    --game-shadow: 0 24px 70px rgba(4, 8, 25, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
}

body.tv-mode,
body.player-mode {
    background: #e9eef3;
}

button,
input,
textarea,
select {
    color: inherit;
    font: inherit;
    letter-spacing: 0;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3,
strong,
b {
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    letter-spacing: 0;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: 0;
    background: var(--white);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

input,
select {
    min-height: 46px;
    padding: 0 13px;
}

textarea {
    min-height: 88px;
    padding: 12px 13px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(49, 87, 224, 0.14);
}

.field {
    display: grid;
    gap: 7px;
    color: #3d4048;
    font-size: 0.82rem;
    font-weight: 750;
}

.field input,
.field select,
.field textarea {
    font-weight: 500;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button-primary {
    border-color: var(--yellow);
    background: var(--yellow);
    color: #18150c;
}

.button-primary:hover {
    border-color: #ffdf69;
    background: #ffdf69;
}

.button-dark {
    border-color: var(--blue);
    background: var(--blue);
    color: var(--white);
}

.button-outline {
    border-color: var(--line);
    background: var(--white);
    color: var(--ink);
}

.button-outline:hover {
    border-color: #a9adb7;
}

.button-danger-subtle {
    border-color: rgba(200, 59, 59, 0.22);
    background: #fff2f1;
    color: var(--danger);
}

.button-large {
    min-height: 52px;
    padding: 0 22px;
}

.compact-button {
    min-height: 36px;
    padding: 0 11px;
    font-size: 0.78rem;
}

.full-width {
    width: 100%;
}

.plain-action,
.text-link,
.back-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 750;
    text-decoration: underline;
    text-decoration-color: rgba(23, 24, 29, 0.24);
    text-underline-offset: 4px;
}

.plain-action:hover,
.text-link:hover,
.back-action:hover {
    text-decoration-color: currentColor;
}

.danger-text {
    color: var(--danger);
}

.section-label {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.wordmark {
    position: relative;
    display: inline-flex;
    width: 110px;
    height: 77px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    text-decoration: none;
}

.wordmark-image {
    position: absolute;
    top: -24.6%;
    left: -5.25%;
    display: block;
    width: 109.4%;
    max-width: none;
    height: auto;
}

.brand-link,
.host-brand {
    display: inline-flex;
    text-decoration: none;
}

.live-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.live-status i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #35d88c;
    box-shadow: 0 0 0 5px rgba(53, 216, 140, 0.13);
}

.live-status.connecting i {
    background: var(--yellow);
}

.live-status.offline i {
    background: var(--coral);
    box-shadow: 0 0 0 5px rgba(239, 93, 86, 0.13);
}

.toast {
    position: fixed;
    z-index: 1000;
    right: 18px;
    bottom: 18px;
    width: min(380px, calc(100vw - 36px));
    padding: 13px 16px;
    border: 1px solid #363840;
    border-radius: 6px;
    background: #1c1e24;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
    color: #fff;
    font-weight: 720;
}

.toast.error {
    border-color: #6f3030;
    background: #401e1e;
}

.is-busy .button,
.is-busy button {
    cursor: progress;
}

/* Homepage */

.home-page {
    min-height: 100%;
    background: #e9ebef;
}

.home-hero {
    position: relative;
    display: flex;
    min-height: 100svh;
    flex-direction: column;
    overflow: hidden;
    background-color: #f4f7f8;
    background-image: url("images/live-quiz-hero.png");
    background-position: center;
    background-size: cover;
    color: var(--ink);
}

.home-hero::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    background: linear-gradient(90deg, rgba(249, 251, 252, 0.98) 0%, rgba(249, 251, 252, 0.94) 34%, rgba(249, 251, 252, 0.58) 55%, rgba(249, 251, 252, 0.16) 76%, rgba(249, 251, 252, 0.08) 100%);
    content: "";
    pointer-events: none;
}

.home-header {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(1440px, calc(100% - 64px));
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    border-bottom: 1px solid rgba(23, 24, 29, 0.14);
}

.home-nav {
    display: flex;
    align-items: center;
    gap: 26px;
}

.home-nav > a:not(.button) {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.88rem;
    font-weight: 720;
    text-decoration: none;
}

.home-nav > a:not(.button):hover {
    color: #fff;
}

.home-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(1440px, calc(100% - 64px));
    flex: 1;
    align-items: center;
    margin: 0 auto;
    padding: 54px 0 72px;
}

.home-copy {
    width: min(640px, 48%);
}

.home-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: #505967;
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: uppercase;
}

.home-kicker span {
    width: 28px;
    height: 3px;
    background: var(--yellow);
}

.home-copy h1 {
    margin-bottom: 20px;
    color: #161a21;
    font-size: 4.75rem;
    font-weight: 900;
    line-height: 0.96;
}

.home-intro {
    width: min(550px, 100%);
    margin-bottom: 30px;
    color: #4f5864;
    font-size: 1.08rem;
    line-height: 1.65;
}

.hero-join {
    width: min(510px, 100%);
}

.hero-join > label {
    display: block;
    margin-bottom: 8px;
    color: #20252c;
    font-size: 0.82rem;
    font-weight: 800;
}

.hero-join > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 146px;
    gap: 9px;
}

.hero-join input {
    min-height: 57px;
    border: 2px solid #d5dae1;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 24, 29, 0.1);
    color: #15171c;
    font-size: 1.45rem;
    font-weight: 900;
    text-align: center;
}

.hero-join .button {
    min-height: 57px;
}

.home-host-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    color: #69717c;
    font-size: 0.84rem;
}

.home-host-actions a {
    color: #171b22;
    font-weight: 800;
    text-underline-offset: 4px;
}

/* Public account pages */

.public-shell {
    --public-top-gap: clamp(12px, 1.8vw, 24px);
    min-height: 100svh;
    padding-top: var(--public-top-gap);
    background: #eef0f3;
}

.public-header {
    display: flex;
    width: min(1240px, calc(100% - 40px));
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
}

.auth-grid {
    display: grid;
    width: min(1240px, calc(100% - 40px));
    min-height: calc(100svh - 100px - var(--public-top-gap));
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.8fr);
    margin: 0 auto 24px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.auth-context {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 70px;
    background: #eaf0ff;
    color: var(--ink);
}

.auth-context .section-label {
    color: var(--blue);
}

.auth-context h1 {
    width: min(620px, 100%);
    margin-bottom: 56px;
    font-size: 3.25rem;
    line-height: 1.04;
}

.auth-context-list {
    display: grid;
    gap: 0;
}

.auth-context-list > div {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 2px 16px;
    padding: 19px 0;
    border-top: 1px solid #cfd9ef;
}

.auth-context-list > div > span {
    grid-row: 1 / 3;
    color: var(--blue);
    font-size: 0.74rem;
    font-weight: 900;
}

.auth-context-list small {
    color: var(--muted);
}

.auth-form-wrap {
    display: grid;
    place-items: center;
    padding: 54px;
}

.auth-form {
    display: grid;
    width: min(400px, 100%);
    gap: 18px;
}

.auth-form :is(h1, h2) {
    margin-bottom: 2px;
    font-size: 2rem;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f3f4f6;
}

.segmented button {
    min-height: 38px;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
}

.segmented button.active {
    background: #fff;
    box-shadow: 0 1px 4px rgba(23, 24, 29, 0.12);
    color: var(--ink);
}

.auth-note,
.form-note,
.join-smallprint {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.load-error {
    width: min(620px, calc(100% - 40px));
    margin: 14vh auto;
    padding: 42px;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

/* Host application */

.host-app {
    display: grid;
    min-height: 100svh;
    grid-template-columns: 224px minmax(0, 1fr);
}

.host-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100svh;
    flex-direction: column;
    padding: 24px 16px 18px;
    border-right: 1px solid var(--line);
    background: #f8fafc;
    color: var(--ink);
}

.host-brand {
    padding: 0 8px 28px;
}

.host-brand .wordmark {
    width: 150px;
    height: 105px;
}

.host-nav {
    display: grid;
    gap: 4px;
}

.host-nav button {
    display: flex;
    min-height: 46px;
    align-items: center;
    padding: 0 13px;
    border-radius: 6px;
    background: transparent;
    color: #626c78;
    font-size: 0.87rem;
    font-weight: 760;
    text-align: left;
}

.host-nav button:hover {
    background: #e9eef4;
    color: var(--ink);
}

.host-nav button.active {
    background: var(--yellow);
    color: #19160c;
}

.sidebar-session {
    display: grid;
    gap: 3px;
    margin-top: auto;
    padding: 16px 13px;
    border-top: 1px solid var(--line);
}

.sidebar-session small,
.sidebar-session span {
    color: var(--muted);
    font-size: 0.72rem;
}

.sidebar-session strong {
    color: var(--blue);
    font-size: 1.35rem;
}

.host-workspace {
    min-width: 0;
}

.host-topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
}

.host-session-status {
    display: flex;
    align-items: center;
    gap: 11px;
}

.host-session-status > div {
    display: grid;
    line-height: 1.2;
}

.host-session-status strong {
    font-size: 0.9rem;
}

.host-session-status small {
    color: var(--muted);
    font-size: 0.72rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9a9eaa;
}

.status-dot.lobby {
    background: var(--green);
}

.status-dot.question_open {
    background: var(--blue);
}

.status-dot.answer_reveal {
    background: var(--yellow-deep);
}

.host-top-actions,
.heading-actions {
    display: flex;
    align-items: center;
    gap: 11px;
}

.host-user {
    padding-left: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.mobile-host-nav {
    display: none;
}

.host-content {
    width: min(1320px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 50px;
}

.workspace-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.workspace-heading h1 {
    margin: 0;
    font-size: 2.15rem;
    line-height: 1.08;
}

.workspace-card {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 24, 29, 0.05);
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
}

.card-heading.compact {
    align-items: center;
}

.card-heading h2 {
    margin: 0;
    font-size: 1.18rem;
}

.card-heading a {
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 800;
}

.phase-pill,
.count-badge,
.captain-label {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: #edf0ff;
    color: var(--blue);
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: uppercase;
}

.host-announcement {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-left: 4px solid var(--yellow);
    background: #fff7cf;
    font-size: 0.84rem;
}

.host-announcement strong {
    flex: 0 0 auto;
}

.live-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.82fr);
    gap: 16px;
}

.live-side {
    display: grid;
    align-content: start;
    gap: 16px;
}

.live-control-card .card-heading > div:first-child {
    display: grid;
    gap: 8px;
}

.host-clock {
    display: grid;
    min-width: 92px;
    text-align: right;
    color: var(--blue);
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 0.9;
}

.host-clock small {
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 750;
    text-transform: uppercase;
}

.host-clock.paused {
    color: var(--coral);
}

.host-question {
    padding: 26px 24px 24px;
}

.host-question > small {
    color: var(--muted);
    font-weight: 750;
}

.host-question h3 {
    margin: 8px 0 20px;
    font-size: 1.5rem;
    line-height: 1.28;
}

.host-answer-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.host-answer-list > div {
    display: grid;
    min-height: 54px;
    grid-template-columns: 30px 1fr;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.host-answer-list > div b {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 4px;
    background: #eef0f4;
    font-size: 0.75rem;
}

.host-answer-list > div.correct {
    border-color: #43b786;
    background: #effaf5;
}

.host-answer-list > div.correct b {
    background: var(--green);
    color: #fff;
}

.lobby-control {
    display: grid;
    min-height: 310px;
    place-content: center;
    padding: 30px;
    text-align: center;
}

.lobby-control span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 850;
    text-transform: uppercase;
}

.lobby-control strong {
    margin: 4px 0 10px;
    font-size: 3.4rem;
}

.lobby-control p {
    margin: 0;
    color: var(--muted);
}

.response-meter {
    display: grid;
    gap: 8px;
    padding: 18px 24px;
    border-top: 1px solid var(--line);
}

.response-meter > div:first-child {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.78rem;
}

.response-meter strong {
    color: var(--ink);
}

.meter {
    height: 8px;
    overflow: hidden;
    border-radius: 99px;
    background: #e9ebef;
}

.meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
    transition: width 220ms ease;
}

.command-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 18px 24px 22px;
    border-top: 1px solid var(--line);
}

.command-bar .button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.76rem;
}

.display-tool {
    overflow: hidden;
}

.mini-display {
    display: grid;
    min-height: 244px;
    place-content: center;
    gap: 6px;
    padding: 26px;
    background: #edf2ff;
    color: var(--ink);
    text-align: center;
}

.mini-display small,
.mini-display span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.mini-display strong {
    font-size: 1.5rem;
    line-height: 1.2;
}

.mini-display.lobby strong {
    color: var(--blue);
    font-size: 2.6rem;
}

.mini-display.question {
    place-content: space-between;
    align-content: stretch;
    text-align: left;
}

.mini-display.question > span {
    color: var(--yellow);
    text-align: right;
}

.mini-display.reveal {
    background: #0c6b4b;
}

.announcement-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 18px 20px 20px;
}

.session-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 17px 20px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.session-strip > div {
    display: grid;
}

.session-strip small {
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.session-strip strong {
    font-size: 0.95rem;
}

/* Quiz builder */

.generator-band {
    display: grid;
    grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1.35fr);
    gap: 36px;
    margin-bottom: 18px;
    padding: 28px;
    border-radius: 7px;
    background: var(--yellow);
}

.generator-band h2 {
    margin: 0;
    font-size: 1.45rem;
}

.generator-band .section-label {
    color: #6c5704;
}

.generator-form {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.65fr auto;
    align-items: end;
    gap: 9px;
}

.generator-form .field {
    color: #4c400d;
}

.quiz-editor {
    display: grid;
    gap: 16px;
}

.quiz-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 110px;
    align-items: end;
    gap: 12px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.quiz-title-row > div {
    display: grid;
    padding: 7px 12px;
    border-left: 1px solid var(--line);
}

.quiz-title-row > div span {
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.round-list {
    display: grid;
    gap: 14px;
}

.round-editor {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.round-header {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: #f6f7f8;
}

.round-header > span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.round-header > input {
    min-height: 38px;
    border: 0;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 850;
}

.round-header > input:focus {
    background: #fff;
}

.question-editor {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--line);
}

.question-number {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 5px;
    background: var(--blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
}

.question-fields {
    display: grid;
    gap: 14px;
}

.answer-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.answer-edit {
    display: grid;
    grid-template-columns: 18px 28px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.answer-edit.selected {
    border-color: var(--green);
    background: #f0faf6;
}

.answer-edit > input[type="radio"] {
    width: 16px;
    min-height: 16px;
    accent-color: var(--green);
}

.answer-edit > input:last-child {
    min-height: 38px;
    border: 0;
    background: transparent;
}

.answer-edit b {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 4px;
    background: #eceef2;
    font-size: 0.72rem;
}

.question-meta-fields {
    display: grid;
    grid-template-columns: 120px 0.75fr minmax(220px, 1.4fr) auto;
    align-items: end;
    gap: 9px;
}

.add-question {
    margin: 14px 20px 16px 66px;
    color: var(--blue);
}

.add-round {
    justify-self: start;
}

/* Team management */

.team-management-list {
    display: grid;
    gap: 13px;
}

.managed-team {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.managed-team > header {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 20px;
    padding: 18px 20px;
}

.managed-team > header > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-avatar,
.initial {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 5px;
    background: #e9edff;
    color: var(--blue);
    font-weight: 900;
}

.team-avatar {
    width: 42px;
    height: 42px;
}

.initial {
    width: 30px;
    height: 30px;
    font-size: 0.74rem;
}

.managed-team h2 {
    margin: 0;
    font-size: 1rem;
}

.managed-team header small {
    color: var(--muted);
}

.team-score {
    display: grid;
    text-align: right;
}

.team-score strong {
    font-size: 1.25rem;
}

.team-score span {
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.team-actions,
.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.member-list {
    border-top: 1px solid var(--line);
}

.member-row {
    display: grid;
    min-height: 55px;
    grid-template-columns: 32px minmax(130px, 1fr) auto 85px 150px auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-bottom: 1px solid #eceef1;
    font-size: 0.8rem;
}

.member-row:last-child {
    border-bottom: 0;
}

.member-row > span:not(.initial):not(.captain-label) {
    color: var(--muted);
}

.member-row select {
    min-height: 35px;
    font-size: 0.76rem;
}

.empty-row {
    display: block;
    padding: 18px 20px;
    color: var(--muted);
}

.people-table-card {
    overflow-x: auto;
}

.people-table {
    width: 100%;
    border-collapse: collapse;
}

.people-table th,
.people-table td {
    padding: 13px 17px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.people-table th {
    color: var(--muted);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.people-table td:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.empty-state {
    display: grid;
    min-height: 240px;
    place-content: center;
    gap: 4px;
    padding: 30px;
    border: 1px dashed #bfc3cc;
    border-radius: 7px;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    color: var(--ink);
}

/* Settings */

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
    gap: 16px;
}

.settings-section {
    align-self: start;
}

.settings-section > .field,
.settings-section > .toggle-row,
.settings-section > .button,
.settings-section > .form-note {
    margin-right: 22px;
    margin-left: 22px;
}

.settings-section > .field {
    margin-top: 18px;
}

.settings-section > .button {
    margin-top: 20px;
    margin-bottom: 22px;
}

.mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 20px;
}

.mode-option {
    display: grid;
    min-height: 112px;
    grid-template-columns: 18px 1fr;
    align-items: start;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
}

.mode-option.selected,
.mode-option:has(input:checked) {
    border-color: var(--blue);
    background: #f1f4ff;
}

.mode-option input {
    width: 17px;
    min-height: 17px;
    margin-top: 2px;
    accent-color: var(--blue);
}

.mode-option span {
    display: grid;
    gap: 5px;
}

.mode-option small {
    color: var(--muted);
    line-height: 1.45;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 17px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.toggle-row > span {
    display: grid;
    gap: 3px;
}

.toggle-row small {
    color: var(--muted);
}

.toggle-row input {
    width: 42px;
    min-height: 23px;
    appearance: none;
    border: 0;
    border-radius: 99px;
    background: #c5c9d1;
    cursor: pointer;
}

.toggle-row input::after {
    display: block;
    width: 17px;
    height: 17px;
    margin: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    content: "";
    transition: transform 140ms ease;
}

.toggle-row input:checked {
    background: var(--green);
}

.toggle-row input:checked::after {
    transform: translateX(19px);
}

/* TV display */

.tv-stage {
    display: grid;
    width: 100vw;
    min-height: 100vh;
    min-height: 100svh;
    grid-template-rows: 76px minmax(0, 1fr) 50px;
    overflow: hidden;
    background: #edf2f6;
    color: var(--ink);
}

.tv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
}

.tv-header .wordmark {
    width: 96px;
    height: 67px;
}

.tv-header-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--muted);
    font-size: 0.8rem;
}

.tv-content {
    min-height: 0;
    overflow: hidden;
}

.tv-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 0 34px;
    border-top: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.tv-footer strong {
    color: var(--ink);
}

.tv-announcement {
    position: fixed;
    z-index: 40;
    top: 76px;
    left: 50%;
    width: min(760px, calc(100% - 80px));
    padding: 12px 20px;
    border-radius: 0 0 7px 7px;
    background: var(--yellow);
    color: #18150b;
    font-weight: 850;
    text-align: center;
    transform: translateX(-50%);
}

.tv-centre {
    display: grid;
    height: 100%;
    place-content: center;
    padding: 50px;
    text-align: center;
}

.tv-kicker {
    margin-bottom: 12px;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.tv-centre h1,
.tv-lobby h1,
.tv-question h1,
.tv-reveal h1,
.tv-break-layout h1,
.tv-leaderboard-layout h1,
.podium-screen h1 {
    font-size: 3.65rem;
    line-height: 1.06;
}

.countdown-number {
    color: var(--blue);
    font-size: 9rem;
    line-height: 1;
}

.tv-lobby {
    display: grid;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 28px 60px;
    align-items: center;
    padding: 54px 7vw 30px;
}

.tv-lobby-copy h1 {
    max-width: 760px;
    margin-bottom: 25px;
}

.pin-display {
    display: inline-grid;
    gap: 2px;
    padding: 17px 22px;
    border-left: 5px solid var(--yellow);
    border: 1px solid var(--line);
    border-left: 5px solid var(--yellow);
    background: #fff;
    box-shadow: 0 12px 30px rgba(23, 24, 29, 0.08);
}

.pin-display span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 850;
    text-transform: uppercase;
}

.pin-display strong {
    color: var(--blue);
    font-size: 3rem;
    line-height: 1;
}

.lobby-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 25px;
    color: var(--muted);
}

.lobby-counts strong {
    color: var(--ink);
}

.tv-qr {
    display: grid;
    justify-items: center;
    padding: 18px;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 22px 50px rgba(23, 24, 29, 0.13);
}

.tv-qr img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
}

.tv-qr strong {
    margin-top: 8px;
    font-size: 1.15rem;
}

.tv-qr span {
    color: var(--muted);
    font-size: 0.72rem;
}

.joiner-rail {
    display: flex;
    grid-column: 1 / -1;
    min-height: 74px;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.joiner-rail > div {
    display: grid;
    min-width: 155px;
    grid-template-columns: 40px 1fr;
    gap: 0 9px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.joiner-rail .lobby-participant-avatar {
    display: grid;
    width: 40px;
    height: 40px;
    grid-row: 1 / 3;
    place-items: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .8);
    border-radius: 50%;
    background: var(--blue);
    object-fit: cover;
    font-weight: 900;
}

.joiner-rail .lobby-participant-avatar.team-avatar-stack {
    display: flex;
    overflow: visible;
    border: 0;
    background: transparent;
}

.joiner-rail small {
    color: var(--muted);
}

.joiner-rail > p {
    color: var(--muted);
}

.tv-question {
    display: grid;
    height: 100%;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 26px;
    padding: 42px 6vw 28px;
}

.tv-question-top {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 150px;
    align-items: center;
    gap: 44px;
}

.tv-question-top h1 {
    max-width: 1100px;
    margin: 0;
}

.tv-timer {
    display: grid;
    width: 138px;
    height: 138px;
    place-content: center;
    border: 6px solid var(--yellow);
    border-radius: 50%;
    text-align: center;
}

.tv-timer strong {
    font-size: 3rem;
    line-height: 0.9;
}

.tv-timer span {
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.66rem;
    text-transform: uppercase;
}

.tv-timer.paused {
    border-color: var(--coral);
}

.tv-answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tv-answer {
    display: grid;
    min-height: 98px;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-radius: 7px;
    color: #fff;
    font-size: 1.42rem;
    font-weight: 820;
}

.tv-answer b {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.68);
    border-radius: 5px;
}

.answer-0 {
    background: var(--tv-blue);
}

.answer-1 {
    background: var(--tv-teal);
}

.answer-2 {
    background: var(--tv-red);
}

.answer-3 {
    background: var(--tv-yellow);
    color: #17130a;
}

.answer-3 b {
    border-color: rgba(23, 19, 10, 0.5);
}

.tv-response-line {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 0.76rem;
}

.tv-response-line > div {
    height: 8px;
    overflow: hidden;
    border-radius: 99px;
    background: #dce3ea;
}

.tv-response-line i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--yellow);
}

.tv-response-line strong {
    color: var(--ink);
}

.tv-reveal {
    display: grid;
    height: 100%;
    grid-template-columns: minmax(0, 0.8fr) minmax(460px, 1.2fr);
    align-items: center;
    gap: 6vw;
    padding: 48px 7vw;
}

.reveal-answer > span {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border-radius: 7px;
    background: var(--green);
    font-size: 2rem;
    font-weight: 950;
}

.reveal-answer h1 {
    margin: 18px 0 13px;
}

.reveal-answer > p:last-child {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.answer-results {
    display: grid;
    gap: 11px;
}

.answer-results > div {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) minmax(120px, 1fr) 36px;
    align-items: center;
    gap: 14px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.answer-results > div.correct {
    border-color: var(--green);
    background: #eaf8f2;
}

.answer-results > div > span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.answer-results > div > span b {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 4px;
    background: #edf1f5;
}

.answer-results > div > i {
    height: 9px;
    overflow: hidden;
    border-radius: 99px;
    background: #e1e6eb;
}

.answer-results em {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--yellow);
}

.tv-break-layout,
.tv-leaderboard-layout {
    display: grid;
    height: 100%;
    grid-template-columns: minmax(0, 0.72fr) minmax(440px, 1.28fr);
    align-items: center;
    gap: 7vw;
    padding: 50px 7vw;
}

.tv-break-layout > div:first-child p:last-child,
.tv-leaderboard-layout > div:first-child p:last-child {
    color: var(--muted);
    font-size: 1rem;
}

.tv-leader-rows,
.player-leader-rows {
    display: grid;
    gap: 8px;
}

.tv-leader-rows > div {
    display: grid;
    min-height: 57px;
    grid-template-columns: 42px minmax(0, 1fr) auto 95px;
    align-items: center;
    gap: 12px;
    padding: 7px 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.tv-leader-rows > div:first-child {
    border-color: var(--yellow);
}

.tv-leader-rows b {
    color: var(--blue);
    font-size: 1.25rem;
}

.tv-leader-rows small {
    color: var(--muted);
}

.tv-leader-rows strong {
    text-align: right;
}

.podium-screen {
    position: relative;
    display: grid;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    padding: 38px 6vw 24px;
}

.winner-heading {
    position: relative;
    z-index: 2;
    text-align: center;
}

.winner-heading h1 {
    margin: 0 0 7px;
    color: #b28000;
}

.winner-heading > span {
    color: var(--muted);
}

.podium {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 12px;
    padding-top: 28px;
}

.podium-place {
    display: grid;
    width: min(260px, 27%);
    place-items: center;
    align-content: start;
    gap: 7px;
    padding: 22px 15px;
    border-radius: 7px 7px 0 0;
    border: 1px solid var(--line);
    border-bottom: 0;
    background: #fff;
    box-shadow: 0 16px 34px rgba(23, 24, 29, 0.08);
    text-align: center;
}

.podium-place > span {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    background: #edf1f5;
    font-size: 1.35rem;
    font-weight: 950;
}

.podium-place small {
    color: var(--muted);
}

.podium-place.first {
    min-height: 255px;
    background: var(--yellow);
    color: #17130a;
}

.podium-place.first small {
    color: rgba(23, 19, 10, 0.6);
}

.podium-place.second {
    min-height: 195px;
}

.podium-place.third {
    min-height: 155px;
}

.confetti i {
    position: absolute;
    z-index: 1;
    top: -20px;
    left: calc((var(--i) * 5.6%) + 1%);
    width: 9px;
    height: 22px;
    background: var(--yellow);
    opacity: 0.72;
    transform: rotate(calc(var(--i) * 19deg));
    animation: confettiFall 4s linear infinite;
    animation-delay: calc(var(--i) * -0.19s);
}

.confetti i:nth-child(3n) {
    background: var(--teal);
}

.confetti i:nth-child(3n + 1) {
    background: var(--coral);
}

@keyframes confettiFall {
    to {
        top: 105%;
        transform: rotate(560deg);
    }
}

/* Player controller */

.player-page {
    display: grid;
    min-height: 100svh;
    place-items: center;
    padding: 24px;
    background: #121319;
}

.player-controller {
    display: flex;
    width: min(430px, 100%);
    min-height: min(820px, calc(100svh - 48px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #34363f;
    border-radius: 8px;
    background: #f5f6f8;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
}

.player-header,
.player-game-header {
    display: flex;
    min-height: 69px;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: #191b21;
}

.player-header .wordmark,
.player-game-header .wordmark {
    width: 84px;
    height: 59px;
}

.connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.connection-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e2a224;
}

.connection-badge.online i {
    background: #34ce89;
}

.connection-badge.offline i {
    background: var(--coral);
}

.player-join {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    padding: 34px 26px;
}

.player-join h1 {
    margin-bottom: 24px;
    font-size: 2rem;
    line-height: 1.08;
}

.player-join form {
    display: grid;
    min-width: 0;
    max-width: 100%;
    gap: 16px;
}

.player-join .field,
.join-session-title,
.team-choice,
.join-option-note,
.join-smallprint {
    min-width: 0;
    max-width: 100%;
}

.player-join .field input,
.player-join .field select {
    min-width: 0;
    max-width: 100%;
}

.join-session-title h1,
.join-option-note,
.join-smallprint {
    overflow-wrap: anywhere;
}

.player-join .segmented button {
    min-width: 0;
    padding: 6px 8px;
    line-height: 1.2;
    white-space: normal;
}

.player-join .field input,
.player-join .field select {
    min-height: 52px;
}

.player-join .field input[inputmode="numeric"] {
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
}

.player-host-link {
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
    text-underline-offset: 4px;
}

.identity-step {
    justify-content: flex-start;
    overflow-y: auto;
}

.back-action {
    align-self: start;
    margin-bottom: 22px;
    color: var(--muted);
}

.join-session-title {
    margin-bottom: 23px;
}

.join-session-title > span {
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.join-session-title h1 {
    margin: 5px 0 0;
}

.team-choice {
    margin-top: 2px;
}

.or-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.69rem;
}

.or-divider::before,
.or-divider::after {
    height: 1px;
    background: var(--line);
    content: "";
}

.player-announcement {
    padding: 10px 16px;
    background: var(--yellow);
    color: #18150b;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
}

.player-identity {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.player-initial {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 6px;
    background: #e9edff;
    color: var(--blue);
    font-weight: 950;
}

.player-identity > div:not(.player-score) {
    display: grid;
    line-height: 1.25;
}

.player-identity small {
    color: var(--muted);
    font-size: 0.7rem;
}

.player-score {
    display: grid;
    text-align: right;
    line-height: 1.1;
}

.player-score span {
    color: var(--muted);
    font-size: 0.66rem;
    text-transform: uppercase;
}

.player-main {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
}

.player-footer {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-top: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.7rem;
}

.player-footer .plain-action {
    color: var(--muted);
    font-size: 0.7rem;
}

.player-waiting,
.player-discuss,
.player-locked,
.player-result,
.vote-recorded,
.player-reveal {
    display: grid;
    min-height: 100%;
    flex: 1;
    place-content: center;
    justify-items: center;
    padding: 30px 24px;
    text-align: center;
}

.player-waiting h1,
.player-discuss h1,
.player-locked h1,
.player-result h1,
.vote-recorded h1,
.player-reveal h1 {
    margin-bottom: 11px;
    font-size: 1.75rem;
    line-height: 1.15;
}

.player-waiting > p,
.player-discuss > p,
.player-locked > p,
.player-result > p,
.vote-recorded > p,
.player-reveal > p {
    color: var(--muted);
}

.waiting-pulse {
    width: 18px;
    height: 18px;
    margin-bottom: 24px;
    border: 5px solid #c7d0f4;
    border-radius: 50%;
    background: var(--blue);
    animation: waitingPulse 1.6s ease-in-out infinite;
}

@keyframes waitingPulse {
    50% {
        box-shadow: 0 0 0 14px rgba(49, 87, 224, 0.08);
        transform: scale(1.08);
    }
}

.player-team-summary {
    width: 100%;
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    text-align: left;
}

.player-team-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
}

.player-team-summary > div span {
    color: var(--muted);
    font-size: 0.72rem;
}

.player-team-summary > div strong {
    color: var(--blue);
    font-size: 1.18rem;
}

.player-team-summary ul {
    margin: 0;
    padding: 4px 15px 8px;
    list-style: none;
}

.player-team-summary li {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eceef1;
    font-size: 0.8rem;
}

.player-team-summary li:last-child {
    border-bottom: 0;
}

.player-team-summary li b {
    color: var(--blue);
    font-size: 0.65rem;
    text-transform: uppercase;
}

.player-countdown {
    display: grid;
    min-height: 100%;
    flex: 1;
    place-content: center;
    justify-items: center;
    background: var(--blue);
    color: #fff;
}

.player-countdown span {
    font-weight: 850;
    text-transform: uppercase;
}

.player-countdown strong {
    color: var(--yellow);
    font-size: 7rem;
    line-height: 1;
}

.discussion-timer {
    display: grid;
    width: 112px;
    height: 112px;
    margin-top: 22px;
    place-content: center;
    border: 5px solid var(--yellow);
    border-radius: 50%;
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 0.9;
}

.discussion-timer span {
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.62rem;
    text-transform: uppercase;
}

.phone-question {
    display: grid;
    flex: 1;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 15px;
    padding: 20px 16px 17px;
}

.phone-question-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.phone-question-meta strong {
    color: var(--blue);
}

.phone-question h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.24;
}

.phone-answer-grid {
    display: grid;
    min-height: 320px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.phone-answer {
    display: grid;
    min-width: 0;
    min-height: 150px;
    grid-template-rows: 39px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    padding: 12px;
    border-radius: 7px;
    color: #fff;
    font-weight: 820;
    text-align: left;
}

.phone-answer b {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.66);
    border-radius: 5px;
}

.phone-answer span {
    align-self: center;
    overflow-wrap: anywhere;
}

.phone-answer.answer-3 {
    color: #17130a;
}

.phone-answer.answer-3 b {
    border-color: rgba(23, 19, 10, 0.45);
}

.player-locked > span,
.player-reveal .section-label,
.vote-recorded .section-label {
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.player-locked > b,
.vote-recorded > b,
.player-reveal > span {
    display: grid;
    width: 82px;
    height: 82px;
    margin: 18px 0;
    place-items: center;
    border-radius: 7px;
    background: var(--blue);
    color: #fff;
    font-size: 2.2rem;
}

.player-reveal.right {
    background: #eaf8f2;
}

.player-reveal.right > span {
    background: var(--green);
}

.player-reveal.wrong {
    background: #fff0ef;
}

.player-reveal.wrong > span {
    background: var(--coral);
}

.captain-vote {
    display: grid;
    gap: 13px;
    padding: 20px 16px;
}

.captain-vote h1 {
    margin: 0;
    font-size: 1.55rem;
}

.captain-vote > p {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.vote-totals {
    display: grid;
    gap: 8px;
}

.vote-totals button {
    display: grid;
    min-height: 58px;
    grid-template-columns: 32px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    text-align: left;
}

.vote-totals button:hover {
    border-color: var(--blue);
}

.vote-totals button > b {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 4px;
    background: #edf0ff;
    color: var(--blue);
}

.vote-totals button > strong {
    color: var(--blue);
    font-size: 1.15rem;
    text-align: right;
}

.player-board {
    padding: 24px 18px;
}

.player-board h1 {
    margin-bottom: 18px;
    font-size: 1.6rem;
}

.player-leader-rows > div {
    display: grid;
    min-height: 50px;
    grid-template-columns: 28px minmax(0, 1fr) auto 65px;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.player-leader-rows > div:first-child {
    border-left: 4px solid var(--yellow);
}

.player-leader-rows > div b {
    color: var(--blue);
}

.player-leader-rows > div small {
    color: var(--muted);
    font-size: 0.64rem;
}

.player-leader-rows > div strong {
    text-align: right;
}

.result-rank {
    color: var(--blue);
    font-size: 4rem;
    font-weight: 950;
    line-height: 1;
}

.player-result > strong {
    margin-bottom: 8px;
    font-size: 1.3rem;
}

/* Cohesive live-quiz experience */

:where(button, a, input, textarea, select):focus-visible {
    outline: 3px solid #172a72;
    outline-offset: 3px;
}

.button,
input,
textarea,
select {
    border-radius: 10px;
}

.button-primary {
    border-color: #ffd43b;
    background: linear-gradient(135deg, #ffe05d, #ffc928);
    box-shadow: 0 8px 24px rgba(255, 201, 40, 0.2);
}

.button-primary:hover {
    border-color: #ffe780;
    background: linear-gradient(135deg, #ffe780, #ffd43b);
}

.button-ghost {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(8, 13, 35, 0.35);
    color: #fff;
    backdrop-filter: blur(10px);
}

.button-ghost:hover,
.button-light {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.home-hero {
    background-position: center;
    color: #fff;
}

.home-hero::before {
    background:
        radial-gradient(circle at 48% 42%, rgba(95, 61, 196, 0.22), transparent 30%),
        linear-gradient(90deg, rgba(6, 10, 30, 0.99) 0%, rgba(7, 12, 34, 0.95) 37%, rgba(7, 12, 34, 0.68) 58%, rgba(7, 12, 34, 0.2) 82%, rgba(7, 12, 34, 0.12) 100%);
}

.home-header {
    border-bottom-color: rgba(255, 255, 255, 0.16);
}

.home-header .wordmark {
    width: 100px;
    height: 70px;
}

.home-copy {
    width: min(680px, 51%);
}

.home-kicker,
.home-intro {
    color: rgba(255, 255, 255, 0.74);
}

.home-copy h1 {
    color: #fff;
    font-size: clamp(3.8rem, 5vw, 5.25rem);
    letter-spacing: -0.045em;
    text-shadow: 0 12px 45px rgba(0, 0, 0, 0.3);
}

.home-intro {
    margin-bottom: 22px;
    font-size: 1.06rem;
}

.home-primary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.hero-join {
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: rgba(5, 10, 29, 0.52);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(14px);
}

.hero-join > label {
    color: rgba(255, 255, 255, 0.72);
}

.hero-join > label strong {
    color: #fff;
}

.home-flow {
    position: relative;
    z-index: 2;
    display: grid;
    width: min(1440px, calc(100% - 64px));
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 auto 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 16px;
    background: rgba(5, 9, 27, 0.72);
    box-shadow: var(--game-shadow);
    backdrop-filter: blur(16px);
}

.home-flow > div {
    display: grid;
    min-height: 88px;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.home-flow > div:last-child {
    border-right: 0;
}

.home-flow > div > span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(255, 212, 59, 0.42);
    border-radius: 50%;
    background: rgba(255, 212, 59, 0.1);
    color: var(--yellow);
    font-weight: 900;
}

.home-flow p {
    display: grid;
    margin: 0;
}

.home-flow strong {
    color: #fff;
}

.home-flow small {
    color: rgba(255, 255, 255, 0.58);
}

.host-app {
    background: #f3f5fa;
}

.host-sidebar {
    border-right: 0;
    background:
        radial-gradient(circle at 10% 92%, rgba(108, 92, 255, 0.22), transparent 28%),
        var(--navy);
    color: #fff;
}

.host-nav button {
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.58);
}

.host-nav button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.host-nav button.active {
    background: linear-gradient(135deg, rgba(108, 92, 255, 0.95), rgba(49, 87, 224, 0.95));
    box-shadow: 0 10px 28px rgba(49, 87, 224, 0.28);
    color: #fff;
}

.sidebar-session {
    border-top-color: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-session small,
.sidebar-session span {
    color: rgba(255, 255, 255, 0.52);
}

.sidebar-session strong {
    color: var(--yellow);
}

.host-topbar {
    border-bottom-color: #e3e6ee;
    box-shadow: 0 6px 22px rgba(22, 30, 55, 0.04);
}

.workspace-heading {
    align-items: center;
}

.workspace-heading h1 {
    letter-spacing: -0.035em;
}

.workspace-subtitle {
    max-width: 680px;
    margin: 9px 0 0;
    color: var(--muted);
}

.workspace-card {
    border-color: #e1e5ed;
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(20, 27, 50, 0.06);
}

.save-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 750;
}

.save-state i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.save-state.unsaved {
    color: #8d6400;
}

.save-state.unsaved i {
    background: var(--yellow-deep);
}

.host-lobby-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
    gap: 18px;
}

.host-invite-card {
    position: relative;
    display: grid;
    min-height: 520px;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: center;
    gap: 28px;
    overflow: hidden;
    padding: 38px;
    border: 1px solid rgba(126, 110, 255, 0.45);
    border-radius: 20px;
    background:
        radial-gradient(circle at 84% 18%, rgba(25, 211, 223, 0.18), transparent 26%),
        radial-gradient(circle at 18% 90%, rgba(139, 92, 246, 0.32), transparent 34%),
        linear-gradient(145deg, #090f2d 0%, #13123c 58%, #201052 100%);
    box-shadow: var(--game-shadow);
    color: #fff;
}

.host-invite-card::after {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity: 0.22;
    content: "";
    pointer-events: none;
}

.host-invite-copy,
.host-qr-card {
    position: relative;
    z-index: 1;
}

.live-chip {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    padding: 0 12px;
    border: 1px solid rgba(63, 225, 163, 0.28);
    border-radius: 999px;
    background: rgba(25, 155, 103, 0.14);
    color: #86f0c5;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.live-chip i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #41e0a2;
    box-shadow: 0 0 0 5px rgba(65, 224, 162, 0.1);
}

.host-invite-copy .section-label {
    color: rgba(255, 255, 255, 0.55);
}

.host-lobby-pin {
    display: block;
    margin-bottom: 26px;
    color: var(--yellow);
    font-size: clamp(3.4rem, 5.3vw, 5.5rem);
    letter-spacing: 0.06em;
    line-height: 0.9;
    text-shadow: 0 0 36px rgba(255, 212, 59, 0.22);
}

.host-invite-copy h2 {
    margin-bottom: 10px;
    font-size: 1.7rem;
}

.host-invite-copy > p:last-of-type {
    max-width: 520px;
    color: rgba(255, 255, 255, 0.65);
}

.host-invite-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 25px;
}

.host-qr-card {
    display: grid;
    justify-items: center;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35), 0 0 0 8px rgba(108, 92, 255, 0.14);
    color: var(--ink);
}

.host-qr-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
}

.host-qr-card strong {
    margin-top: 7px;
    font-size: 1.05rem;
}

.host-qr-card span {
    color: var(--muted);
    font-size: 0.74rem;
}

.room-checklist-card {
    display: flex;
    flex-direction: column;
}

.room-checklist {
    display: grid;
    padding: 8px 20px 4px;
}

.room-checklist > :where(button, a, div) {
    display: grid;
    min-height: 78px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: inherit;
    text-align: left;
    text-decoration: none;
}

.room-checklist > :where(button, a, div):last-child {
    border-bottom: 0;
}

.room-checklist > :where(button, a) b {
    color: var(--blue);
    font-size: 0.72rem;
}

.room-checklist > :where(button, a, div) > span:nth-child(2) {
    display: grid;
}

.room-checklist small {
    color: var(--muted);
}

.check-state {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #edf0f6;
    color: var(--muted);
    font-weight: 900;
}

.check-state.complete {
    background: #e7f8f1;
    color: #126d4f;
}

.lobby-player-list {
    display: flex;
    min-height: 94px;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 7px;
    margin: 4px 20px 20px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.lobby-player-list > span {
    display: inline-flex;
    height: 32px;
    align-items: center;
    gap: 7px;
    padding: 0 10px 0 4px;
    border-radius: 999px;
    background: #f0f2f8;
    font-size: 0.75rem;
    font-weight: 750;
}

.lobby-player-list i {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 0.67rem;
    font-style: normal;
}

.lobby-player-list p,
.centred-note {
    color: var(--muted);
    text-align: center;
}

.room-checklist-card > .button,
.room-checklist-card > .form-note {
    margin-right: 20px;
    margin-left: 20px;
}

.room-checklist-card > .form-note {
    margin-top: 9px;
    margin-bottom: 20px;
}

.lobby-session-strip {
    margin-top: 18px;
}

.finished-host-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 18px;
}

.final-standings-card .player-leader-rows {
    padding: 8px 20px 20px;
}

.next-game-card {
    display: grid;
    align-content: center;
    gap: 12px;
    padding: 30px;
}

.next-game-card h2,
.next-game-card p {
    margin: 0;
}

.next-game-card > p:not(.section-label) {
    margin-bottom: 12px;
    color: var(--muted);
}

.settings-inline-note {
    margin: 0 20px 18px;
}

.builder-live-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 15px;
    border: 1px solid #eadca8;
    border-radius: 12px;
    background: #fff9df;
    color: #6e5710;
    font-size: 0.8rem;
}

.builder-live-note span {
    color: #7f6d36;
}

.generator-form {
    grid-template-columns: minmax(220px, 1fr) auto auto;
}

.tv-stage {
    position: relative;
    background:
        radial-gradient(circle at 12% 86%, rgba(73, 58, 211, 0.35), transparent 29%),
        radial-gradient(circle at 88% 12%, rgba(13, 164, 203, 0.22), transparent 26%),
        linear-gradient(145deg, #050919 0%, #090f29 48%, #130b34 100%);
    color: #fff;
}

.tv-header,
.tv-footer {
    position: relative;
    z-index: 3;
    border-color: rgba(255, 255, 255, 0.11);
    background: rgba(5, 9, 25, 0.76);
    color: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
}

.tv-header-meta,
.tv-footer strong {
    color: rgba(255, 255, 255, 0.76);
}

.tv-content {
    position: relative;
}

.tv-content::before {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.17;
    content: "";
    pointer-events: none;
}

.tv-content > * {
    position: relative;
    z-index: 1;
}

.tv-kicker {
    color: var(--cyan);
    letter-spacing: 0.08em;
}

.tv-lobby {
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 32px 7vw;
    padding-top: 44px;
}

.tv-lobby-copy h1 {
    margin-bottom: 30px;
    color: #fff;
    font-size: clamp(3.2rem, 5vw, 5.4rem);
    letter-spacing: -0.045em;
}

.pin-display {
    padding: 18px 26px;
    border-color: rgba(255, 255, 255, 0.17);
    border-left: 5px solid var(--yellow);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
}

.pin-display span,
.lobby-counts,
.tv-response-line,
.reveal-answer > p:last-child,
.tv-break-layout > div:first-child p:last-child,
.tv-leaderboard-layout > div:first-child p:last-child {
    color: rgba(255, 255, 255, 0.56);
}

.pin-display strong {
    color: var(--yellow);
    font-size: 4.25rem;
    letter-spacing: 0.08em;
}

.lobby-counts strong,
.tv-response-line strong {
    color: #fff;
}

.tv-qr {
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38), 0 0 0 10px rgba(108, 92, 255, 0.12);
}

.joiner-rail > div {
    border-color: rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    backdrop-filter: blur(10px);
}

.joiner-rail small,
.joiner-rail > p {
    color: rgba(255, 255, 255, 0.5);
}

.tv-centre h1,
.tv-question h1,
.tv-reveal h1,
.tv-break-layout h1,
.tv-leaderboard-layout h1,
.podium-screen h1 {
    color: #fff;
    letter-spacing: -0.04em;
}

.countdown-number {
    color: var(--yellow);
    text-shadow: 0 0 70px rgba(255, 212, 59, 0.32);
}

.tv-timer {
    border-color: var(--yellow);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 50px rgba(255, 212, 59, 0.16);
}

.tv-timer span {
    color: rgba(255, 255, 255, 0.54);
}

.tv-answer {
    min-height: 112px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.tv-response-line > div {
    background: rgba(255, 255, 255, 0.15);
}

.answer-results > div,
.tv-leader-rows > div {
    border-color: rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    backdrop-filter: blur(10px);
}

.answer-results > div.correct {
    border-color: rgba(65, 224, 162, 0.7);
    background: rgba(20, 155, 103, 0.22);
}

.answer-results > div > span b {
    background: rgba(255, 255, 255, 0.12);
}

.answer-results > div > i {
    background: rgba(255, 255, 255, 0.12);
}

.tv-leader-rows > div:first-child {
    border-color: var(--yellow);
    background: rgba(255, 212, 59, 0.13);
}

.tv-leader-rows b {
    color: var(--yellow);
}

.tv-leader-rows small {
    color: rgba(255, 255, 255, 0.48);
}

.winner-heading h1 {
    color: var(--yellow);
}

.winner-heading > span {
    color: rgba(255, 255, 255, 0.58);
}

.podium-place {
    border-color: rgba(255, 255, 255, 0.15);
    border-radius: 16px 16px 0 0;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(12px);
}

.podium-place > span {
    background: rgba(255, 255, 255, 0.12);
}

.podium-place small {
    color: rgba(255, 255, 255, 0.52);
}

.tv-route-stage {
    grid-template-rows: 76px minmax(0, 1fr) 50px;
}

.tv-route-error {
    display: grid;
    max-width: 900px;
    place-content: center;
    margin: auto;
    padding: 7vw;
    text-align: center;
}

.tv-route-error h1 {
    margin-bottom: 15px;
    color: #fff;
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 1.04;
}

.tv-route-error p:last-child {
    color: rgba(255, 255, 255, 0.58);
    font-size: 1.1rem;
}

.player-page {
    background:
        radial-gradient(circle at 15% 90%, rgba(108, 92, 255, 0.34), transparent 28%),
        radial-gradient(circle at 90% 8%, rgba(25, 211, 223, 0.15), transparent 26%),
        var(--navy);
}

.player-controller {
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    background: #f4f6fa;
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.52);
}

.player-header,
.player-game-header {
    background: rgba(6, 10, 29, 0.98);
}

.player-join {
    position: relative;
    background:
        radial-gradient(circle at 86% 12%, rgba(25, 211, 223, 0.12), transparent 25%),
        radial-gradient(circle at 10% 90%, rgba(108, 92, 255, 0.23), transparent 30%),
        linear-gradient(160deg, #0a102b, #101339 70%, #171040);
    color: #fff;
}

.player-join::before {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity: 0.13;
    content: "";
    pointer-events: none;
}

.player-join > * {
    position: relative;
    z-index: 1;
}

.player-join .section-label,
.join-session-title > span {
    color: var(--cyan);
}

.player-join .field {
    color: rgba(255, 255, 255, 0.72);
}

.player-join-intro {
    margin: -14px 0 22px;
    color: rgba(255, 255, 255, 0.58);
}

.player-join .segmented {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
}

.player-join .segmented button {
    color: rgba(255, 255, 255, 0.62);
}

.player-join .segmented button.active {
    background: var(--electric);
    color: #fff;
}

.player-join .segmented button:disabled {
    color: rgba(255, 255, 255, 0.32);
}

.player-host-link,
.join-smallprint,
.join-option-note,
.player-route-state > p:last-child {
    color: rgba(255, 255, 255, 0.5);
}

.join-option-note {
    margin: -5px 0 0;
    font-size: 0.75rem;
}

.back-action {
    color: rgba(255, 255, 255, 0.62);
}

.inline-error {
    margin-bottom: 17px;
    padding: 11px 13px;
    border: 1px solid rgba(255, 111, 111, 0.42);
    border-radius: 10px;
    background: rgba(200, 59, 59, 0.16);
    color: #ffd2d2;
    font-size: 0.82rem;
}

.player-route-state {
    align-items: center;
    text-align: center;
}

.player-route-state .waiting-pulse {
    margin-right: auto;
    margin-left: auto;
    border-color: rgba(255, 255, 255, 0.32);
    background: var(--yellow);
}

.player-main {
    background: #f4f6fa;
}

.player-waiting {
    background:
        radial-gradient(circle at 50% 105%, rgba(108, 92, 255, 0.16), transparent 36%),
        #f4f6fa;
}

.phone-question {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.phone-answer {
    border-radius: 15px;
    box-shadow: 0 9px 20px rgba(17, 24, 50, 0.12);
    transition: opacity 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.phone-answer.selected {
    z-index: 2;
    box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--electric), 0 12px 28px rgba(17, 24, 50, 0.22);
    transform: translateY(-2px);
}

.phone-answer.not-selected {
    opacity: 1;
    box-shadow: 0 5px 14px rgba(17, 24, 50, 0.12);
    transform: scale(0.985);
}

.phone-answer:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -7px;
    box-shadow: 0 0 0 4px #172a72, 0 0 0 7px #fff, 0 12px 28px rgba(17, 24, 50, 0.22);
}

.phone-answer.answer-3:focus-visible {
    outline-color: #172a72;
}

.answer-confirm-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 0 -2px;
    padding: 10px 11px;
    border: 1px solid #d9deeb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 -8px 25px rgba(18, 25, 51, 0.08);
}

.answer-confirm-bar > span {
    display: grid;
    min-width: 0;
}

.answer-confirm-bar small {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
}

.answer-confirm-bar strong {
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-inline-note,
.join-option-note {
    line-height: 1.5;
}

/* Light visual direction */

.home-page,
.home-hero {
    background-color: #f7f9fc;
    color: var(--ink);
}

.home-hero::before {
    background:
        radial-gradient(circle at 48% 42%, rgba(108, 92, 255, 0.08), transparent 30%),
        linear-gradient(90deg, rgba(249, 251, 255, 0.99) 0%, rgba(249, 251, 255, 0.96) 38%, rgba(249, 251, 255, 0.72) 60%, rgba(249, 251, 255, 0.2) 83%, rgba(249, 251, 255, 0.1) 100%);
}

.home-header {
    min-height: 72px;
    margin-top: 14px;
    padding: 0 16px;
    border: 1px solid rgba(211, 217, 229, 0.88);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 35px rgba(28, 38, 65, 0.08);
    backdrop-filter: blur(14px);
}

.home-nav > a:not(.button) {
    color: #303746;
}

.home-nav > a:not(.button):hover {
    color: var(--blue);
}

.home-kicker {
    color: #596474;
}

.home-copy h1 {
    color: #141924;
    text-shadow: none;
}

.home-intro {
    color: #566171;
}

.button-ghost {
    border-color: #d8ddea;
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink);
    box-shadow: 0 8px 22px rgba(23, 30, 52, 0.08);
}

.button-ghost:hover {
    border-color: #b8c0d2;
    background: #fff;
    color: var(--ink);
}

.hero-join {
    border-color: rgba(205, 211, 224, 0.9);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 46px rgba(31, 41, 68, 0.1);
}

.hero-join > label,
.hero-join > label strong {
    color: #303746;
}

.home-flow {
    border-color: rgba(210, 215, 228, 0.95);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 45px rgba(28, 38, 65, 0.1);
}

.home-flow > div {
    border-right-color: #e3e7ef;
}

.home-flow > div > span {
    border-color: rgba(49, 87, 224, 0.2);
    background: #edf1ff;
    color: var(--blue);
}

.home-flow strong {
    color: var(--ink);
}

.home-flow small {
    color: var(--muted);
}

.host-sidebar {
    border-right: 1px solid #e1e5ed;
    background: #fff;
    color: var(--ink);
}

.host-nav button {
    color: #687283;
}

.host-nav button:hover {
    background: #f0f3f8;
    color: var(--ink);
}

.host-nav button.active {
    background: #edf1ff;
    box-shadow: none;
    color: var(--blue);
}

.sidebar-session {
    border-top-color: #e1e5ed;
    background: #f6f8fc;
}

.sidebar-session small,
.sidebar-session span {
    color: var(--muted);
}

.sidebar-session strong {
    color: var(--blue);
}

.host-invite-card {
    border-color: #d9e0f4;
    background:
        radial-gradient(circle at 86% 16%, rgba(25, 211, 223, 0.13), transparent 27%),
        radial-gradient(circle at 12% 92%, rgba(139, 92, 246, 0.1), transparent 34%),
        linear-gradient(145deg, #ffffff 0%, #f6f8ff 55%, #eef4ff 100%);
    box-shadow: 0 22px 55px rgba(43, 57, 94, 0.12);
    color: var(--ink);
}

.host-invite-card::after {
    background-image: radial-gradient(rgba(49, 87, 224, 0.11) 1px, transparent 1px);
    opacity: 0.3;
}

.live-chip {
    border-color: rgba(20, 155, 103, 0.2);
    background: #eaf8f2;
    color: #126d4f;
}

.host-invite-copy .section-label,
.host-invite-copy > p:last-of-type {
    color: var(--muted);
}

.host-lobby-pin {
    color: var(--blue);
    text-shadow: none;
}

.host-invite-copy h2 {
    color: var(--ink);
}

.host-invite-card .button-light {
    border-color: #d5dae6;
    background: #fff;
    color: var(--ink);
}

.host-qr-card {
    border-color: #e0e4ed;
    box-shadow: 0 22px 50px rgba(36, 48, 80, 0.15), 0 0 0 8px rgba(49, 87, 224, 0.05);
}

.mini-display.question > span {
    color: #705600;
}

.mini-display.reveal {
    background: #0c6b4b;
    color: #fff;
}

.mini-display.reveal small,
.mini-display.reveal span {
    color: rgba(255, 255, 255, 0.82);
}

.mini-display.reveal strong {
    color: #fff;
}

.tv-stage {
    background:
        radial-gradient(circle at 10% 88%, rgba(108, 92, 255, 0.12), transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(25, 211, 223, 0.1), transparent 28%),
        linear-gradient(145deg, #f8faff 0%, #f1f5fb 52%, #f8f4ff 100%);
    color: var(--ink);
}

.tv-header,
.tv-footer {
    border-color: #dfe4ee;
    background: rgba(255, 255, 255, 0.86);
    color: var(--muted);
}

.tv-header-meta,
.tv-footer strong {
    color: #4d5666;
}

.tv-content::before {
    background-image: radial-gradient(rgba(49, 87, 224, 0.14) 1px, transparent 1px);
    opacity: 0.16;
}

.tv-kicker {
    color: var(--blue);
}

.tv-lobby-copy h1,
.tv-centre h1,
.tv-question h1,
.tv-reveal h1,
.tv-break-layout h1,
.tv-leaderboard-layout h1,
.podium-screen h1 {
    color: var(--ink);
}

.pin-display {
    border-color: #dfe4ee;
    border-left-color: var(--yellow);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 38px rgba(35, 46, 78, 0.1);
}

.pin-display span,
.lobby-counts,
.tv-response-line,
.reveal-answer > p:last-child,
.tv-break-layout > div:first-child p:last-child,
.tv-leaderboard-layout > div:first-child p:last-child {
    color: var(--muted);
}

.pin-display strong {
    color: var(--blue);
}

.lobby-counts strong,
.tv-response-line strong {
    color: var(--ink);
}

.tv-qr {
    border-color: #dfe4ed;
    box-shadow: 0 26px 62px rgba(39, 52, 87, 0.16), 0 0 0 9px rgba(108, 92, 255, 0.05);
}

.joiner-rail > div {
    border-color: #dfe4ed;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
}

.joiner-rail small,
.joiner-rail > p {
    color: var(--muted);
}

.countdown-number {
    color: var(--blue);
    text-shadow: 0 0 60px rgba(49, 87, 224, 0.16);
}

.tv-timer {
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 14px 38px rgba(42, 54, 88, 0.1);
}

.tv-timer span {
    color: var(--muted);
}

.tv-response-line > div,
.answer-results > div > i {
    background: #dfe5ee;
}

.answer-results > div,
.tv-leader-rows > div {
    border-color: #dfe4ed;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
}

.answer-results > div.correct {
    border-color: rgba(20, 155, 103, 0.42);
    background: #eaf8f2;
}

.answer-results > div > span b {
    background: #edf1f6;
}

.tv-leader-rows > div:first-child {
    border-color: var(--yellow-deep);
    background: #fff9df;
}

.tv-leader-rows b {
    color: var(--blue);
}

.tv-leader-rows small {
    color: var(--muted);
}

.winner-heading h1 {
    color: #9b7200;
}

.winner-heading > span {
    color: var(--muted);
}

.podium-place {
    border-color: #dfe4ed;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    box-shadow: 0 18px 42px rgba(40, 53, 87, 0.13);
}

.podium-place > span {
    background: #edf1f6;
}

.podium-place small {
    color: var(--muted);
}

.tv-route-error h1 {
    color: var(--ink);
}

.tv-route-error p:last-child {
    color: var(--muted);
}

.player-page {
    background:
        radial-gradient(circle at 14% 88%, rgba(108, 92, 255, 0.13), transparent 30%),
        radial-gradient(circle at 88% 10%, rgba(25, 211, 223, 0.1), transparent 28%),
        #eef2f8;
}

.player-controller {
    border-color: #dce1eb;
    box-shadow: 0 28px 80px rgba(38, 49, 79, 0.22);
}

.player-header,
.player-game-header {
    border-bottom: 1px solid #e0e4ed;
    background: rgba(255, 255, 255, 0.96);
}

.player-header .connection-badge,
.player-game-header .connection-badge {
    color: var(--muted);
}

.player-join {
    background:
        radial-gradient(circle at 88% 12%, rgba(25, 211, 223, 0.1), transparent 27%),
        radial-gradient(circle at 10% 92%, rgba(108, 92, 255, 0.09), transparent 31%),
        linear-gradient(160deg, #ffffff, #f5f8ff 72%, #f8f5ff);
    color: var(--ink);
}

.player-join::before {
    background-image: radial-gradient(rgba(49, 87, 224, 0.11) 1px, transparent 1px);
    opacity: 0.15;
}

.player-join .section-label,
.join-session-title > span {
    color: var(--blue);
}

.player-join .field {
    color: #454d5c;
}

.player-join-intro,
.player-host-link,
.join-smallprint,
.join-option-note,
.player-route-state > p:last-child {
    color: var(--muted);
}

.player-join .segmented {
    border-color: #dfe4ed;
    background: #edf1f6;
}

.player-join .segmented button {
    color: var(--muted);
}

.player-join .segmented button.active {
    background: #fff;
    color: var(--blue);
    box-shadow: 0 4px 12px rgba(34, 47, 82, 0.09);
}

.player-join .segmented button:disabled {
    color: #a8afbc;
}

.back-action {
    color: var(--muted);
}

.inline-error {
    border-color: #f1c7c5;
    background: #fff0ef;
    color: #9d2929;
}

/* Responsive */

@media (min-width: 1650px) {
    .home-copy h1 {
        font-size: 5.2rem;
    }

    .tv-centre h1,
    .tv-question h1,
    .tv-reveal h1,
    .tv-break-layout h1,
    .tv-leaderboard-layout h1,
    .podium-screen h1 {
        font-size: 4.15rem;
    }

    .tv-answer {
        min-height: 112px;
        font-size: 1.6rem;
    }
}

@media (max-width: 1160px) {
    .home-copy {
        width: 56%;
    }

    .home-copy h1 {
        font-size: 4rem;
    }

    .generator-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .generator-form .button {
        align-self: end;
    }

    .question-meta-fields {
        grid-template-columns: 120px 1fr;
    }

    .question-meta-fields .explanation-field {
        grid-column: 1 / -1;
    }

    .managed-team > header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .team-actions {
        grid-column: 1 / -1;
    }

    .member-row {
        grid-template-columns: 32px minmax(120px, 1fr) auto 70px auto auto;
    }

    .member-row select {
        display: none;
    }
}

@media (max-width: 940px) {
    .home-hero {
        background-position: 66% center;
    }

    .home-copy {
        width: min(620px, 78%);
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }

    .auth-context {
        display: none;
    }

    .auth-form-wrap {
        min-height: calc(100svh - 110px);
    }

    .host-app {
        grid-template-columns: 1fr;
    }

    .host-sidebar {
        display: none;
    }

    .mobile-host-nav {
        display: flex;
        gap: 4px;
        overflow-x: auto;
        padding: 8px 18px;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }

    .mobile-host-nav button {
        min-height: 37px;
        flex: 0 0 auto;
        padding: 0 12px;
        border-radius: 5px;
        background: transparent;
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 800;
    }

    .mobile-host-nav button.active {
        background: var(--dark);
        color: #fff;
    }

    .live-layout,
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .live-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .session-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .session-strip > button {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .generator-band {
        grid-template-columns: 1fr;
    }

    .tv-centre h1,
    .tv-lobby h1,
    .tv-question h1,
    .tv-reveal h1,
    .tv-break-layout h1,
    .tv-leaderboard-layout h1,
    .podium-screen h1 {
        font-size: 2.8rem;
    }

    .tv-lobby {
        grid-template-columns: minmax(0, 1fr) 250px;
        gap: 28px;
        padding-right: 5vw;
        padding-left: 5vw;
    }

    .tv-reveal,
    .tv-break-layout,
    .tv-leaderboard-layout {
        grid-template-columns: 1fr;
        align-content: center;
    }
}

@media (max-width: 700px) {
    .home-hero {
        min-height: 100svh;
        background-position: 70% center;
    }

    .home-hero::before {
        background: rgba(249, 251, 252, 0.88);
    }

    .home-header {
        width: calc(100% - 32px);
        min-height: 69px;
    }

    .home-header .wordmark {
        width: 90px;
        height: 63px;
    }

    .home-nav {
        gap: 12px;
    }

    .home-nav > a:first-child,
    .home-nav > a:nth-child(2) {
        display: none;
    }

    .home-nav .button {
        min-height: 39px;
        padding: 0 11px;
        font-size: 0.72rem;
    }

    .home-hero-inner {
        width: calc(100% - 32px);
        align-items: end;
        padding: 50px 0 28px;
    }

    .home-copy {
        width: 100%;
    }

    .home-kicker {
        margin-bottom: 14px;
    }

    .home-copy h1 {
        margin-bottom: 15px;
        font-size: 2.8rem;
    }

    .home-intro {
        margin-bottom: 23px;
        font-size: 0.92rem;
        line-height: 1.55;
    }

    .hero-join > div {
        grid-template-columns: minmax(0, 1fr) 115px;
    }

    .hero-join input,
    .hero-join .button {
        min-height: 52px;
    }

    .hero-join input {
        font-size: 1.25rem;
    }

    .hero-join .button {
        padding: 0 10px;
        font-size: 0.78rem;
    }

    .home-host-actions {
        margin-top: 16px;
    }

    .public-header {
        width: calc(100% - 28px);
    }

    .auth-grid {
        width: 100%;
        min-height: calc(100svh - 76px - var(--public-top-gap));
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-form-wrap {
        padding: 32px 22px;
    }

    .host-topbar {
        padding: 0 16px;
    }

    .host-top-actions .button,
    .host-user {
        display: none;
    }

    .host-content {
        width: calc(100% - 28px);
        padding-top: 24px;
    }

    .workspace-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .heading-actions {
        width: 100%;
    }

    .heading-actions .button {
        flex: 1;
    }

    .host-answer-list,
    .answer-editor-grid,
    .mode-options {
        grid-template-columns: 1fr;
    }

    .live-side {
        grid-template-columns: 1fr;
    }

    .session-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .generator-band {
        padding: 20px;
    }

    .generator-form {
        grid-template-columns: 1fr;
    }

    .quiz-title-row {
        grid-template-columns: 1fr 1fr;
    }

    .quiz-title-row > .field {
        grid-column: 1 / -1;
    }

    .round-header {
        grid-template-columns: 1fr auto;
    }

    .round-header > span {
        grid-column: 1 / -1;
    }

    .question-editor {
        grid-template-columns: 1fr;
        padding: 18px 14px;
    }

    .question-meta-fields {
        grid-template-columns: 1fr;
    }

    .question-meta-fields .explanation-field {
        grid-column: auto;
    }

    .add-question {
        margin-left: 20px;
    }

    .managed-team > header {
        grid-template-columns: 1fr auto;
        gap: 13px;
    }

    .team-actions {
        flex-wrap: wrap;
    }

    .member-row {
        grid-template-columns: 32px minmax(0, 1fr) auto;
        padding: 10px 14px;
    }

    .member-row > span:not(.initial),
    .member-row > select,
    .member-row > button[data-set-captain] {
        display: none;
    }

    .member-row > .plain-action {
        font-size: 0.7rem;
    }

    .settings-section > .field,
    .settings-section > .toggle-row,
    .settings-section > .button,
    .settings-section > .form-note {
        margin-right: 16px;
        margin-left: 16px;
    }

    .player-page {
        display: block;
        padding: 0;
    }

    .player-controller {
        width: 100%;
        min-height: 100svh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 560px) {
    .home-copy h1 {
        font-size: 2.45rem;
    }

    .hero-join > div {
        grid-template-columns: 1fr;
    }

    .hero-join .button {
        width: 100%;
    }

    .home-host-actions span {
        width: 100%;
    }
}

@media (max-width: 1160px) {
    .host-lobby-grid {
        grid-template-columns: 1fr;
    }

    .room-checklist-card {
        min-height: 440px;
    }

    .finished-host-grid {
        grid-template-columns: 1fr;
    }

    .home-copy {
        width: min(660px, 58%);
    }
}

@media (max-width: 940px) {
    .home-copy {
        width: min(620px, 78%);
    }

    .home-flow {
        width: calc(100% - 40px);
    }

    .home-flow > div {
        padding: 14px 16px;
    }

    .host-invite-card {
        min-height: 470px;
        grid-template-columns: minmax(0, 1fr) 260px;
        padding: 30px;
    }

    .tv-lobby {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 30vw);
    }
}

@media (max-width: 700px) {
    .home-hero {
        min-height: 100svh;
        background-position: 64% center;
    }

    .home-hero::before {
        background:
            radial-gradient(circle at 70% 28%, rgba(95, 61, 196, 0.08), transparent 28%),
            linear-gradient(180deg, rgba(249, 251, 255, 0.9) 0%, rgba(249, 251, 255, 0.96) 62%, rgba(249, 251, 255, 1) 100%);
    }

    .home-hero-inner {
        align-items: center;
        padding: 38px 0 28px;
    }

    .home-copy {
        width: 100%;
    }

    .home-copy h1 {
        color: #141924;
        font-size: clamp(2.65rem, 13vw, 4rem);
    }

    .home-kicker,
    .home-intro {
        color: #566171;
    }

    .home-primary-actions {
        display: grid;
        grid-template-columns: 1fr 0.72fr;
    }

    .home-primary-actions .button {
        padding: 0 12px;
        font-size: 0.8rem;
    }

    .hero-join {
        width: 100%;
    }

    .home-flow {
        width: calc(100% - 32px);
        grid-template-columns: 1fr;
        margin-bottom: 16px;
    }

    .home-flow > div {
        min-height: 66px;
        border-right: 0;
        border-bottom: 1px solid #e3e7ef;
    }

    .home-flow > div:last-child {
        border-bottom: 0;
    }

    .workspace-heading .save-state {
        width: 100%;
    }

    .host-invite-card {
        min-height: 0;
        grid-template-columns: 1fr;
        padding: 25px 20px;
    }

    .host-qr-card {
        width: min(270px, 100%);
        justify-self: center;
    }

    .host-lobby-pin {
        font-size: clamp(3rem, 16vw, 4.4rem);
    }

    .host-invite-actions {
        display: grid;
    }

    .room-checklist > :where(button, a, div) {
        grid-template-columns: 34px minmax(0, 1fr) auto;
    }

    .tv-stage {
        grid-template-rows: 64px minmax(0, 1fr) 44px;
    }

    .tv-header,
    .tv-footer {
        padding-right: 16px;
        padding-left: 16px;
    }

    .tv-header .wordmark {
        height: 56px;
    }

    .tv-header-meta {
        min-width: 0;
        gap: 10px;
        font-size: 0.7rem;
    }

    .tv-header-meta > span:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tv-lobby {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        align-content: start;
        gap: 20px;
        overflow-y: auto;
        padding: 24px 20px;
    }

    .tv-lobby-copy {
        text-align: center;
    }

    .tv-lobby-copy h1 {
        margin-bottom: 18px;
        font-size: clamp(2rem, 9vw, 2.8rem);
    }

    .pin-display strong {
        font-size: 3rem;
    }

    .lobby-counts {
        justify-content: center;
        margin-top: 16px;
    }

    .tv-qr {
        width: min(240px, 75vw);
        justify-self: center;
        padding: 14px;
    }

    .joiner-rail {
        grid-column: 1;
        min-width: 0;
        overflow-x: auto;
    }

    .tv-footer {
        min-width: 0;
        gap: 10px;
        font-size: 0.64rem;
    }

    .generator-form {
        grid-template-columns: 1fr;
    }

    .next-game-card {
        padding: 22px;
    }

    .answer-confirm-bar {
        position: sticky;
        bottom: 0;
    }
}

@media (max-width: 560px) {
    .home-primary-actions {
        grid-template-columns: 1fr;
    }

    .home-flow small {
        font-size: 0.7rem;
    }

    .phone-answer-grid {
        min-height: min(43vh, 300px);
    }

    .phone-answer {
        min-height: 120px;
    }

    .phone-question.has-pending-answer .phone-answer-grid {
        min-height: min(37vh, 255px);
    }

    .phone-question.has-pending-answer .phone-answer {
        min-height: 100px;
    }

    .answer-confirm-bar {
        grid-template-columns: 1fr;
    }

    .answer-confirm-bar .button {
        width: 100%;
    }
}

@media (max-height: 700px) and (min-width: 701px) {
    .tv-stage {
        grid-template-rows: 60px minmax(0, 1fr) 42px;
    }

    .tv-header,
    .tv-footer {
        padding-right: 24px;
        padding-left: 24px;
    }

    .tv-header .wordmark {
        height: 52px;
    }

    .tv-lobby {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
        gap: 14px 4vw;
        overflow-y: auto;
        padding: 18px 5vw 12px;
    }

    .tv-lobby-copy h1 {
        margin-bottom: 16px;
        font-size: clamp(2.35rem, 4.5vw, 3.8rem);
    }

    .pin-display {
        padding: 12px 20px;
    }

    .pin-display strong {
        font-size: 3.25rem;
    }

    .lobby-counts {
        margin-top: 14px;
    }

    .tv-qr {
        padding: 12px;
    }

    .tv-qr strong {
        margin-top: 4px;
        font-size: 1rem;
    }

    .joiner-rail {
        min-height: 56px;
    }

    .joiner-rail > div {
        padding: 6px 9px;
    }
}

@media (orientation: landscape) and (max-height: 620px) {
    .player-controller {
        min-height: 100svh;
    }

    .player-header,
    .player-game-header {
        min-height: 54px;
    }

    .player-header .wordmark,
    .player-game-header .wordmark {
        height: 50px;
    }

    .phone-answer-grid {
        min-height: 210px;
    }

    .phone-answer {
        min-height: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Polished homepage navigation and three-step journey */

.home-header {
    width: min(1240px, calc(100% - 48px));
    min-height: 82px;
    margin-top: 18px;
    padding: 6px 10px 6px 18px;
    overflow: hidden;
    border: 1px solid rgba(202, 210, 225, 0.78);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 20px 55px rgba(28, 38, 65, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(135%);
}

.home-header::before {
    position: absolute;
    top: 0;
    right: 24px;
    left: 24px;
    height: 2px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, transparent, rgba(49, 87, 224, 0.75), rgba(25, 153, 164, 0.7), transparent);
    content: "";
}

.home-header .brand-link {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 14px;
}

.home-header .brand-link:hover {
    background: #f5f7fc;
}

.home-header .wordmark {
    width: 98px;
    height: 68px;
}

.home-nav {
    gap: 4px;
    padding: 5px;
    border: 1px solid rgba(217, 222, 233, 0.9);
    border-radius: 16px;
    background: rgba(243, 246, 251, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.home-nav > a:not(.button) {
    padding: 10px 14px;
    border-radius: 11px;
    color: #3d4657;
    font-size: 0.82rem;
    font-weight: 780;
    transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.home-nav > a:not(.button):hover {
    background: #fff;
    box-shadow: 0 5px 14px rgba(32, 44, 75, 0.09);
    color: var(--blue);
}

.home-nav .button {
    min-height: 44px;
    margin-left: 3px;
    padding: 0 15px 0 17px;
    gap: 9px;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(222, 164, 0, 0.2);
}

.home-nav .button::after {
    font-size: 1.15rem;
    line-height: 1;
    content: "→";
    transition: transform 150ms ease;
}

.home-nav .button:hover::after {
    transform: translateX(3px);
}

.home-flow {
    width: min(1240px, calc(100% - 48px));
    gap: 14px;
    margin: 0 auto 24px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.home-flow > div {
    --step-accent: #3157e0;
    --step-tint: #edf1ff;
    position: relative;
    min-height: 104px;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 16px;
    padding: 18px 20px;
    overflow: visible;
    border: 1px solid rgba(205, 212, 225, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 16px 38px rgba(32, 44, 75, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.home-flow > div:nth-child(2) {
    --step-accent: #7255c9;
    --step-tint: #f1edff;
}

.home-flow > div:nth-child(3) {
    --step-accent: #076b72;
    --step-tint: #e7f7f6;
}

.home-flow > div:hover {
    z-index: 3;
    border-color: color-mix(in srgb, var(--step-accent) 34%, white);
    box-shadow: 0 20px 46px rgba(32, 44, 75, 0.15);
    transform: translateY(-4px);
}

.home-flow > div::before {
    position: absolute;
    top: -1px;
    left: 20px;
    width: 52px;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: var(--step-accent);
    content: "";
}

.home-flow > div:not(:last-child)::after {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: -22px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid #d9dfeb;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 16px rgba(32, 44, 75, 0.12);
    color: #667085;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    content: "›";
    transform: translateY(-50%);
}

.home-flow > div > span {
    width: 48px;
    height: 48px;
    border: 1px solid color-mix(in srgb, var(--step-accent) 22%, white);
    border-radius: 15px;
    background: var(--step-tint);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: var(--step-accent);
    font-size: 0.9rem;
}

.home-flow p {
    gap: 2px;
}

.home-flow strong {
    color: #151b27;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.home-flow small {
    color: #687385;
    font-size: 0.76rem;
    line-height: 1.35;
}

@media (max-width: 940px) {
    .home-header,
    .home-flow {
        width: calc(100% - 40px);
    }

    .home-flow > div {
        min-height: 96px;
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 12px;
        padding: 16px;
    }

    .home-flow > div > span {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }
}

@media (max-width: 700px) {
    .home-header {
        width: calc(100% - 24px);
        min-height: 70px;
        margin-top: 10px;
        padding: 5px 6px 5px 10px;
        border-radius: 18px;
    }

    .home-header .wordmark {
        width: 86px;
        height: 60px;
    }

    .home-nav {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .home-nav .button {
        min-height: 42px;
        margin-left: 0;
        padding: 0 12px 0 14px;
    }

    .home-flow {
        width: calc(100% - 24px);
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .home-flow > div {
        min-height: 78px;
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 12px;
        padding: 12px 15px;
        border: 1px solid rgba(205, 212, 225, 0.9);
        border-radius: 15px;
    }

    .home-flow > div > span {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .home-flow > div:not(:last-child)::after {
        top: auto;
        right: 50%;
        bottom: -17px;
        width: 24px;
        height: 24px;
        font-size: 1.1rem;
        transform: translateX(50%) rotate(90deg);
    }

    .home-flow > div:last-child {
        border-bottom: 1px solid rgba(205, 212, 225, 0.9);
    }

    .home-flow small {
        font-size: 0.73rem;
    }
}

/* Low-cost AI quiz generator */

.generator-band {
    grid-template-columns: minmax(250px, 0.68fr) minmax(480px, 1.32fr);
    align-items: center;
    gap: 34px;
    padding: 28px 30px;
    overflow: hidden;
    border: 1px solid #d8def0;
    border-radius: 18px;
    background:
        radial-gradient(circle at 8% 18%, rgba(255, 212, 59, 0.24), transparent 30%),
        radial-gradient(circle at 92% 12%, rgba(25, 153, 164, 0.13), transparent 30%),
        linear-gradient(135deg, #fbfcff, #f2f5ff);
    box-shadow: 0 16px 38px rgba(37, 49, 84, 0.09);
}

.generator-copy {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: center;
    gap: 9px;
}

.generator-chip {
    display: inline-flex;
    width: max-content;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid rgba(49, 87, 224, 0.16);
    border-radius: 999px;
    background: #edf1ff;
    color: var(--blue);
    font-size: 0.67rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.generator-chip i {
    color: #85620a;
    font-size: 0.82rem;
    font-style: normal;
}

.generator-band .generator-copy h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.generator-copy > p {
    max-width: 440px;
    margin: 0;
    color: #637084;
    font-size: 0.82rem;
    line-height: 1.55;
}

.generator-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
}

.generator-fields {
    display: grid;
    grid-template-columns: minmax(210px, 1.65fr) minmax(92px, 0.45fr) minmax(130px, 0.65fr);
    align-items: end;
    gap: 10px;
}

.generator-form .field {
    min-width: 0;
    color: #465166;
    font-size: 0.72rem;
}

.generator-form :is(input, select) {
    border-color: #d7ddec;
    background: rgba(255, 255, 255, 0.94);
}

.generator-actions {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 10px;
}

.generator-actions .button {
    min-height: 47px;
    gap: 8px;
}

.generator-actions .button-dark {
    border-color: #202a4b;
    background: linear-gradient(135deg, #26345d, #17213e);
    box-shadow: 0 10px 22px rgba(26, 37, 70, 0.19);
    color: #fff;
}

.generator-actions .button-dark:hover {
    background: linear-gradient(135deg, #3157e0, #2748bd);
}

.generator-assurance {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin: 0;
    color: #566176;
    font-size: 0.69rem;
    font-weight: 680;
}

.generator-assurance span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.generator-assurance span::before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #14939c;
    content: "";
}

.generator-replace-note,
.generator-feedback {
    margin: 0;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 680;
    line-height: 1.45;
}

.generator-replace-note {
    padding-left: 10px;
    border-left: 3px solid #d59a12;
    border-radius: 0;
    color: #765b1e;
}

.generator-feedback {
    padding: 10px 12px;
    border: 1px solid #ccd5e7;
    background: rgba(255, 255, 255, 0.8);
    color: #3e4b62;
}

.generator-feedback:empty {
    display: none;
}

.generator-feedback.loading {
    border-color: #c9d4f5;
    background: #edf2ff;
    color: #294aad;
}

.generator-feedback.success {
    border-color: #b9decf;
    background: #edf9f4;
    color: #17634c;
}

.generator-feedback.fallback {
    border-color: #ead39b;
    background: #fff9e9;
    color: #72520d;
}

.generator-feedback.error {
    border-color: #efbdc1;
    background: #fff1f2;
    color: #9a2933;
}

.generator-feedback:focus-visible {
    outline: 3px solid #3157e0;
    outline-offset: 2px;
}

.generator-band[aria-busy="true"] .generator-copy,
.generator-band[aria-busy="true"] .generator-assurance,
.generator-band[aria-busy="true"] .generator-replace-note {
    opacity: 0.72;
}

.host-app [inert] {
    opacity: 0.68;
    filter: saturate(0.78);
    transition: opacity 160ms ease;
}

.suggestion-library {
    display: grid;
    gap: 18px;
    padding: 20px 22px;
    border: 1px solid #dce2ed;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(36, 50, 79, 0.06);
}

.suggestion-library.open {
    border-color: #cfd8ea;
    background: linear-gradient(180deg, #fff, #f8faff);
}

.suggestion-library-heading,
.suggestion-library-heading > div {
    display: flex;
    align-items: center;
    gap: 14px;
}

.suggestion-library-heading {
    justify-content: space-between;
}

.suggestion-library-heading > div > div {
    display: grid;
    gap: 3px;
}

.suggestion-library-heading :is(h2, p) {
    margin: 0;
}

.suggestion-library-heading h2 {
    color: var(--ink);
    font-size: 1rem;
    letter-spacing: -0.015em;
}

.suggestion-library-heading h2 + p {
    color: #667287;
    font-size: 0.74rem;
}

.suggestion-library-icon {
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: #eaf6f5;
    color: #12636a;
    font-size: 1.2rem;
    font-weight: 800;
}

.suggestion-library-body {
    display: grid;
    gap: 15px;
    padding-top: 16px;
    border-top: 1px solid #e2e6ef;
}

.suggestion-library-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.42fr) auto;
    align-items: end;
    gap: 10px;
}

.suggestion-library-tools .button {
    min-height: 45px;
}

.suggestion-library-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.suggestion-library-results:focus-visible {
    outline: 3px solid #3157e0;
    outline-offset: 4px;
}

.suggestion-card {
    display: grid;
    align-content: start;
    gap: 11px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #dce2ed;
    border-radius: 13px;
    background: #fff;
}

.suggestion-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suggestion-card-meta span {
    padding: 4px 7px;
    border-radius: 999px;
    background: #eef2fa;
    color: #4f5f78;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.suggestion-card h3,
.suggestion-card > p {
    margin: 0;
}

.suggestion-card h3 {
    color: var(--ink);
    font-size: 0.86rem;
    line-height: 1.42;
}

.suggestion-card > p {
    color: #687489;
    font-size: 0.7rem;
    line-height: 1.45;
}

.suggestion-answer-list {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.suggestion-answer-list li {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    color: #536077;
    font-size: 0.68rem;
}

.suggestion-answer-list b {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 6px;
    background: #f0f2f7;
    font-size: 0.6rem;
}

.suggestion-answer-list li.correct {
    color: #17634c;
    font-weight: 750;
}

.suggestion-answer-list li.correct b {
    background: #dff3eb;
    color: #17634c;
}

.suggestion-card .button {
    width: 100%;
    min-height: 39px;
    margin-top: auto;
}

.suggestion-library-empty {
    display: grid;
    grid-column: 1 / -1;
    min-height: 118px;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 24px;
    border: 1px dashed #cfd6e4;
    border-radius: 13px;
    color: #647086;
    text-align: center;
}

.suggestion-library-empty.error {
    border-color: #e5b8bd;
    background: #fff6f7;
    color: #922e38;
}

.library-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #d7def0;
    border-top-color: #3157e0;
    border-radius: 50%;
    animation: generatorSpin 700ms linear infinite;
}

.button-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: generatorSpin 700ms linear infinite;
}

@keyframes generatorSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1160px) {
    .generator-band {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .generator-copy > p {
        max-width: 720px;
    }

    .suggestion-library-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .generator-band {
        gap: 20px;
        padding: 21px 18px;
        border-radius: 15px;
    }

    .generator-fields,
    .generator-actions {
        grid-template-columns: 1fr;
    }

    .generator-assurance {
        display: grid;
    }

    .suggestion-library {
        padding: 17px 16px;
    }

    .suggestion-library-heading,
    .suggestion-library-heading > div {
        align-items: flex-start;
    }

    .suggestion-library-heading {
        display: grid;
    }

    .suggestion-library-heading .button {
        width: 100%;
    }

    .suggestion-library-tools,
    .suggestion-library-results {
        grid-template-columns: 1fr;
    }
}
