/* Game-local styling; the hosted controls use the pinned shared shell. */
.source-page #flag-stage { position: absolute; width: 1080px; height: 1920px; transform-origin: top left; color: #f7f7f4; }
.source-page #flag-stage * { box-sizing: border-box; }
.fr-capture { position: absolute; top: 370px; left: 40px; width: 1000px; }
.fr-board { position: relative; width: 100%; padding: 30px; background: #101317; border: 2px solid #353b46; border-radius: 30px; box-shadow: 0 24px 80px #0005; overflow: hidden; }
.fr-board::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: #ffd43b; }
.fr-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.fr-kicker { color: #bdc4ce; font-size: 23px; letter-spacing: 3px; font-weight: 650; margin: 0 0 8px; }
.fr-heading h1 { margin: 0; font: 900 64px/.98 Inter, sans-serif; letter-spacing: -3px; color: #fff; }
.fr-heading h1 span { color: #ffd43b; }
.fr-clock { text-align: right; }
.fr-clock strong { font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -2px; }
.fr-clock span { display: block; margin-top: 9px; font-size: 24px; color: #bbc2cd; }
.fr-join { margin: 25px 0 19px; padding: 15px 18px; border: 1px solid #4a4e54; border-radius: 12px; font-size: 30px; line-height: 1.3; background: #23272e; color: #f2f3f5; }
.fr-join strong { color: #ffd43b; font-weight: 800; }
.fr-lanes { display: grid; gap: 10px; }
.fr-lane { position: relative; height: 104px; display: grid; grid-template-columns: 62px minmax(0, 1fr) 235px; gap: 12px; align-items: center; padding: 10px 14px 10px 0; border: 1px solid #39404b; border-left: 5px solid var(--country); border-radius: 13px; background: #1b2027; }
.fr-lane[data-leading=true] { background: color-mix(in srgb, var(--country) 9%, #1b2027); }
.fr-rank { text-align: center; font-size: 34px; font-weight: 750; color: var(--country); font-variant-numeric: tabular-nums; }
.fr-country { min-width: 0; align-self: stretch; position: relative; }
.fr-country-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; line-height: 1; }
.fr-country-name { font-size: 32px; line-height: 1; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-score { font-size: 30px; font-weight: 800; color: var(--country); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fr-track { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; border-radius: 6px; background: repeating-linear-gradient(90deg, #ffffff08 0 1px, transparent 1px 20%); border-bottom: 1px solid #ffffff1a; }
.fr-progress { position: absolute; inset: 15px 0 12px; width: var(--progress, 0%); background: var(--country); opacity: .42; transition: width .45s ease; }
.fr-flag { position: absolute; width: 64px; height: 48px; left: clamp(0px, calc(var(--progress, 0%) - 64px), calc(100% - 64px)); top: 0; filter: drop-shadow(0 2px 3px #0009); transition: left .45s ease; }
.fr-country-name small { font-size: 22px; font-weight: 500; color: #b8c2d0; margin-left: 6px; }
.fr-gift { display: flex; align-items: center; gap: 9px; padding-left: 14px; border-left: 1px solid #414752; align-self: stretch; min-width: 0; }
.fr-gift img { width: 53px; height: 58px; object-fit: contain; flex: none; }
.fr-gift-copy { min-width: 0; }
.fr-gift strong { font-size: 28px; line-height: 1.1; display: block; overflow: hidden; text-overflow: ellipsis; max-height: 64px; font-weight: 750; }
.fr-gift span { display: block; font-size: 24px; margin-top: 6px; color: #c5cbd3; }
.fr-gift .fr-chat-only { font-size: 25px; color: #dce1e8; }
.fr-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #d7dce4; font-size: 25px; margin-top: 21px; }
.fr-bottom p { margin: 0; }
.fr-bottom strong { color: #fff; }
.fr-brand { font-weight: 700; font-size: 22px; color: #a5aebc; }
.fr-recent { position: relative; margin: 20px auto 0; width: 950px; min-height: 80px; display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 28px; color: #f7f7f4; padding: 15px 22px; background: #14181fed; border: 1px solid #414854; border-radius: 18px; text-align: center; }
.fr-recent>span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-recent:empty { display: none; }
.fr-result { margin: 20px 0 0; padding: 20px; border-radius: 13px; border: 1px solid #8c7833; background: #2d281b; text-align: center; }
.fr-result[hidden] { display: none; }
.fr-result strong { display: block; font-size: 38px; color: #fff0ae; }
.fr-result p { margin: 8px 0 0; font-size: 27px; color: #f2ead0; }
.fr-board[data-phase=result] .fr-join { display: none; }
.fr-mode { position: absolute; top: 311px; left: 0; width: 1080px; text-align: center; font-size: 26px; color: #ffe58d; font-weight: 750; letter-spacing: 2px; }
.fr-mode:empty { display: none; }
.fr-board[data-phase=result] .fr-lanes { margin-top: 18px; }
html.tt-shell .country-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
html.tt-shell .country-selects label { border-left: 3px solid var(--country); padding-left: 10px; }
html.tt-shell .country-selects select { font-size: 15px; }
html.tt-shell .gift-copy>strong { color: var(--country); }
html.tt-shell .country-keys { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
html.tt-shell .country-keys li { border: 1px solid #414854; border-left: 3px solid var(--country); border-radius: 7px; padding: 6px 9px; font-size: 14px; }
html.tt-shell .country-keys b { color: var(--country); }
html.tt-shell #preview-caption { margin: 0; color: #a9afb9; font-size: 14px; }
@media (max-width:600px) { html.tt-shell .country-selects { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion:reduce) { .fr-flag, .fr-progress { transition: none; } }

/* Original map and flag bunting stay behind the compact, opaque race board. */
.fr-backdrop { position: absolute; inset: 0; width: 1080px; height: 1920px; pointer-events: none; background: radial-gradient(ellipse at 50% 40%, #244552, #0c1b29 75%); }
html.source-page:not([data-background=themed]) .fr-backdrop { display: none; }
html.source-page[data-background=solid], html.source-page[data-background=solid] body { background: var(--tt-source-bg) !important; }
