:root {
    --design-width: 3584;
    --design-height: 1280;
    --text: #18233a;
    --muted: #66738d;
    --deep: #24345c;
    --sky: #edf7ff;
    --cream: rgba(255, 250, 242, 0.92);
    --panel: rgba(255, 255, 255, 0.78);
    --line: rgba(36, 52, 92, 0.12);
    --gold: #f6b629;
    --mint: #59c7ba;
    --coral: #ff7f72;
    --violet: #8f7cff;
    --horse-size: 168px;
    --runner-band-height: 170px;
    --wall-opacity: 0.72;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
    color: var(--text);
    background-color: #0b1220;
    background-image: url("http://link-promotion-dev.oss-cn-shanghai.aliyuncs.com/big_screen_back.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.screen-shell {
    width: calc(var(--design-width) * 1px);
    height: calc(var(--design-height) * 1px);
    position: relative;
    overflow: hidden;
    transform-origin: top left;
}

.screen-viewport {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.stage {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.42s ease, transform 0.42s ease, visibility 0.42s ease;
}

.screen-shell[data-stage="join"] .join-stage,
.screen-shell[data-stage="idle"] .join-stage,
.screen-shell[data-stage="race"] .race-stage,
.screen-shell[data-stage="result"] .result-stage {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.24em;
    color: var(--violet);
}

.join-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 700px;
    align-items: center;
    gap: 120px;
    padding: 112px 140px 96px;
}

.join-backdrop,
.result-backdrop,
.race-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.join-backdrop {
    background:
        radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.78), transparent 24%),
        radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.56), transparent 22%),
        linear-gradient(180deg, rgba(237, 247, 255, 0.9), rgba(255, 239, 244, 0.88));
}

.join-panel,
.join-qr-shell,
.result-card {
    position: relative;
    z-index: 1;
}

.join-panel {
    max-width: 2320px;
}

.join-title,
.race-title,
.result-title {
    margin: 0;
    font-weight: 900;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.join-title {
    max-width: 100%;
    font-size: 114px;
    line-height: 1.05;
    color: var(--deep);
}

.join-description {
    margin: 42px 0 0;
    max-width: 1320px;
    font-size: 44px;
    line-height: 1.6;
    color: rgba(36, 52, 92, 0.84);
}

.join-meta {
    margin-top: 52px;
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.status-pill,
.meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 82px;
    padding: 0 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 16px 40px rgba(121, 114, 171, 0.12);
    font-size: 32px;
    font-weight: 800;
    color: var(--deep);
}

.join-qr-shell {
    display: grid;
    justify-items: center;
    gap: 26px;
    width: 700px;
    min-height: 720px;
    padding: 38px 38px 44px;
    border-radius: 56px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 26px 60px rgba(133, 124, 186, 0.16);
    backdrop-filter: blur(14px);
}

.qr-frame {
    width: 100%;
    aspect-ratio: 1;
    padding: 30px;
    border-radius: 46px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(36, 52, 92, 0.08);
}

.qr-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-frame img.hidden {
    display: none;
}

.qr-caption {
    margin: 0;
    min-height: 52px;
    font-size: 38px;
    font-weight: 700;
    color: rgba(36, 52, 92, 0.78);
    text-align: center;
}

.qr-caption.hidden {
    visibility: hidden;
}

.race-stage {
    padding: 34px 44px 42px;
    color: #18304a;
}

.race-backdrop {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
        url("./image/跑道.png") center center / cover no-repeat;
}

.race-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 36px;
    padding: 12px 14px 0;
}

.race-title {
    max-width: 2100px;
    font-size: 80px;
    line-height: 1.04;
    color: #17325a;
    text-shadow: 0 6px 18px rgba(255, 255, 255, 0.45);
}

.race-round-summary {
    margin: 14px 0 0;
    font-size: 30px;
    font-weight: 700;
    color: rgba(23, 50, 90, 0.72);
}

.race-metrics {
    display: flex;
    gap: 18px;
}

