﻿/* ========== Design Tokens ========== */
:root {
    --background: #F9F5F5;
    --primary: #A85A5A;
    --primary-foreground: #FFFFFF;
    --secondary: #EBCBCB;
    --secondary-foreground: #4A4040;
    --card-bg: #FFFFFF;
    --text-main: #4A4040;
    --text-muted: #9CA3AF;
    --accent-gold: #D4AF37;
    --radius: 16px;
    --shadow: 0 4px 20px -2px rgba(168, 90, 90, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(235, 203, 203, 0.6);
    --phone-max-width: 420px;
    --phone-min-height: 640px;
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--text-main);
    min-height: 100%;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* 手机框：包裹主体 + 底部栏，大屏时整体为手机比例 */
.phone-frame {
    position: relative;
    width: 100%;
    max-width: var(--phone-max-width);
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--background);
    overflow: visible;
}
@media (max-width: 420px) {
    .phone-frame {
        max-width: none;
        width: 100vw;
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }
}

/* 主体内容区 */
.app-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 60px;
    position: relative;
    height: 100%;
}

/* 电脑/大屏：整页限定为手机比例，底部栏在框内底部 */
@media (min-width: 421px) {
    body {
        background: #2c2c2c;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
    }
    .phone-frame {
        width: var(--phone-max-width);
        min-height: auto;
        height: calc(var(--phone-max-width) * (19.5 / 9));
        max-height: 90vh;
        box-shadow: 0 0 0 2px var(--glass-border);
        border-radius: 24px;
        overflow: hidden;
    }
    .app-wrapper {
        padding-bottom: 72px;
    }
}

/* 首页时不显示底部栏 */
.on-home .tab-bar { display: none !important; }
.on-home .app-wrapper { padding-bottom: 0; }

/* ========== Views (SPA) ========== */
.view {
    display: none;
    flex: 1;
    min-height: 0;
    padding: 24px;
    animation: viewFadeIn 0.35s ease-out forwards;
}
.view.active {
    display: flex;
    flex-direction: column;
}
@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Home View ---------- */
.view-home {
    text-align: center;
    padding: 0;
    position: relative;
    overflow: hidden;
}
.view-home.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.home-content {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 0 min(100vw, var(--phone-max-width));
    box-sizing: border-box;
}
.view-home::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(100vw, var(--phone-max-width));
    background: url('../fig/bg.png') no-repeat center bottom;
    background-size: cover;
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
}
.view-home > * {
    position: relative;
    z-index: 1;
}
.home-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breathe 2.5s ease-in-out infinite;
}
.home-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    mix-blend-mode: darken;
}
@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.92; }
}
.home-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin: 0 0 4px;
}
.home-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 32px;
    letter-spacing: 0.05em;
}
.daily-card {
    margin-top: 32px;
    width: 100%;
    max-width: 320px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    text-align: left;
}
.daily-card h3 { font-size: 0.95rem; margin: 0 0 8px; color: var(--text-main); }
.daily-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.daily-card .fortune {
    margin-top: 12px;
    padding: 12px;
    background: var(--background);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--primary);
}

/* ---------- Game View ---------- */
.game-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 16px 20px;
    margin: -20px -20px 20px -20px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.game-topbar .brand-mini { font-size: 1.25rem; font-weight: 700; color: var(--text-main); }
.balance-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(168,90,90,0.08);
}
.balance-wrap span { font-size: 1rem; font-weight: 700; }
.balance-icon img {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
    mix-blend-mode: darken;
}
.balance-number { color: var(--primary); }
.main-card {
    flex: 1;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 340px;
}
.track-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.track-status { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }

