* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #1f5132;
    color: #eafaf0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hr-header {
    width: 100%;
    max-width: 760px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.hr-header h1 { margin: 0; font-size: 1.4rem; font-weight: 800; }
.hr-header h1 span { font-size: 0.55rem; color: #9ed3b3; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.bankroll-wrap { font-size: 0.95rem; } .bankroll-wrap strong { color: #ffe082; font-variant-numeric: tabular-nums; }

.hr-main { width: 100%; max-width: 760px; padding: 6px 12px 28px; }

.race-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(0,0,0,0.18); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px;
    font-size: 0.9rem; font-weight: 600; flex-wrap: wrap; gap: 8px;
}
.bar-right { display: flex; align-items: center; gap: 10px; }
#study-timer { color: #ffe082; font-variant-numeric: tabular-nums; }
.ghost-btn { background: none; border: 1px solid rgba(255,255,255,0.4); color: #eafaf0; border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: 0.8rem; }

/* Runners */
.runners { display: flex; flex-direction: column; gap: 6px; }
.runner {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.06); border: 1.5px solid transparent;
    border-radius: 8px; padding: 8px 10px; cursor: pointer;
}
.runner:hover { background: rgba(255,255,255,0.1); }
.runner.sel { border-color: #ffe082; background: rgba(255,224,130,0.12); }
.r-num { width: 24px; height: 24px; flex: none; border-radius: 50%; background: #0f3a22; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; }
.r-main { flex: 1; min-width: 0; }
.r-name { font-weight: 700; } .r-age { color: #9ed3b3; font-weight: 400; font-size: 0.8rem; }
.r-meta { font-size: 0.78rem; color: #cde6d8; font-variant-numeric: tabular-nums; }
.r-comment { font-size: 0.74rem; color: #9ed3b3; font-style: italic; }
.r-odds { text-align: right; font-weight: 800; font-size: 1rem; }
.r-odds .r-dec { display: block; font-size: 0.7rem; color: #9ed3b3; font-weight: 600; }
.r-fin { width: 28px; text-align: center; font-weight: 800; }
.fin-1 { color: #ffe082; }

/* Betting area */
.betting-area { display: flex; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.bet-controls { flex: 1; min-width: 240px; }
.bet-type { display: flex; gap: 6px; margin-bottom: 8px; }
.bet-type button { flex: 1; padding: 8px; border: 1px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.15); color: #eafaf0; border-radius: 6px; cursor: pointer; font-weight: 600; }
.bet-type button.active { background: #ffe082; color: #1f3a28; border-color: #ffe082; }
.stake-label { display: block; margin-bottom: 8px; font-size: 0.9rem; }
.stake-label input { width: 90px; padding: 6px; border-radius: 6px; border: none; font-size: 16px; }
.place-bet-btn { width: 100%; padding: 10px; border: none; border-radius: 8px; background: #2ecc71; color: #0f3a22; font-weight: 800; cursor: pointer; }
.places-note { font-size: 0.72rem; color: #9ed3b3; margin-top: 8px; }

.slip-wrap { flex: 1; min-width: 240px; }
.slip-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: #9ed3b3; margin-bottom: 6px; }
.betslip { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-height: 28px; }
.bet { background: rgba(0,0,0,0.18); border-radius: 6px; padding: 6px 8px; font-size: 0.8rem; }
.bet.empty { color: #7fae93; font-style: italic; }
.run-btn { width: 100%; padding: 12px; border: none; border-radius: 8px; background: #ffe082; color: #1f3a28; font-weight: 800; font-size: 1rem; cursor: pointer; }

/* Track */
.track-wrap { background: #2e7d4f; border-radius: 10px; padding: 8px; margin-bottom: 12px; }
#track { width: 100%; display: block; }

/* Result */
.result-banner { background: rgba(0,0,0,0.25); border-radius: 10px; padding: 12px; margin-bottom: 12px; text-align: center; }
.result-banner .podium { font-weight: 700; }
.result-banner .net { margin-top: 6px; font-weight: 800; font-size: 1.1rem; }
.result-banner .net.pos { color: #7CFC9A; } .result-banner .net.neg { color: #ff8a80; }

.version-info { position: fixed; bottom: 6px; right: 8px; font-size: 0.65rem; color: rgba(255,255,255,0.35); }