.metric-pill {
    min-width: 210px;
    padding: 20px 26px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 16px 40px rgba(73, 98, 138, 0.12);
    text-align: center;
    backdrop-filter: blur(10px);
}

.metric-label {
    display: block;
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 700;
    color: rgba(24, 35, 58, 0.66);
}

.metric-pill strong {
    font-size: 46px;
    line-height: 1;
    font-weight: 900;
    color: #203a60;
}

.track-shell {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    height: calc((var(--design-height) * 1px) - 220px);
    padding: 24px 16px 22px;
}

.track-markers {
    display: flex;
    justify-content: space-between;
    margin: 0 48px 12px 34px;
    color: rgba(24, 35, 58, 0.52);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.22em;
}

.track-lanes {
    position: relative;
    height: calc(100% - 20px);
    padding: 120px 0 30px;
    overflow: hidden;
}

.horse-runner {
    position: absolute;
    left: 24px;
    bottom: 14px;
    display: grid;
    justify-items: center;
    transition: left 0.14s linear;
    transform: translateX(0);
    will-change: left;
}

.horse-runner.is-idle {
    animation: horse-idle 1.8s ease-in-out infinite;
}

.horse-runner.is-racing {
    animation: horse-racing 0.8s ease-in-out infinite;
}

.horse-runner.is-finished {
    filter: drop-shadow(0 10px 16px rgba(255, 204, 72, 0.28));
}

.horse-runner img {
    display: block;
    width: auto;
    height: var(--horse-size);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.horse-nameplate {
    margin-top: -4px;
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 24px rgba(79, 93, 128, 0.14);
    font-size: 18px;
    font-weight: 800;
    color: #264268;
    white-space: nowrap;
}

.result-stage {
    padding: 48px 72px;
}

.result-backdrop {
    background:
        radial-gradient(circle at 10% 18%, rgba(255, 255, 255, 0.72), transparent 22%),
        radial-gradient(circle at 90% 12%, rgba(255, 255, 255, 0.56), transparent 22%),
        linear-gradient(180deg, rgba(239, 247, 255, 0.92), rgba(255, 239, 245, 0.92));
}

.result-card {
    position: relative;
    z-index: 1;
    height: calc((var(--design-height) * 1px) - 96px);
    padding: 44px 54px 38px;
    border-radius: 44px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.84);
    box-shadow: 0 30px 72px rgba(114, 109, 164, 0.16);
    backdrop-filter: blur(16px);
}

.result-card.settlement-mode {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.36);
    box-shadow: 0 16px 40px rgba(68, 33, 10, 0.16);
    backdrop-filter: blur(6px);
}

.result-card.finalists-only {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.result-card.finalists-only .eyebrow,
.result-card.finalists-only .result-title,
.result-card.finalists-only .result-subtitle {
    text-align: center;
}

.result-card.finalists-only .final-board {
    width: min(1320px, 100%);
}

.result-title {
    max-width: 100%;
    font-size: 78px;
    color: #22395f;
}

.result-subtitle {
    margin: 14px 0 0;
    font-size: 32px;
    color: rgba(34, 57, 95, 0.72);
}

.podium-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin-top: 34px;
}

.podium-card {
    position: relative;
    padding: 28px 24px 24px;
    border-radius: 38px;
    background: var(--cream);
    border: 1px solid rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 40px rgba(112, 123, 152, 0.12);
    text-align: center;
}

.podium-card.rank-1 {
    background: linear-gradient(180deg, rgba(255, 232, 175, 0.9), rgba(255, 250, 242, 0.95));
}

.podium-card.rank-2 {
    background: linear-gradient(180deg, rgba(231, 239, 255, 0.92), rgba(255, 250, 242, 0.95));
}

.podium-card.rank-3 {
    background: linear-gradient(180deg, rgba(255, 221, 196, 0.92), rgba(255, 250, 242, 0.95));
}

.podium-rank {
    display: inline-grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.84);
    color: #24345c;
    font-size: 34px;
    font-weight: 900;
}