/* 跑道区域：背景层滚动 + 车道层 */
.track-area {
    flex: 1;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    padding: 0;
}
/* 跑道背景：单格 160px 无缝循环，圈圈覆盖 8 行，大小位置有设计感；用 JS 取模实现无限滚动 */
.track-bg {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 200%;
    min-width: 400px;
    z-index: 0;
    will-change: transform;
    background-color: rgba(250, 247, 247, 0.98);
    /* 一格 160px 横向平铺；圆圈分布在 8 行（约 6%–94%），x 与大小错落 */
    background-image:
        /* 第 1 行附近 */
        radial-gradient(circle at 18px 8%, transparent 6px, rgba(235, 203, 203, 0.5) 6px, rgba(235, 203, 203, 0.5) 10px, transparent 10px),
        radial-gradient(circle at 92px 14%, transparent 10px, rgba(168, 90, 90, 0.15) 10px, rgba(168, 90, 90, 0.15) 14px, transparent 14px),
        /* 第 2 行 */
        radial-gradient(circle at 55px 26%, transparent 8px, rgba(235, 203, 203, 0.45) 8px, rgba(235, 203, 203, 0.45) 13px, transparent 13px),
        radial-gradient(circle at 128px 22%, transparent 11px, rgba(168, 90, 90, 0.12) 11px, transparent 14px),
        /* 第 3 行 */
        radial-gradient(circle at 12px 38%, transparent 9px, rgba(235, 203, 203, 0.4) 9px, rgba(235, 203, 203, 0.4) 14px, transparent 14px),
        radial-gradient(circle at 78px 42%, transparent 7px, rgba(168, 90, 90, 0.2) 7px, rgba(168, 90, 90, 0.2) 11px, transparent 11px),
        /* 第 4 行 */
        radial-gradient(circle at 142px 52%, transparent 12px, rgba(235, 203, 203, 0.38) 12px, rgba(235, 203, 203, 0.38) 17px, transparent 17px),
        radial-gradient(circle at 38px 48%, transparent 8px, rgba(168, 90, 90, 0.1) 8px, transparent 12px),
        /* 第 5 行 */
        radial-gradient(circle at 105px 58%, transparent 10px, rgba(235, 203, 203, 0.42) 10px, rgba(235, 203, 203, 0.42) 15px, transparent 15px),
        radial-gradient(circle at 22px 62%, transparent 6px, rgba(168, 90, 90, 0.18) 6px, rgba(168, 90, 90, 0.18) 10px, transparent 10px),
        /* 第 6 行 */
        radial-gradient(circle at 68px 72%, transparent 9px, rgba(235, 203, 203, 0.35) 9px, rgba(235, 203, 203, 0.35) 14px, transparent 14px),
        radial-gradient(circle at 135px 76%, transparent 11px, rgba(168, 90, 90, 0.14) 11px, transparent 15px),
        /* 第 7 行 */
        radial-gradient(circle at 45px 84%, transparent 8px, rgba(235, 203, 203, 0.48) 8px, rgba(235, 203, 203, 0.48) 12px, transparent 12px),
        radial-gradient(circle at 115px 88%, transparent 7px, rgba(168, 90, 90, 0.16) 7px, rgba(168, 90, 90, 0.16) 11px, transparent 11px),
        /* 第 8 行 */
        radial-gradient(circle at 32px 94%, transparent 10px, rgba(235, 203, 203, 0.4) 10px, rgba(235, 203, 203, 0.4) 15px, transparent 15px),
        radial-gradient(circle at 98px 90%, transparent 9px, rgba(168, 90, 90, 0.12) 9px, transparent 13px),
        /* 细竖线节奏 */
        linear-gradient(90deg, transparent 0, transparent 78px, rgba(235, 203, 203, 0.22) 79px, transparent 80px),
        linear-gradient(90deg, transparent 0, transparent 158px, rgba(168, 90, 90, 0.07) 159px, transparent 160px);
    background-size: 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%, 160px 100%;
    background-repeat: repeat-x;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
}
.track-lanes {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.finish-line {
    position: absolute;
    right: 48px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--text-muted), var(--primary));
    z-index: 1;
    pointer-events: none;
}
.finish-label {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    font-weight: 700;
    z-index: 1;
    pointer-events: none;
}
.lane {
    flex: 1;
    min-height: 54px;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 12px;
    transition: background 0.35s ease;
}
.lane:nth-child(even) { background: rgba(235,203,203,0.15); }
.lane-rank {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    z-index: 12;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.lane-rank.show {
    opacity: 1;
}
.lane-finished-1 .lane-rank { background: rgba(128, 50, 50, 0.95); }
.lane-finished-2 .lane-rank { background: rgba(148, 70, 70, 0.9); }
.lane-finished-3 .lane-rank { background: rgba(168, 90, 90, 0.85); }
.lane-finished-4 .lane-rank { background: rgba(180, 100, 100, 0.75); }
/* 前四名冲线：从左到右展开红色条，1 最深依次变浅 */
.lane-finished-1::after,
.lane-finished-2::after,
.lane-finished-3::after,
.lane-finished-4::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 80%;
    width: 0;
    z-index: 0;
    pointer-events: none;
    animation: lane-red-expand 0.55s ease-out forwards;
}
.lane-finished-1::after { background: rgba(120, 45, 45, 0.52); }
.lane-finished-2::after { background: rgba(150, 65, 65, 0.42); }
.lane-finished-3::after { background: rgba(175, 90, 90, 0.32); }
.lane-finished-4::after { background: rgba(195, 110, 110, 0.22); }
@keyframes lane-red-expand {
    from { width: 0; }
    to { width: 100%; }
}
.horse {
    position: absolute;
    left: 12px;
    transition: left 0.06s linear;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 300;
    box-sizing: border-box;
}
.horse .horse-avatar { order: 0; }
.horse .horse-info { order: 1; }
.horse .horse-bubble { order: 2; }
/* 靠近终点：仅把文字移到图标左侧，图标位置不变 */
.horse.name-left .horse-info {
    position: absolute;
    right: 100%;
    margin-right: 8px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
}
.horse-avatar {
    width: 64.8px;
    height: 55.08px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    box-shadow: none;
    transition: transform 0.15s;
}
.horse-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform: translateY(-20%);
    mix-blend-mode: darken;
}
.horse.fallen .horse-avatar {
    animation: horseFall 0.4s ease-out;
}
@keyframes horseFall {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(-25deg) scale(1.05); }
    100% { transform: rotate(0deg) scale(1); }
}
.horse-info .horse-num { font-size: 0.65rem; font-weight: 700; color: var(--text-muted); }
.horse-info .horse-name { font-size: 0.8rem; font-weight: 600; color: var(--text-main); }
.horse-bubble {
    position: absolute;
    left: 100%;
    margin-left: 8px;
    padding: 4px 10px;
    background: var(--card-bg);
    border-radius: 12px;
    font-size: 0.7rem;
    color: var(--primary);
    box-shadow: var(--shadow);
    white-space: nowrap;
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    z-index: 15;
}
.horse-bubble.show {
    animation: bubblePop 1.2s ease-out forwards;
}
@keyframes bubblePop {
    0% { opacity: 0; transform: scale(0.8); }
    20% { opacity: 1; transform: scale(1.05); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: scale(1); }
}
.horse-avatar.running { animation: bounce 0.4s infinite alternate ease-in-out; }
@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}
.commentary-box {
    margin-top: 6px;
    padding: 12px 16px;
    background: transparent;
    border-radius: 12px;
    border: none;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 44px;
    padding-left: 22px;
}
.commentary-box .live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1s infinite;
    transform: translateY(-2px);
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.game-footer { padding-top: 20px; }

