:root{--bg:#f2e9ff;--ink:#4a315f;--table:#b9e0d8;--accent:#6942b9;--pink:#f282bb;--yellow:#ffe49a;--paper:#fffdf1;--muted:#8d769f;--line:3px;--radius:48px;font-family:ui-rounded,'Trebuchet MS',system-ui,sans-serif;color:var(--ink);background:var(--bg);font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-height:100dvh}button,input,select{font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.45}select:focus-visible,input:focus-visible{outline:3px solid #e460a3;outline-offset:4px}button{border:var(--line) solid var(--ink);border-radius:17px;background:var(--paper);font-weight:800;box-shadow:0 4px 0 var(--ink);padding:12px 18px;transition:transform .15s,box-shadow .15s}button:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 6px 0 var(--ink)}button:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 var(--ink)}button.primary{background:var(--accent);color:var(--paper)}button.soft{background:var(--table)}button.plain{box-shadow:none;border:0;background:transparent;padding:7px 10px;font-size:12px;color:var(--muted)}button.icon{width:43px;height:43px;padding:7px;font-size:21px;background:var(--table);box-shadow:none}button.small{padding:8px 12px;font-size:12px;border-width:2px;box-shadow:0 2px var(--ink)}h1,h2,h3,p{margin:0}h1{font-size:52px;letter-spacing:-2px;line-height:1.05}h2{font-size:30px;letter-spacing:-1px}h3{font-size:18px}p{line-height:1.6}small,.muted{color:var(--muted)}.eyebrow{font-size:10px;letter-spacing:2px;text-transform:uppercase;font-weight:900}.app-shell{max-width:1120px;padding:30px 32px 24px;margin:auto}.topbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:28px}.brand-small{font-size:22px;font-weight:950;letter-spacing:-1px}.top-actions{display:flex;gap:10px}.title-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.subtitle{font-size:10px;text-transform:uppercase;letter-spacing:1.6px;margin-top:10px;color:var(--muted)}.moon{width:58px;height:58px;transform:rotate(-7deg)}.home-grid{display:grid;grid-template-columns:1.1fr 1fr;gap:42px;align-items:center;padding:35px 15px 20px}.home-heading{font-size:80px;line-height:.98}.home-copy{max-width:380px;margin:22px 0;color:var(--muted);font-size:16px}.home-buttons{display:grid;gap:16px;max-width:370px}.home-buttons button{font-size:17px;padding:17px;display:flex;justify-content:space-between;align-items:center}.mini-links{display:flex;flex-wrap:wrap;gap:14px;margin-top:26px}.home-art{height:430px;border:4px solid var(--ink);border-radius:45% 45% 38% 38%;background:var(--table);box-shadow:0 10px var(--ink);position:relative;display:flex;align-items:center;justify-content:center}.home-art:before{content:'';position:absolute;inset:12px;border:2px solid #719e9a80;border-radius:inherit}.home-art .card{width:120px;height:178px;position:absolute;transform:rotate(-16deg) translateX(-50px)}.home-art .card:last-of-type{transform:rotate(14deg) translateX(54px)}.home-art .avatar{position:absolute;width:76px;height:76px;top:-25px;left:28px}.home-art .moon{position:absolute;right:12px;top:-45px}.spark{position:absolute;font-size:31px;color:var(--paper);pointer-events:none}.spark.one{left:25px;top:29%}.spark.two{right:27px;bottom:28px}.home-foot{margin-top:45px;border-top:1px solid #4a315f20;padding-top:20px;display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}.profile-pill{display:flex;gap:9px;align-items:center;background:#ffffff60;border-radius:30px;padding:6px 14px 6px 6px;font-size:12px}.avatar{width:50px;height:50px;color:var(--ink);flex-shrink:0}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:28px}.table{height:400px;border:var(--line) solid var(--ink);border-radius:var(--radius);background:var(--table);box-shadow:0 9px 0 var(--ink);position:relative;margin:47px 0 30px}.table:before{content:'';position:absolute;inset:10px;border:2px solid #6aa69b70;border-radius:calc(var(--radius) - 10px);pointer-events:none}.opponents{display:contents}.player{position:absolute;text-align:center;z-index:3;width:87px;transform:translate(-50%,-50%)}.player .avatar{width:54px;height:54px}.player-name{font-weight:800;font-size:12px;background:var(--bg);border-radius:12px;padding:4px 4px 7px}.player-name small{display:block;font-size:10px;font-weight:400;margin-top:2px}.level{position:absolute;top:35px;right:6px;min-width:24px;border:2px solid var(--bg);background:var(--ink);color:var(--paper);border-radius:20px;font-size:12px;font-weight:900;padding:3px}.piles{display:flex;gap:48px;justify-content:center;align-items:center;height:100%;padding-top:15px}.pile-wrap{text-align:center;position:relative}.pile-label{font-size:10px;letter-spacing:1.4px;text-transform:uppercase;font-weight:900;margin-top:17px;color:var(--muted)}.pile{width:80px;height:116px;position:relative}.pile>.card{position:absolute;top:0;left:0}.card{width:80px;height:116px;min-width:0;background:var(--paper);border:var(--line) solid var(--ink);border-radius:13px;box-shadow:0 4px var(--ink);position:relative;display:inline-flex;align-items:center;justify-content:center;color:var(--ink);padding:0;flex-shrink:0;user-select:none;touch-action:pan-y}.card.red{color:#d54c7d}.corner{position:absolute;left:7px;top:5px;font-size:21px;font-weight:900;line-height:.95;text-align:center}.corner small{display:block;font-size:14px;color:inherit;margin-top:4px}.corner.bottom{left:auto;top:auto;bottom:5px;right:7px;transform:rotate(180deg)}.pip{font-size:42px;line-height:1}.back{background:repeating-linear-gradient(119deg,var(--pink) 0 11px,var(--yellow) 11px 20px);color:var(--accent)}.back:after{content:'';position:absolute;inset:5px;border:2px solid #ffffff70;border-radius:6px}.back-eight{background:var(--paper);border:2px solid var(--ink);border-radius:50%;font-size:45px;font-weight:950;width:53px;line-height:54px;letter-spacing:-3px;padding-right:3px;z-index:1}.suit-chip{position:absolute;bottom:28px;left:50%;transform:translateX(-50%);border:2px solid var(--ink);border-radius:30px;background:var(--paper);padding:7px 15px;font-size:12px;white-space:nowrap;font-weight:800}.suit-chip b{font-size:18px;margin-right:6px}.turn-banner{background:var(--accent);color:var(--paper);border:var(--line) solid var(--ink);box-shadow:0 5px var(--ink);border-radius:22px;padding:13px 15px;display:flex;gap:13px;align-items:center;margin-bottom:22px;min-height:73px}.turn-banner small{color:#e2d4f5;display:block;margin-top:4px;font-size:11px}.timer{width:43px;height:43px;border-radius:50%;display:grid;place-items:center;font-weight:900;font-size:17px;background:conic-gradient(var(--yellow) var(--timer,100%),#ffffff35 0);position:relative}.timer:before{content:'';position:absolute;inset:3px;background:var(--accent);border-radius:50%}.timer span{z-index:1}.direction{font-size:28px;color:var(--yellow);margin-left:auto}.hand-head{display:flex;align-items:center;justify-content:space-between;font-size:13px;margin-bottom:12px}.hand-head small{font-size:11px;margin-left:6px}.badge{border:2px solid var(--ink);border-radius:30px;background:var(--yellow);font-size:11px;padding:6px 12px;font-weight:900}.hand-scroll{overflow-x:auto;overflow-y:hidden;padding:25px 4px 12px;margin:0 -4px;scrollbar-width:thin;scrollbar-color:#baa4d5 transparent;min-height:161px}.hand{display:flex;gap:7px;min-width:min-content;justify-content:center}.hand .card{transition:transform .18s cubic-bezier(.2,.8,.2,1),box-shadow .18s;touch-action:pan-x}.hand .card.selected{transform:translateY(-17px);box-shadow:0 5px var(--ink)}.hand .card:hover:not(.selected){transform:translateY(-5px)}.order{position:absolute;top:-15px;right:-7px;min-width:25px;height:25px;background:var(--accent);color:var(--paper);border:2px solid var(--bg);border-radius:50%;font-size:12px;display:grid;place-items:center}.sort-row{display:flex;align-items:center;gap:4px;font-size:9px;color:var(--muted);margin:7px 0 16px}.sort-row .active{background:var(--table);border:1px solid var(--ink);border-radius:9px;color:var(--ink)}.sort-row .hint{margin-left:auto}.actions{display:grid;grid-template-columns:1fr 1.5fr;gap:12px}.sidebar{padding-top:40px}.panel{border:2px solid var(--ink);border-radius:24px;background:#ffffff55;padding:20px;margin-bottom:20px}.panel h3{margin-bottom:10px}.panel p{font-size:12px}.countdown-track{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0}.countdown-track span{display:grid;place-items:center;width:25px;height:29px;border-radius:8px;background:#4a315f10;font-size:12px;font-weight:800}.countdown-track .current{background:var(--accent);color:var(--paper)}.countdown-track .done{background:var(--table)}.emoji-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.emoji-row button{font-size:22px;padding:5px 8px;box-shadow:none;border:1px solid #4a315f30}.log{font-size:11px;line-height:1.7;color:var(--muted);max-height:135px;overflow:auto}.log div{border-bottom:1px solid #4a315f12;padding:5px 0}.center-page{max-width:650px;margin:20px auto}.center-page>h2{margin-bottom:10px}.center-page>.muted{margin-bottom:26px}.field{display:flex;flex-direction:column;gap:9px;margin:20px 0;font-size:12px;font-weight:800}select,input{border:2px solid var(--ink);background:var(--paper);padding:12px;border-radius:12px;min-width:0}.option-row{display:flex;gap:10px;flex-wrap:wrap}.option-row button.chosen{background:var(--accent);color:var(--paper)}.settings-row{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #4a315f20;padding:15px 0;gap:15px}.settings-row label{font-size:14px}.settings-row input[type=checkbox]{width:22px;height:22px;accent-color:var(--accent)}.cosmetic-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 22px}.theme-buttons{display:flex;gap:10px;flex-wrap:wrap}.theme-button{flex:1;min-width:100px;font-size:11px;padding:12px 8px}.swatches{display:flex;justify-content:center;margin-bottom:8px}.swatches i{width:20px;height:20px;border:1px solid var(--ink);border-radius:50%;margin-left:-4px}.preview-swatch{background:var(--table);border:3px solid var(--ink);border-radius:var(--radius);height:160px;display:flex;align-items:center;justify-content:center;gap:25px;margin:20px 0;position:relative}.preview-swatch .card{transform:rotate(-10deg)}.preview-swatch .card+ .card{transform:rotate(8deg)}.avatar-options{display:flex;gap:12px;flex-wrap:wrap}.avatar-options button{padding:3px;box-shadow:none;background:transparent;border-color:transparent}.avatar-options .chosen{border-color:var(--accent);background:var(--yellow)}.history-item{display:flex;justify-content:space-between;gap:16px;padding:16px 0;border-bottom:1px solid #4a315f20;font-size:13px}.history-item small{display:block;margin-top:5px}dialog{border:3px solid var(--ink);border-radius:28px;background:var(--bg);color:var(--ink);padding:28px;width:min(430px,calc(100% - 28px));box-shadow:0 8px var(--ink);max-height:90dvh;overflow:auto}dialog::backdrop{background:#30204388;backdrop-filter:blur(5px)}dialog h2{font-size:26px;margin-bottom:12px}dialog p{font-size:14px;margin:12px 0 20px}dialog .option-row button{flex:1}#toast{position:fixed;bottom:25px;left:50%;transform:translate(-50%,30px);max-width:calc(100% - 30px);background:var(--ink);color:var(--paper);border-radius:15px;padding:12px 20px;font-size:13px;z-index:50;pointer-events:none;opacity:0;transition:opacity .2s,transform .2s}#toast.show{opacity:1;transform:translate(-50%,0)}#motion-layer{position:fixed;inset:0;pointer-events:none;z-index:20;overflow:hidden}.flying{position:fixed;margin:0;will-change:transform;transform-origin:center}.tutorial-card{display:flex;justify-content:center;gap:20px;margin:25px 0}.tutorial-dots{display:flex;gap:7px;margin:20px 0}.tutorial-dots i{width:25px;height:5px;border-radius:10px;background:#4a315f20}.tutorial-dots i.on{background:var(--accent)}/* Room-code type follows its actual panel width. The negative trailing margin
   cancels the last letter-spacing advance so the visible code is centered.
   The viewport-size fallback also fits 320px phones; codes never get truncated. */
.room-code{container-type:inline-size;font-weight:900;text-align:center;padding:24px 0;direction:ltr}.room-code>span{display:inline-block;font-size:clamp(20px,7vw,40px);font-size:clamp(20px,9cqi,40px);letter-spacing:.04em;margin-inline-end:-.04em;line-height:1.25;white-space:nowrap}.room-player{display:flex;gap:12px;align-items:center;margin:12px 0}.room-player strong{flex:1}.waiting-pulse{width:14px;height:14px;background:var(--pink);border:2px solid var(--ink);border-radius:50%;display:inline-block;animation:pulse 1.8s infinite;margin-right:8px}@keyframes pulse{50%{transform:scale(1.35);opacity:.5}}.result-icon{font-size:65px;text-align:center;margin-bottom:15px}.notice{padding:12px 15px;border-radius:14px;background:#ffe49a70;font-size:12px;line-height:1.6;margin:16px 0}.floating-emoji{position:fixed;font-size:40px;animation:emoji 2s ease-out forwards;pointer-events:none;z-index:50}@keyframes emoji{to{transform:translateY(-150px) rotate(15deg);opacity:0}}body[data-back=dots] .back{background:radial-gradient(var(--yellow) 4px,transparent 5px) 0 0/18px 18px,var(--pink)}body[data-back=diamonds] .back{background:repeating-conic-gradient(var(--yellow) 0 25%,var(--pink) 0 50%) 0/24px 24px}body[data-decoration=none] .spark,body[data-decoration=none] .moon{visibility:hidden}body[data-decoration=stars] .spark{color:var(--pink)}body[data-border=soft]{--line:2px}body[data-border=bold]{--line:4px}body[data-card=round] .card{border-radius:22px}body[data-card=square] .card{border-radius:5px}.reduce-motion *{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto}@media(min-width:900px){.game-layout .hand .card{width:75px;height:110px}.game-layout .hand{justify-content:flex-start}.game-layout .table{height:385px}}@media(max-width:800px){.app-shell{max-width:530px;padding:20px 22px 24px}.topbar{margin-bottom:24px}.home-grid{display:flex;flex-direction:column-reverse;padding:20px 0 0;gap:35px}.home-art{height:235px;width:90%;border-radius:45px}.home-art .card{width:85px;height:125px}.home-art .avatar{width:60px;height:60px}.home-art .moon{width:48px;top:-30px}.home-heading{font-size:55px}.home-copy{margin:15px 0 22px;font-size:14px}.home-grid>div:not(.home-art){width:100%}.home-buttons{max-width:none}.home-foot{margin-top:28px;line-height:1.7;gap:15px}.home-foot span:last-child{text-align:right}.game-layout{display:block}.sidebar{display:none}.title-row{margin-bottom:18px}h1{font-size:46px}.table{height:310px;margin:57px 0 25px}.piles{gap:35px;padding-top:4px}.suit-chip{bottom:25px}.player{width:74px}.player .avatar{width:49px;height:49px}.player-name{font-size:11px}.level{right:0;top:32px}.hand{justify-content:flex-start;gap:6px}.hand .card{width:70px;height:103px}.hand .corner{font-size:19px;left:6px}.hand .corner.bottom{left:auto;right:6px}.hand .pip{font-size:36px}.hand-scroll{min-height:147px}.sort-row button{font-size:10px;padding:6px 9px}.actions button{font-size:13px;padding:11px 8px}.turn-banner{margin-bottom:20px;padding:10px 12px}.center-page{margin-top:10px}.center-page h2{font-size:29px}.cosmetic-grid{gap:0 12px}.profile-pill span{max-width:110px;overflow:hidden;text-overflow:ellipsis}.topbar .profile-pill{font-size:11px}.topbar .profile-pill .avatar{width:32px;height:32px}.top-actions{gap:7px}}@media(max-width:370px){.app-shell{padding:16px}.table{height:285px}.sort-row .hint{display:none}.profile-pill{display:none}.card{width:72px;height:105px}.home-heading{font-size:48px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

body[data-shape=scalloped] .table,body[data-shape=clipped] .table{border:0;background:none;box-shadow:none}body[data-shape=scalloped] .table:before,body[data-shape=clipped] .table:before{inset:-3px;background:var(--table-art) center/100% 100% no-repeat;border:0;border-radius:0}body[data-shape=scalloped] .piles,body[data-shape=clipped] .piles{position:relative}body[data-shape=scalloped] .preview-swatch,body[data-shape=clipped] .preview-swatch{border:0;background:var(--table-art) center/100% 100% no-repeat}body[data-title=badge] .title-row h1{border:3px solid var(--ink);background:var(--yellow);border-radius:24px;padding:7px 17px;box-shadow:0 4px var(--ink);font-size:39px;transform:rotate(-2deg)}body[data-title=tile] .title-row h1{display:flex;gap:4px;font-size:34px;letter-spacing:-1px}body[data-title=tile] .title-row h1 span{display:inline-block;background:var(--paper);border:2px solid var(--ink);border-radius:9px;padding:3px 5px;box-shadow:0 3px var(--ink);transform:rotate(var(--tilt))}body[data-title=tile] .title-row h1 span:nth-child(2n){background:var(--yellow)}@media(max-width:400px){body[data-title=tile] .title-row h1{font-size:27px;gap:2px}body[data-title=tile] .title-row h1 span{padding:3px}body[data-title=badge] .title-row h1{font-size:33px}}

/* The game is a viewport, not a scrolling document. Other pages still scroll. */
.tile-label{display:none}
body.playing .app-shell{height:100dvh;max-width:1120px;padding:8px max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));display:flex;flex-direction:column;gap:5px}
body.playing .topbar{margin:0;min-height:28px;flex-shrink:0}
body.playing .topbar .icon{width:30px;height:28px;padding:0;font-size:18px}
body.playing .title-row{margin:0;height:36px;flex-shrink:0}
body.playing .title-row h1{font-size:28px;line-height:1;letter-spacing:-1px}
body.playing .title-row .moon{width:30px;height:30px}
body.playing .subtitle{margin-top:3px;font-size:8px;letter-spacing:1px}
body.playing .game-layout{flex:1;min-height:0;gap:20px}
body.playing .game-layout>section{height:100%;min-height:0;display:flex;flex-direction:column;gap:5px}
body.playing .table{height:clamp(110px,23dvh,230px);min-height:110px;flex-shrink:0;margin:24px 12px 5px;box-shadow:0 4px var(--ink)}
body.playing .player{width:64px}
body.playing .player .avatar{width:30px;height:30px}
body.playing .player-name{font-size:9px;padding:2px;max-height:30px;overflow:hidden}
body.playing .player-name small{font-size:8px;margin:0}
body.playing .level{top:16px;right:6px;min-width:17px;padding:1px;font-size:9px}
body.playing .piles{padding:0 0 16px;gap:25px}
body.playing .pile,body.playing .pile>.card{width:49px;height:69px}
body.playing .pile .corner{font-size:15px;left:3px;top:3px}
body.playing .pile .corner.bottom{left:auto;top:auto;right:3px;bottom:3px}
body.playing .pile .corner small{font-size:10px;margin-top:1px}
body.playing .pile .pip{font-size:25px}
body.playing .pile .back-eight{width:33px;line-height:35px;font-size:30px}
body.playing .pile-label{font-size:8px;margin-top:5px;letter-spacing:0}
body.playing .suit-chip{bottom:3px;padding:1px 8px;font-size:10px}
body.playing .suit-chip b{font-size:13px}
body.playing .turn-banner{min-height:38px;flex-shrink:0;padding:4px 9px;margin:0;gap:8px;border-radius:13px;box-shadow:0 2px var(--ink);font-size:12px}
body.playing .turn-banner small{font-size:9px;margin:1px 0 0}
body.playing .timer{width:27px;height:27px;font-size:12px;flex-shrink:0}
body.playing .direction{font-size:20px}
body.playing .hand-head{margin:0;min-height:24px;flex-shrink:0;font-size:12px}
body.playing .badge{padding:3px 8px;font-size:10px}
body.playing .hand-scroll{flex:1;min-height:0;width:100%;padding:0;margin:0;overflow:visible}
body.playing .hand{display:block;position:relative;min-width:0;width:100%;height:100%}
body.playing .hand .card{position:absolute;margin:0;touch-action:none;box-shadow:0 2px var(--ink);border-width:2px;transition:transform .12s,box-shadow .12s}
body.playing .hand .card.selected{transform:translateY(-6px);box-shadow:0 2px var(--accent);border-color:var(--accent);background:var(--yellow)}
body.playing .hand .card:hover:not(.selected){transform:translateY(-2px)}
body.playing .hand .order{top:0;right:0;min-width:16px;height:16px;font-size:10px;border-width:1px;z-index:1}
body.playing .hand[data-layout=tiles] .card{border-radius:6px;box-shadow:0 1px var(--ink)}
body.playing .hand[data-layout=tiles] .corner,body.playing .hand[data-layout=tiles] .pip{display:none}
body.playing .hand[data-layout=tiles] .tile-label{display:block;font-size:clamp(11px,3vw,17px);font-weight:900;white-space:nowrap;line-height:1}
body.playing .hand[data-layout=tiles] .card.selected{transform:translateY(-2px)}
body.playing .hand[data-layout=tiles] .order{top:-6px;right:-1px;height:12px;min-width:13px;font-size:8px;border-radius:4px}
body.playing .sort-row{margin:0;min-height:24px;flex-shrink:0;gap:0}
body.playing .sort-row button{padding:4px 7px;font-size:10px}
body.playing .sort-row .hint{font-size:8px}
body.playing .actions{flex-shrink:0;gap:8px}
body.playing .actions button{padding:8px;font-size:13px;min-height:38px;border-radius:12px;box-shadow:0 2px var(--ink)}
body.playing .mobile-emoji{margin:0;flex-shrink:0;gap:6px}
body.playing .mobile-emoji button{font-size:17px;padding:1px 9px;min-height:25px}
body.playing .sidebar{padding-top:24px;min-height:0;overflow:auto}
body.playing:has(.large-hand) .title-row,body.playing .large-hand .mobile-emoji{display:none}
body.playing .large-hand .table{height:110px}
body.playing[data-title=badge] .title-row h1{padding:1px 8px;font-size:25px;border-width:2px;box-shadow:0 2px var(--ink)}
body.playing[data-title=tile] .title-row h1{font-size:20px;gap:2px}
body.playing[data-title=tile] .title-row h1 span{padding:1px 3px}
@media(max-height:650px){body.playing .table{height:110px}body.playing .title-row{height:29px}body.playing .title-row h1{font-size:24px}body.playing .mobile-emoji{display:none}}
@media(max-height:450px){body.playing .title-row{display:none}body.playing .table{height:80px;min-height:80px;margin-top:15px}body.playing .player .avatar{display:none}body.playing .level{top:-10px}body.playing .turn-banner small{display:none}body.playing .table .pile{transform:scale(.75)}body.playing .pile-label{display:none}}
body.playing .compact-help{flex-shrink:0;font-size:9px;line-height:12px;color:var(--muted);text-align:center}
body.playing .hand .grouped-card{flex-direction:column;gap:1px}
body.playing .hand .grouped-card .tile-label{font-size:13px;line-height:13px}
body.playing .hand .copy-count{font-size:9px;line-height:10px;color:var(--ink);font-weight:800}
body.playing .hand .grouped-card .order{min-width:14px;max-width:100%;height:11px;font-size:8px;top:-5px}