.podium-card img {
    width: 110px;
    height: 110px;
    margin: 22px auto 16px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(104, 116, 149, 0.16);
}

.podium-name {
    font-size: 34px;
    font-weight: 900;
    color: #24345c;
}

.podium-caption {
    margin-top: 10px;
    color: rgba(36, 52, 92, 0.72);
    font-size: 22px;
    font-weight: 700;
}

.final-board {
    margin-top: 32px;
    padding: 30px 30px 24px;
    border-radius: 36px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.84);
}

.result-card.settlement-mode .final-board {
    margin-top: 22px;
    min-height: 560px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.44);
}

.final-board-head h2 {
    margin: 0 0 16px;
    font-size: 34px;
    color: #24345c;
}

.final-ranking-list {
    display: grid;
    gap: 18px;
}

.final-ranking-list.qualified-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 260px));
    justify-content: center;
    align-content: center;
    gap: 28px 30px;
    min-height: 460px;
    max-height: 560px;
    overflow: auto;
    padding: 18px 12px 24px;
}

.final-ranking-list.champion-grid {
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: 8px 12px;
}

.qualified-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 18px 16px 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 30px rgba(64, 75, 106, 0.16);
}

.qualified-card img {
    width: 138px;
    height: 138px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 12px 26px rgba(72, 82, 112, 0.26);
}

.qualified-name {
    width: 100%;
    text-align: center;
    font-size: 30px;
    font-weight: 900;
    color: #24345c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.final-rank-card {
    display: grid;
    grid-template-columns: 68px 78px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.82);
}

.final-rank-no {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(143, 124, 255, 0.12);
    color: #5a4bcb;
    font-size: 30px;
    font-weight: 900;
}

.final-rank-card img {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    object-fit: cover;
}

.final-rank-name {
    font-size: 28px;
    font-weight: 900;
    color: #24345c;
}

.final-rank-meta {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 700;
    color: rgba(36, 52, 92, 0.68);
}

.final-rank-progress {
    font-size: 28px;
    font-weight: 900;
    color: #203a60;
}

.countdown-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    z-index: 20;
}

.countdown-overlay.hidden {
    display: none;
}

.countdown-card {
    min-width: 420px;
    padding: 52px 68px;
    border-radius: 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.84);
    box-shadow: 0 26px 60px rgba(96, 110, 146, 0.16);
    color: #25365f;
}

.countdown-overlay.is-race-timer {
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(2px);
}

.countdown-overlay.is-race-timer .countdown-card {
    background: rgba(72, 76, 84, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
    color: #f1f5ff;
}

.countdown-overlay.is-race-timer .countdown-card p {
    color: rgba(241, 245, 255, 0.86);
}

.countdown-overlay.is-race-timer .countdown-card span {
    color: #ffffff;
}

.countdown-card p {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: rgba(37, 54, 95, 0.68);
}

.countdown-card span {
    display: block;
    margin-top: 6px;
    font-size: 180px;
    line-height: 1;
    font-weight: 900;
    color: #ef8354;
}

.barrage-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 12;
    opacity: var(--wall-opacity, 0.72);
}

.barrage-item {
    position: absolute;
    left: 0;
    transform: translateX(-120%);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 28px rgba(97, 114, 146, 0.16);
    white-space: nowrap;
    animation: barrage-flight linear forwards;
}

.barrage-item img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.barrage-item strong {
    font-weight: 900;
    font-size: 22px;
}

.barrage-item span {
    color: #30466d;
    font-weight: 700;
    font-size: 22px;
}

.barrage-layer,
.countdown-overlay {
    width: 100%;
    height: 100%;
}

.barrage-item.top {
    box-shadow: 0 0 0 1px rgba(246, 182, 41, 0.48), 0 12px 28px rgba(97, 114, 146, 0.18);
}

@keyframes horse-idle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes horse-racing {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-7px) scale(1.01); }
}

@keyframes barrage-flight {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(calc((var(--design-width) * 1px) + 220px)); }
}