/* 喊加油按钮：比赛中可点 */
.btn-cheer {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #b8942f 100%);
    color: #fff;
    font-weight: 600;
}
.btn-cheer:active { transform: scale(0.95); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    height: 48px;
    width: 100%;
    padding: 0 24px;
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
    border: none;
    outline: none;
}
.btn:active { transform: scale(0.95); }
.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--text-main);
}
.btn-outline:hover { background: var(--secondary); }

/* ---------- Achievements View ---------- */
.achieve-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    text-align: center;
}
.stat-card .value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
}
.achieve-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.achieve-item {
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    text-align: center;
    transition: transform 0.2s;
}
.achieve-item:active { transform: scale(0.98); }
.achieve-item.locked { opacity: 0.65; filter: grayscale(0.6); }
.achieve-item.unlocked {
    border-color: var(--accent-gold);
    box-shadow: 0 4px 20px -2px rgba(212, 175, 55, 0.2);
    animation: achieveUnlock 0.6s ease-out;
}
@keyframes achieveUnlock {
    0% { transform: scale(0.98); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 4px 24px -2px rgba(212, 175, 55, 0.35); }
    100% { transform: scale(1); box-shadow: 0 4px 20px -2px rgba(212, 175, 55, 0.2); }
}
.achieve-item .icon { font-size: 2rem; margin-bottom: 8px; }
.achieve-item .icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.achieve-item .title { font-size: 0.9rem; font-weight: 600; color: var(--text-main); }
.achieve-item .desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- Bottom Tab Bar ---------- */
.tab-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 64px;
    flex-shrink: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding: 0 8px;
}
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    border-radius: 12px;
}
.tab-item:active { transform: scale(0.95); }
.tab-item.active { color: var(--primary); font-weight: 600; }
.tab-item .tab-icon { font-size: 1.4rem; }
.tab-item .tab-icon img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
    mix-blend-mode: darken;
}

