body[data-tool=horse] [data-roulette],body[data-tool=horse] .topbar .roulette-heading { display:none!important; }
body[data-tool=horse]:not(.horse-only) .page-shell>main { display:flex; flex-direction:column; }
body[data-tool=horse] main>[data-ad-position=top] { order:-1; margin:0 0 24px; }
body[data-tool=horse] main>[data-ad-position=footer] { order:1; }
#horse-tool { min-width:0; padding-bottom:24px; color:var(--cw-text); }
.horse-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 22px; }
.horse-eyebrow { margin:0 0 6px; color:var(--cw-primary); font-size:11px; font-weight:750; letter-spacing:2px; }
.horse-heading h1 { margin:0 0 8px; font-size:30px; letter-spacing:-1px; }
.horse-heading p:last-child { margin:0; color:var(--cw-muted); font-size:14px; }
.horse-heading .guide-button { padding:10px 14px; white-space:nowrap; }
.horse-layout { display:grid; grid-template-columns:290px minmax(0,1fr); gap:20px; align-items:start; }
.horse-card { min-width:0; border:1px solid var(--cw-line); border-radius:16px; background:var(--cw-surface); box-shadow:0 4px 18px #172b3a05; }
.horse-settings { padding:22px; }
.horse-section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.horse-section-title h2 { margin:0; font-size:17px; }
.horse-section-title .count { white-space:nowrap; border-radius:8px; padding:5px 8px; font-size:12px; }
#horse-fields { margin:0; padding:0; border:0; min-width:0; }
#horse-fields>label { display:block; margin:18px 0 8px; font-weight:650; font-size:13px; }
.horse-roster-heading { display:flex; justify-content:space-between; gap:10px; font-size:13px; font-weight:650; margin-bottom:10px; }.horse-roster-heading span+span { font-size:11px; color:var(--cw-muted); font-weight:400; }
.horse-roster { display:grid; gap:7px; max-height:334px; overflow:auto; padding:2px 3px 3px 1px; scrollbar-width:thin; }
.horse-person { display:flex; align-items:center; gap:7px; min-width:0; }.horse-person>span { display:grid; place-items:center; width:24px; height:24px; flex:none; border-radius:50%; background:var(--horse-color); color:#fff; font-size:11px; font-weight:750; box-shadow:inset 0 -2px 3px #00000016; }
html[data-theme] .horse-person input { min-width:0; width:100%; height:36px; padding:7px 9px; border-radius:8px; border:1px solid var(--cw-input); background:var(--cw-page); color:var(--cw-text); font-family:inherit; font-size:13px; box-sizing:border-box; }
.horse-person input:focus-visible { outline:2px solid var(--cw-primary); outline-offset:1px; }
.horse-person button { flex:none; width:25px; height:30px; padding:0; border:0; background:transparent; color:var(--cw-muted); border-radius:6px; font-size:19px; }.horse-person button:hover:not(:disabled) { background:#d9494910; color:#b83641; }.horse-person button:disabled { opacity:.3; }
.horse-add { width:100%; margin-top:10px; padding:9px; background:var(--cw-selected); color:var(--cw-primary); border:1px dashed var(--cw-input); border-radius:8px; font-size:12px; font-weight:650; }
.horse-camera-note { position:absolute; bottom:12px; left:50%; transform:translateX(-50%); z-index:4; border:1px solid #fff9; background:#ffffffcc; border-radius:20px; padding:5px 11px; color:#376662; font-size:10px; backdrop-filter:blur(5px); pointer-events:none; white-space:nowrap; }
#horse-mode { width:100%; }
.horse-top-row { display:flex; gap:10px; align-items:center; margin-top:12px; font-size:14px; }
html[data-theme] #horse-top-count { width:72px; }
.horse-hint { margin:9px 0 0; color:var(--cw-muted); font-size:12px; line-height:1.65; }
.horse-equal { display:flex; align-items:center; gap:10px; margin-top:22px; border-radius:10px; padding:12px; background:var(--cw-selected); color:var(--cw-primary); }
.horse-equal>span { font-size:21px; }.horse-equal p { margin:0; font-size:12px; line-height:1.7; }
.horse-error { margin:12px 0; font-size:13px; color:#b93442; line-height:1.7; }
.horse-race-card { overflow:hidden; }
.horse-stage { position:relative; height:570px; overflow:hidden; background:radial-gradient(ellipse at 65% 15%,#f9effb88,transparent 60%),linear-gradient(150deg,#e6f2f5,#f1f1ee 60%,#e1eeea); }
.horse-stage canvas { display:block; width:100%; height:100%; border:0; border-radius:0; box-shadow:none; }
#horse-stage { background:linear-gradient(#d9eff4,#eef5df); }
.horse-labels { position:absolute; inset:0; pointer-events:none; z-index:2; }
.horse-name { position:absolute; transform:translate(-50%,-100%); background:#ffffffeb; border:1px solid #ffffff; border-bottom:2px solid var(--horse-color); border-radius:5px; padding:3px 6px; color:#203544; font-size:10px; font-weight:650; white-space:nowrap; max-width:125px; overflow:hidden; text-overflow:ellipsis; box-shadow:0 2px 5px #18334412; }
.horse-scorebar { position:absolute; z-index:4; inset:0 0 auto; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 18px; background:linear-gradient(#ffffffef,#ffffffaa); color:#263b49; font-size:12px; }
.horse-scorebar>div { display:flex; align-items:center; gap:9px; }.horse-scorebar i { width:7px; height:7px; border-radius:50%; background:#0f9286; box-shadow:0 0 0 4px #0f928614; }
#horse-selection { border:1px solid #b9d8ce; padding:4px 8px; border-radius:6px; color:#11685d; background:#f5fffa; font-size:11px; }
#horse-time { font:650 17px/1 ui-monospace,monospace; margin-left:5px; }
.horse-countdown { position:absolute; top:42%; left:50%; transform:translate(-50%,-50%); z-index:5; display:grid; place-items:center; width:95px; height:95px; border-radius:50%; background:#ffffffd9; color:#0f766e; font-size:56px; font-weight:850; box-shadow:0 10px 45px #244e4320; }
.horse-result { position:absolute; z-index:6; left:8%; right:8%; top:42%; transform:translateY(-50%); padding:20px; text-align:center; border:1px solid #fff; border-radius:14px; background:#ffffffdc; color:#172b3a; box-shadow:0 8px 40px #22443918; backdrop-filter:blur(8px); }
.horse-result>span { display:block; margin-bottom:8px; color:#0f766e; font-size:14px; font-weight:700; }
#horse-result-names { display:flex; justify-content:center; gap:10px; flex-wrap:wrap; max-height:170px; overflow:auto; }
#horse-result-names strong { font-size:clamp(24px,3vw,42px); line-height:1.35; overflow-wrap:anywhere; }.horse-result[data-multiple=true] strong { font-size:24px; }.horse-result small { display:block; margin-top:9px; color:#536574; font-size:11px; }
.horse-graphics-error { position:absolute; top:40%; left:10%; right:10%; z-index:8; background:#fff7f5; color:#a52b30; padding:20px; font-size:14px; border:1px solid #dfb7b4; border-radius:10px; line-height:1.7; }
.horse-race-footer { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:15px 20px; border-top:1px solid var(--cw-line); }
.horse-race-footer p { margin:0; font-size:13px; color:var(--cw-muted); line-height:1.6; min-width:0; overflow-wrap:anywhere; }
.horse-actions { display:flex; gap:8px; flex-shrink:0; }.horse-actions button { padding:10px 20px; border-radius:8px; min-width:110px; font-weight:700; }
.horse-ranking { padding:18px 20px 20px; border-top:1px solid var(--cw-line); }.horse-ranking .horse-section-title { margin-bottom:12px; }.horse-ranking h2 { font-size:14px; }#horse-ranking-note { font-size:11px; color:var(--cw-muted); }
#horse-ranking-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; list-style:none; padding:0; margin:0; max-height:192px; overflow:auto; }
#horse-ranking-list li { min-width:0; display:flex; align-items:center; gap:7px; padding:9px 8px; background:var(--cw-page); border-radius:7px; font-size:12px; border:1px solid transparent; }
#horse-ranking-list li[data-selected=true] { background:var(--cw-selected); border-color:var(--cw-primary); }#horse-ranking-list b { color:var(--cw-primary); font-size:12px; min-width:19px; }#horse-ranking-list span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }#horse-ranking-list small { margin-left:auto; font-size:10px; color:var(--cw-muted); white-space:nowrap; }
#horse-ranking-list span::before { content:''; display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--horse-color); margin-right:6px; vertical-align:1px; }
.horse-history { margin-top:20px; padding:20px 22px; }.horse-history .horse-section-title { margin-bottom:10px; }
#horse-history-list { list-style:none; margin:0; padding:0; }#horse-history-list>li+li { border-top:1px solid var(--cw-line); }
.horse-history summary { display:flex; flex-wrap:wrap; gap:12px; padding:13px 0; font-size:13px; cursor:pointer; }.horse-history summary time { color:var(--cw-muted); font-size:12px; }.horse-history summary strong { flex:1; min-width:0; overflow-wrap:anywhere; }
.horse-history-ranking { display:flex; flex-wrap:wrap; gap:8px 16px; padding:0 0 15px; margin:0; list-style:none; font-size:12px; color:var(--cw-muted); }
#horse-help-dialog { max-width:460px; width:calc(100vw - 50px); box-sizing:border-box; }#horse-help-dialog ol { padding-left:22px; font-size:14px; line-height:2; }#horse-help-dialog button { padding:10px 20px; border-radius:8px; }
html[data-theme=dark] .horse-stage { background:radial-gradient(ellipse at 50% 30%,#3d5775,#263d4b); }
@media(max-width:1100px) { .horse-layout { grid-template-columns:255px minmax(0,1fr); gap:16px; }.horse-settings { padding:18px; }.horse-stage { height:530px; }#horse-ranking-list { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:800px) { .horse-layout { display:flex; flex-direction:column; }.horse-settings { width:100%; box-sizing:border-box; }.horse-race-card { width:100%; }.horse-stage { height:470px; }#horse-fields { display:block; }.horse-roster { grid-template-columns:repeat(2,minmax(0,1fr)); max-height:220px; gap:8px 12px; }.horse-top-row { flex-wrap:wrap; }.horse-equal { margin-top:14px; }.horse-equal br { display:none; }.horse-equal p { line-height:1.6; }.horse-heading h1 { font-size:26px; }.horse-heading p:last-child { font-size:12px; } }
@media(max-width:430px) { html[data-theme] .tool-tabs button { padding:11px 5px; min-width:0; font-size:12px; }.horse-heading { align-items:start; gap:8px; }.horse-heading .guide-button { padding:8px; font-size:12px; }.horse-heading h1 { font-size:24px; }.horse-stage { height:420px; }.horse-scorebar { padding:12px 10px; gap:6px; font-size:10px; }.horse-scorebar>div { gap:6px; }#horse-time { font-size:14px; margin:0; }#horse-selection { font-size:10px; padding:3px 5px; }.horse-name { font-size:9px; padding:2px 4px; max-width:86px; }.horse-race-footer { padding:12px; flex-wrap:wrap; gap:10px; }.horse-actions { margin-left:auto; }.horse-actions button { min-height:40px; padding:9px 17px; }.horse-ranking { padding:15px 12px; }#horse-ranking-list { grid-template-columns:repeat(2,minmax(0,1fr)); }#horse-ranking-note { display:none; }.horse-history { padding:16px; }.horse-result { left:5%; right:5%; }.horse-result[data-multiple=true] strong { font-size:20px; } }
body.horse-only { overflow:hidden; }body.horse-only .topbar,body.horse-only .ad-rail,body.horse-only main>:not(#horse-tool),body.horse-only .horse-heading,body.horse-only .horse-settings,body.horse-only .horse-history,body.horse-only .horse-ranking { display:none!important; }
body.horse-only .page-shell,body.horse-only main,body.horse-only #horse-tool,body.horse-only .horse-layout { display:block; width:100%; min-width:0; max-width:none; margin:0; padding:0; }
body.horse-only .horse-race-card { position:fixed; inset:0; border:0; border-radius:0; height:100dvh; display:flex; flex-direction:column; }.horse-only .horse-stage { flex:1; min-height:0; height:auto; }.horse-only .horse-race-footer { flex:none; padding:8px 14px; }.horse-only .horse-actions button { min-height:34px; padding:6px 14px; }
@media(max-width:800px) { html[data-theme] .horse-person input { font-size:16px; } }
@media(max-width:430px) { .horse-roster { grid-template-columns:minmax(0,1fr); max-height:234px; } }
@media(max-width:430px) { html[data-theme] .tool-tabs button { white-space:nowrap; }.tool-tabs #tool-cliff { flex:1.05; }.tool-tabs #tool-marble,.tool-tabs #tool-horse { flex:1.3; } }
@media(prefers-reduced-motion:reduce) { .horse-name { transition:none; } }
