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