/* ---------- Settings View ---------- */
.view-settings .main-card { padding: 20px; }

/* ---------- Dialogs ---------- */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(6px);
    height: var(--overlay-height, 100vh);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.dialog-overlay.open {
    opacity: 1;
    visibility: visible;
}
.dialog-content {
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 40px -8px rgba(168,90,90,0.2);
    width: 100%;
    max-width: 360px;
    max-height: calc(var(--overlay-height, 100vh) - 40px);
    display: flex;                 /* 关键 */
    flex-direction: column;        /* 关键 */
    overflow: hidden;              /* 不允许整体滚动 */
    padding: 28px 0 0 0;
    transform: translateY(16px) scale(0.96);
    transition: transform 0.3s ease-out;
}
.dialog-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;                 /* 关键 */
    padding: 0 28px 0 28px;
}
.dialog-overlay.open .dialog-content {
    transform: translateY(0) scale(1);
}
.dialog-content2 {
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 40px -8px rgba(168,90,90,0.2);
    width: 100%;
    max-width: 360px;
    padding: 28px;
    max-height: calc(var(--overlay-height, 100vh) - 40px);
    overflow-y: auto;
    transform: translateY(16px) scale(0.96);
    transition: transform 0.3s ease-out;
}
.dialog-overlay.open .dialog-content2 {
    transform: translateY(0) scale(1);
}
.dialog-header { margin-bottom: 20px; }
.dialog-title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.dialog-desc { font-size: 0.875rem; color: var(--text-muted); margin: 6px 0 0; }
.form-group { margin-bottom: 18px; }
.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}
.input, .select {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--secondary);
    background: var(--background);
    padding: 0 14px;
    font-size: 0.95rem;
    color: var(--text-main);
}
.select { display: none; }
.horse-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 6px 2px;
}
.horse-card {
    border: 1px solid var(--secondary);
    border-radius: 12px;
    padding: 8px 6px;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.horse-card img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
    mix-blend-mode: darken;
}
.horse-card .horse-card-name {
    font-size: 0.72rem;
    color: var(--text-main);
    text-align: center;
}
.horse-card.selected {
    border-color: var(--primary);
    box-shadow: 0 6px 16px -8px rgba(168,90,90,0.35);
    transform: translateY(-2px);
}
.input:focus, .select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168,90,90,0.15);
}
.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-group .radio-card { flex: 0 0 calc(33.333% - 8px); }
.radio-card {
    flex: 1;
    border: 1px solid var(--secondary);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;              /* 新增 */
    align-items: center;        /* 垂直居中 */
    justify-content: center;    /* 水平居中 */
    gap: 6px;                   /* 两个元素间距 */
}
.radio-card:hover { background: rgba(235,203,203,0.3); }
.radio-card.selected {
    border-color: var(--primary);
    background: rgba(168,90,90,0.08);
    color: var(--primary);
    font-weight: 600;
}
.radio-label {font-size: 0.85rem;}
.radio-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 0; }
.radio-card.selected .radio-text { color: var(--primary); }
.odds-trend {
    height: 40px;
    margin: 12px 0;
    background: linear-gradient(90deg, rgba(168,90,90,0.1) 0%, rgba(212,175,55,0.1) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.dialog-actions {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    padding: 20px 28px 20px;
    border-top: 1px solid var(--glass-border);
    background: var(--card-bg);
}
.dialog-actions .btn { flex: 1; }

.settlement-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin: 16px 0;
    letter-spacing: 0.02em;
}
.settlement-detail {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 8px 0;
}
.confetti-wrap {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 199;
    overflow: hidden;
}
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent-gold);
    animation: confettiFall 2s ease-out forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.number-roll { display: inline-block; }
.hidden { display: none !important; }
.view-achievements {
    overflow-y: auto;
}