/* Bubblegum lettering: local rounded faces, no external fonts or art. */
:root{--display-font:ui-rounded,'Arial Rounded MT Bold','Trebuchet MS',system-ui,sans-serif;font-family:var(--display-font);--muted:#776189}
h1,h2,h3,.brand-small,button,.player-name,.turn-banner strong,.hand-head strong,.badge{font-family:var(--display-font);font-weight:900;letter-spacing:-.025em}
h1,h2,.brand-small{text-shadow:0 2px 0 var(--paper)}
h1{color:var(--accent)}
.eyebrow{letter-spacing:.18em;line-height:1.3}
.home-heading{text-shadow:0 3px 0 var(--paper),0 6px 0 #4a315f15}
.panel h3{color:var(--accent)}
button.primary{text-shadow:0 1px 0 #35215150}
body.playing .topbar .eyebrow{font-size:9px;color:var(--ink)}
body.playing .title-row{height:42px;align-items:center}
body.playing .title-row h1{font-size:30px;font-weight:950;letter-spacing:-1.3px;text-shadow:0 2px var(--paper),0 3px #4a315f18}
body.playing .subtitle{font-size:8px;letter-spacing:.075em;font-weight:700;color:var(--muted)}
/* A small hand no longer leaves a blank reservoir beneath the cards. */
body.playing .table{height:auto;min-height:clamp(110px,23dvh,230px);flex:1 0 auto;container-type:size;isolation:isolate}
body.playing .hand-scroll{flex:0 1 114px;min-height:0}
body.playing .large-hand .table{height:auto;min-height:110px}
.board-suit{position:absolute;inset:7% 8%;display:block;width:84%;height:86%;overflow:visible;pointer-events:none;user-select:none;color:var(--ink);fill:currentColor;opacity:.13;z-index:0}
.table[data-suit=hearts] .board-suit,.table[data-suit=diamonds] .board-suit{color:#b73168;opacity:.18}
body.playing .table .piles{position:relative;z-index:1}
body.playing .table .spark{z-index:1;opacity:.65}
body.playing .player-name{font-size:10px;line-height:1.15;border:1px solid #4a315f18;box-shadow:0 2px 0 #4a315f10;padding:3px 4px;max-height:none}
body.playing .player-name small{font-family:system-ui,sans-serif;font-weight:500;font-size:8px;line-height:1.2;margin-top:2px}
body.playing .pile-label{display:inline-block;background:transparent;text-shadow:0 1px 1px #fffdf180;border-radius:6px;padding:2px 4px;font-weight:900;font-size:8px;line-height:1.2;color:var(--ink);letter-spacing:.035em;max-width:90px}
body.playing .suit-chip{z-index:2;background:var(--paper);box-shadow:0 2px 0 #4a315f20;font-weight:900;letter-spacing:.01em;bottom:5px;max-width:90%;white-space:normal;text-align:center;line-height:1.2;padding:3px 10px}
body.playing .turn-banner{border-radius:14px;background:linear-gradient(110deg,var(--accent),#4a315f);min-height:42px}
body.playing .turn-banner>div:nth-child(2){min-width:0}
body.playing .turn-banner strong{font-size:14px;line-height:1.15;letter-spacing:.01em}
body.playing .turn-banner small{font-family:system-ui,sans-serif;font-size:10px;line-height:1.2;color:#f2e9ff}
body.playing .hand-head{padding:2px 1px;font-size:13px;gap:6px}
body.playing .hand-head small{font-family:system-ui,sans-serif;font-size:10px;font-weight:500}
body.playing .badge{font-size:10px;letter-spacing:.01em;white-space:nowrap}
body.playing .sort-row{border-top:1px solid #4a315f18;padding-top:3px;align-items:center}
body.playing .sort-row>strong{font-size:8px;letter-spacing:.08em;margin-right:4px}
body.playing .sort-row button{font-weight:800;color:var(--ink)}
body.playing .actions button{font-size:14px;font-weight:900;letter-spacing:.015em}
@media(max-height:650px){body.playing .table{min-height:110px}body.playing .title-row{height:32px}body.playing .title-row h1{font-size:25px}body.playing .turn-banner{min-height:38px}body.playing .turn-banner strong{font-size:12px}body.playing .turn-banner small{font-size:9px}}
@media(max-height:450px){body.playing .table,body.playing .large-hand .table{min-height:80px}body.playing .turn-banner{min-height:32px}}
/* Let the central cards breathe with the expanding board, not the hand. */
body.playing .table .pile,body.playing .table .pile>.card{width:clamp(49px,24cqh,80px);height:clamp(69px,34cqh,116px)}
body.playing .table .pile .corner{font-size:clamp(15px,7cqh,21px)}
body.playing .table .pile .corner small{font-size:clamp(10px,4.5cqh,14px)}
body.playing .table .pile .pip{font-size:clamp(25px,12cqh,42px)}
body.playing .table .pile .back-eight{width:clamp(33px,16cqh,53px);line-height:clamp(35px,17cqh,54px);font-size:clamp(30px,14cqh,45px)}
/* Synthetic placement controls are outside the live game and never persist. */
.placement-qa-controls{display:flex;flex-wrap:wrap;gap:5px;flex-shrink:0;padding-bottom:8px}
.placement-qa-controls button.small{font-size:10px;padding:5px 7px}
.placement-probe{position:fixed;bottom:0;left:0;right:0;z-index:70;background:var(--paper);color:var(--ink);border-top:1px solid var(--ink);padding:4px;text-align:center;font:11px/1.25 system-ui,sans-serif;pointer-events:none}

/* Highlights belong to the painted object, not an independently sized overlay.
   SVG border geometry scales with every avatar; non-scaling strokes stay legible
   at 30px. No measurements, animation callbacks, or detached highlight layers. */
.avatar{overflow:visible}
.avatar-highlight{stroke:var(--yellow);stroke-width:8;vector-effect:non-scaling-stroke;opacity:0;pointer-events:none}
.player.active .avatar-highlight,.avatar-options .chosen .avatar-highlight{opacity:1}
.avatar-options button{line-height:0;border:0;padding:6px;border-radius:22px}
.avatar-options .chosen{background:transparent}
/* Zero-offset spread shadows follow the actual border-radius (including card
   cosmetics) and transform with their button. Keep the elevation as a second
   shadow; specificity wins over compact/mobile/card hover declarations. */
button:focus-visible{outline:none;box-shadow:0 0 0 3px #e460a3,0 4px 0 var(--ink)!important}
button:focus-visible:hover:not(:disabled){box-shadow:0 0 0 3px #e460a3,0 6px 0 var(--ink)!important}
button:focus-visible:active:not(:disabled){box-shadow:0 0 0 3px #e460a3,0 1px 0 var(--ink)!important}
/* Avatar-picker focus follows the same painted rounded border, not its padding. */
.avatar-options button:focus-visible{box-shadow:none!important}
.avatar-options button:focus-visible .avatar-highlight{opacity:1;stroke:#e460a3}
@media(forced-colors:active){
 button:focus-visible{outline:3px solid Highlight;outline-offset:3px}
 .avatar-options button:focus-visible{outline:none}
 .player.active .avatar-highlight,.avatar-options .chosen .avatar-highlight,.avatar-options button:focus-visible .avatar-highlight{stroke:Highlight;forced-color-adjust:none}
}

/* Keep Quit visible in the existing compact game header. */
body.playing .top-actions{flex-shrink:0;align-items:center}
body.playing .quit-button{font-size:12px;line-height:1.2;min-height:28px;padding:4px 10px;border-width:2px;border-radius:10px;box-shadow:none;white-space:nowrap}
body.playing .topbar>.eyebrow{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Shared icon geometry: no font baseline, native-button padding, or floated
   arrows. Fixed square hit areas remain centered under border cosmetics. */
.ui-icon{display:block;width:1.25em;height:1.25em;flex:none;pointer-events:none}
button.icon,body.playing .topbar button.icon{display:inline-grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;flex:0 0 44px;padding:0;border-radius:50%;line-height:1}
button.icon .ui-icon{width:20px;height:20px}
button:has(>.ui-icon):not(.icon){display:inline-flex;align-items:center;justify-content:center;gap:8px}
.home-buttons button:has(>.ui-icon),.actions button:has(>.ui-icon){justify-content:space-between}
button:has(>.ui-icon)>span{min-width:0;overflow-wrap:anywhere}
.top-actions{align-items:center;flex-shrink:0}
.topbar>span{min-width:0;overflow-wrap:anywhere}
.profile-pill{min-width:0;line-height:1.2;text-align:start}
.profile-pill .avatar,.avatar-options .avatar{display:block}
.profile-pill span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.direction{display:grid;place-items:center;flex:0 0 28px;line-height:1}
.direction .ui-icon{width:24px;height:24px}
.timer{flex:0 0 auto;line-height:1;font-variant-numeric:tabular-nums}
.timer span{display:grid;place-items:center;width:100%;height:100%}
.level,.badge{line-height:1.2;text-align:center}
.level{display:inline-grid;place-items:center}
.emoji-row button{display:inline-grid;place-items:center;line-height:1.2}
.emoji-row .ui-icon{width:20px;height:20px}
.settings-row label{min-width:0;overflow-wrap:anywhere}
.settings-row select{max-width:65%;flex:0 1 auto}
.settings-row input[type=checkbox]{flex:0 0 22px;margin:0}
.field select,.field input{width:100%;max-width:100%;line-height:1.3}
.field label{line-height:1.35;overflow-wrap:anywhere}
.cosmetic-grid .field{min-width:0}
.room-player strong{min-width:0;overflow-wrap:anywhere}
.room-player small{flex-shrink:0}
.option-row button{min-width:0;overflow-wrap:anywhere;line-height:1.3}
@media(max-width:370px){.cosmetic-grid{grid-template-columns:minmax(0,1fr)}.settings-row{gap:10px}.settings-row select{max-width:60%;padding:10px 6px}}

/* The back badge and its authored numeral are concentric squares/circles.
   No letter spacing, baseline or asymmetric padding survives at any size. */
.back-eight{--badge-size:53px;display:grid;place-items:center;width:var(--badge-size);height:var(--badge-size);aspect-ratio:1;line-height:1;letter-spacing:0;padding:0;flex:none}
.back-eight-art{display:block;width:100%;height:100%}
body.playing .pile .back-eight{--badge-size:33px;width:var(--badge-size);height:var(--badge-size);line-height:1}
body.playing .table .pile .back-eight{--badge-size:clamp(33px,16cqh,53px);width:var(--badge-size);height:var(--badge-size);line-height:1}

/* Public play order remains available after flights, including reduced motion.
   Wrap instead of clipping the eighth card on narrow phones. */
.play-order{flex-shrink:0;min-width:0;padding:3px 8px;border:1px solid #4a315f30;border-radius:9px;background:var(--paper);font:11px/1.25 system-ui,sans-serif}
.play-order>strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}
.play-order ol{display:flex;flex-wrap:wrap;gap:2px 7px;list-style:none;padding:0;margin:2px 0 0}
.play-order li{border-radius:4px;white-space:nowrap;padding:1px 2px}
.play-order .play-number{font-size:9px;color:var(--ink)}
.play-order .red{color:#a62e4b}
.play-order [aria-current=step]{background:var(--yellow);outline:1px solid var(--accent)}

/* Friends is a bounded shell, not a page-length scrolling dialog. Its header
   and footer never scroll away, even with long lists or the phone keyboard. */
dialog.friends-dialog{position:fixed;inset:auto;top:calc(var(--friends-viewport-top,0px) + max(12px,env(safe-area-inset-top)));left:var(--friends-viewport-center,50vw);transform:translateX(-50%);margin:0;width:min(430px,calc(var(--friends-viewport-width,100vw) - max(12px,env(safe-area-inset-left)) - max(12px,env(safe-area-inset-right))));max-width:none;max-height:calc(var(--friends-viewport-height,100dvh) - max(12px,env(safe-area-inset-top)) - max(20px,env(safe-area-inset-bottom)));padding:0;overflow:hidden}
dialog.friends-dialog[open]{display:flex;flex-direction:column}
.friends-dialog-header{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:10px;flex-shrink:0;padding:12px 14px;border-bottom:1px solid #4a315f20}
.friends-dialog-header h2{margin:0;min-width:0;font-size:clamp(19px,5.5vw,24px);line-height:1.15;overflow-wrap:anywhere}
.friends-dialog-header .friends-close{width:44px;height:44px;min-width:44px;min-height:44px;flex-shrink:0}
.friends-dialog-body{min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding:4px 18px 10px;scroll-padding-block:12px;overflow-wrap:anywhere}
.friends-dialog-body:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}
.friends-dialog-body input{font-size:16px}
.friends-dialog-body button{min-height:44px;max-width:100%;overflow-wrap:anywhere}
.friends-dialog-body .notice{overflow-wrap:anywhere}
.friends-dialog-body .settings-row>button{width:100%}
.friends-dialog-body #friends-list{margin-top:20px}
.friends-dialog-body .friends-invite-help{font-size:12px}
.friends-row{flex-wrap:wrap;gap:8px}
.friends-row>div{min-width:0}
.friends-row-actions{display:flex;flex-wrap:wrap;gap:4px}
.friends-dialog-footer{flex-shrink:0;padding:10px 14px 14px;border-top:1px solid #4a315f20;background:var(--bg)}
.friends-dialog-footer button{width:100%;min-height:44px;padding:9px 14px}
@media(max-height:450px){.friends-dialog-header{padding:8px 12px}.friends-dialog-header h2{font-size:18px}.friends-dialog-footer{padding:8px 12px 12px}}

/* A live, anonymous guest-session total; never a promise of available opponents. */
.online-count{display:grid;grid-template-columns:9px minmax(0,1fr);column-gap:9px;row-gap:5px;max-width:440px;margin:18px 0;color:var(--ink);text-align:start;font-size:14px;line-height:1.4}
.online-count-dot{width:8px;height:8px;margin-top:5px;border-radius:50%;background:#7d7388;border:1px solid currentColor}
.online-count[data-state="ready"] .online-count-dot{background:#3a8870}
.online-count strong{font-weight:800;margin-inline-end:9px}
.online-count-value{display:inline-block;max-width:100%;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.online-count-help{grid-column:2;font-size:12px;line-height:1.45;max-width:42ch;color:var(--ink);opacity:.8}

/* Rulebook and practice stay inside one bounded dialog; exits never scroll away. */
dialog.how-to-play-dialog{padding:0;width:min(690px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 32px);overflow:hidden;box-sizing:border-box}
.guide-shell{display:flex;flex-direction:column;max-height:calc(100dvh - 40px);min-height:0;min-width:0;text-align:start}
.guide-header{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:8px;padding:10px 14px;flex-shrink:0}
.guide-header h2{margin:0;font-size:clamp(22px,5vw,30px);line-height:1.2;overflow-wrap:anywhere}
.guide-header button{width:44px;height:44px;padding:9px}
.guide-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:0 14px 12px;flex-shrink:0;border-bottom:1px solid #4a315f25}
.guide-shell button{min-height:44px;min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.3}
.guide-tabs button{font-size:14px;padding:10px 8px}
.guide-live-warning{margin:0;padding:7px 16px;background:var(--yellow);font-size:12px;line-height:1.4;flex-shrink:0}
.guide-body{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;padding:12px 18px 18px;scroll-padding:12px;line-height:1.55;font-size:15px;overflow-wrap:anywhere;-webkit-overflow-scrolling:touch}
.guide-body:focus-visible{outline:2px solid var(--accent);outline-offset:-4px}
.guide-body p{margin:8px 0 14px;line-height:inherit}
.guide-body h3{font-size:24px;line-height:1.2;margin:14px 0}
.guide-index{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:14px 0}
.guide-index a{display:block;padding:9px;border:1px solid #4a315f30;background:var(--paper);border-radius:10px;font-size:13px;line-height:1.35;color:var(--ink);text-decoration:none;min-height:44px;box-sizing:border-box;font-weight:700}
.guide-index a:hover,.guide-index a:focus-visible{background:var(--yellow)}
.guide-rule{margin:9px 0;border:1px solid #4a315f35;border-radius:13px;background:var(--paper);overflow:hidden}
.guide-rule summary{cursor:pointer;padding:14px 12px;font-size:16px;font-weight:850;line-height:1.35}
.guide-rule[open] summary{border-bottom:1px solid #4a315f20;background:#6942b90b}
.guide-rule ul{padding:0 16px 0 31px;margin:12px 0}.guide-rule li{margin:9px 0}
.guide-example{margin:12px;padding:12px;border-radius:10px;background:#6942b910;border-inline-start:4px solid var(--accent)}
.guide-example p{margin:5px 0 0}
.guide-footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px;padding:10px 14px max(12px,env(safe-area-inset-bottom));border-top:1px solid #4a315f25;flex-shrink:0;background:var(--bg)}
.guide-footer button{padding:9px 12px;font-size:14px;flex:1 1 auto}
.guide-progress{display:flex;align-items:center;gap:12px;font-size:12px;font-weight:800}
.guide-progress progress{flex:1;min-width:0;height:8px;accent-color:var(--accent)}
.guide-card-row{display:flex;align-items:center;justify-content:center;gap:13px;padding:12px 0 10px;min-height:108px}
.guide-card-row .card{position:relative!important;width:62px!important;height:89px!important;min-width:62px!important;margin:0!important;transform:none!important;flex:none;border-radius:9px!important;box-sizing:border-box}
.guide-card-row .card .corner{font-size:16px}.guide-card-row .card .corner small{font-size:12px}.guide-card-row .card .pip{font-size:34px}.guide-card-row .card .corner.bottom{font-size:16px}
.guide-card-choice{position:relative;display:block;background:none!important;border:0!important;padding:0!important;box-shadow:none!important;transition:transform 160ms;overflow:visible!important}
.guide-card-choice.selected{transform:translateY(-7px)}
.guide-card-choice.selected .card{outline:3px solid var(--accent);outline-offset:3px}
.guide-order{position:absolute;right:-8px;top:-10px;border-radius:50%;width:25px;height:25px;background:var(--accent);color:white;display:grid;place-items:center;font-weight:900;border:2px solid var(--paper)}
.guide-play{display:block;margin:4px auto 14px;min-width:140px!important}
.guide-prompt{font-weight:800}.guide-choices{display:grid;gap:8px}.guide-choices button{text-align:start;padding:12px 14px;font-size:15px}
.guide-feedback{margin-top:14px;padding:12px;background:#6942b90b;border-radius:12px;font-size:14px;min-height:44px}.guide-feedback.correct{background:#b9e0d866}.guide-feedback p{margin:5px 0 0}
.guide-practice-note{font-size:12px;opacity:.8}
@media(max-width:370px){.guide-index{grid-template-columns:1fr}.guide-tabs{padding-inline:10px}.guide-body{padding-inline:12px}.guide-footer{padding-inline:10px}.guide-tabs button{font-size:13px}.guide-body h3{font-size:22px}}
@media(prefers-reduced-motion:reduce){.guide-card-choice{transition:none}}
body.reduce-motion .guide-card-choice{transition:none}
.guide-played .guide-card-choice{animation:guide-drop 500ms cubic-bezier(.22,.8,.3,1) both}
.guide-played .guide-card-choice:nth-child(2){animation-delay:700ms}
@keyframes guide-drop{0%{transform:translateY(-22px) rotate(-8deg);opacity:.35}75%{transform:translateY(3px) rotate(2deg);opacity:1}100%{transform:translateY(0) rotate(0);opacity:1}}
@media(prefers-reduced-motion:reduce){.guide-played .guide-card-choice{animation:none}}
body.reduce-motion .guide-played .guide-card-choice{animation:none}

/* Victory picture and fireworks are entirely code-native and finite. */
.victory-panel{text-align:center;position:relative;isolation:isolate;max-width:480px;margin:auto}
.victory-art{position:relative;isolation:isolate;width:min(100%,360px);aspect-ratio:360/245;margin:-8px auto 0;overflow:hidden;border-radius:24px;pointer-events:none}
.victory-illustration{display:block;width:100%;height:100%;position:relative;z-index:1}
.victory-panel h2{font-size:clamp(25px,6vw,38px);line-height:1.12;font-weight:950;letter-spacing:-.035em;margin:4px 0 12px;overflow-wrap:anywhere;text-wrap:balance;color:var(--accent)}
.victory-panel p{font-size:15px;line-height:1.5;max-width:370px;margin:0 auto 20px}
.victory-panel .option-row{justify-content:center;flex-wrap:wrap;gap:10px}
.victory-panel .option-row button{min-height:46px;flex:1;min-width:100px}
.victory-burst{position:absolute;left:var(--bx);top:var(--by);width:1px;height:1px;z-index:2}
.victory-spark{position:absolute;width:5px;height:11px;background:var(--spark);border-radius:4px;opacity:0;transform:translate(-50%,-50%);animation:victory-firework 1.6s cubic-bezier(.12,.64,.22,1) var(--delay) 1 both;will-change:transform,opacity}
@keyframes victory-firework{0%{opacity:0;transform:translate(-50%,-50%) scale(.2)}12%{opacity:.95}65%{opacity:.85}100%{opacity:0;transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy) + 16px)) rotate(var(--angle)) scale(.35)}}
.victory-art.is-victory[data-motion="on"] .victory-illustration{animation:victory-arrive .65s cubic-bezier(.2,.75,.2,1) 1 both}
@keyframes victory-arrive{from{opacity:.3;transform:translateY(10px) scale(.94)}to{opacity:1;transform:none}}
.victory-art[data-motion="off"] .victory-spark,.reduce-motion .victory-spark{display:none;animation:none}
.victory-art[data-motion="off"] .victory-illustration,.reduce-motion .victory-illustration{animation:none}
@media(prefers-reduced-motion:reduce){.victory-spark{display:none;animation:none}.victory-illustration{animation:none!important}}
@media(max-height:560px){.victory-art{width:min(100%,230px)}.victory-panel h2{font-size:25px}.victory-panel p{margin-bottom:12px}}

/* At text zoom/landscape, nonessential controls scroll with the lesson, not
   beside it. A long translated Restart label can never consume the footer. */
.guide-body>.guide-tabs{padding:0 0 12px;margin-bottom:12px}
.guide-body>.guide-live-warning{margin:0 0 12px;padding:8px 10px;border-radius:8px}
.guide-footer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
.guide-footer.guide-practice-footer{grid-template-columns:repeat(3,minmax(0,1fr))}
.guide-footer button{padding:8px 6px;font-size:13px;overflow-wrap:anywhere}
.guide-restart{margin-top:10px;text-align:center}
.guide-restart button{max-width:100%;white-space:normal}
@media(max-height:500px){
 dialog.how-to-play-dialog{width:min(690px,calc(100vw - 16px));max-height:calc(100dvh - 16px)}
 .guide-shell{max-height:calc(100dvh - 24px)}
 .guide-header{padding:6px 10px}
 .guide-header h2{font-size:18px;line-height:1.2}
 .guide-body{padding-top:8px;padding-bottom:12px}
 .guide-footer{padding:6px 10px max(8px,env(safe-area-inset-bottom));gap:6px}
 .guide-footer button{font-size:12px;padding:6px 4px}
}
