/* The party pages: the TV (party/) and the phone (play/). The app's colors,
   Syne for the room code and headings, Helvetica Neue for the rest. */

@font-face {
    font-family: "Syne";
    src: url("/fonts/Syne-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: light;
    --background: #F4F7F6;
    --card: #FFFFFF;
    --ink: #12324A;
    --ink-muted: #557083;
    --ocean: #8EC5DE;
    --ocean-tint: #DCEFF7;
    --ocean-deep: #2B6C95;
    --land: #7DB46C;
    --land-tint: #E1F0D9;
    --land-deep: #3F7A38;
    --mountain-deep: #7A4E2C;
    --sahara: #E8C27E;
    --sahara-tint: #FAEFD9;
    --sahara-deep: #8A6420;
    --outline: #D9E4E6;
    --outline-strong: #C9D8DC;
    --segment: #E3ECEE;
    --display: "Syne", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.band-left {
    animation: band-left 4s linear infinite;
}

.band-right {
    animation: band-right 5s linear infinite;
}

@keyframes band-left {
    from { transform: translateX(0); }
    to { transform: translateX(-34px); }
}

@keyframes band-right {
    from { transform: translateX(-34px); }
    to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .band-left,
    .band-right {
        animation: none;
    }
}

.overline {
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    color: var(--ink);
}

.tile {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    border: 0;
    font-weight: 700;
    color: var(--ink);
    text-align: left;
    transition: opacity 0.25s;
    --ring: 2px;
}

/* The chosen or right tile gets an ink ring on top, so the waves still
   reach the tile's edges, as on the app's tiles. */
.tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border: var(--ring) solid transparent;
    border-radius: inherit;
    pointer-events: none;
    transition: border-color 0.25s;
}

.tile-name {
    position: relative;
    z-index: 1;
}

.tile-waves {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

.tile.is-dim {
    opacity: 0.32;
}

.tile.is-chosen::after,
.tile.is-correct::after {
    border-color: var(--ink);
}

.timebar {
    overflow: hidden;
    background: var(--ocean-tint);
}

.timebar > div {
    height: 100%;
    background: var(--land);
    transform-origin: left;
    animation: time linear forwards;
}

@keyframes time {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.notice {
    position: fixed;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--sahara-tint);
    border: 1.5px solid var(--sahara);
    color: var(--sahara-deep);
    font-size: 14px;
    font-weight: 700;
    z-index: 10;
}

/* MARK: TV
   Laid out on a 16:9 stage that fits any screen; 1rem is 1% of its width. */

html.tv {
    font-size: calc(min(100vw, 177.78vh) / 100);
    height: 100%;
}

html.tv body {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stage {
    position: relative;
    width: min(100vw, 177.78vh);
    height: min(100vh, 56.25vw);
    overflow: hidden;
}

.tv .notice {
    font-size: 1rem;
    padding: 0.6rem 1.4rem;
}

.tv-header {
    position: absolute;
    left: 4rem;
    right: 4rem;
    top: 2.6rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.tv-header .mark {
    width: 3.6rem;
    height: 3.6rem;
}

.tv-header .title {
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tv-header .spacer {
    flex: 1;
}

.segmented {
    display: inline-flex;
    padding: 0.25rem;
    gap: 0.2rem;
    background: var(--segment);
    border-radius: 1.1rem;
}

.segmented button {
    border: 0;
    background: transparent;
    padding: 0.5rem 1.1rem;
    border-radius: 0.85rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink-muted);
}

.segmented button[aria-pressed="true"] {
    background: var(--card);
    color: var(--ink);
    font-weight: 700;
}

.icon-button {
    border: 1.5px solid var(--outline-strong);
    background: var(--card);
    border-radius: 1rem;
    padding: 0.55rem 1rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.icon-button.is-muted {
    color: var(--ink-muted);
}

.icon-button.is-asking {
    border-color: var(--mountain-deep);
    color: var(--mountain-deep);
}

.icon-button.large {
    font-size: 1.6rem;
    padding: 1rem 2.4rem;
    border-radius: 1.3rem;
}

.invite {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.4rem;
}

.pill {
    border: 1.5px solid var(--outline-strong);
    background: var(--card);
    border-radius: 999px;
    padding: 0.5rem 1.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}

.primary {
    border: 0;
    background: var(--ocean-deep);
    color: #FFFFFF;
    font-weight: 700;
}

.tv .primary {
    font-size: 1.6rem;
    padding: 1rem 3.4rem;
    border-radius: 1.3rem;
}

/* Start page and rooms this screen does not run */

.tv a.primary,
.tv a.icon-button {
    display: inline-block;
    text-decoration: none;
}

.tv a.icon-button {
    color: var(--ink);
}

.tv-header .home {
    display: flex;
}

/* Two lines of title and the steps across the stage, so the buttons stay
   above the ground's waves. */
.entry {
    position: absolute;
    left: 4rem;
    right: 4rem;
    top: 10rem;
}

.entry .overline {
    font-size: 1.2rem;
}

.entry h1 {
    max-width: 80rem;
    margin: 1rem 0 0;
    font-family: var(--display);
    font-size: 4.8rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.entry .lead {
    margin: 2rem 0 0;
    max-width: 52rem;
    font-size: 1.8rem;
    line-height: 1.45;
    color: var(--ink-muted);
}

.steps {
    margin: 2.6rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
}

.steps li {
    padding: 1.6rem;
    background: var(--card);
    border: 2px solid var(--outline);
    border-radius: 1.6rem;
    font-size: 1.5rem;
    line-height: 1.4;
}

.steps b {
    display: block;
    margin-bottom: 0.6rem;
    font-family: var(--display);
    font-size: 2.4rem;
    color: var(--ocean-deep);
}

.entry-actions {
    margin-top: 2.8rem;
    display: flex;
    align-items: center;
    gap: 1.4rem;
    flex-wrap: wrap;
}

.text-link {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ocean-deep);
}

/* Along the window's whole bottom edge, past the 16:9 stage when the
   screen is wider or taller than that. */
.ground {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 6rem;
}

/* Lobby */

.qr-card {
    position: absolute;
    left: 4rem;
    top: 9.5rem;
    width: 33rem;
    padding: 2.2rem 2.2rem 2rem;
    background: var(--card);
    border: 2px solid var(--outline);
    border-radius: 2rem;
    text-align: center;
}

.qr-card .qr svg {
    display: block;
    width: 22rem;
    height: 22rem;
    margin: 0 auto;
}

.qr-card .hint {
    margin-top: 1.3rem;
    font-size: 1.2rem;
    color: var(--ink-muted);
}

.qr-card .link {
    margin-top: 0.3rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.qr-card .link b {
    font-family: var(--display);
    color: var(--ocean-deep);
    letter-spacing: 0.06em;
}

.lobby-side {
    position: absolute;
    left: 41rem;
    right: 4rem;
    top: 10rem;
    bottom: 9rem;
    display: flex;
    flex-direction: column;
}

.lobby-side .overline {
    font-size: 1.1rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.8rem;
    margin-top: 1.2rem;
    flex: 1;
    overflow: hidden;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.4rem 1.3rem 0.4rem 0.4rem;
    background: var(--card);
    border: 2px solid var(--outline);
    border-radius: 999px;
    font-size: 1.35rem;
    font-weight: 500;
    animation: pop 0.35s ease-out;
}

.chip .avatar {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.2rem;
}

.chip.no-pop {
    animation: none;
}

.chip.is-away {
    opacity: 0.45;
}

.chip-remove {
    border: 0;
    background: none;
    padding: 0 0.2rem 0 0.3rem;
    margin-left: -0.4rem;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--ink-muted);
}

.chip.is-asking {
    border-color: var(--mountain-deep);
}

.chip.is-asking .chip-remove {
    margin-left: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mountain-deep);
}

.chip.is-waiting {
    border-style: dashed;
    color: var(--ink-muted);
    padding-left: 1.3rem;
    animation: none;
}

@keyframes pop {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.empty-lobby {
    margin-top: 1.4rem;
    font-family: var(--display);
    font-size: 3.4rem;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.lobby-bottom {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    flex-wrap: wrap;
}

.summary {
    font-size: 1.3rem;
    color: var(--ink-muted);
}

.summary button {
    border: 0;
    background: none;
    padding: 0 0 0 0.6rem;
    font-weight: 700;
    color: var(--ocean-deep);
}

.settings {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1rem 1.6rem;
    margin: 1.4rem 0;
    padding: 1.6rem;
    background: var(--card);
    border: 2px solid var(--outline);
    border-radius: 1.6rem;
}

.settings .overline {
    font-size: 0.95rem;
}

.settings .segmented {
    justify-self: start;
    /* Seven categories may not fit one line beside the QR code. */
    flex-wrap: wrap;
    max-width: 100%;
}

.settings .segmented button {
    font-size: 1.2rem;
    padding: 0.6rem 1.3rem;
}

/* Ready */

.center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ready .overline {
    font-size: 1.6rem;
}

.ready .big {
    margin-top: 1rem;
    font-family: var(--display);
    font-size: 7rem;
    letter-spacing: -0.03em;
}

.countdown {
    margin-top: 2rem;
    width: 9rem;
    height: 9rem;
    border-radius: 50%;
    background: var(--ocean-deep);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-size: 4.4rem;
}

/* Question and reveal */

.q-top {
    position: absolute;
    left: 4rem;
    right: 4rem;
    top: 2.6rem;
    display: flex;
    align-items: center;
    gap: 1.8rem;
    font-size: 1.6rem;
    font-weight: 700;
}

.q-top .timebar {
    flex: 1;
    height: 1.2rem;
    border-radius: 0.6rem;
}

.q-top .timebar > div {
    border-radius: 0.6rem;
}

.q-top .seconds {
    min-width: 3rem;
    text-align: right;
    font-size: 2.2rem;
}

.q-top .answered {
    color: var(--ink-muted);
    font-weight: 500;
}

.q-title {
    position: absolute;
    left: 0;
    right: 0;
    top: 6.6rem;
    text-align: center;
    font-size: 1.3rem;
}

.flag {
    position: absolute;
    left: 50%;
    top: 9.6rem;
    transform: translateX(-50%);
    height: 22rem;
    aspect-ratio: 4 / 3;
    border-radius: 1.2rem;
    overflow: hidden;
    border: 2px solid var(--outline);
    background: var(--card);
}

.flag img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* An outline question shows the country's shape, on the ground. */
.outline {
    position: absolute;
    left: 50%;
    top: 8.6rem;
    transform: translateX(-50%);
    height: 24rem;
    aspect-ratio: 1;
}

.outline img,
.phone-outline img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* A landmark question shows its photo, named and credited with the answer. */
.photo {
    position: absolute;
    left: 50%;
    top: 9.6rem;
    transform: translateX(-50%);
    border-radius: 1.2rem;
    overflow: hidden;
}

.photo img {
    display: block;
    height: 22rem;
    width: auto;
    max-width: calc(100vw - 8rem);
    object-fit: cover;
}

.photo-credit {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2.4rem 1.2rem 0.8rem;
    background: linear-gradient(transparent, rgba(18, 50, 74, 0.8));
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.3;
}

.photo-credit b {
    display: block;
    font-family: var(--display);
    font-size: 1.8rem;
}

/* A capital question shows the country, a currency question the currency,
   a greeting question the greeting. */
.subject {
    position: absolute;
    left: 4rem;
    right: 4rem;
    top: 10rem;
    height: 21rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    text-align: center;
}

.subject-flag {
    height: 7rem;
    aspect-ratio: 4 / 3;
    border-radius: 0.8rem;
    overflow: hidden;
    border: 2px solid var(--outline);
}

.subject-flag img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subject-symbol {
    min-width: 8rem;
    height: 8rem;
    padding: 0 2rem;
    border-radius: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sahara-tint);
    color: var(--sahara-deep);
    font-family: var(--display);
    font-size: 4rem;
}

.subject-name {
    font-family: var(--display);
    font-size: 6.4rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.subject-latin {
    font-size: 2.4rem;
    color: var(--ink-muted);
}

.tv-tiles {
    position: absolute;
    left: 4rem;
    right: 4rem;
    bottom: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
}

.tv-tiles .tile {
    height: 9.2rem;
    padding: 1.3rem 1.8rem;
    border-radius: 1.6rem;
    --ring: 0.3rem;
    font-size: 2.4rem;
    letter-spacing: -0.01em;
}

.tv-tiles .tile-waves {
    height: 3.6rem;
}

.count {
    position: absolute;
    right: 1.4rem;
    top: 1.2rem;
    z-index: 1;
    min-width: 3.6rem;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    background: var(--card);
    font-size: 1.6rem;
    text-align: center;
}

.tile.is-correct .count {
    background: var(--ink);
    color: #FFFFFF;
}

/* Leaderboard and results */

.board {
    position: absolute;
    left: 50%;
    top: 12rem;
    transform: translateX(-50%);
    width: 62rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.board-row {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1rem 1.8rem 1rem 1.2rem;
    background: var(--card);
    border: 2px solid var(--outline);
    border-radius: 1.6rem;
    font-size: 1.9rem;
    animation: rise 0.4s ease-out backwards;
}

.board-row .place {
    width: 3rem;
    text-align: center;
    font-family: var(--display);
    font-size: 2.2rem;
}

.board-row .avatar {
    width: 3.6rem;
    height: 3.6rem;
    font-size: 1.6rem;
}

.board-row .name {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-row .gained {
    color: var(--land-deep);
    font-weight: 700;
    font-size: 1.5rem;
}

.board-row .move {
    width: 2.6rem;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
}

.board-row .move.up {
    color: var(--land-deep);
}

.board-row .move.down {
    color: var(--mountain-deep);
}

.board-row .score {
    min-width: 7rem;
    text-align: right;
    font-weight: 700;
}

@keyframes rise {
    from { transform: translateY(1.4rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.heading {
    position: absolute;
    left: 0;
    right: 0;
    top: 3.2rem;
    text-align: center;
}

.heading h1 {
    margin: 0;
    font-family: var(--display);
    font-size: 3.4rem;
    letter-spacing: -0.02em;
}

.heading p {
    margin: 0.4rem 0 0;
    font-size: 1.3rem;
    color: var(--ink-muted);
}

.podium {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 1.6rem;
}

.step {
    width: 19rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: rise 0.6s ease-out backwards;
}

.step .avatar {
    width: 6rem;
    height: 6rem;
    font-size: 2.6rem;
    border: 0.3rem solid var(--card);
}

.step .name {
    margin-top: 0.8rem;
    max-width: 100%;
    font-size: 2rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step .score {
    font-size: 1.4rem;
    color: var(--ink-muted);
}

.step .block {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-top: 1.2rem;
    border-radius: 1.6rem 1.6rem 0 0;
    display: flex;
    justify-content: center;
    padding-top: 1.2rem;
    font-family: var(--display);
    font-size: 4rem;
}

.step .block .tile-waves {
    height: 4rem;
}

.step.first .block {
    height: 20rem;
}

.step.second .block {
    height: 14rem;
}

.step.third .block {
    height: 10rem;
}

.final-rest {
    position: absolute;
    right: 4rem;
    top: 11rem;
    width: 24rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.final-rest .board-row {
    font-size: 1.3rem;
    padding: 0.6rem 1.2rem 0.6rem 0.8rem;
    border-radius: 1.2rem;
}

.final-rest .board-row .avatar {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.1rem;
}

.final-rest .board-row .place {
    width: 2rem;
    font-size: 1.4rem;
}

/* The way back to holdmy.world, where the header is on other screens. */
.final-home {
    position: absolute;
    left: 4rem;
    top: 2.6rem;
}

.final-actions {
    position: absolute;
    left: 0;
    right: 0;
    top: 10rem;
    display: flex;
    justify-content: center;
    gap: 1.2rem;
}

.connecting .mark {
    width: 10rem;
    height: 10rem;
}

.connecting p {
    margin-top: 2rem;
    font-size: 1.6rem;
    color: var(--ink-muted);
}

/* MARK: TV on a phone
   On a phone, or a tablet held upright, the 16:9 stage would shrink every
   screen to a strip with buttons too small to tap, so the TV page becomes a
   normal page there: the start page, and a room run from the phone. */

@media (orientation: portrait), (max-height: 500px) {
    html.tv,
    html.tv body {
        height: auto;
        min-height: 100%;
        font-size: 16px;
    }

    html.tv body {
        display: block;
        overflow: auto;
    }

    .tv .stage {
        width: auto;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        max-width: 640px;
        margin: 0 auto;
        padding: 16px 20px max(20px, env(safe-area-inset-bottom));
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .tv .tv-header {
        position: static;
        flex-wrap: wrap;
        gap: 8px 10px;
        min-height: 44px;
    }

    .tv .tv-header .mark {
        width: 34px;
        height: 34px;
    }

    .tv .tv-header .title {
        font-size: 20px;
    }

    .tv .segmented {
        flex-wrap: wrap;
        padding: 3px;
        gap: 2px;
        border-radius: 14px;
    }

    .tv .segmented button {
        font-size: 14px;
        padding: 7px 12px;
        border-radius: 11px;
    }

    .tv .icon-button {
        min-height: 44px;
        padding: 8px 12px;
        border-radius: 12px;
        font-size: 14px;
    }

    .tv a.icon-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .tv .primary,
    .tv .icon-button.large {
        min-height: 56px;
        padding: 16px 20px;
        border-radius: 20px;
        font-size: 18px;
        text-align: center;
    }

    .tv .ground {
        position: static;
        flex: none;
        margin: auto -20px 0;
        width: calc(100% + 40px);
        height: 48px;
    }

    /* Start page and rooms this phone does not run */

    .tv .entry {
        position: static;
        margin: 28px 0 32px;
    }

    .tv .entry .overline {
        font-size: 12px;
    }

    .tv .entry h1 {
        margin-top: 10px;
        font-size: 34px;
        line-height: 1.08;
    }

    .tv .entry .lead {
        margin-top: 14px;
        font-size: 17px;
    }

    .tv .steps {
        margin-top: 22px;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tv .steps li {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 16px;
        border-radius: 18px;
        font-size: 16px;
    }

    .tv .steps b {
        min-width: 18px;
        margin: 0;
        font-size: 24px;
        text-align: center;
    }

    .tv .entry-actions {
        margin-top: 24px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .tv .text-link {
        align-self: center;
        padding: 12px;
        font-size: 16px;
    }

    .tv .connecting .mark {
        width: 72px;
        height: 72px;
    }

    .tv .connecting p {
        margin-top: 18px;
        font-size: 16px;
    }

    /* Lobby: the QR code first, then the players, the settings and Start. */

    .tv .qr-card {
        position: static;
        width: auto;
        margin-top: 16px;
        padding: 20px;
        border-radius: 22px;
    }

    .tv .qr-card .qr svg {
        width: min(220px, 60vw);
        height: min(220px, 60vw);
    }

    .tv .qr-card .hint {
        margin-top: 12px;
        font-size: 14px;
    }

    .tv .qr-card .link {
        margin-top: 2px;
        font-size: 20px;
    }

    .tv .invite {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 14px;
    }

    .tv .pill {
        padding: 9px 16px;
        font-size: 14px;
    }

    .tv .lobby-side {
        position: static;
        margin: 22px 0 24px;
    }

    .tv .lobby-side .overline {
        font-size: 12px;
    }

    .tv .chips {
        margin-top: 10px;
        gap: 8px;
        overflow: visible;
    }

    .tv .chip {
        gap: 8px;
        padding: 4px 6px 4px 4px;
        font-size: 15px;
    }

    .tv .chip .avatar {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .tv .chip-remove {
        margin-left: 0;
        padding: 4px 8px;
        font-size: 18px;
    }

    .tv .chip.is-waiting {
        padding: 9px 14px;
    }

    .tv .empty-lobby {
        margin-top: 6px;
        font-size: 24px;
    }

    .tv .settings {
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 16px 0 0;
        padding: 16px;
        border-radius: 18px;
    }

    .tv .settings .overline {
        margin-top: 4px;
        font-size: 11px;
    }

    .tv .settings .segmented button {
        font-size: 13px;
        padding: 7px 10px;
    }

    .tv .lobby-bottom {
        margin-top: 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .tv .summary {
        text-align: center;
        font-size: 14px;
    }

    .tv .summary button {
        padding: 8px 4px 8px 8px;
    }

    /* Get ready */

    .tv .ready .overline {
        font-size: 14px;
    }

    .tv .ready .big {
        margin-top: 8px;
        font-size: 44px;
    }

    .tv .countdown {
        margin-top: 24px;
        width: 88px;
        height: 88px;
        font-size: 40px;
    }

    /* Question and reveal */

    .tv .q-top {
        position: static;
        flex-wrap: wrap;
        gap: 6px 12px;
        font-size: 15px;
    }

    .tv .q-top .timebar {
        min-width: 120px;
        height: 8px;
        border-radius: 4px;
    }

    .tv .q-top .seconds {
        min-width: 24px;
        font-size: 20px;
    }

    .tv .q-top .answered {
        font-size: 14px;
    }

    .tv .q-title {
        position: static;
        margin-top: 20px;
        font-size: 12px;
    }

    .tv .flag {
        position: static;
        transform: none;
        width: min(100%, 320px);
        height: auto;
        margin: 12px auto 0;
        border-radius: 14px;
    }

    .tv .outline {
        position: static;
        transform: none;
        width: min(100%, 280px);
        height: auto;
        margin: 8px auto 0;
    }

    .tv .subject {
        position: static;
        height: auto;
        margin-top: 14px;
        gap: 10px;
    }

    .tv .subject-flag {
        height: 44px;
        border-radius: 8px;
    }

    .tv .subject-symbol {
        min-width: 56px;
        height: 56px;
        padding: 0 16px;
        border-radius: 28px;
        font-size: 28px;
    }

    .tv .subject-name {
        font-size: 30px;
    }

    .tv .subject-latin {
        font-size: 16px;
    }

    .tv .photo {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: fit-content;
        margin: 12px auto 0;
        border-radius: 14px;
    }

    .tv .photo img {
        height: auto;
        max-height: 220px;
        max-width: 100%;
    }

    .tv .photo-credit {
        padding: 20px 10px 6px;
        font-size: 11px;
    }

    .tv .photo-credit b {
        font-size: 16px;
    }

    .tv .tv-tiles {
        position: static;
        margin-top: 18px;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tv .tv-tiles .tile {
        height: auto;
        min-height: 64px;
        padding: 14px 16px 30px;
        border-radius: 18px;
        --ring: 3px;
        font-size: 19px;
    }

    .tv .tv-tiles .tile-waves {
        height: 24px;
    }

    .tv .count {
        right: 12px;
        top: 12px;
        min-width: 32px;
        padding: 3px 8px;
        font-size: 14px;
    }

    /* Leaderboard and results */

    .tv .heading {
        position: static;
        margin-top: 16px;
    }

    .tv .heading h1 {
        font-size: 28px;
    }

    .tv .heading p {
        margin-top: 4px;
        font-size: 14px;
    }

    .tv .board {
        position: static;
        transform: none;
        width: auto;
        margin: 18px 0 24px;
        gap: 8px;
    }

    .tv .board-row {
        gap: 10px;
        padding: 10px 14px 10px 10px;
        border-radius: 16px;
        font-size: 16px;
    }

    .tv .board-row .place {
        width: 24px;
        font-size: 18px;
    }

    .tv .board-row .avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .tv .board-row .gained {
        font-size: 13px;
    }

    .tv .board-row .move {
        width: 24px;
        font-size: 12px;
    }

    .tv .board-row .score {
        min-width: 56px;
    }

    .tv .podium {
        position: static;
        transform: none;
        margin-top: 24px;
        justify-content: center;
        gap: 8px;
    }

    .tv .step {
        flex: 1;
        width: auto;
        min-width: 0;
    }

    .tv .step .avatar {
        width: 48px;
        height: 48px;
        font-size: 20px;
        border-width: 3px;
    }

    .tv .step .name {
        margin-top: 6px;
        font-size: 15px;
    }

    .tv .step .score {
        font-size: 12px;
    }

    .tv .step .block {
        margin-top: 8px;
        padding-top: 8px;
        border-radius: 14px 14px 0 0;
        font-size: 26px;
    }

    .tv .step .block .tile-waves {
        height: 24px;
    }

    .tv .step.first .block {
        height: 120px;
    }

    .tv .step.second .block {
        height: 88px;
    }

    .tv .step.third .block {
        height: 64px;
    }

    .tv .final-rest {
        position: static;
        width: auto;
        margin-top: 16px;
        gap: 6px;
    }

    .tv .final-rest .board-row {
        padding: 8px 12px 8px 8px;
        border-radius: 14px;
        font-size: 14px;
    }

    .tv .final-rest .board-row .avatar {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .tv .final-rest .board-row .place {
        width: 20px;
        font-size: 15px;
    }

    .tv .final-home {
        position: static;
        order: -1;
        align-self: flex-start;
    }

    /* Play again and a new room after the podium, at the bottom. */
    .tv .final-actions {
        position: static;
        order: 1;
        margin: 24px 0 8px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
}

/* MARK: Phone */

html.phone,
html.phone body {
    height: 100%;
}

.phone-screen {
    position: relative;
    min-height: 100%;
    min-height: 100dvh;
    max-width: 560px;
    margin: 0 auto;
    padding: 16px 20px max(20px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.phone-top {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.phone-top .spacer {
    flex: 1;
}

.phone-top .mark {
    width: 34px;
    height: 34px;
}

.phone .segmented {
    border-radius: 14px;
    padding: 3px;
}

.phone .segmented button {
    font-size: 14px;
    padding: 7px 12px;
    border-radius: 11px;
}

.phone-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.phone .big-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
}

.phone h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.02em;
}

.phone .muted {
    color: var(--ink-muted);
    font-size: 15px;
    line-height: 1.45;
}

.phone .overline {
    font-size: 12px;
}

.phone .code {
    font-family: var(--display);
    font-size: 40px;
    letter-spacing: 0.08em;
}

.field {
    width: 100%;
    padding: 15px 16px;
    border: 1.5px solid var(--outline-strong);
    border-radius: 16px;
    background: var(--card);
    font: inherit;
    font-size: 18px;
    color: var(--ink);
    outline: none;
}

.field:focus {
    border-color: var(--ocean-deep);
}

.field.code-field {
    text-align: center;
    font-family: var(--display);
    font-size: 30px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.colors {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.colors button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    padding: 0;
}

.colors button[aria-pressed="true"] {
    border-color: var(--ink);
}

.phone .primary {
    width: 100%;
    padding: 18px;
    border-radius: 20px;
    font-size: 19px;
}

.phone .secondary {
    width: 100%;
    padding: 16px;
    border: 1.5px solid var(--outline-strong);
    border-radius: 20px;
    background: var(--card);
    font-size: 17px;
    font-weight: 700;
}

.phone a.link-button {
    display: block;
    text-align: center;
    text-decoration: none;
}

.error {
    margin: 12px 0 0;
    color: var(--mountain-deep);
    font-size: 15px;
    font-weight: 500;
}

.link-button {
    border: 0;
    background: none;
    padding: 10px;
    color: var(--ink-muted);
    font-size: 15px;
}

.me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
}

.me .avatar {
    width: 30px;
    height: 30px;
    font-size: 14px;
}

.phone .score {
    font-weight: 700;
    color: var(--land-deep);
    font-size: 16px;
}

.big-avatar {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    font-size: 42px;
}

.phone .timebar {
    height: 6px;
    border-radius: 3px;
    margin: 6px 0 10px;
}

.phone .timebar > div {
    border-radius: 3px;
}

.phone-hint {
    text-align: center;
    font-size: 14px;
    color: var(--ink-muted);
    margin-bottom: 10px;
}

/* The question as the TV shows it, smaller, above the options. */
.phone-flag,
.phone-subject-flag {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 2px solid var(--outline);
    background: var(--card);
}

.phone-flag {
    height: clamp(96px, 22dvh, 180px);
    margin: 0 auto 14px;
    border-radius: 14px;
}

.phone-flag img,
.phone-subject-flag img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* No long-press menu with the image's address, which names the country. */
    -webkit-touch-callout: none;
    pointer-events: none;
}

.phone-outline {
    height: clamp(110px, 26dvh, 210px);
    aspect-ratio: 1;
    margin: 0 auto 10px;
}

.phone-outline img {
    /* No long-press menu with the image's address, which names the country. */
    -webkit-touch-callout: none;
    pointer-events: none;
}

.phone-subject {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 16px;
    border-radius: 20px;
    background: var(--card);
    text-align: center;
}

.phone-subject-flag {
    height: 40px;
    border-radius: 8px;
}

.phone-subject-symbol {
    min-width: 56px;
    height: 56px;
    padding: 0 16px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sahara-tint);
    color: var(--sahara-deep);
    font-family: var(--display);
    font-size: 28px;
}

.phone-subject-name {
    font-family: var(--display);
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.phone-subject-latin {
    margin-top: -6px;
    font-size: 15px;
    color: var(--ink-muted);
}

.phone-photo {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 14px;
    border-radius: 14px;
    overflow: hidden;
}

.phone-photo img {
    display: block;
    height: clamp(110px, 26dvh, 210px);
    width: auto;
    max-width: 100%;
    object-fit: cover;
    /* No long-press menu with the image's address, which names the place. */
    -webkit-touch-callout: none;
    pointer-events: none;
}

.phone-credit {
    margin-top: 14px;
    font-size: 12px;
    color: var(--ink-muted);
    text-align: center;
}

.phone-tiles {
    flex: 1;
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    min-height: 0;
}

.phone-tiles .tile {
    width: 100%;
    min-height: 60px;
    padding: 14px 16px;
    border-radius: 20px;
    --ring: 3px;
    font-size: 21px;
    letter-spacing: -0.01em;
}

.phone-tiles .tile-waves {
    height: 30px;
}

.phone-tiles button.tile:active {
    transform: scale(0.98);
}

.result {
    background: var(--land-tint);
}

.result.wrong {
    background: var(--sahara-tint);
}

.result.none {
    background: var(--segment);
}

.result .points {
    margin-top: 8px;
    font-size: 64px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--land-deep);
}

.result.wrong .points,
.result.none .points {
    color: var(--ink-muted);
}

.place-card {
    margin-top: 28px;
    padding: 18px;
    border-radius: 20px;
    background: var(--card);
}

.place-card .place {
    font-family: var(--display);
    font-size: 30px;
}

.place-card .move {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--land-deep);
}

.place-card .move.down {
    color: var(--mountain-deep);
}

.mini-podium {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.mini-podium div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--card);
    border-radius: 14px;
    font-size: 16px;
}

.mini-podium .avatar {
    width: 28px;
    height: 28px;
    font-size: 13px;
}

.mini-podium b {
    margin-left: auto;
}

.standings .is-me {
    box-shadow: inset 0 0 0 2px var(--ink);
    font-weight: 700;
}

.standings .gap {
    margin: -4px 0;
    text-align: center;
    color: var(--ink-muted);
    letter-spacing: 0.2em;
}

.promo {
    display: block;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--ocean-tint);
    color: var(--ocean-deep);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.bottom {
    margin-top: 16px;
}
