:root{color-scheme:dark;--ink:#0b131e;--navy:#142235;--gold:#e5bc65;--cream:#faf0d7;--muted:#aab8c7;--red:#e75158;--blue:#4598ea;--green:#41b777;--yellow:#edc54c;--line:#b48a4148;--board-size:min(calc(100vw - 24px),calc(100dvh - 196px),654px)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#0b131e;color:var(--cream);font-family:system-ui,-apple-system,'Segoe UI',sans-serif}body{background:radial-gradient(ellipse at 10% 0%,#25445550,transparent 45%),radial-gradient(ellipse at 90% 100%,#743b262d,transparent 50%),#0b131e}button,input,select{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default;opacity:.47}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #fff2b8;outline-offset:3px}button{touch-action:manipulation}a{color:var(--gold);text-decoration:none}.hidden{display:none!important}h1,h2,h3,p{margin-top:0}h1,h2,h3{font-family:Georgia,'Times New Roman',serif}.muted{color:var(--muted)}.eyebrow{font-size:10px;letter-spacing:2.8px;font-weight:750;color:var(--gold);text-transform:uppercase;margin:0 0 14px}.gold{border:1px solid #f9d992;background:linear-gradient(#f4d790,#d9aa51 52%,#b8832e);color:#2c1b0b;box-shadow:inset 0 2px 0 #fff1bf88,0 4px 0 #805326,0 10px 22px #0005;border-radius:10px;min-height:48px;padding:12px 24px;font-weight:800;letter-spacing:.6px}.gold:hover:not(:disabled){filter:brightness(1.08)}.quiet{background:#162333;border:1px solid #526075;color:#e3e9ee;border-radius:9px;min-height:44px;padding:10px 17px}.text-button{background:none;border:0;color:var(--muted);min-height:44px;padding:9px 13px;font-size:13px}.icon-button{display:grid;place-items:center;min-width:42px;min-height:42px;border:1px solid #52607566;border-radius:9px;background:#122133;color:var(--cream);font-size:17px}.wide{width:100%}.row{display:flex;align-items:center;gap:12px}.spread{justify-content:space-between}.crown{font-size:54px;color:var(--gold);text-shadow:0 2px 0 #805326,0 0 40px #e5bc6544}.loading{min-height:70dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px}.loading p{color:var(--muted)}
/* Title and invitation screens, not a dashboard. */
.title-screen{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 16px 22px;overflow:hidden;position:relative;text-align:center}.title-screen::before{content:'';position:absolute;width:580px;height:580px;border:1px solid #d8b26a17;border-radius:50%;z-index:0;box-shadow:0 0 0 28px #d8b26a07,0 0 0 78px #d8b26a04;pointer-events:none}.title-screen>*{z-index:1}.title-screen .crown{font-size:45px;margin-bottom:10px}.wordmark{line-height:.92;font-size:clamp(52px,9vw,84px);letter-spacing:6px;margin:0;color:#fff0c8;text-shadow:0 3px 0 #806034,0 10px 25px #0008}.wordmark span{display:block;font-size:.54em;letter-spacing:9px;margin-top:15px;color:var(--gold)}.title-portraits{display:flex;margin:28px 0 22px;gap:10px;width:min(560px,93vw);height:clamp(130px,26vh,210px)}.title-portrait{flex:1;position:relative;overflow:hidden;border-radius:45% 45% 8px 8px;border:1px solid #d8b26a66;box-shadow:0 7px 18px #0007;background:#172334;transform:translateY(8px) rotate(var(--tilt))}.title-portrait:nth-child(2),.title-portrait:nth-child(3){transform:translateY(-5px) rotate(var(--tilt))}.title-portrait img{width:100%;height:100%;object-fit:cover;filter:saturate(.8);object-position:50% 45%}.title-portrait::after{content:'';position:absolute;inset:0;box-shadow:inset 0 0 20px #0008;background:linear-gradient(transparent 65%,#06121b)}.tagline{color:#c1cbd5;font-size:13px;letter-spacing:.4px;margin:4px 0 25px}.play-button{min-width:250px;font-size:21px;letter-spacing:3px;min-height:58px}.attribution{font-size:10px;color:#738395;letter-spacing:1.2px;margin:31px 0 0}.title-footer{font-size:11px;color:#8595a7;margin-top:14px;display:inline-block;padding:10px}.page{min-height:100dvh;padding:20px max(16px,env(safe-area-inset-right)) 28px}.page-nav{max-width:820px;margin:0 auto 28px;display:flex;align-items:center;justify-content:space-between}.small-mark{font-family:Georgia,serif;color:var(--gold);letter-spacing:1px;font-size:16px}.page-content{max-width:660px;margin:0 auto}.page-content>h1{font-size:38px;margin-bottom:10px}.page-content>p.muted{line-height:1.6;font-size:14px}.modes{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:28px}.mode{border:1px solid var(--line);background:linear-gradient(145deg,#1b2a3d,#0e1928);border-radius:16px;overflow:hidden;padding:0;text-align:left;color:var(--cream);box-shadow:0 16px 30px #0003}.mode-art{height:180px;overflow:hidden;position:relative;background:#172b3c;display:flex}.mode-art img{width:100%;height:100%;object-fit:cover}.mode-art.friends img{width:50%}.mode-art::after{content:'';position:absolute;inset:0;background:linear-gradient(transparent 40%,#142235)}.mode-copy{padding:18px 18px 21px}.mode h2{font-size:25px;margin:0 0 8px}.mode p{font-size:12px;line-height:1.6;color:var(--muted);margin:0}.mode-arrow{float:right;color:var(--gold);font-size:26px}.secondary-links{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:18px}.resume-card{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);padding:13px 16px;border-radius:12px;margin:20px 0 0;background:#1c2a3544}.resume-card small{display:block;color:var(--muted);font-size:11px;margin-top:5px}.form-panel{padding:24px;background:linear-gradient(145deg,#1a293b,#111d2b);border:1px solid var(--line);border-radius:18px;margin-top:22px;box-shadow:0 18px 45px #0003}.field{display:flex;flex-direction:column;gap:8px;font-size:13px;font-weight:600;margin-bottom:20px}.field small{color:var(--muted);font-weight:400;font-size:11px;line-height:1.5}.field input,.field select{min-height:48px;border:1px solid #526078;background:#091625;color:var(--cream);border-radius:9px;padding:10px 12px;width:100%}.field input::placeholder{color:#758399}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.check{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:22px;font-size:13px}.check input{width:21px;height:21px;accent-color:var(--gold);flex-shrink:0}.check small{display:block;color:var(--muted);font-size:11px;font-weight:400;line-height:1.5;margin-top:4px}.room-code-input{text-transform:uppercase;font-size:24px;font-weight:800;letter-spacing:5px}.tabs{display:flex;gap:10px;margin-top:22px}.tabs button{flex:1}.tabs button.selected{border-color:var(--gold);color:var(--gold);background:#3a3024}.join-art{width:100%;height:110px;object-fit:cover;object-position:50% 35%;opacity:.65;border-radius:12px;margin:8px 0 22px}.fine-print{color:#8998a8;font-size:11px;line-height:1.6;text-align:center;margin:20px 0 0}.error-box{padding:14px;border:1px solid #cd777b;border-radius:10px;color:#ffd4d6;background:#702e332f;font-size:13px;line-height:1.5;margin-top:16px}.invite-code{font-family:system-ui,sans-serif;font-size:clamp(38px,8vw,54px);letter-spacing:6px;color:var(--cream);margin:0 0 15px}.seats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:24px 0}.seat{background:#182637;border:1px solid #51607655;border-bottom:3px solid var(--player-color);border-radius:12px;overflow:hidden;text-align:center;padding-bottom:14px}.seat img{width:100%;height:104px;object-fit:cover;opacity:.9}.seat.empty img{opacity:.25;filter:grayscale(1)}.seat b{display:block;font-size:12px;margin:12px 5px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.seat small{display:block;color:var(--muted);font-size:10px;line-height:1.6}.seat .online-label{color:#96d3af}.lobby-controls{display:flex;flex-wrap:wrap;align-items:center;gap:12px}.lobby-controls .check{width:100%;margin:12px 0}.host-note{color:var(--muted);font-size:12px;line-height:1.6;margin-top:20px}.copy-link{display:flex;gap:8px}.copy-link input{min-width:0;flex:1;background:#0c1726;border:1px solid #526075;color:var(--muted);border-radius:9px;padding:8px;font-size:12px}
/* The board owns the gameplay screen. No detached dice panel. */
.game-shell{min-height:100dvh;padding: max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:center;overflow:hidden}.game-top{height:43px;width:min(100%,660px);display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 9px}.game-title{font-family:Georgia,serif;color:#ebcd8c;font-size:17px;letter-spacing:.5px}.connection{font-size:10px;color:var(--muted);display:flex;gap:6px;align-items:center;white-space:nowrap}.connection i{width:6px;height:6px;background:#ceae5b;border-radius:50%;display:inline-block}.connection.live i{background:#73bd91}.connection.offline i{background:#df7777}.game-top .row{gap:7px}.table-layout{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%}.board-frame{width:var(--board-size);flex-shrink:0;padding:9px;border-radius:16px;background:linear-gradient(145deg,#b28a4b,#57412b 40%,#a27841 76%,#52321f);border:1px solid #d8ba79;box-shadow:0 14px 0 -7px #342517,0 25px 45px #0009,inset 0 0 0 3px #634428;position:relative}.board-frame::before{content:'';position:absolute;inset:4px;border:1px solid #efdc9988;border-radius:12px;pointer-events:none}.board{aspect-ratio:1;position:relative;display:grid;grid-template-columns:repeat(15,1fr);grid-template-rows:repeat(15,1fr);isolation:isolate;background:#b39a71;border:1px solid #452d16;overflow:hidden}.cell{position:relative;display:grid;place-items:center;user-select:none}.cell.track{background:linear-gradient(145deg,#fff9e9,#e9dfc9);border:.5px solid #735d4470;box-shadow:inset 0 1px #fff8,inset 0 -1px #a18a6144}.cell.home{background:linear-gradient(145deg,color-mix(in srgb,var(--player-color) 80%,white),color-mix(in srgb,var(--player-color) 78%,#381d16));border:.5px solid #0004;box-shadow:inset 1px 1px #ffffff44,inset -1px -2px #0002}.cell.start{background:linear-gradient(145deg,color-mix(in srgb,var(--player-color) 75%,white),var(--player-color))}.cell.start::after{content:'◆';font-size:clamp(8px,1.1vw,16px);color:#fff5dc;text-shadow:0 1px 2px #0007}.cell.star::after{content:'★';font-size:clamp(14px,2vw,24px);color:#9c7a36;text-shadow:0 1px white}.cell.gate::after{content:'›';font-size:clamp(16px,2vw,26px);color:#624523;line-height:1;transform:rotate(var(--angle))}.cell.legal-origin{cursor:pointer}.cell.legal-origin::before{content:'';position:absolute;inset:0;border:2px solid white;box-shadow:inset 0 0 8px #fff9;z-index:4;pointer-events:none}.base-art{position:absolute;width:40%;height:40%;z-index:1;pointer-events:none;overflow:hidden}.base-art img{width:100%;height:100%;object-fit:cover;filter:saturate(.86) brightness(.7);display:block}.base-art::after{content:'';position:absolute;inset:0;background:linear-gradient(transparent,#0002);box-shadow:inset 0 0 22px #0007,inset 0 0 0 2px var(--player-color)}.base-art.red{left:0;top:0}.base-art.blue{right:0;top:0}.base-art.green{left:0;bottom:0}.base-art.yellow{right:0;bottom:0}.token{position:absolute;z-index:5;display:grid;place-items:center;width:73%;height:73%;min-width:0;padding:0;border-radius:50% 50% 42% 42%;border:1.5px solid #fff4d6;background:linear-gradient(145deg,color-mix(in srgb,var(--player-color) 70%,white),var(--player-color) 42%,color-mix(in srgb,var(--player-color) 66%,black));box-shadow:0 3px 0 color-mix(in srgb,var(--player-color) 36%,#000),0 5px 5px #0008,inset 0 1px 2px #fff7;color:white;font-size:clamp(9px,1.25vw,14px);font-weight:800;line-height:1;text-shadow:0 1px 2px #000a;transform:translate(var(--x,0),var(--y,0)) scale(var(--scale,1));pointer-events:none;opacity:1!important}.token::before{content:'';position:absolute;top:-19%;left:21%;width:58%;height:42%;background:inherit;border:1px solid #fffa;border-radius:50%;z-index:-1}.token.yellow{color:#342607;text-shadow:none}.token.legal{z-index:12;pointer-events:auto;cursor:pointer;animation:tokenGlow 1.3s ease-in-out infinite}.token.mine{z-index:10}.token.has-stack{box-shadow:2px 2px 0 #eddeb5,3px 4px 0 var(--player-color),4px 6px 0 #1b2131,0 8px 6px #0008}.token em{position:absolute;right:-28%;top:-28%;font-style:normal;font-size:clamp(7px,.85vw,10px);height:15px;padding:1px 3px;border:1px solid #fff;border-radius:6px;background:#122233;color:white;text-shadow:none;display:grid;place-items:center}.token.free em{background:#245e41}.token:focus-visible{outline-offset:4px;z-index:20}.moving-token{position:absolute;z-index:40;width:4.8%;height:4.8%;pointer-events:none;transition:left 90ms linear,top 90ms linear}.moving-token .token{width:100%;height:100%;font-size:11px}.move-trail{position:absolute;width:3%;height:3%;border-radius:50%;background:#fff5cd88;z-index:3;animation:trail .5s ease-out forwards;pointer-events:none}.goal{position:absolute;left:40%;top:40%;width:20%;height:20%;z-index:3;background:radial-gradient(ellipse at 40% 20%,#fae6a1,#d4ad5b 50%,#b18132);border:2px solid #704c24;box-shadow:inset 0 0 0 2px #fae8a580,inset 0 0 14px #87571d70;display:flex;align-items:center;justify-content:center;flex-direction:column}.board-roll{background:transparent;color:#412a12;border:0;padding:2px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;width:100%;height:100%;opacity:1!important;border-radius:0}.board-roll:disabled{cursor:default}.roll-word{font-size:clamp(8px,1.05vw,12px);font-weight:900;letter-spacing:1px;line-height:1.1;min-height:9px}.die{width:54%;aspect-ratio:1;max-width:65px;border-radius:20%;background:linear-gradient(140deg,#fffdf6,#e7ddc9);box-shadow:inset 0 1px 2px white,inset -2px -2px 4px #c5b79c,2px 4px 0 #806d50,0 5px 8px #7051216b;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:9%;padding:16%;padding:10%;transform:rotate(-5deg);position:relative;flex-shrink:0}.die i{border-radius:50%;background:#273441;visibility:hidden;box-shadow:inset 0 1px 1px #0005}.die[data-value='1'] i:nth-child(5),.die[data-value='2'] i:nth-child(1),.die[data-value='2'] i:nth-child(9),.die[data-value='3'] i:nth-child(1),.die[data-value='3'] i:nth-child(5),.die[data-value='3'] i:nth-child(9),.die[data-value='4'] i:nth-child(1),.die[data-value='4'] i:nth-child(3),.die[data-value='4'] i:nth-child(7),.die[data-value='4'] i:nth-child(9),.die[data-value='5'] i:nth-child(1),.die[data-value='5'] i:nth-child(3),.die[data-value='5'] i:nth-child(5),.die[data-value='5'] i:nth-child(7),.die[data-value='5'] i:nth-child(9),.die[data-value='6'] i:nth-child(1),.die[data-value='6'] i:nth-child(3),.die[data-value='6'] i:nth-child(4),.die[data-value='6'] i:nth-child(6),.die[data-value='6'] i:nth-child(7),.die[data-value='6'] i:nth-child(9){visibility:visible}.die[data-value='1'] i:nth-child(5){background:#b93237}.die[data-value='0']::after{content:'♛';position:absolute;inset:0;display:grid;place-items:center;font-size:clamp(18px,3vw,30px);color:#a67a30}.die.rolling{animation:roll .55s linear infinite}.board-roll:not(:disabled) .die{box-shadow:inset 0 1px white,2px 4px 0 #806d50,0 0 14px #fff1bc;animation:dieReady 2s ease-in-out infinite}.board-roll .die.rolling{animation:roll .55s linear infinite}.table-side{width:var(--board-size)}.hud{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.player-chip{min-width:0;border:1px solid #56617455;border-bottom:3px solid var(--player-color);background:linear-gradient(#1d2b3b,#121e2c);border-radius:9px;display:flex;align-items:center;gap:7px;padding:7px 6px;position:relative}.player-chip.active{border-color:var(--player-color);box-shadow:0 0 0 1px var(--player-color),0 0 18px color-mix(in srgb,var(--player-color) 20%,transparent)}.player-chip img{width:30px;height:34px;object-fit:cover;border-radius:5px}.chip-info{min-width:0}.player-chip b{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.player-chip small{display:block;color:#a7b3c0;font-size:9px;white-space:nowrap;margin-top:5px}.player-chip.finished{opacity:.7}.turn-info{display:flex;align-items:center;flex-direction:column;justify-content:center;height:56px;text-align:center;margin-top:7px;gap:5px}.turn-info strong{color:var(--cream);font-size:14px}.turn-info p{font-size:11px;color:#a7b6c7;margin:0;line-height:1.4;max-width:98%}.helper-row{display:flex;justify-content:center;align-items:center;gap:10px;height:35px}.helper-row button{font-size:11px;padding:5px 11px;min-height:34px}.kick{background:#44272a;border:1px solid #ae7175;border-radius:8px;color:#f1b8b7}.reconnect{position:absolute;inset:0;z-index:55;background:#07131dce;backdrop-filter:blur(3px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:22px;text-align:center;border-radius:12px}.reconnect h2{font-size:24px;margin-bottom:10px}.reconnect p{font-size:12px;line-height:1.7;max-width:260px;color:#c0cddd}.reconnect .quiet{font-size:12px}.status-dot{width:6px;height:6px;border-radius:50%;background:var(--gold);display:inline-block;margin-right:5px}
/* Native dialog retains keyboard focus and keeps menus separate from gameplay. */
dialog{max-width:min(480px,calc(100vw - 26px));width:480px;max-height:86dvh;padding:0;background:linear-gradient(145deg,#203045,#0c1826);color:var(--cream);border:1px solid #d5ad626f;border-radius:18px;box-shadow:0 24px 80px #000b;overscroll-behavior:contain}dialog::backdrop{background:#020810b8;backdrop-filter:blur(5px)}#dialogContent{padding:23px}.dialog-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:20px}.dialog-head h2{margin:0;font-size:27px}.dialog-head .icon-button{font-size:15px;min-width:38px;min-height:38px}.dialog-actions{display:flex;flex-direction:column;gap:10px}.dialog-actions a{display:block;text-align:center}.rules-copy p{font-size:13px;line-height:1.7;color:#c8d0db}.rules-copy strong{color:#ffe2a7}.rules-copy h3{font-size:20px;margin:24px 0 10px}.choice{display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;border:1px solid #c59c5166;background:#213348;color:var(--cream);padding:15px;border-radius:11px;min-height:65px;width:100%;margin-bottom:10px}.choice strong{font-size:14px}.choice small{display:block;font-size:11px;color:#a5b7ca;margin-top:5px;line-height:1.5}.choice .arrow{color:var(--gold);font-size:23px}.log-list{display:flex;flex-direction:column;gap:10px;font-size:12px;line-height:1.6;color:#c3cdd9}.log-list p{padding-bottom:10px;border-bottom:1px solid #ffffff12;margin:0}.log-list time{display:block;font-size:9px;color:#7f91a5}.results{text-align:center}.results h2{font-size:30px;margin:4px 0 10px}.ranking{display:flex;align-items:center;gap:15px;border:1px solid #65738a55;border-left:4px solid var(--player-color);border-radius:9px;padding:12px 15px;margin-bottom:10px;text-align:left}.ranking b{font-size:24px;color:var(--gold);font-family:Georgia,serif;min-width:44px}.ranking span{font-size:13px}.ranking small{display:block;color:var(--muted);font-size:10px;margin-top:3px}#notice{position:fixed;bottom:max(22px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:100;max-width:calc(100vw - 28px);width:max-content;border-radius:10px;background:#24354beF;border:1px solid #9dadbf88;padding:12px 17px;box-shadow:0 5px 25px #0008;font-size:12px;line-height:1.5;display:none;pointer-events:none}#notice.show{display:block}
@keyframes tokenGlow{50%{filter:brightness(1.22);box-shadow:0 0 0 3px #ffefb899,0 3px 0 #293442,0 0 12px white}}@keyframes roll{0%{transform:rotate(-12deg) scale(.95)}25%{transform:rotate(21deg) translate(2px,-3px)}50%{transform:rotate(-25deg) scale(1.03)}75%{transform:rotate(16deg) translate(-3px,2px)}100%{transform:rotate(-12deg) scale(.95)}}@keyframes dieReady{50%{transform:rotate(4deg) translateY(-2px)}}@keyframes trail{to{opacity:0;transform:scale(.3)}}
@media(max-width:520px){.title-portraits{gap:7px}.title-screen{padding-top:22px}.wordmark{font-size:60px}.wordmark span{letter-spacing:7px}.modes{gap:12px}.mode-art{height:145px}.mode-copy{padding:15px 12px 17px}.mode h2{font-size:22px}.mode p{font-size:11px}.page-nav{margin-bottom:23px}.page-content>h1{font-size:33px}.form-panel{padding:20px}.seats{grid-template-columns:1fr 1fr}.seat{display:grid;grid-template-columns:55px 1fr;grid-template-rows:1fr 1fr;text-align:left;padding:0;gap:0}.seat img{grid-row:1/3;width:55px;height:78px}.seat b{margin:14px 8px 0;font-size:11px;align-self:end}.seat small{margin:3px 8px 12px;font-size:9px}.board-frame{padding:6px;border-radius:12px}.board-frame::before{inset:3px;border-radius:9px}.hud{gap:5px}.player-chip{gap:4px;padding:7px 5px}.player-chip img{width:21px;height:28px}.player-chip b{font-size:10px}.player-chip small{font-size:8px}.game-title{font-size:15px}.game-top{height:39px;margin-bottom:8px}.game-top .icon-button{min-width:37px;min-height:37px;font-size:14px}.game-shell{padding-inline:12px}.goal{border-width:1px}.token{border-width:1px}.token em{height:12px;font-size:7px;min-width:13px}.turn-info strong{font-size:13px}.turn-info p{font-size:10px}.table-layout{gap:12px}.table-side{width:min(100%,420px)}.title-screen .crown{font-size:36px}.attribution{margin-top:26px}}
@media(max-width:359px){:root{--board-size:min(calc(100vw - 16px),calc(100dvh - 193px))}.game-shell{padding-inline:8px}.player-chip img{display:none}.player-chip{padding:8px}.wordmark{font-size:48px}.title-portraits{height:130px}.form-panel{padding:16px}.form-grid{gap:10px}.field select{font-size:13px;padding-inline:6px}.game-top .connection{font-size:9px}}
@media(orientation:landscape) and (max-height:620px){:root{--board-size:min(calc(100dvh - 67px),calc(100vw - 255px))}.game-shell{padding:6px 16px;justify-content:flex-start}.game-top{height:38px;width:min(100%,900px);margin-bottom:5px}.table-layout{flex-direction:row;justify-content:center;align-items:center;gap:20px}.table-side{width:200px}.hud{grid-template-columns:1fr 1fr;gap:9px}.player-chip{display:flex;flex-direction:column;text-align:center;padding:8px 4px}.player-chip img{width:30px;height:32px}.player-chip b{font-size:10px}.player-chip small{font-size:9px}.turn-info{height:76px;margin-top:14px}.helper-row{height:44px;flex-direction:column}.game-title{font-size:14px}.board-frame{padding:5px;border-radius:11px}.title-screen{padding:20px}.title-screen .crown{display:none}.title-portraits{height:115px;width:370px;margin:18px 0}.wordmark{font-size:43px}.wordmark span{font-size:.46em;margin-top:8px}.tagline{margin-bottom:14px;font-size:11px}.play-button{min-height:46px;font-size:16px;padding:9px}.attribution{margin-top:20px}.title-footer{margin-top:0}.page{padding-top:12px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;scroll-behavior:auto!important;transition:none!important}.die.rolling{animation:none!important}}

/* Crop the baked portrait frames away inside the full-bleed board quadrants. */
.base-art.red img,.base-art.yellow img{transform:scale(1.47)}
.base-art.blue img,.base-art.green img{transform:scale(1.17)}

/* v1.0.0-rc.2 private room chat */
.chat-button{position:relative;min-width:37px;min-height:37px;border:1px solid #8e784d66;background:#162638;color:#f7dfaa;border-radius:9px;font-size:16px}.chat-button span,.lobby-controls #lobbyChatBadge{position:absolute;transform:translate(3px,-7px);min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:#c54c51;color:white;font:800 9px/16px system-ui;text-align:center}.chat-list{height:min(48dvh,390px);overflow:auto;display:flex;flex-direction:column;gap:9px;padding:2px 2px 8px;overscroll-behavior:contain}.chat-message{border-left:3px solid var(--player-color);background:#101f2f;border-radius:8px;padding:9px 10px}.chat-message.mine{background:#213148}.chat-message>div{display:flex;align-items:center;gap:7px}.chat-message b{font-size:11px;color:#ffe1a6}.chat-message time{font-size:8px;color:#8192a5;margin-left:auto}.chat-message p{font-size:13px;line-height:1.45;margin:5px 0 0;overflow-wrap:anywhere}.chat-mute{border:0;background:transparent;color:#8fa2b6;font-size:8px;padding:2px}.chat-compose{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:10px}.chat-compose input{min-width:0;border:1px solid #53687d;background:#091624;color:white;border-radius:9px;padding:11px;font-size:13px}.chat-compose .gold{min-width:70px;padding:8px 12px}.chat-reactions{display:flex;gap:6px;margin-top:10px}.chat-reactions button{flex:1;padding:6px;min-height:32px}.chat-empty{text-align:center;padding:35px 8px}.lobby-controls #lobbyChat{position:relative}
@media(max-width:520px){.chat-list{height:min(45dvh,330px)}.chat-compose input{font-size:16px}.chat-reactions{gap:4px}.chat-reactions button{padding:5px}}

/* RC3 game-art pass */
.page{background:linear-gradient(#061018c9,#061018e8),url('assets/backgrounds/menu-jungle.jpg') center/cover fixed}.page-content{position:relative}.page-content>p.muted,.page-content>.eyebrow{display:none}.small-mark{font-size:24px}.modes{grid-template-columns:repeat(3,1fr)}.mode-copy p{display:none}.mode-copy{min-height:72px;display:flex;align-items:center}.mode h2{margin:0}.snake-art{background:linear-gradient(#0b1a12aa,#0b1a12aa),url('assets/backgrounds/snake-jungle.jpg') center/cover}.game-title:empty{display:block;width:1px}.token{overflow:hidden;padding:0;background:radial-gradient(circle at 35% 30%,#fff7d9 0 5%,var(--player-color) 58%,#18212c 100%);border:2px solid #f6d98e;box-shadow:inset 0 0 0 2px #0005,0 3px 0 #293442,0 4px 8px #0008}.coin-art{width:82%;height:82%;border-radius:50%;object-fit:cover;object-position:center;display:block;box-shadow:inset 0 0 8px #0009;pointer-events:none}.token em{z-index:3}.board-frame.dice-impact{animation:boardImpact .52s cubic-bezier(.18,.8,.2,1)}.board-frame.dice-impact::after{content:'';position:absolute;left:50%;top:50%;width:22%;height:22%;border:3px solid #ffe49b;border-radius:50%;transform:translate(-50%,-50%);animation:diceShock .5s ease-out;pointer-events:none;z-index:30}.illustrated-rules{margin:-23px;background:linear-gradient(#21130766,#21130766),url('assets/backgrounds/rules-jungle.jpg') center/cover;min-height:70dvh;padding:28px 22px;border-radius:17px}.illustrated-rules .rules-banner{height:100px;display:grid;place-items:center;font-size:56px;color:#f4cf78;text-shadow:0 5px 20px #000}.rule-tiles{display:grid;gap:10px}.rule-tiles>div{display:grid;grid-template-columns:48px 1fr;align-items:center;gap:12px;background:#f1dfbce8;color:#342313;border:2px solid #8d622d;border-radius:12px;padding:12px 14px;box-shadow:0 5px 18px #0007}.rule-tiles b{font-size:24px;text-align:center}.rule-tiles span{font-family:Georgia,serif;font-size:13px;line-height:1.4}.snake-screen{min-height:100dvh;background:linear-gradient(#07110ac4,#07110ae8),url('assets/backgrounds/snake-jungle.jpg') center/cover fixed;padding:12px;display:flex;flex-direction:column;align-items:center}.snake-top{width:min(620px,100%);display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.snake-score{display:flex;gap:18px;background:#07130fdd;border:1px solid #cda85c;border-radius:12px;padding:9px 16px;font-family:Georgia,serif}.snake-score span:first-child{color:#e9bd51}.snake-stage{width:min(600px,calc(100vw - 24px));aspect-ratio:1;position:relative;border:7px solid #75502b;border-radius:16px;box-shadow:0 18px 50px #000a,inset 0 0 0 2px #dfbd71;background:#07120c}.snake-stage canvas{width:100%;height:100%;display:block;background:transparent}.snake-start{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);min-width:170px}.snake-pad{display:none;margin-top:10px;text-align:center}.snake-pad button{width:58px;height:48px;background:#142519dd;border:1px solid #b58d49;color:#f1d58b;border-radius:10px;margin:3px;font-size:18px}@keyframes boardImpact{20%{transform:scale(.992) translateY(2px)}45%{transform:scale(1.006) translateY(-1px)}100%{transform:none}}@keyframes diceShock{0%{opacity:1;transform:translate(-50%,-50%) scale(.3)}100%{opacity:0;transform:translate(-50%,-50%) scale(2.6)}}
@media(max-width:720px){.modes{grid-template-columns:1fr 1fr}.snake-mode{grid-column:1/-1}.snake-mode .mode-art{height:125px}.snake-pad{display:block}.illustrated-rules{padding:18px 14px}.rule-tiles>div{grid-template-columns:38px 1fr;padding:10px}.rule-tiles span{font-size:12px}}

/* RC4 stage 1: game-first shell, stable board, physical coins/die */
.board-frame.dice-impact{animation:none!important}.board-frame.dice-impact::after{display:none!important}
.title-screen .wordmark,.title-screen .eyebrow,.title-screen .tagline,.title-screen .attribution{display:none!important}
.title-screen{justify-content:center;gap:28px;background:linear-gradient(#07111bbb,#07111bdd),url('assets/backgrounds/menu-jungle.jpg') center/cover fixed}
.title-portraits{margin:0 auto;max-width:720px;height:min(38vh,330px)}.play-button{max-width:420px}
.game-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;max-width:900px;margin:24px auto}.game-choice{padding:0;overflow:hidden;border:2px solid #caa45d;border-radius:18px;background:#0b1722;color:#f6df9b;box-shadow:0 18px 50px #0009}.choice-image{height:300px;background-position:center;background-size:cover}.choice-ludo{background-image:linear-gradient(#06101822,#06101855),url('assets/backgrounds/menu-jungle.jpg')}.choice-ladders{background-image:linear-gradient(#06101833,#06101866),url('assets/backgrounds/snake-jungle.jpg')}.game-choice strong{display:block;padding:18px;font:700 24px Georgia,serif;letter-spacing:1px}.classic-modes{grid-template-columns:1fr 1fr;max-width:760px;margin-inline:auto}.classic-modes .mode-copy{justify-content:center;text-align:center}.classic-modes .mode-arrow{display:none}
.board-frame{transform:none!important}.die.rolling{animation:dieTumble .16s steps(2,end) infinite!important}.board-roll:not(:disabled) .die:not(.rolling){animation:none!important}@keyframes dieTumble{0%{transform:rotate(-12deg) translate(-2px,-3px)}50%{transform:rotate(18deg) translate(3px,1px)}100%{transform:rotate(-7deg) translate(0,2px)}}
.token{border:2px solid #f3d47b!important;background:radial-gradient(circle at 34% 27%,#fff4c6 0 4%,var(--player-color) 55%,#121923 100%)!important}.coin-art{width:86%!important;height:86%!important;object-fit:cover!important;border-radius:50%!important}
@media(max-width:720px){.game-choice-grid{grid-template-columns:1fr;gap:14px}.choice-image{height:190px}.game-choice strong{font-size:18px;padding:13px}}



/* Shared private-room chat remains usable when a mobile keyboard reduces the
   visual viewport; message updates never replace the focused input. */
.snakes-online-actions{display:grid;gap:12px;margin-top:18px}
#dialog.room-chat{position:fixed;box-sizing:border-box;margin:0;left:50%;right:auto;bottom:auto;transform:translateX(-50%);top:calc(var(--chat-top,0px) + var(--chat-height,100dvh) - min(600px,calc(var(--chat-height,100dvh) - 20px)) - 10px);width:min(480px,calc(100vw - 20px));height:min(600px,calc(var(--chat-height,100dvh) - 20px));max-height:none;padding:18px;background:linear-gradient(#253123,#101d15);border:2px solid #c4a062;border-radius:18px;color:#f3e2bd;overflow:hidden}
#dialog.room-chat #dialogContent{display:flex;flex-direction:column;height:100%;min-height:0;gap:10px}
#dialog.room-chat .dialog-head{margin-bottom:0;flex:none;min-height:38px}
#dialog.room-chat .dialog-head h2{font-size:22px;margin:0}
#dialog.room-chat .dialog-head button{min-width:44px;min-height:44px}
#dialog.room-chat .chat-list{flex:1;min-height:40px;height:auto;max-height:none;margin:0;overflow:auto;overscroll-behavior:contain;padding:6px}
#dialog.room-chat .chat-message p{overflow-wrap:anywhere;white-space:pre-wrap}
#dialog.room-chat .chat-reactions{display:flex;gap:6px;flex:none;justify-content:space-between;margin:0}
#dialog.room-chat .chat-reactions button{min-width:42px;min-height:42px;padding:6px 9px}
#dialog.room-chat .chat-compose{display:flex;gap:8px;flex:none;margin:0}
#dialog.room-chat input,#nickname,#joinCode,.invite-fallback{font-size:16px;min-width:0}
#dialog.room-chat input{flex:1;width:0;min-height:44px;border:1px solid #988151;border-radius:8px;background:#112319;color:#f6ebcd;padding:10px}
#dialog.room-chat .chat-compose button{width:auto;min-width:72px;min-height:44px;padding:8px 12px;font-size:13px}
#dialog.room-chat .chat-foot{display:flex;align-items:center;justify-content:space-between;gap:6px;font:10px/1.3 system-ui;flex:none;min-height:26px}
#dialog.room-chat .chat-foot button{font-size:11px}
#chatConnection{color:#e4c486;text-align:right}
@media(max-height:430px){#dialog.room-chat{padding:10px}#dialog.room-chat #dialogContent{gap:5px}#dialog.room-chat .chat-reactions button{min-height:34px}#dialog.room-chat .chat-foot{min-height:20px}}

/* RC10.1 — Classic Back control. Scoped so the approved menus and Snakes
   board remain untouched. The header never displaces the center dice. */
.classic-game{--board-size:min(calc(100vw - 24px),calc(100dvh - 232px),654px)}
.classic-game-top{height:44px;min-height:44px;flex-shrink:0;gap:8px}
.classic-heading{display:flex;align-items:center;gap:9px;min-width:0;flex:1}
.classic-heading .game-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.classic-back{display:inline-flex;align-items:center;justify-content:center;gap:3px;flex:none;min-width:76px;min-height:44px;padding:8px 10px;border:1px solid #b48b4e;border-radius:9px;background:linear-gradient(145deg,#43311e,#1f1a12);box-shadow:inset 0 1px #f5d59366,0 3px 0 #100d08;color:#fae5b5;font-size:13px;font-weight:650;touch-action:manipulation}
.classic-back svg{width:18px;height:18px;flex:none}
.classic-back:hover{border-color:#f5d593;background:linear-gradient(145deg,#594226,#282013)}
.classic-back:active{box-shadow:inset 0 2px 4px #0009,0 1px 0 #100d08}
.classic-back:focus-visible{outline:3px solid #fff2b8;outline-offset:3px}
.classic-game-top>.row{gap:6px;flex:none}
.classic-game-top .icon-button,.classic-game-top .chat-button{min-width:44px;min-height:44px}
@media(max-width:520px){
 .classic-game-top{gap:5px;height:44px;min-height:44px}
 .classic-heading{gap:6px}.classic-heading .game-title{font-size:10px;letter-spacing:0}
 .classic-game-top .connection{font-size:0;gap:0;min-width:7px}
 .classic-game-top .connection i{width:7px;height:7px}
}
@media(orientation:portrait) and (max-height:540px){
 .classic-game{--board-size:min(calc(100vw - 24px),calc(100dvh - 210px))}
 .classic-game .player-chip{min-height:38px;padding:5px}
 .classic-game .turn-info{height:44px;margin-top:4px}
 .classic-game .table-layout{gap:10px}
}
@media(orientation:landscape) and (max-height:620px){
 .classic-game{--board-size:min(calc(100dvh - 68px),calc(100vw - 250px))}
 .classic-game-top{height:44px;min-height:44px}
 .classic-game .table-layout{gap:18px}
 .classic-game .table-side{width:200px;flex:none}
 .classic-game .hud{grid-template-columns:1fr 1fr;gap:6px}
 .classic-game .player-chip{flex-direction:row;text-align:left;min-height:44px;padding:5px;gap:4px}
 .classic-game .player-chip img{width:24px;height:28px}
 .classic-game .player-chip b{font-size:10px}
 .classic-game .player-chip small{font-size:8px}
 .classic-game .turn-info{height:48px;margin-top:8px}
 .classic-game .helper-row{height:40px}
}
