/* Chomp Crossing Race (multiplayer): the lobby, the countdown, and the results podium, over the
   shared game page styles. The theme matches solo Chomp Crossing. */

:root {
    --accent: #f43f5e;
    --accent-soft: #fecdd3;
    --glow: rgba(244, 63, 94, 0.42);
    --gold: #fde68a;
    --silver: #e2e8f0;
    --bronze: #f0b27a;
}

body {
    background: linear-gradient(135deg, #0b0508, #1f0a12);
}

.message {
    background: rgba(20, 6, 11, 0.8);
}

/* Buttons work even though the message box lets taps through to the board. */
.message-button {
    justify-self: center;
    margin-top: 16px;
    padding: 10px 22px;
    color: white;
    background: var(--accent);
    border: 2px solid var(--accent-soft);
    border-radius: 10px;
    font:
        700 1rem 'Orbitron',
        sans-serif;
    cursor: pointer;
    pointer-events: auto;
}

.message-button:hover {
    background: #e11d48;
}

.message-button:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.message-button[hidden] {
    display: none;
}

/* The lobby's players, each with their square and a bit of its trail. */
.lobby-players {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    max-width: 420px;
    margin: 16px auto 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.lobby-players[hidden] {
    display: none;
}

.lobby-players li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 3px 8px 3px 4px;
    color: white;
    border-radius: 8px;
}

/* The player's own row stands out. */
.lobby-players .lobby-you {
    background: rgba(253, 230, 138, 0.14);
    box-shadow: inset 0 0 0 1px rgba(253, 230, 138, 0.5);
}

.lobby-players .lobby-you span {
    color: var(--gold);
    font-weight: 700;
}

/* The tag after a bot's name, in the lobby and on the podium. */
.bot-tag {
    flex: none;
    margin-left: 6px;
    padding: 1px 4px;
    color: #1f0a12;
    background: var(--gold);
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.lobby-players .bot-tag {
    margin-left: 0;
}

.lobby-players span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A square with one square's length of its trail behind it, drawn at twice this size. The
   shared game style paints every canvas dark, but these sit on the panel. */
.lobby-square {
    flex: none;
    width: 50px;
    height: 28px;
    background: transparent;
    image-rendering: pixelated;
}

/* "3, 2, 1, GO!" in the middle of the board. */
.countdown {
    position: absolute;
    top: 38%;
    left: 50%;
    z-index: 3;
    transform: translate(-50%, -50%);
    color: var(--gold);
    font:
        700 clamp(4rem, 16vw, 8rem) 'Orbitron',
        sans-serif;
    text-shadow:
        0 4px 0 #7a0000,
        0 0 24px rgba(253, 230, 138, 0.6);
    pointer-events: none;
}

.countdown[hidden] {
    display: none;
}

/* A line at the top of the board while watching the rest of the race. */
.race-status {
    position: absolute;
    top: 10px;
    left: 50%;
    z-index: 2;
    margin: 0;
    padding: 6px 14px;
    transform: translateX(-50%);
    color: white;
    background: rgba(20, 6, 11, 0.82);
    border: 1px solid var(--accent);
    border-radius: 999px;
    font-size: 0.9rem;
    white-space: nowrap;
    pointer-events: none;
}

.race-status[hidden] {
    display: none;
}

/* The results podium: second, first, then third, with first on the tallest block. */
.podium {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    text-align: center;
    color: white;
    background: rgba(12, 4, 8, 0.88);
}

.podium[hidden] {
    display: none;
}

.podium h2 {
    margin: 0 0 14px;
    color: var(--accent-soft);
    font:
        700 clamp(1.6rem, 5vw, 2.6rem) 'Orbitron',
        sans-serif;
}

.podium-places {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.podium-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    max-width: 180px;
    min-width: 0;
}

.podium-place-1 {
    order: 2;
}

.podium-place-2 {
    order: 1;
}

.podium-place-3 {
    order: 3;
}

.podium-stage {
    width: 100%;
    height: auto;
    background: transparent;
    image-rendering: pixelated;
}

.podium-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
}

.podium-distance {
    color: var(--accent-soft);
    font-size: 0.85rem;
}

.podium-block {
    display: grid;
    place-items: center;
    width: 100%;
    margin-top: 6px;
    color: #1f0a12;
    border-radius: 8px 8px 0 0;
    font:
        700 1.3rem 'Orbitron',
        sans-serif;
}

.podium-place-1 .podium-block {
    height: 120px;
    background: var(--gold);
}

.podium-place-2 .podium-block {
    height: 86px;
    background: var(--silver);
}

.podium-place-3 .podium-block {
    height: 60px;
    background: var(--bronze);
}

.podium-pot {
    margin: 16px 0 4px;
    color: var(--gold);
    font-weight: 700;
    font-size: 1.1rem;
}

.podium-you {
    margin: 0;
    color: var(--accent-soft);
}

/* Phones and the apps have less room on the podium. */
@media (max-width: 520px) {
    .podium-block {
        font-size: 1rem;
    }

    .podium-place-1 .podium-block {
        height: 80px;
    }

    .podium-place-2 .podium-block {
        height: 58px;
    }

    .podium-place-3 .podium-block {
        height: 40px;
    }

    .race-status {
        font-size: 0.78rem;
    }
}
