/* Shared layout and roulette, matching the November design review. */
html[data-theme] body { font-size:14px; }
html[data-theme] .topbar { min-height:68px; padding:10px 24px; gap:28px; flex-wrap:nowrap; }
.topbar .brand { font-size:23px; letter-spacing:-1px; }
.topbar .tool-tabs { flex:1; min-width:0; }
html[data-theme] .topbar .tool-tabs button { min-width:0; min-height:42px; padding:9px 16px; font-size:14px; white-space:nowrap; }
html[data-theme] .topbar .tool-tabs button[aria-selected=true] { box-shadow:none; }
html[data-theme] .theme-toggle { min-height:36px; padding:7px 10px; font-size:12px; white-space:nowrap; }
html[data-theme] .page-shell { max-width:1440px; padding:0 24px; }
html[data-theme] .page-shell>main { padding-top:20px; }
html[data-theme] :is(.panel,.pick-card,.cliff-roster-panel,.cliff-arena-card,.marble-card,.horse-card) { border-color:var(--cw-line); border-radius:12px; box-shadow:0 3px 14px #20373d03; }
html[data-theme] :is(.heading,.pick-heading,.cliff-heading,.marble-heading,.horse-heading) { margin:0 0 18px; }
html[data-theme] :is(.heading,.pick-heading,.cliff-heading,.marble-heading,.horse-heading) h1 { font-size:26px; line-height:1.35; letter-spacing:-.8px; color:var(--cw-text); }
html[data-theme] :is(.heading,.pick-heading,.cliff-heading,.marble-heading,.horse-heading) p { font-size:12px; line-height:1.6; margin:4px 0 0; color:var(--cw-muted); }
html[data-theme] .guide-button { min-height:34px; padding:7px 11px; font-size:12px; white-space:nowrap; }
html[data-theme] .ad-banner { max-width:970px; margin:0 auto 20px; }
html[data-theme] .ad-label { font-size:10px; letter-spacing:1px; margin-bottom:6px; }
html[data-theme] .ad-placement .ad-space { border-radius:0; }
html[data-theme] main>[data-ad-position=footer] { margin:24px auto; }
html[data-theme] .roulette-heading { display:flex; align-items:center; gap:16px; }
.roulette-heading .roulette-heading-copy { display:block; margin-right:auto; }
.roulette-heading #roulette-eyebrow { display:none; }
html[data-theme] .roulette-heading #sharing { display:flex; align-items:center; gap:8px; padding:0; margin:0; border:0; box-shadow:none; background:transparent; max-width:360px; }
.roulette-heading #sharing>div { display:block; }
.roulette-heading #sharing strong { font-size:12px; color:var(--cw-muted); }
.roulette-heading #share-status { display:none; }
.roulette-heading #sharing:has(a:not([href])) #share-status { display:block; font-size:11px; }
.roulette-heading #display { width:128px; font-size:12px; }
html[data-theme] .roulette-heading #copy-display { min-height:34px; font-size:12px; padding:7px 10px; }
.roulette-heading .heading-actions { flex-wrap:nowrap; gap:8px; }
body[data-tool=roulette]:not(.wheel-only) .connection-row { grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); gap:16px; margin-bottom:16px; }
html[data-theme] .connection { padding:12px 16px; gap:8px 12px; }
.connection .connection-footer { gap:3px; }
html[data-theme] .connection :is(.status,#receive-count) { font-size:12px; line-height:1.4; }
html[data-theme] .connection .platform-picker { padding:2px; gap:2px; border:0; background:var(--cw-page); border-radius:7px; }
html[data-theme] .connection .platform-picker button { min-height:28px; padding:4px 12px; font-size:12px; }
html[data-theme] .connection .platform-picker button[aria-pressed=true] { background:var(--cw-surface); color:var(--cw-primary); box-shadow:0 1px 4px #183c4612; }
html[data-theme] .connection #channel { min-height:34px; padding:7px 10px; font-size:12px; }
html[data-theme] .connection :is(#connect,#disconnect) { min-height:34px; padding:7px 12px; font-size:12px; }
.connection .connection-options { grid-row:3; gap:10px; font-size:11px; }
.connection #panda-connection-options { grid-row:4; gap:12px; font-size:11px; }
.connection #platform-status { font-size:11px; }
html[data-theme] .recent-history { min-height:150px; }
.recent-history-inner { padding:12px 16px; }
html[data-theme] .recent-history h2 { font-size:14px; line-height:20px; margin:0 0 6px; }
html[data-theme] .recent-history :is(th,td) { font-size:11px; height:25px; padding:3px 6px; line-height:18px; }
html[data-theme] .recent-history td:nth-child(4),html[data-theme] .recent-history td:first-child:not(.table-empty) { font-size:11px; }
.recent-history .recent-time-column { width:60px; }.recent-history .recent-participant-column { width:25%; }.recent-history .recent-input-column { width:34%; }.recent-history .recent-slots-column { width:48px; }.recent-history .recent-source-column { width:58px; }
body[data-tool=roulette]:not(.wheel-only) .page-shell .workspace { display:grid; grid-template-columns:236px minmax(0,1fr) 300px; gap:16px; align-items:stretch; }
body[data-tool=roulette]:not(.wheel-only) .workspace>:is(.settings,.participants) { grid-column:auto; padding:16px; min-height:0; }
html[data-theme] :is(.settings,.participants) h2 { font-size:16px; }
html[data-theme] .settings .rule-settings-heading p { font-size:12px; margin:5px 0 8px; }
.settings .rule-choice { margin:12px 0 8px; }
html[data-theme] .settings :is(label:not(.check),.rule-choice) { font-size:12px; }
.settings .rule-choice input { width:17px; height:17px; }
.settings .rule-fields>label,.settings .rule-equation label { margin:8px 0 4px; }
html[data-theme] .settings :is(input:not([type=checkbox]),select) { min-height:34px; height:34px; font-size:12px; padding:6px 9px; }
html[data-theme] .settings .input-unit input { padding-right:48px; }
html[data-theme] .settings .rule-equation input { padding-right:31px; }
.settings .input-unit>span { top:9px; font-size:11px; }
html[data-theme] .settings .exact-rule-summary { padding:9px 0 10px; margin:0 0 10px; border:0; border-bottom:1px solid var(--cw-line); background:transparent; border-radius:0; }
html[data-theme] .settings .exact-rule-summary p { font-size:11px; line-height:1.5; margin-bottom:6px; }
html[data-theme] .settings #edit-exact-rules { font-size:12px; min-height:32px; padding:6px 8px; }
html[data-theme] .settings .example { padding:8px; margin:10px 0; font-size:11px; line-height:1.7; }
.settings .rule-save-area { padding:10px 0 0; }
.settings .rule-save-area button { min-height:38px; font-size:13px; }
.settings #fan-help,.settings #rule-save-hint { font-size:11px; line-height:1.5; margin:5px 0 0; }
body[data-tool=roulette]:not(.wheel-only) .wheel-panel { padding:18px 16px 14px; justify-content:center; }
body:not(.wheel-only) .wheel-panel .wheel-stage { width:calc(100% - 24px); max-width:510px; margin:24px auto 18px; }
html[data-theme] body:not(.wheel-only) .wheel-panel .spin-button { width:72%; align-self:center; min-height:44px; font-size:16px; margin:0; }
html[data-theme] body:not(.wheel-only) .wheel-panel .reset-button { align-self:center; width:auto; min-height:30px; padding:5px 14px; margin-top:7px; font-size:12px; border:0; background:transparent; color:#536574; }
.participants .section-title { margin-bottom:9px; }
html[data-theme] .participants .participant-undo { font-size:11px; padding:4px 6px; min-height:28px; border-color:var(--cw-line); }
.participants .participant-heading-actions { gap:5px; }
html[data-theme] .participants .participant-help { font-size:11px; margin:0 0 8px; }
.participants .participant-add-form { margin-bottom:12px; gap:6px; }
html[data-theme] .participants .participant-add-form :is(input,button) { min-height:34px; font-size:12px; padding:7px 9px; }
.participants .people-list { gap:6px; padding-right:3px; min-height:180px; }
body:not(.readonly) .participants .people-list .person { border:0; padding:7px 6px; border-radius:7px; gap:3px; background:var(--cw-page); }
.participants .person-name-button { font-size:12px; line-height:20px; }
.participants .person-details { padding-left:11px; }.participants .person-details:before { width:6px; height:6px; top:7px; }
body:not(.readonly) .participants .people-list .person-slot-form { grid-template-columns:minmax(48px,54px) 44px; height:26px; gap:4px; }
html[data-theme] .participants .person-slot-form input { min-height:26px; height:26px; font-size:12px; }
body:not(.readonly) .participants .slot-stepper { height:26px; grid-template-rows:26px; gap:2px; }
html[data-theme] .participants .person-slot-form .slot-step { min-width:0; min-height:26px; height:26px; width:21px; border-color:var(--cw-line); }
body.readonly .participants .person { border:0; background:var(--cw-page); padding:8px; }
body.readonly .participants .person-name { font-size:13px; }
body.readonly .participants .person-slot-count { font-size:12px; }
html[data-theme] .history { padding:16px; }.history h2 { font-size:16px; }
html[data-theme] .history :is(th,td) { font-size:12px; padding:8px; }
html[data-theme] .page-shell footer { font-size:11px; }
body.readonly[data-tool=roulette]:not(.wheel-only) .page-shell .workspace { grid-template-columns:minmax(0,1fr) 300px; }
body.readonly .roulette-heading #sharing { display:none; }
@media(min-width:1101px) { body:not(.wheel-only) .participants .people-list { flex:1; height:0; max-height:none; } }
@media(max-width:1100px) and (min-width:761px) {
  body[data-tool=roulette]:not(.wheel-only) .page-shell .workspace { grid-template-columns:220px minmax(0,1fr); }
  body[data-tool=roulette]:not(.wheel-only) .workspace>.participants { grid-column:1/-1; }
  body.readonly[data-tool=roulette]:not(.wheel-only) .page-shell .workspace { grid-template-columns:minmax(0,1fr) 280px; }
  body.readonly[data-tool=roulette]:not(.wheel-only) .workspace>.participants { grid-column:auto; }
  .roulette-heading #display { width:100px; }
}
@media(max-width:900px) { html[data-theme] .topbar { gap:12px; flex-wrap:wrap; } .topbar .tool-tabs { order:3; width:100%; flex-basis:100%; overflow-x:auto; } html[data-theme] .topbar .tool-tabs button { flex:1; padding:9px; } }
@media(max-width:760px) {
  html[data-theme] .page-shell { padding:0 14px; } html[data-theme] .page-shell>main { padding-top:16px; }
  html[data-theme] .topbar { padding:10px 14px; }
  html[data-theme] .roulette-heading { flex-wrap:wrap; gap:10px; }
  .roulette-heading .roulette-heading-copy { width:100%; }
  html[data-theme] .roulette-heading #sharing { margin-right:auto; max-width:calc(100% - 100px); gap:6px; }
  .roulette-heading #display { width:74px; }.roulette-heading #sharing strong { font-size:11px; }
  body[data-tool=roulette]:not(.wheel-only) .connection-row { grid-template-columns:1fr; gap:12px; }
  html[data-theme] .recent-history { height:140px; min-height:140px; }
  body[data-tool=roulette]:not(.wheel-only) .page-shell .workspace,body.readonly[data-tool=roulette]:not(.wheel-only) .page-shell .workspace { display:flex; flex-direction:column; gap:14px; }
  body[data-tool=roulette]:not(.wheel-only) .workspace>.wheel-panel { order:0; }
  body[data-tool=roulette]:not(.wheel-only) .workspace>.participants { order:1; }
  body[data-tool=roulette]:not(.wheel-only) .workspace>.settings { order:2; display:block; }
  .participants .people-list { height:auto!important; max-height:480px!important; flex:none!important; }
  body[data-tool=roulette]:not(.wheel-only) .page-shell>main { display:block; }
  html[data-theme] .ad-banner { margin-bottom:16px; }
  html[data-theme] .page-shell footer { gap:12px; }
}
@media(pointer:coarse) { html[data-theme] .participants .person-slot-form input { height:36px; min-height:36px; } body:not(.readonly) .participants .people-list .person-slot-form,body:not(.readonly) .participants .slot-stepper { height:36px; grid-template-rows:36px; } html[data-theme] .participants .person-slot-form .slot-step { height:36px; min-height:36px; } }
