:root{--ink:#252b1c;--lime:#d3e936;--paper:#f8f8ef;--line:rgba(37,43,28,.23);font-family:Arial,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;background:#10121c;padding:32px 24px 40px}button,input{font:inherit;color:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.32;cursor:default}button:focus-visible,input:focus-visible{outline:2px solid var(--ink);outline-offset:5px}button{touch-action:manipulation}[hidden]{display:none!important}.game-shell{width:min(1100px,100%);margin:auto;background:var(--lime);border:1px solid rgba(255,255,255,.4);border-radius:10px;padding:36px 44px 26px;box-shadow:0 16px 70px #0002;transition:background .6s;overflow:hidden}.game-shell.racing{background:#d6dfb5}.masthead{display:flex;align-items:center;justify-content:space-between;padding-bottom:29px;border-bottom:1px solid var(--line)}.wordmark{background:none;border:0;padding:0;font-size:25px;letter-spacing:-1.5px;font-weight:850}.wordmark span{margin-left:0}.header-actions{display:flex;gap:24px;align-items:center}.text-button{border:0;padding:4px 0;background:transparent;font-size:13px;line-height:1.5;white-space:nowrap}.text-button:hover:not(:disabled){opacity:.65}.sound-button{display:flex;gap:7px;align-items:center}#sound-icon{font-size:18px}.draw-intro{display:flex;justify-content:space-between;align-items:flex-end;padding:42px 0 30px}.eyebrow{font-size:12px;line-height:1.5;margin:0 0 12px;font-weight:500;letter-spacing:.05em}h1{font-size:66px;line-height:1.15;letter-spacing:-3px;font-weight:900;margin:0}h1 span{font-weight:400;letter-spacing:-2px}.intro-aside{font-size:15px;line-height:1.85;margin:0 2px 8px;letter-spacing:.03em}.drawing-card{background:var(--paper);border:1px solid #b2bd60;border-radius:7px;box-shadow:0 5px 0 #7d8d2b55;overflow:hidden}.canvas-meta{display:flex;justify-content:space-between;align-items:center;padding:17px 20px 0;font-size:12px;color:#727968;pointer-events:none}.canvas-meta b{margin-left:7px;font-size:22px;font-weight:400;vertical-align:-2px}.drawing-surface{height:clamp(290px,34vw,390px);position:relative}#drawing-canvas{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair}.empty-hint{position:absolute;bottom:10%;left:0;right:0;text-align:center;color:#a1a78b;font-size:13px;letter-spacing:.1em;pointer-events:none;transition:opacity .2s}.empty-hint.faded{opacity:0}.drawing-tools{padding:8px 20px 17px;display:flex;align-items:center;justify-content:space-between;gap:12px}.swatches{display:flex;gap:10px;align-items:center;padding:2px}.swatch{position:relative;width:23px;height:23px;border-radius:50%;background:var(--swatch);border:1px solid #0001;padding:0}.swatch.selected:after{content:"";position:absolute;inset:-5px;border:1.5px solid var(--swatch);border-radius:50%}.tool-actions{display:flex;gap:23px;align-items:center;color:#6c7261}.guide-button{margin-right:5px;font-size:11px}.guide-button.active{color:#4f5841;text-decoration:underline;text-decoration-style:dashed;text-underline-offset:4px}.draw-submit-row{display:flex;align-items:flex-end;justify-content:space-between;margin-top:27px;gap:24px}.name-field{display:flex;flex-direction:column;width:265px;gap:9px;font-size:12px;color:#596329}.name-field input{border:0;border-bottom:1px solid #89991f66;border-radius:0;background:transparent;outline:none;padding:0 0 8px;font-size:21px;font-weight:650;width:100%;color:var(--ink)}.name-field input:focus{border-bottom-color:var(--ink)}.primary-button{display:flex;align-items:center;justify-content:space-between;gap:35px;min-height:59px;min-width:240px;padding:15px 22px;border:1px solid #252b1c;border-radius:3px;background:var(--ink);color:#eef4c8;font-size:17px;font-weight:650;box-shadow:0 3px 0 #88942f55;transition:transform .16s,background .16s}.primary-button span{font-size:26px;font-weight:400;line-height:1}.primary-button:hover{background:#384329;transform:translateY(-1px)}.primary-button:active{transform:translateY(1px)}.borrow-button{display:block;margin:25px auto 40px;border:0;background:none;padding:6px;font-size:12px}.borrow-button span{margin-left:4px}.borrow-button:hover{text-decoration:underline;text-underline-offset:4px}.page-footer{display:flex;justify-content:space-between;font-size:11px;line-height:1.5;color:#58602d;padding-top:8px;gap:20px}.page-footer i{font-style:normal;padding:0 5px}.race-heading{position:relative;z-index:2;padding:27px 0 0;display:flex;justify-content:space-between;align-items:flex-start}.race-heading .eyebrow{margin-bottom:8px}h2{font-size:30px;letter-spacing:-1px;margin:0;line-height:1.2}.race-stage{height:570px;position:relative;margin:0 -44px;isolation:isolate;transition:height .6s}.race-stage canvas{display:block;width:100%;height:100%}.live-standings{position:absolute;top:25px;right:43px;width:155px;display:grid;gap:4px;z-index:2}.standing-row{display:flex;align-items:center;gap:9px;font-size:11px;padding:9px 11px;border-radius:2px;transition:background .2s;background:#d6dfb52b}.standing-row.is-player{color:#eef4c8;background:var(--ink)}.standing-row b{width:12px;font-weight:500}.standing-dot{height:5px;width:5px;background:var(--horse-color);border-radius:50%}.standing-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.countdown{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:126px;font-weight:850;color:var(--ink);text-shadow:0 2px 0 #f8f8ef80;pointer-events:none;padding-bottom:80px}.countdown.pulse{animation:count-pulse .7s both}@keyframes count-pulse{0%{transform:scale(1.15);opacity:0}15%{opacity:1}80%{opacity:1}100%{transform:scale(.95);opacity:0}}.finish-stamp{position:absolute;top:35%;left:50%;transform:translate(-50%,-50%) rotate(-9deg);font-size:70px;font-weight:850;white-space:nowrap;border:4px solid var(--ink);padding:8px 20px;animation:stamp .3s both}@keyframes stamp{from{opacity:0;transform:translate(-50%,-50%) rotate(-9deg) scale(1.5)}to{opacity:1;transform:translate(-50%,-50%) rotate(-9deg) scale(1)}}.race-progress{position:relative;z-index:2;width:300px;max-width:100%;margin:-8px auto 42px}.distance-row{display:flex;align-items:center;justify-content:space-between;font-size:12px;font-variant-numeric:tabular-nums;margin-bottom:9px}.progress-track{height:3px;background:#69744045;overflow:hidden}.progress-track div{height:100%;width:0;background:var(--ink);transition:width .12s linear}.race-progress p{font-size:12px;text-align:center;color:#647049;margin:15px -20px 0}.race-stage.finished{height:290px}.race-stage.finished .live-standings{display:none}.results{margin-top:0;animation:rise .55s both}.result-heading{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);padding-top:26px;gap:16px}.result-heading h2{font-size:57px;letter-spacing:-3px;font-weight:850}.result-copy{font-size:14px;margin:12px 0 0;color:#586143}.result-time{display:flex;flex-direction:column;text-align:right;gap:6px}.result-time strong{font-size:50px;font-weight:500;font-variant-numeric:tabular-nums;letter-spacing:-2px}.result-time span{font-size:12px;color:#657050}.result-actions{display:flex;gap:14px;margin:26px 0 30px}.result-actions .primary-button{flex:1;min-width:0;font-size:15px}.secondary-button{border:1px solid #7d8860;background:transparent;border-radius:3px;padding:15px 20px;min-height:57px;font-size:15px;flex:1;display:flex;align-items:center;justify-content:space-between;gap:20px}.secondary-button:hover{background:#e5ebce80}.score-section{padding:2px 0 24px;animation:rise .45s both}.section-label{border-bottom:1px solid var(--line);padding-bottom:13px;display:flex;justify-content:space-between;gap:20px;font-size:12px}.section-label span:last-child{font-size:11px;color:#657050}.score-layout{display:grid;grid-template-columns:1fr 1.2fr;gap:38px;margin-top:23px}.result-roster{display:flex;flex-direction:column;gap:5px}.roster-row{display:grid;grid-template-columns:22px 64px 1fr 42px;align-items:center;gap:9px;width:100%;text-align:left;padding:12px 10px;background:transparent;border:1px solid transparent;border-radius:3px}.roster-row.selected{background:#f6f7e990;border-color:#b3be94}.roster-row:hover{background:#edf1d670}.roster-row canvas{width:64px;height:42px}.roster-rank{font-size:18px}.roster-person{display:flex;flex-direction:column;gap:5px;min-width:0}.roster-person strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:550}.roster-person span{font-size:11px;color:#64704d}.roster-score{font-size:19px;text-align:right;font-variant-numeric:tabular-nums}.score-detail-heading{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:2px 0 20px}.score-detail h3{font-size:16px;margin:0}.score-detail-heading>span{font-size:12px;color:#596446}.metric-row{display:grid;grid-template-columns:59px 1fr 40px;gap:12px;align-items:center;margin:13px 0;font-size:12px}.metric-row>span:last-child{text-align:right;font-variant-numeric:tabular-nums}.metric-track{height:7px;background:#86966433;border-radius:1px;overflow:hidden}.metric-fill{height:100%;background:var(--ink);transform-origin:left;animation:bar-in .55s both}.score-caption{font-size:11px;line-height:1.7;color:#5d6948;margin-top:18px}.score-footer{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding-top:17px;margin-top:23px;gap:16px;font-size:11px;color:#657050}.score-footer button{font-size:12px}.toast{position:fixed;left:50%;bottom:32px;transform:translate(-50%,15px);background:#252b1cf5;color:#f8f8ed;border:1px solid #ffffff30;padding:13px 20px;font-size:13px;border-radius:4px;z-index:20;opacity:0;pointer-events:none;transition:.2s;max-width:calc(100% - 32px);text-align:center}.toast.visible{opacity:1;transform:translate(-50%,0)}dialog{border:1px solid #afb99a;background:#f6f7e9;border-radius:8px;padding:27px 30px 30px;max-width:460px;width:calc(100% - 36px);color:var(--ink);box-shadow:0 20px 100px #0004}dialog::backdrop{background:#10121b99;backdrop-filter:blur(5px)}.dialog-top{display:flex;align-items:center;justify-content:space-between}.dialog-top .eyebrow{margin:0}.icon-button{border:0;background:none;font-size:28px;line-height:1;padding:2px 4px}dialog h2{font-size:42px;margin:20px 0;line-height:1.15}dialog ol{padding-left:22px;display:grid;gap:20px;font-size:14px}dialog li{padding-left:5px}dialog li strong{display:block;font-weight:600;margin-bottom:7px}dialog li span{font-size:12px;line-height:1.7;color:#6a735e}.prototype-note{font-size:11px;line-height:1.8;color:#727a68;border-top:1px solid #c7ceba;padding-top:17px;margin:23px 0}.full-width{width:100%;justify-content:center;min-width:0;font-size:15px}@keyframes rise{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}@keyframes bar-in{from{transform:scaleX(0)}to{transform:scaleX(1)}}
body{padding:12px 10px 20px}.game-shell{padding:23px 22px 20px;border-radius:7px}.masthead{padding-bottom:20px}.wordmark{font-size:22px}.header-actions{gap:16px}.text-button{font-size:12px}.draw-intro{padding:30px 0 25px}h1{font-size:53px;letter-spacing:-3px}.eyebrow{font-size:10px;margin-bottom:12px}.intro-aside{font-size:12px;margin-bottom:4px}.canvas-meta{padding:12px 12px 0;font-size:10px}.canvas-meta b{font-size:18px}.drawing-surface{height:290px}.drawing-tools{padding:10px 13px 16px}.swatches{gap:9px}.swatch{height:20px;width:20px}.tool-actions{gap:15px}.guide-button{font-size:10px;margin-right:0}.tool-actions .text-button{font-size:11px}.draw-submit-row{gap:20px;margin-top:26px}.name-field{width:45%;font-size:10px;gap:10px}.name-field input{font-size:18px;padding-bottom:8px}.primary-button{min-width:0;min-height:54px;gap:17px;padding:13px 17px;font-size:15px}.primary-button span{font-size:22px}.borrow-button{margin:24px auto 34px;font-size:11px}.page-footer{font-size:9px;gap:10px}.race-heading{padding-top:24px}.race-heading h2{font-size:25px}.race-heading .text-button{font-size:11px}.race-stage{margin:0 -22px;height:510px}.live-standings{top:20px;right:17px;width:122px;gap:2px}.standing-row{font-size:9px;padding:7px 8px;gap:6px}.countdown{font-size:105px}.race-progress{width:250px;margin-top:0;margin-bottom:35px}.distance-row{font-size:11px}.race-progress p{font-size:11px}.race-stage.finished{height:240px}.result-heading{padding-top:22px}.result-heading h2{font-size:44px;letter-spacing:-2px}.result-time strong{font-size:39px}.result-time span{font-size:10px}.result-copy{font-size:12px;line-height:1.6}.result-actions{gap:9px;margin:24px 0}.result-actions .primary-button,.secondary-button{font-size:12px;min-height:51px;padding:12px 12px;gap:8px}.score-layout{grid-template-columns:1fr;gap:24px;margin-top:16px}.roster-row{grid-template-columns:23px 60px 1fr 40px;padding:8px 10px}.score-detail{padding:17px 12px;background:#f4f5e780;border:1px solid #bac49f;border-radius:4px}.score-detail-heading{margin-bottom:17px}.metric-row{margin:15px 0}.score-caption{margin-bottom:0}.section-label{font-size:11px}.section-label span:last-child{font-size:9px}.score-footer{align-items:flex-start;flex-direction:column;font-size:10px;gap:13px}.finish-stamp{font-size:50px}
@media(max-width:380px){.game-shell{padding-left:17px;padding-right:17px}.race-stage{margin-left:-17px;margin-right:-17px}h1{font-size:46px}.intro-aside{font-size:11px}.drawing-tools{padding-left:10px;padding-right:10px}.tool-actions{gap:11px}.swatches{gap:8px}.swatch{width:18px;height:18px}.drawing-surface{height:275px}.name-field input{font-size:16px}.page-footer span:last-child{max-width:115px;text-align:right}.header-actions{gap:13px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* One portrait layout: the wide screen only previews the phone-sized game. */
html{background:var(--lime);overscroll-behavior-y:none}
body{padding:0;background:var(--lime);overscroll-behavior-y:none}
.game-shell{width:100%;max-width:480px;min-height:100svh;margin:0 auto;padding:18px 18px max(16px,env(safe-area-inset-bottom));border:0;border-radius:0;box-shadow:none}
.masthead{padding-top:env(safe-area-inset-top);padding-bottom:14px}
.header-actions .text-button{min-height:40px}
.draw-intro{padding:20px 0 23px}
.canvas-meta{font-size:11px;padding:12px 13px 0}
.drawing-surface{height:clamp(210px,calc(100svh - 430px),380px)}
.drawing-tools{padding:4px 8px;gap:6px}
.swatches{gap:0;padding:0}
.swatch{width:34px;height:44px;border:0;border-radius:0;background:transparent}
.swatch:before{content:"";position:absolute;left:50%;top:50%;width:21px;height:21px;transform:translate(-50%,-50%);background:var(--swatch);border-radius:50%}
.swatch.selected:after{inset:auto;left:50%;top:50%;width:29px;height:29px;transform:translate(-50%,-50%);border:1.5px solid var(--swatch);border-radius:50%}
.tool-actions{gap:2px}
.tool-actions .text-button{min-height:44px;min-width:36px;font-size:12px}
.tool-actions .guide-button{min-width:59px;font-size:11px}
.draw-submit-row{margin-top:22px}
.name-field input{font-size:18px}
#race-button{min-height:56px;min-width:48%}
.borrow-button{min-height:44px;margin:12px auto 15px}
.race-stage{margin:0 -18px;height:clamp(340px,calc(100svh - 255px),570px)}
.race-stage.finished{height:220px}
.live-standings{top:5px;right:18px;width:118px}
.race-progress{margin:0 auto 24px;width:calc(100% - 56px)}
.countdown{font-size:100px;padding-bottom:40px}
.page-footer{font-size:10px;padding-top:12px}
.result-actions .primary-button,.secondary-button{min-height:54px;font-size:13px}
.score-layout{grid-template-columns:1fr}
.roster-row{min-height:66px}
@media(max-width:350px){.game-shell{padding-left:12px;padding-right:12px}.race-stage{margin-left:-12px;margin-right:-12px}.swatch{width:30px}.tool-actions .guide-button{min-width:52px}.tool-actions .text-button{font-size:11px}.intro-aside{font-size:11px}.name-field input{font-size:16px}.primary-button{padding:12px}.page-footer{font-size:9px}}

/* Every entrant's scores stay open on the phone. */
.result-cards{display:grid;gap:12px}.horse-result{background:#f7f8ed;border:1px solid #aab596;border-radius:5px;padding:12px}.horse-result.own-result{border:2px solid var(--horse-color);padding:11px}.horse-result-heading{display:flex;align-items:center;gap:8px}.horse-result-heading canvas{width:76px;height:51px;flex:0 0 76px}.horse-result-heading .roster-rank{font-size:22px;min-width:18px}.horse-result-heading .roster-person{min-width:0;flex:1}.roster-person strong{overflow-wrap:anywhere;font-size:13px}.horse-total{text-align:right;flex:0 0 auto}.horse-total strong{font-size:24px;display:block}.horse-total small{font-size:10px;color:#747f65}.all-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 10px;margin-top:12px}.score-cell{display:grid;grid-template-columns:1fr auto;gap:5px;font-size:11px}.score-cell b{font-size:11px}.mini-track{grid-column:1/-1;height:4px;border-radius:3px;background:#dce2cf;overflow:hidden}.mini-track i{display:block;height:100%;background:var(--horse-color);border-radius:3px}.horse-verdict{font-size:11px;line-height:1.6;color:#637153;border-top:1px solid #dfe4d4;margin:12px 0 0;padding-top:8px}.scoring-note{font-size:11px;line-height:1.7;color:#657252}.race-stage.finished{height:150px;min-height:150px}.distance-row{gap:8px;font-variant-numeric:tabular-nums}#speed-label{color:#687750}.result-heading{padding-top:12px}.section-label{gap:10px}.section-label span{font-size:11px}

.race-stage.finished .live-standings{display:none}

/* Rank rows slide into their actual race positions. */
.live-standings{display:block;height:120px;width:132px}.standing-row{position:absolute;top:0;left:0;width:100%;height:28px;transition:transform .35s ease,background .25s;padding:5px 7px}.standing-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rank-change{width:9px;font-weight:700}.standing-row.gaining:not(.is-player){background:#eff6b7}.race-progress p{min-height:36px;line-height:1.6}
@media(prefers-reduced-motion:reduce){.standing-row{transition:none}}

.play-mode{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:-5px 0 16px;font-size:11px}.play-mode .secondary-button{min-height:44px;padding:9px 12px;font-size:12px}.room-panel{background:#f6f8e3;border:1px solid #8d9c50;border-radius:5px;padding:13px;margin:0 0 16px}.room-heading{display:flex;justify-content:space-between;align-items:center;font-size:14px}.room-panel p{font-size:12px;line-height:1.6;margin:8px 0}.room-panel small{display:block;margin-top:10px;font-size:10px;color:#727b58}.room-members{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:12px 0}.room-member{border:1px solid #d4dbc0;padding:8px 6px;border-radius:3px;min-width:0;font-size:11px}.room-member.ready{background:#e4ecb6;border-color:#9bad4b}.room-member strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.room-member span{display:block;font-size:10px;margin-top:5px;color:#647143}.room-actions{display:flex;gap:8px}.room-actions button{width:50%;min-width:0;min-height:45px;font-size:12px;padding:10px;justify-content:center}.room-panel input{width:100%;font-size:12px;margin-top:10px;padding:10px;border:1px solid #cad1b2;background:white}.room-mode .draw-intro{padding-top:16px;padding-bottom:14px}.room-mode .draw-intro h1{font-size:39px}.room-mode .intro-aside{display:none}.room-mode .drawing-surface{height:240px}.live-standings{height:180px}

.drawing-tools{flex-wrap:wrap}.drawing-tools .swatches{flex:1}.drawing-tools .tool-actions{margin-left:auto}

/* Keep drawing and starting together in the phone's visible viewport. */
.game-shell{padding-top:8px}
.masthead{padding-bottom:6px;gap:8px}
.wordmark{font-size:18px;letter-spacing:-.7px;white-space:nowrap}
.header-actions{gap:10px;flex-shrink:0}
#draw-screen{display:flex;flex-direction:column;height:calc(100svh - 190px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:350px;padding-top:10px;gap:10px;margin-bottom:130px}
.draw-intro{padding:0;flex-shrink:0}
.draw-intro h1{font-size:28px;line-height:1.2;letter-spacing:-1.5px}
.draw-intro h1 span{font-size:25px;letter-spacing:-1px}
.draw-intro .eyebrow{font-size:9px;margin-bottom:5px}
.intro-aside{display:none}
.play-mode{margin:0;flex-shrink:0}
.play-mode .secondary-button{flex:0 0 auto}
.drawing-card{display:flex;flex-direction:column;flex:1;min-height:205px}
.canvas-meta{padding-top:6px;flex-shrink:0}
.drawing-surface,.room-mode .drawing-surface{height:auto;min-height:110px;flex:1}
.drawing-tools{flex-shrink:0;row-gap:0;padding:0 6px}
.drawing-tools .swatches{justify-content:space-between;flex:1 0 100%}
.drawing-tools .tool-actions{justify-content:flex-end;width:100%;gap:10px}
.tool-actions .text-button{min-height:36px}
.swatch{height:36px}
.draw-submit-row{position:fixed;z-index:10;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;margin:0;padding:8px 18px max(10px,env(safe-area-inset-bottom));background:var(--lime);border-top:1px solid var(--line);box-shadow:0 -5px 15px #252b1c0a;display:flex;flex-direction:column;align-items:stretch;gap:8px}
.draw-submit-row .name-field{width:100%;display:flex;flex-direction:row;align-items:center;gap:14px;min-height:28px;white-space:nowrap}
.draw-submit-row .name-field input{min-width:0;flex:1;font-size:16px;padding:3px 0}
.start-actions{display:flex;gap:8px}
.start-actions .primary-button{flex:1;min-width:0!important;min-height:50px!important;font-size:14px;padding:10px 12px;justify-content:center;gap:8px}
.room-mode #race-button{background:transparent;color:var(--ink)}
.room-mode .draw-intro{display:none}
.room-panel{margin:0;padding:8px 10px;flex-shrink:0}
.room-panel p{font-size:11px;margin:3px 0;line-height:1.4}
.room-panel small{display:none}
.room-members{gap:4px;margin:6px 0}
.room-member{padding:4px 5px}
.room-member span{margin-top:2px}
.room-actions button{width:100%;min-height:36px;padding:6px}
.room-heading .text-button{min-height:32px}
.game-shell:not(.racing) .page-footer{display:none}
.toast{bottom:calc(132px + env(safe-area-inset-bottom))}
@media(min-width:360px){.drawing-tools{flex-wrap:nowrap}.drawing-tools .swatches{flex:1 1 auto}.drawing-tools .tool-actions{width:auto;gap:2px}.swatch{width:28px}.tool-actions .text-button{min-width:32px}.tool-actions .guide-button{min-width:52px}}
@media(max-height:640px){#draw-screen{gap:6px;padding-top:6px}.draw-intro .eyebrow{display:none}.draw-intro h1,.draw-intro h1 span{font-size:24px}.room-panel{padding:5px 8px}}

/* A single title and an explicit, persistent two-mode selector. */
.draw-intro .eyebrow{margin:0;font-size:10px}
.play-mode{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border:1px solid #89972f;border-radius:6px;background:#e5ed9b}
.mode-button{border:0;border-radius:3px;background:transparent;min-height:42px;font-size:14px;font-weight:650;padding:8px;color:#556129}
.mode-button[aria-pressed="true"]{background:var(--ink);color:#f5f8d7;box-shadow:0 2px 4px #252b1c18}
.mode-button:disabled{opacity:1;cursor:default}
.mode-hint{margin:-4px 0 0;font-size:10px;line-height:1.4;color:#59652d;flex-shrink:0}
@media(max-height:640px){.draw-intro{display:none}}

/* Soft, translucent surfaces around a large, distraction-free drawing space. */
:root{--ink:#252b1c;--lime:#d3e936;--paper:#f8f8ef;--line:#252b1c2e}
html,body{background:#d3e936}
body{background:radial-gradient(ellipse at 5% 12%,#ffffff14,transparent 58%),linear-gradient(150deg,#d3e936,#cfe335);background-attachment:fixed}
.game-shell{background:transparent}.game-shell.racing{background:#d6dfb5}
.masthead{border-bottom:0;padding-bottom:4px;gap:5px}
.wordmark{font-size:20px;letter-spacing:-.6px;display:flex;align-items:center;gap:2px}
.horse-emoji{font-size:28px;line-height:1.2}
.header-actions{gap:8px}.header-actions .text-button{font-size:11px}
#draw-screen{height:calc(100svh - 174px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:385px;padding-top:3px;gap:7px;margin-bottom:126px}
.play-mode{grid-template-columns:repeat(3,minmax(0,1fr));padding:4px;border:1px solid #ffffffad;border-radius:13px;background:#ffffff52;box-shadow:0 5px 22px #59632910;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.mode-button{min-height:38px;font-size:12px;border-radius:9px;color:#596329;white-space:nowrap}
.mode-button[aria-pressed="true"]{background:linear-gradient(135deg,#252b1c,#384329);color:white;box-shadow:0 3px 10px #59632930}
.mode-hint{color:#647143;font-size:10px;margin:0 3px;line-height:1.3}
.drawing-card{min-height:150px;border-radius:18px;border:1px solid #ffffffde;background:linear-gradient(150deg,#f8f8efe8,#f6f7e9e0);box-shadow:0 8px 22px #64714312;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.drawing-surface{min-height:110px;position:relative}
.canvas-meta{font-size:10px;color:#727968;padding:8px 13px 0}
.open-editor{position:absolute;inset:0;z-index:2;border:0;background:transparent;display:flex;align-items:center;justify-content:flex-end;flex-direction:column;padding:12px;color:#647143;font-size:12px;gap:4px}
.open-editor small{font-size:9px;opacity:.7}
.empty-hint{display:none}
.drawing-card .drawing-tools{display:none}
.inspiration-heading{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:#647143;flex-shrink:0;height:25px}
.inspiration-heading .text-button{font-size:11px;min-height:30px;color:#596329}
.template-tray{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;flex-shrink:0}
.template-choice{padding:2px 3px 5px;display:flex;flex-direction:column;align-items:center;min-width:0;border:1px solid #ffffffcc;border-radius:12px;background:#ffffff69;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:#596329}
.template-choice canvas{width:100%;height:58px;object-fit:contain}.template-choice span{font-size:10px}
.draw-submit-row{border-top:1px solid #ffffffc7;border-radius:20px 20px 0 0;background:#f6f7e9ca;backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);box-shadow:0 -6px 25px #5963290c;padding-top:9px}
.name-field,.name-field input{color:#596329}.name-field input{border-bottom-color:#b2bd6077}
.primary-button{border:0;border-radius:12px;background:linear-gradient(115deg,#252b1c,#384329);box-shadow:0 5px 14px #59632927;color:#fff}
.primary-button:hover{background:linear-gradient(115deg,#384329,#465333)}
.room-mode #race-button{background:#ffffff88;color:#596329;border:1px solid #b2bd60}
.secondary-button{border-color:#9bad4b;color:#596329;border-radius:10px}
.room-panel,.arena-panel{background:#ffffff65;border:1px solid #ffffffaa;border-radius:12px;padding:7px 9px;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);flex-shrink:0}
.room-heading{gap:5px;font-size:11px}.room-heading strong{white-space:nowrap;font-size:11px}
#room-status{font-size:10px;flex:1;text-align:right;color:#596329;line-height:1.3}
.room-heading .text-button{font-size:10px;min-height:28px}
.room-members{display:flex;gap:4px;margin:3px 0;flex-wrap:wrap}
.room-member{background:#fff5;border:1px solid #c6cf9c;border-radius:7px;flex:1 1 26%;padding:4px;font-size:10px}
.room-member strong{font-size:9px}.room-member span{font-size:9px;margin-top:1px;color:#647143}.room-member.ready{background:#e4edb5;border-color:#9bad4b}
.room-actions button{min-height:29px;font-size:10px;padding:4px;background:#fff5;border:0}
.room-panel input{margin-top:5px;padding:6px}
.region-fields{display:flex;gap:6px;align-items:center}.region-fields label{display:flex;align-items:center;gap:3px;min-width:0;flex:1;font-size:10px;color:#647143}
.region-fields select{width:100%;min-width:0;min-height:32px;border:1px solid #b3be94;border-radius:6px;background:#fff9;color:#596329;font:inherit;font-size:11px}
.region-fields button{font-size:11px;white-space:nowrap}
.arena-panel p{font-size:10px;line-height:1.4;margin:5px 0 0;color:#596329}.arena-rank{color:#596329!important}
.editor-open{overflow:hidden}.editor-open body{overflow:hidden}
.drawing-fullscreen .drawing-card{position:fixed;z-index:40;inset:calc(62px + env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom));border-radius:16px;min-height:0;background:#f8f8ef;box-shadow:0 0 0 100vmax #d3e936;backdrop-filter:none;-webkit-backdrop-filter:none}
.drawing-fullscreen .drawing-surface{min-height:0;flex:1}
.drawing-fullscreen .open-editor{display:none}
.drawing-fullscreen .drawing-tools{display:flex;padding:5px 12px;flex-wrap:nowrap;gap:8px;border-top:1px solid #ccd4b2;background:#f6f7e9}
.drawing-fullscreen .swatches{flex:1;justify-content:space-between}.drawing-fullscreen .swatch{height:44px;width:34px}
.drawing-fullscreen .tool-actions{width:auto;gap:4px}.drawing-fullscreen .tool-actions .text-button{min-height:44px}
.editor-toolbar{position:fixed;inset:env(safe-area-inset-top) 0 auto;z-index:42;height:62px;padding:8px 12px;display:flex;align-items:center;gap:10px;background:#d3e936;color:#252b1c}
.editor-toolbar strong{font-size:16px;white-space:nowrap}.editor-toolbar>span{font-size:10px;flex:1}.editor-toolbar .text-button{min-height:44px;font-size:12px;white-space:nowrap}.editor-toolbar .primary-button{min-height:42px;min-width:0;font-size:13px;padding:9px 13px;white-space:nowrap}
.race-stage{border-radius:18px;overflow:hidden;box-shadow:inset 0 0 30px #fff3}
.live-standings .standing-row{background:#fffffe38;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-radius:7px;color:#596329}
.live-standings .standing-row.is-player{background:#252b1cdd;color:white}
.live-standings{left:18px;right:auto;width:104px;height:104px}
.live-standings .standing-row{height:22px;padding:3px 5px;gap:4px;font-size:8px;border-radius:6px}
.live-standings .standing-row b{width:9px}.live-standings .standing-dot{width:4px;height:4px}.live-standings .rank-change{width:7px}
.horse-result{border:1px solid #ffffffc0;border-radius:16px;background:#ffffff80;backdrop-filter:blur(15px);-webkit-backdrop-filter:blur(15px);box-shadow:0 5px 18px #59632910}
.horse-result.own-result{border-color:#9bad4b}.horse-total small,.roster-person span{color:#647143}.horse-verdict{color:#647143;border-top-color:#b3be9455}
.ability-radar{display:block;width:100%;height:auto;max-height:240px;object-fit:contain;margin:5px 0}
.all-metrics{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.scoring-note{color:#727968}.score-cell{color:#647143}
dialog{background:linear-gradient(145deg,#f8f8eff5,#edf1d7f5);border:1px solid white;border-radius:20px;color:#252b1c;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
.leaderboard-tabs{display:flex;gap:8px;margin:16px 0}.leaderboard-tabs button{justify-content:center;min-height:40px}.board-row{display:flex;gap:10px;align-items:center;padding:10px;border-bottom:1px solid #b3be9477;font-size:12px}.board-row strong{flex:1}.board-row span{color:#596329}.board-empty,#board-mine{font-size:12px;line-height:1.7;color:#647143}#leaderboard-dialog h2{font-size:21px}#board-entries{max-height:48svh;overflow:auto}
@media(orientation:landscape){.drawing-fullscreen .drawing-card{inset:calc(54px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}.editor-toolbar{height:54px}.drawing-fullscreen .canvas-meta{display:none}.drawing-fullscreen .drawing-tools{padding:0 14px}.drawing-fullscreen .swatches{max-width:320px}.drawing-fullscreen .tool-actions{margin-left:auto}}
@media(max-width:350px){.wordmark{font-size:18px}.horse-emoji{font-size:24px}.header-actions{gap:5px}.header-actions .text-button{font-size:10px}.editor-toolbar>span{display:none}.editor-toolbar strong{flex:1}.drawing-fullscreen .drawing-tools{flex-wrap:wrap}.drawing-fullscreen .swatches{flex:1 0 100%}.drawing-fullscreen .tool-actions{justify-content:flex-end;flex:1}.template-choice canvas{height:46px}}

/* Thumb-sized whip trial controls keep the original lime / cream / olive theme. */
.whip-controls{display:flex;align-items:center;gap:12px;margin:0 0 12px;padding:10px 12px;border:1px solid #ffffffaa;border-radius:16px;background:#f8f8efc9;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.whip-readout{flex:1;min-width:0;display:grid;gap:3px}.whip-readout strong{font-size:17px;font-variant-numeric:tabular-nums;color:#252b1c}.whip-readout span{font-size:10px;color:#647143}
.whip-meter{height:4px;margin-top:3px;overflow:hidden;background:#d7dfb5;border-radius:5px}.whip-meter i{height:100%;display:block;width:0;background:#849824;border-radius:5px;transition:width .08s linear}
.whip-button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:64px;min-width:134px;padding:10px 16px;border:1px solid #384329;border-radius:14px;background:linear-gradient(120deg,#252b1c,#384329);color:#eef4c8;font:inherit;font-size:19px;font-weight:700;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;box-shadow:0 4px 0 #19200e}
.whip-button.popped{transform:translateY(3px) scale(.97);box-shadow:0 1px 0 #19200e}.whip-button:disabled{opacity:.45;box-shadow:none}.whip-button:focus-visible{outline:3px solid #9bad4b;outline-offset:3px}
.whip-trial .race-stage:not(.finished){height:clamp(250px,calc(100svh - 340px),500px)}.whip-trial .race-progress{margin-bottom:3px}.whip-trial .race-progress p{min-height:20px;margin:5px 0}
@media(max-height:680px){.whip-trial .race-heading{padding-top:10px;padding-bottom:6px}.whip-controls{padding:7px 10px;margin-bottom:5px}.whip-button{min-height:54px}.whip-trial .race-stage:not(.finished){height:clamp(210px,calc(100svh - 295px),400px)}}

.whip-button svg{transform-origin:70% 80%;transition:transform .07s ease-out}.whip-button.popped svg{transform:rotate(-28deg) scale(1.12)}
@media(prefers-reduced-motion:reduce){.whip-button.popped{transform:none}.whip-button svg{transition:none}.whip-button.popped svg{transform:none}}

/* The entire wide pad is the hit target; art and text never intercept touch. */
.whip-controls{display:grid;gap:6px;padding:8px 10px 10px}.whip-readout{display:flex;align-items:center;flex-wrap:wrap;column-gap:8px;row-gap:4px}.whip-readout strong{font-size:14px;white-space:nowrap}.whip-readout span{flex:1;text-align:right;font-size:10px;white-space:nowrap}.whip-meter{flex:1 0 100%;margin:0;height:3px}
.whip-button{position:relative;isolation:isolate;width:100%;height:82px;min-height:82px;padding:0;overflow:hidden;border:2px solid #252b1c;border-radius:18px;background:linear-gradient(115deg,#e8f298,#d3e936);color:#252b1c;box-shadow:0 5px 0 #252b1c;justify-content:flex-end;transition:background .1s}
#whip-pad{position:absolute;left:0;top:-3px;width:59%;height:88px;pointer-events:none}.whip-button-copy{position:relative;display:grid;gap:3px;width:44%;padding-right:8px;text-align:center;pointer-events:none}.whip-button-copy>span{font-size:25px;font-weight:900;letter-spacing:1px;transform:rotate(-4deg)}.whip-button-copy small{font-size:10px;font-weight:500;letter-spacing:0}
.whip-button.popped{background:#f8f8ef;box-shadow:0 1px 0 #252b1c;transform:translateY(4px) scale(.985)}.whip-button:disabled{opacity:.55;box-shadow:0 3px 0 #252b1c}
.whip-impact{position:absolute;left:45%;top:9px;font-size:22px;font-weight:900;color:#252b1c;opacity:0;pointer-events:none;transform:rotate(-15deg)}
.whip-trial .race-stage:not(.finished){height:clamp(220px,calc(100svh - 380px),460px)}
@media(max-height:680px){.whip-controls{padding:5px 8px 8px;gap:4px}.whip-button{height:70px;min-height:70px}#whip-pad{height:77px;top:-3px}.whip-trial .race-stage:not(.finished){height:clamp(185px,calc(100svh - 335px),365px)}}
@media(max-width:350px){.whip-readout strong{font-size:12px}.whip-readout span{font-size:9px}.whip-button-copy>span{font-size:22px}}

.invite-actions{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center;margin:5px 0}.invite-primary{min-height:44px;padding:9px 12px;border:1px solid #252b1c;border-radius:11px;background:#252b1c;color:#f8f8ef;font:inherit;font-weight:750;font-size:14px;box-shadow:0 3px 0 #849824;touch-action:manipulation}.invite-actions .text-button{min-height:44px;white-space:nowrap;font-size:11px}.invite-primary:active{transform:translateY(2px);box-shadow:0 1px 0 #849824}.arena-heading{display:flex;gap:10px;align-items:center}.arena-heading p{flex:1;margin:0!important}.arena-heading button{min-height:36px;white-space:nowrap}.arena-panel{padding:7px 10px!important}#share-guide{max-width:340px}#share-guide-copy{font-size:15px;line-height:1.8}#share-guide-arrow{text-align:right;font-size:44px;color:#596329}#share-guide .primary-button{width:100%;font-size:16px}#leaderboard-dialog .region-fields{margin-top:16px}#leaderboard-dialog select{min-height:42px}.leaderboard-tabs button[aria-pressed=true]{background:#d3e936;color:#252b1c}@media(max-width:350px){.invite-actions{gap:5px}.invite-primary{font-size:12px;padding:8px}.invite-actions .text-button{font-size:10px}}

/* Fullscreen completion stays within thumb reach in both orientations. */
.editor-footer{position:fixed;z-index:42;inset:auto 0 0;padding:8px max(12px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:#d3e936}
#close-editor{display:block;width:100%;min-height:58px;font-size:20px;font-weight:800;border-radius:14px;padding:12px}
.drawing-fullscreen .drawing-card{bottom:calc(84px + env(safe-area-inset-bottom))}
@media(orientation:landscape){.editor-footer{padding-top:5px;padding-bottom:calc(6px + env(safe-area-inset-bottom))}#close-editor{min-height:50px;padding:9px;font-size:18px}.drawing-fullscreen .drawing-card{bottom:calc(66px + env(safe-area-inset-bottom))}}
.invite-actions{grid-template-columns:auto auto 1fr}.invite-primary{position:relative;min-height:36px;font-size:12px;padding:7px 10px;border-radius:9px;box-shadow:0 2px 0 #849824}.invite-primary::after{content:'';position:absolute;inset:-4px 0}.invite-actions #redraw-room{justify-self:end}

/* Primary actions carry more contrast than mode navigation. */
.play-mode{grid-template-columns:1.12fr 1fr 1fr}
.mode-button{padding:8px 4px}
.mode-button[aria-pressed="true"]{background:#f8f8efb8;color:#252b1c;box-shadow:inset 0 0 0 1px #84982466;font-weight:750}
.primary-button,.room-mode #race-button{background:linear-gradient(115deg,#d3e936,#e2ee7b);color:#252b1c;border:1px solid #849824;box-shadow:0 3px 0 #849824}
.primary-button:hover,.room-mode #race-button:hover{background:linear-gradient(115deg,#dceb64,#e7f29b)}
.primary-button:active{transform:translateY(1px);box-shadow:0 1px 0 #849824}
.arena-panel .start-actions{margin-top:8px}
.arena-panel .start-actions #race-button{min-height:54px!important;font-size:17px;font-weight:800;width:100%}
.arena-mode #draw-screen{height:calc(100svh - 138px - env(safe-area-inset-top) - env(safe-area-inset-bottom));margin-bottom:70px}
@media(max-width:350px){.mode-button{font-size:11px}}

#whip-overlay{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;z-index:18;pointer-events:none}

/* Visible interaction stats, separate from the horse's drawing ability scores. */
.whip-live-stats{display:grid;grid-template-columns:1fr 1fr 1.2fr;width:100%;gap:6px;text-align:center}
.whip-live-stats>div{display:grid;gap:2px}.whip-live-stats small{font-size:10px;color:#647143}
.whip-live-stats strong{font-size:15px}.whip-readout #whip-hint{flex:1 0 100%;text-align:center;font-size:10px}
.whip-trial .race-stage:not(.finished){height:clamp(205px,calc(100svh - 404px),460px)}
.whip-result{margin:14px 0 20px;padding:14px;border:1px solid #9bad4b;border-radius:16px;background:linear-gradient(135deg,#f8f8efdd,#e3edacbb);box-shadow:0 5px 18px #59632912}
.whip-result-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px}.whip-result-heading>span{font-size:11px;color:#596329}
.whip-saved{margin:9px 0 12px;font-size:13px;text-align:center;color:#596329}.whip-saved strong{font-size:30px;color:#252b1c;font-variant-numeric:tabular-nums}
.whip-result-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.whip-result-grid>div{display:grid;gap:3px;text-align:center;padding:8px 4px;background:#f8f8ef9c;border-radius:10px}
.whip-result-grid strong{font-size:24px;font-variant-numeric:tabular-nums;line-height:1.1}.whip-result-grid span{font-size:10px;color:#596329}
.whip-gain{text-align:center;font-size:12px;margin:10px 0 5px}.whip-stat-note{margin:0;font-size:10px;line-height:1.6;color:#647143}
.roster-whip-stats{font-size:11px;line-height:1.7;padding:8px 10px;margin:7px 0;border-radius:9px;background:#e5edbd80;color:#596329}
@media(max-height:680px){.whip-trial .race-stage:not(.finished){height:clamp(185px,calc(100svh - 359px),365px)}}
@media(max-width:350px){.whip-live-stats strong{font-size:13px}}

/* Post-race actions stay visible; individual score details open on demand. */
.showing-results .result-actions{position:fixed;z-index:25;left:50%;bottom:0;transform:translateX(-50%);width:100%;max-width:480px;display:flex;gap:9px;margin:0;padding:10px 14px max(12px,env(safe-area-inset-bottom));border:1px solid #ffffffc7;border-radius:18px 18px 0 0;background:#f6f7e9ed;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 -5px 20px #59632920}
.showing-results .result-actions button{flex:1;min-width:0;min-height:52px;font-size:14px;justify-content:center}
.showing-results .results{padding-bottom:calc(90px + env(safe-area-inset-bottom))}
.horse-result-heading{list-style:none;cursor:pointer;touch-action:manipulation;min-height:55px}
.horse-result-heading::-webkit-details-marker{display:none}
.horse-result-heading:focus-visible{outline:2px solid #596329;outline-offset:5px;border-radius:8px}
.result-expand{font-size:22px;line-height:1;color:#596329;transition:transform .15s}
.horse-result[open] .result-expand{transform:rotate(180deg)}
.horse-result:not([open]){padding-top:7px;padding-bottom:7px}
.result-cards{gap:8px}

/* Start, ready and matchmaking remain the most visible next step. */
.start-actions .primary-button,.room-mode #race-button{background:#252b1c;color:#f8f8ef;border:1px solid #252b1c;box-shadow:0 4px 0 #11150d;font-weight:800}
.start-actions .primary-button:hover,.room-mode #race-button:hover{background:#11150d;color:#f8f8ef}
.start-actions .primary-button:active,.room-mode #race-button:active{transform:translateY(2px);box-shadow:0 2px 0 #11150d}

/* The name is a visible input beside mode selection, rather than a quiet footer line. */
.player-name{display:flex;flex-direction:row;align-items:center;gap:10px;width:100%;min-height:44px;flex-shrink:0;padding:5px 10px;background:#f8f8efb8;border:1px solid #8498248c;border-radius:11px;box-shadow:0 2px 7px #5963290c}
.player-name>span{font-size:12px;font-weight:750;white-space:nowrap;color:#252b1c}
.player-name input{flex:1;min-width:0;width:auto;min-height:32px;padding:4px 9px;border:1px solid #b2bd6066;border-radius:7px;background:#f8f8ef;font-size:16px;color:#252b1c}
.player-name:focus-within{border-color:#252b1c;box-shadow:0 0 0 2px #84982433}
.mode-hint{display:none}
#draw-screen{height:calc(100svh - 136px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:350px;margin-bottom:82px;gap:6px}
.draw-submit-row{padding-top:8px;gap:0}
.arena-mode .draw-submit-row{display:none}
.arena-mode #draw-screen{height:calc(100svh - 90px - env(safe-area-inset-top) - env(safe-area-inset-bottom));margin-bottom:12px}
.room-panel{padding:6px 8px}
.room-members{margin:5px 0;gap:5px}
.arena-panel .start-actions{margin-top:6px}

/* Persistent horse identity and a compact four-slot stable. */
.header-actions{display:grid;grid-template-columns:auto auto;gap:0 8px;justify-items:end}
.stable-button{grid-column:1/-1;border:1px solid #84982488;border-radius:9px;background:#f8f8efaa;display:flex;align-items:center;gap:4px;max-width:160px;min-height:32px;padding:4px 8px;font-size:12px;color:#252b1c}
#active-horse-name{max-width:104px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:750}.stable-button small{font-size:12px}
.header-actions .text-button{min-height:27px}
.stable-dialog{padding:17px;max-width:400px}.stable-dialog h2{font-size:22px;margin:0}
.stable-name{display:grid;gap:7px;margin-top:15px;font-size:12px;font-weight:750}
.stable-name input{width:100%;min-height:46px;border:1px solid #849824;border-radius:10px;background:#f8f8ef;padding:10px;font-size:18px}
.stable-note,.stable-storage-note{font-size:11px;color:#647143;line-height:1.5;margin:9px 0}
.stable-slots{display:grid;gap:7px}.stable-slot{display:grid;grid-template-columns:75px 1fr;gap:4px 8px;align-items:center;padding:8px;background:#ffffff80;border:1px solid #b2bd6077;border-radius:12px}
.stable-slot canvas{width:75px;height:50px;grid-row:1/3;object-fit:contain}.stable-slot-copy{display:grid;gap:4px;min-width:0}.stable-slot-copy strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stable-slot-copy small{font-size:10px;color:#647143}
.stable-slot-actions{display:flex;gap:9px;align-items:center}.stable-slot-actions .secondary-button{flex:0 0 auto;min-height:30px;padding:5px 10px;font-size:11px}.stable-slot-actions .text-button{min-height:30px;font-size:10px}
.stable-dialog .full-width{min-height:46px;font-size:15px}
#draw-screen{height:calc(100svh - 154px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
.arena-mode #draw-screen{height:calc(100svh - 108px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
@media(max-height:650px){.stable-dialog{max-height:90svh;overflow:auto}.stable-name{margin-top:10px}.stable-slot{padding:5px}}
@media(max-width:350px){.stable-button{max-width:136px;padding:4px 6px}#active-horse-name{max-width:82px}}

/* Every mode begins from the same row directly below the mode tabs. */
.draw-submit-row,.arena-mode .draw-submit-row{position:static;left:auto;bottom:auto;transform:none;width:100%;max-width:none;margin:0;padding:0;display:flex;flex-shrink:0;background:none;border:0;border-radius:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
.start-actions{width:100%}.start-actions .primary-button{min-height:54px!important;font-size:16px!important}
#draw-screen,.arena-mode #draw-screen{height:calc(100svh - 108px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:320px;margin-bottom:12px}
#draw-submit-row #race-button{font-weight:800}

/* Horse identity fits on the existing masthead row. */
.masthead{gap:6px;align-items:center;flex-wrap:nowrap}
.wordmark{font-size:18px;flex:0 0 auto}.horse-emoji{font-size:25px}
.header-actions{display:flex;flex-wrap:nowrap;align-items:center;gap:5px;min-width:0}
.stable-button{grid-column:auto;min-width:0;max-width:105px;min-height:34px;padding:4px 6px;font-size:11px;gap:3px}
#active-horse-name{max-width:68px;min-width:0}.stable-button small{font-size:10px}
#sound-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.header-actions .sound-button,.header-actions #rules-button{min-width:28px;min-height:34px;justify-content:center;font-size:18px}
#draw-screen,.arena-mode #draw-screen{height:calc(100svh - 88px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
/* This fixed action bar lives directly under body, outside animated result containers. */
#result-actions{position:fixed;z-index:25;left:50%;bottom:0;transform:translateX(-50%);width:100%;max-width:480px;display:flex;gap:9px;margin:0;padding:10px 14px max(12px,env(safe-area-inset-bottom));border:1px solid #ffffffc7;border-radius:18px 18px 0 0;background:#f6f7e9ed;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 -5px 20px #59632920}
#result-actions button{flex:1;min-width:0;min-height:52px;font-size:14px;justify-content:center}
@media(max-width:350px){.wordmark{font-size:16px}.horse-emoji{font-size:22px}.header-actions{gap:3px}.stable-button{max-width:89px;padding:4px}#active-horse-name{max-width:54px}.header-actions .sound-button,.header-actions #rules-button{min-width:24px}}

/* Navigation, context, and the main action form distinct steps. */
.play-mode{margin-bottom:5px}
.mode-hint{display:block;flex-shrink:0;font-size:11px;line-height:1.5;margin:0;padding:8px 10px;background:#f8f8ef99;border:1px solid #ffffffaa;border-radius:10px;color:#596329}
#draw-submit-row{margin-top:3px;margin-bottom:4px}
.arena-panel .arena-heading p{font-size:11px;line-height:1.5}
.header-actions{flex:1;justify-content:flex-end;gap:7px}
#sound-icon{display:none}
#sound-label{position:static;width:auto;height:auto;clip-path:none;overflow:visible}
.header-actions .sound-button,.header-actions #rules-button{min-width:0;min-height:34px;font-size:11px;white-space:nowrap}
.stable-button{order:3;max-width:112px;border:0;background:none;padding:4px 0 4px 2px;font-size:12px}
#active-horse-name{max-width:73px;text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:1px}
@media(max-width:350px){.header-actions{gap:5px}.header-actions .sound-button,.header-actions #rules-button{font-size:10px}.stable-button{max-width:95px;font-size:11px}#active-horse-name{max-width:58px}}

/* Saving is visible beside the canvas and at fullscreen completion. */
.horse-storage-actions{pointer-events:auto;padding:7px 9px 0;gap:7px;color:#596329}
.stable-entry,.save-horse{min-height:36px;padding:7px 10px;border-radius:9px;font-size:12px;font-weight:750;white-space:nowrap}
.stable-entry{border:1px solid #84982477;background:#d3e93625;color:#252b1c;display:flex;align-items:center;gap:6px}
#stable-count{font-size:10px;color:#596329}
.save-horse{border:1px solid #252b1c;background:#252b1c;color:#f8f8ef;margin-left:auto}
.horse-direction{font-size:10px;white-space:nowrap}
.editor-footer{display:grid;grid-template-columns:1fr 2fr;gap:8px}
.editor-footer #close-editor{min-width:0;white-space:nowrap;font-size:18px;padding:10px}
#save-horse{min-width:0;min-height:58px;justify-content:center;padding:8px;font-size:13px;font-weight:750;border-radius:14px;background:#f8f8ef99}
.stable-dialog{max-height:calc(100svh - 24px);overflow:auto}
@media(orientation:landscape){#save-horse{min-height:50px}.editor-footer #close-editor{font-size:17px}}
@media(max-width:350px){.horse-direction{display:none}.stable-entry,.save-horse{font-size:11px}.editor-footer #close-editor{font-size:16px}}

/* The stable floats on the compact canvas; three random horses stay visible below. */
.drawing-card{position:relative}
.horse-storage-actions{position:absolute;z-index:3;top:8px;left:8px;right:8px;padding:0}
.stable-entry,.save-horse{box-shadow:0 3px 14px #59632920;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.stable-entry{background:#f8f8efdd}.horse-direction{display:none}
.drawing-fullscreen .horse-storage-actions{display:none}
.inspiration-picker{position:relative;flex-shrink:0;font-size:11px;color:#596329}
.inspiration-picker .inspiration-heading{height:30px}
.template-choice canvas{height:62px}
#draw-submit-row{position:sticky;top:0;z-index:4}
.room-member{border-radius:10px;display:grid;grid-template-columns:22px minmax(0,1fr);gap:2px 4px}.room-member.ready{box-shadow:inset 0 0 0 1px #84982466}
.room-member-avatar{grid-row:1/3;align-self:center;font-size:20px}.room-member strong,.room-member span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.room-member.arrived{animation:match-arrive .4s ease-out}.room-member.just-ready .room-member-avatar{animation:match-trot .2s 3 alternate}

/* A full-screen gathering sequence uses the existing lime/cream/olive palette. */
.match-overlay{position:fixed;z-index:70;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:calc(18px + env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));overflow:auto;background:radial-gradient(ellipse at 50% 30%,#f8f8eff2 0,#f8f8efc9 33%,#d3e936ee 100%);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);color:#252b1c;animation:match-arrive .3s ease-out}
.match-topline{display:flex;justify-content:space-between;width:min(440px,100%);font-size:12px;color:#596329}
#match-count{font-weight:850;font-variant-numeric:tabular-nums;background:#ffffff88;border-radius:20px;padding:5px 10px}
.match-orbit{position:relative;width:170px;height:170px;flex-shrink:0;display:grid;place-items:center}
.match-orbit i{position:absolute;inset:0;border:1px solid #84982455;border-radius:50%;animation:match-ripple 2.4s infinite}.match-orbit i:nth-child(2){animation-delay:.8s}.match-orbit i:nth-child(3){animation-delay:1.6s}
.match-orbit span{font-size:68px;animation:match-trot .38s infinite alternate}.match-orbit b{position:absolute;font-size:23px;right:25px;top:32px;animation:match-trot .6s infinite alternate}
#match-title{font-size:30px;font-weight:900;text-align:center;margin:0}
#match-copy{text-align:center;font-size:13px;line-height:1.6;max-width:360px;margin:0;color:#596329}
.match-players{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:min(440px,100%)}
.match-player{display:flex;flex-direction:column;align-items:center;min-width:0;padding:6px 5px 10px;border:1px solid #ffffffee;border-radius:16px;background:#ffffff88;box-shadow:0 5px 20px #59632912;animation:match-arrive .4s ease-out}
.match-player.own{border-color:#849824;background:#d3e93633}.match-player.pending{border-style:dashed;box-shadow:none}
.match-player canvas{width:100%;height:67px;object-fit:contain}.match-player strong{font-size:11px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:100%}.match-player small{font-size:10px;color:#647143;margin-top:5px}
.match-note{font-size:11px;color:#647143;text-align:center;margin:0}
#match-cancel{flex:none;width:min(360px,100%);min-height:48px;justify-content:center;background:#f8f8efbb}
.match-overlay[data-phase=success] .match-orbit{width:115px;height:115px}.match-overlay[data-phase=success] .match-orbit span{animation:none}.match-overlay[data-phase=success] .match-orbit b{font-size:36px;right:-4px;top:4px;animation:match-arrive .4s ease-out}
.match-overlay[data-phase=success] #match-count{font-size:20px;background:#252b1c;color:#f8f8ef}
.match-overlay[data-phase=success] .match-player{animation:match-arrive .4s ease-out}.match-overlay[data-phase=success] .match-player:nth-child(2){animation-delay:.05s}.match-overlay[data-phase=success] .match-player:nth-child(3){animation-delay:.1s}
@keyframes match-ripple{0%{transform:scale(.55);opacity:0}25%{opacity:1}100%{transform:scale(1.2);opacity:0}}
@keyframes match-trot{from{transform:translateY(3px) rotate(-5deg)}to{transform:translateY(-4px) rotate(5deg)}}
@keyframes match-arrive{from{opacity:0;transform:translateY(15px) scale(.96)}to{opacity:1;transform:none}}
@media(max-height:650px){.match-overlay{gap:10px;justify-content:flex-start}.match-orbit{height:100px;width:100px}.match-orbit span{font-size:50px}.match-player canvas{height:54px}}
@media(orientation:landscape){.match-overlay{gap:7px}.match-orbit{display:none}.match-players{grid-template-columns:repeat(6,minmax(0,1fr));width:min(760px,100%)}.match-player canvas{height:55px}#match-title{font-size:24px}}
@media(prefers-reduced-motion:reduce){.match-overlay,.match-player,.match-orbit *{animation:none!important}}
.match-player.loading{border-style:dashed}.match-player.loading small{animation:load-breathe 1s infinite alternate}.match-player.loaded{border-color:#849824;background:#d3e93633}.match-player.loaded small{color:#384329;font-weight:800}
.match-overlay[data-phase=loading] .match-orbit{width:110px;height:110px}.match-overlay[data-phase=loading] .match-orbit span{font-size:54px}
@keyframes load-breathe{from{opacity:.4}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.match-player.loading small{animation:none}}
.horse-storage-actions .stable-entry,.horse-storage-actions .save-horse{padding:8px;font-size:11px;min-height:40px}
.stable-slot-actions .secondary-button{min-height:40px;font-size:12px}.stable-slot-actions{gap:7px}.stable-slot-actions .text-button{min-height:40px}


.horse-storage-actions{right:auto;pointer-events:none}
.horse-storage-actions .stable-entry{pointer-events:auto;font-size:12px;padding:8px 10px;min-height:40px}
.inspiration-picker{display:block}
.drawing-fullscreen .inspiration-picker{visibility:hidden}

#whip-button{overflow:hidden}
#report-players{display:grid;gap:8px;margin-top:16px}#report-reason{padding:10px;margin-top:12px;background:var(--paper);border:1px solid var(--line);border-radius:8px}
