*{box-sizing:border-box} :root{font-family: -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;color:#f3e8cc;background:#122820;--gold:#c9af78;--muted:#a9bbad}body{margin:0;overscroll-behavior:none}button{font:inherit;cursor:pointer;color:inherit;border:1px solid #a99465;background:#254334;border-radius:7px;padding:9px 18px;touch-action:manipulation}button:disabled{opacity:.35;cursor:default}button.primary{background:var(--gold);color:#162d22;font-weight:700}button:focus-visible{outline:2px solid white;outline-offset:2px}.screen{height:100vh;height:100dvh;min-height:290px;position:relative;overflow:hidden;padding: max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:radial-gradient(ellipse at center,#284c38,#112820 80%);display:flex;flex-direction:column}.top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:36px;z-index:1;font-size:12px}.top button{padding:5px 10px;font-size:12px}.brand{font-family:Georgia,serif;letter-spacing:2px;color:var(--gold)}.table{flex:1;min-height:0;position:relative;display:grid;grid-template-columns: minmax(85px,17%) 1fr minmax(85px,17%);grid-template-rows: 39px minmax(0,1fr);align-items:center;gap:4px}.felt{position:absolute;inset:6px 9% 0;border:1px solid #a58e60;border-radius:45%;background:radial-gradient(ellipse,#416c4f,#254b38);box-shadow:inset 0 0 0 6px #233f30,inset 0 0 0 7px #887b54;pointer-events:none}.bottom{grid-column:2;grid-row:1;z-index:1;display:flex;justify-content:center;align-items:center;gap:4px}.opponent{z-index:1;grid-row:2;text-align:center;align-self:center;display:flex;flex-direction:column;align-items:center;gap:4px}.left{grid-column:1}.right{grid-column:3}.avatar{width:38px;height:38px;border-radius:50%;background:#c5b38a;color:#263c2d;display:grid;place-items:center;font-family:Georgia;font-size:22px;box-shadow:0 0 0 2px #725f40}.active .avatar{box-shadow:0 0 0 3px #e8d59e}.role{font-size:11px;color:#c2cfc3}.count{font-size:12px;border:1px solid #857850;padding:3px 9px;border-radius:5px;background:#193429}.center{grid-column:2;grid-row:2;z-index:1;align-self:stretch;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;gap:6px}.played{display:flex;justify-content:center;align-items:center;min-height:50px;max-width:100%}.status{font-size:13px;color:#eadbb9;text-align:center;min-height:16px}.notice{font-size:11px;color:#aec6b3;min-height:13px}.actions{display:flex;justify-content:center;gap:7px;z-index:2;margin:6px 0 4px;flex-wrap:wrap}.actions button{min-width:72px;padding:7px 14px;font-size:14px}.hand{display:flex;align-items:flex-end;justify-content:center;padding:15px 4px 0;min-height:88px;isolation:isolate;user-select:none;touch-action:none}.card{flex-shrink:0;position:relative;border:1px solid #b7ac94;border-radius:5px;background:#faf5e7;color:#212923;box-shadow:1px 1px 3px #0004;padding:0;overflow:hidden;width:var(--cw,47px);height:var(--ch,72px);text-align:left;display:block;transition:transform 100ms ease}.card.red{color:#a82c36}.card .r{position:absolute;top:3px;left:4px;font-size:clamp(13px,2.4vw,19px);font-weight:700;line-height:1}.card .s{position:absolute;top:24px;left:5px;font-size:16px}.card .big{position:absolute;bottom:4px;right:4px;font-size:24px;opacity:.85}.card.selected{transform:translateY(-12px);background:#fff9e9;box-shadow:0 0 0 2px #e6c573,1px 1px 5px #0008}.hand .card+.card{margin-left:calc(var(--step,30px) - var(--cw,47px))}.small{width:26px;height:37px;border-radius:3px;box-shadow:none}.small .r{font-size:12px;top:2px;left:3px}.small .s{font-size:12px;top:15px;left:3px}.small .big{display:none}.played .small+.small{margin-left:-5px}.back{background:repeating-linear-gradient(45deg,#90794f,#90794f 3px,#a58c5d 3px,#a58c5d 6px);border:2px solid #e1d0a6}.footer{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted);padding-top:4px;gap:8px}.footer button{padding:4px 8px;font-size:11px}.counter{z-index:3;position:absolute;top:45px;left:50%;transform:translateX(-50%);display:flex;background:#142d24f5;border:1px solid #a99465;border-radius:6px;padding:4px 6px;gap:6px;max-width:95%;overflow:auto}.counter span{font-size:10px;min-width:15px;text-align:center;white-space:nowrap}.counter b{display:block;font-size:13px;color:var(--gold)}.overlay{position:absolute;inset:0;background:#0b1c17c9;z-index:5;display:grid;place-items:center;padding:12px}.panel{border:1px solid #ad9564;background:#203d30;padding:20px;border-radius:12px;max-width:95%;max-height:95%;overflow:auto;text-align:center;min-width:230px}.panel h1{font-family:Georgia,serif;letter-spacing:3px;font-size:26px;color:var(--gold);margin:0 0 8px}.panel h2{margin:0 0 12px;color:var(--gold)}.panel p{font-size:14px;line-height:1.5;color:#d1d7cb}.panel button{margin:4px}.panel .fine{font-size:11px;color:#aebfb0}.portrait{display:none}@media(orientation:portrait){.portrait{display:block;text-align:center;font-size:10px;color:var(--muted)}.table{grid-template-columns:70px 1fr 70px}.screen{justify-content:center}.card .big{display:none}.hand{min-height:90px}.top .brand{font-size:10px;letter-spacing:1px}.actions button{min-width:58px;padding:7px 10px}.opponent .role{font-size:10px}.felt{border-radius:36%}}@media(max-height:380px) and (orientation:landscape){.top{min-height:27px}.table{grid-template-rows:32px minmax(0,1fr)}.hand{min-height:74px;padding-top:12px}.card:not(.small){height:60px}.actions{margin:3px 0}.actions button{padding:5px 12px}.avatar{width:31px;height:31px}.played{min-height:37px}.center{gap:2px}.small{height:32px}.footer{padding-top:1px}}

.selection-status{color:#e4c99a;font-size:12px;line-height:1.3;text-align:center;min-height:16px;padding:2px 4px;z-index:2}.selection-status.can-play{color:#b8e8bb}
/* V0.2.2: high-contrast, large type and traditional card faces */
:root{--muted:#e4e9dc;color:#fff5dd}.top{font-size:clamp(15px,1.5vw,21px);min-height:40px}.top button{font-size:clamp(14px,1.4vw,19px);padding:6px 12px}.brand{font-size:clamp(13px,1.5vw,20px)}.role,.count,.footer,.footer button{font-size:clamp(15px,1.5vw,20px);color:#fff5dd}.opponent b{font-size:clamp(18px,2vw,26px)}.status{font-size:clamp(17px,1.8vw,25px);font-weight:700;color:#fff5dd;line-height:1.2;min-height:22px}.notice,.selection-status{font-size:clamp(15px,1.55vw,21px);font-weight:650;color:#fff2c9;line-height:1.2;min-height:19px}.selection-status.can-play{color:#d4ffd5}.actions button{font-size:clamp(18px,1.8vw,24px);font-weight:650;min-height:41px}.panel p,.panel .fine{font-size:17px;color:#f0efdf}.panel button{font-size:19px}.counter span{font-size:14px;min-width:18px}.counter b{font-size:19px;color:#ffe6a6}.counter{gap:5px}.hand{min-height:clamp(102px,15vh,153px);padding-top:20px}.card{height:var(--ch,clamp(82px,14vh,137px));background:#fffdf5;border-color:#c2b69c;overflow:hidden;container-type:inline-size}.card.red{color:#b32131}.card .corner{position:absolute;top:3px;left:4px;z-index:2;display:flex;flex-direction:column;align-items:center;line-height:.98;font-weight:800;font-size:clamp(15px,34cqw,28px);letter-spacing:-.04em}.corner span{font-size:.84em}.card .opposite{top:auto;left:auto;bottom:3px;right:4px;transform:rotate(180deg)}.card .art{position:absolute;left:23%;top:19%;width:55%;height:62%;pointer-events:none;overflow:visible}.card .court{left:22%;width:56%;top:19%;height:62%}.card .joker-art{left:19%;width:62%}.card.selected{transform:translateY(-15px);background:#fff9df;box-shadow:0 0 0 3px #ffda7e,1px 1px 5px #0008}.small{width:clamp(31px,4.7vw,61px);height:clamp(44px,8vh,87px);border-radius:4px}.small .corner{font-size:clamp(12px,34cqw,22px);left:3px;top:2px}.small .opposite{left:auto;top:auto;right:3px;bottom:2px}.bottom .small{width:33px;height:44px}.played{width:100%;min-height:clamp(49px,9vh,90px);gap:0;position:relative;--pcw:clamp(31px,4.7vw,61px);--pstep:min(var(--pcw),calc((100% - var(--pcw)) / max(1, var(--played-count) - 1)))}.played .small{width:var(--pcw)}.played .small+.small{margin-left:calc(var(--pstep) - var(--pcw))}.play-label{color:#ffe8a8}.pass-message{font-weight:800;color:#fff0bb}.animate-seat-0{animation:from-me .48s ease-out both}.animate-seat-1{animation:from-right .48s ease-out both}.animate-seat-2{animation:from-left .48s ease-out both}@keyframes from-me{from{transform:translateY(45px) scale(.85);opacity:.15}to{transform:none;opacity:1}}@keyframes from-right{from{transform:translateX(90px) scale(.85);opacity:.15}to{transform:none;opacity:1}}@keyframes from-left{from{transform:translateX(-90px) scale(.85);opacity:.15}to{transform:none;opacity:1}}@media(prefers-reduced-motion:reduce){.animate-seat-0,.animate-seat-1,.animate-seat-2{animation:none}}.table{grid-template-rows:45px minmax(0,1fr)}.center{gap:4px}.portrait{font-size:14px}.avatar{flex-shrink:0}.opponent{gap:3px}
@media(max-height:490px) and (orientation:landscape){.screen{padding-top:max(3px,env(safe-area-inset-top));padding-bottom:max(3px,env(safe-area-inset-bottom))}.top{min-height:30px;font-size:15px}.top button{font-size:14px;padding:3px 8px}.table{grid-template-rows:36px minmax(0,1fr)}.bottom .small{height:34px;width:27px}.center{gap:2px}.status{font-size:16px;min-height:18px}.notice,.selection-status{font-size:15px;min-height:17px;padding:0}.played{min-height:39px}.played .small{height:48px}.opponent b{font-size:18px}.opponent .role,.count,.footer,.footer button{font-size:14px}.avatar{width:29px;height:29px;font-size:19px}.actions{margin:2px 0;gap:7px}.actions button{min-height:34px;font-size:18px;padding:3px 13px}.hand{min-height:83px;padding-top:15px}.card:not(.small){height:68px}.footer{padding-top:1px}.footer button{padding:2px 6px}.counter{top:34px}.counter span{font-size:13px}.counter b{font-size:17px}}
@media(orientation:portrait){.top .brand{display:none}.table{grid-template-columns:64px minmax(0,1fr) 64px}.opponent b{font-size:16px}.opponent .role,.count{font-size:13px}.hand .card .art{display:block}.hand .card .corner{font-size:clamp(13px,32cqw,24px)}.actions button{min-width:65px;font-size:17px}.counter{gap:3px}.counter span{font-size:12px}.counter b{font-size:16px}}
.play-label.seat-1{align-self:flex-end;text-align:right;padding-right:5px}.play-label.seat-2{align-self:flex-start;text-align:left;padding-left:5px}.play-label.seat-0{align-self:center}.top button[aria-pressed=false]{color:#e6ddc4}.played.animate-seat-1{--fly-x:clamp(75px,21vw,260px);animation:side-flight .48s ease-out both}.played.animate-seat-2{--fly-x:clamp(-260px,-21vw,-75px);animation:side-flight .48s ease-out both}@keyframes side-flight{from{transform:translateX(var(--fly-x)) scale(.8);opacity:.15}to{transform:none;opacity:1}}@media(prefers-reduced-motion:reduce){.played.animate-seat-1,.played.animate-seat-2{animation:none}}


/* V0.2.3: simpler traditional cards, spoken play callouts, slower table tempo */
:root{--muted:#e8ecdf;color:#fff5dd}
.top button[aria-pressed=false]{color:#e6ddc4}
.notice{font-size:clamp(18px,1.8vw,26px);font-weight:800;color:#ffe6ad;min-height:26px}
.status{font-size:clamp(18px,1.85vw,26px)}
.selection-status{font-size:clamp(16px,1.6vw,22px)}
.actions button{font-size:clamp(18px,1.85vw,24px);min-height:44px}
.hand{padding-top:22px}
.card{background:#fbfbf5;border:2px solid #a9a392;border-radius:9px;box-shadow:0 1px 2px #00000025;color:#232725;overflow:hidden}
.card.red{color:#b12b37}
.card .art,.card svg{display:none !important}
.card .corner{position:absolute;left:8px;top:6px;z-index:2;display:flex;flex-direction:column;align-items:flex-start;line-height:.88;font-weight:800;font-size:clamp(20px,34cqw,34px);letter-spacing:-.04em}
.card .corner b{font-weight:800}
.card .corner span{font-size:.58em;line-height:1;margin-top:2px}
.card .opposite{left:auto;top:auto;right:8px;bottom:6px;transform:none;display:flex;align-items:flex-end;justify-content:flex-end;font-size:clamp(22px,26cqw,32px)}
.card .opposite b{display:none}
.card .opposite span{font-size:1em;margin:0}
.card .face-center{position:absolute;right:10px;bottom:7px;font-size:clamp(26px,19cqw,38px);line-height:1;opacity:.96}
.card .joker-label{right:auto;left:50%;top:50%;bottom:auto;transform:translate(-50%,-50%);font-size:clamp(15px,12cqw,24px);font-weight:800;letter-spacing:.08em;white-space:nowrap}
.card.selected{transform:translateY(-16px);background:#fff8df;box-shadow:0 0 0 3px #ffda7e,1px 2px 6px #0007}
.small{border-radius:6px}
.small .corner{left:4px;top:3px;font-size:clamp(12px,33cqw,22px)}
.small .corner span{font-size:.6em}
.small .opposite{right:4px;bottom:3px;font-size:clamp(12px,27cqw,20px)}
.small .face-center{right:5px;bottom:4px;font-size:clamp(14px,18cqw,22px)}
.small .joker-label{font-size:clamp(9px,10cqw,14px)}
.played.animate-seat-0{animation:from-me .72s ease-out both}
.played.animate-seat-1{--fly-x:clamp(75px,21vw,260px);animation:side-flight .72s ease-out both}
.played.animate-seat-2{--fly-x:clamp(-260px,-21vw,-75px);animation:side-flight .72s ease-out both}
.notice.animate-seat-0,.notice.animate-seat-1,.notice.animate-seat-2{animation:fade-call .72s ease-out both}
@keyframes fade-call{from{transform:translateY(8px);opacity:.2}to{transform:none;opacity:1}}
.play-label{font-size:clamp(17px,1.75vw,23px);color:#fff0bf}
.counter b{font-size:20px}
@media(max-height:490px) and (orientation:landscape){
  .notice{font-size:16px;min-height:18px}
  .status{font-size:16px}
  .selection-status{font-size:14px}
  .card .corner{font-size:18px}
  .card .face-center{font-size:24px}
}

/* 0.2.7: single index per face, actual vertical joker markup, uniform overlap. */
.hand{display:flex;justify-content:center;align-items:flex-end;gap:0;padding:22px 4px 4px;overflow:visible;min-width:0;--cw:88px;--step:40px;--label:35px}
.hand .card{width:var(--cw);flex:0 0 var(--cw)}
.hand .card+.card{margin-left:calc(var(--step) - var(--cw))}
.card{isolation:isolate;z-index:0;position:relative;overflow:hidden;padding:0;border:1px solid #aaa391;border-radius:7px;background:linear-gradient(#fffefa,#f3f3ed);color:#222623;box-shadow:0 1px 2px #0005;--label:25px}
.hand .card{--label:inherit}
.card.red{color:#bd2534}
.card .card-index,.card .joker-stack{position:absolute;top:5px;left:1px;width:var(--label);max-width:calc(100% - 4px);display:flex;flex-direction:column;align-items:center;gap:2px;line-height:1;letter-spacing:0;pointer-events:none;white-space:nowrap}
.card .card-rank,.card .joker-stack b{font-weight:800;font-size:min(34px,calc(var(--label)*.79));line-height:1.04;display:block;letter-spacing:-.025em}
.card .card-suit{display:block;font-size:min(35px,calc(var(--label)*.95));line-height:1}
.card .joker-stack{gap:1px}
.card .joker-stack b{letter-spacing:0;font-size:min(33px,calc(var(--label)*.83))}
.card.selected{transform:translateY(-15px);background:#fff8df;box-shadow:0 0 0 2px #ffda7e,0 2px 4px #0005}
.played{--cw:48px;--step:30px;--label:26px;gap:0;justify-content:center}
.played .card{width:var(--cw);flex:0 0 var(--cw);--label:inherit}
.played .card+.card{margin-left:calc(var(--step) - var(--cw))}
.bottom .card{--label:23px}
.small .card-index,.small .joker-stack{top:2px}
.small .card-rank,.small .joker-stack b{font-size:min(23px,calc(var(--label)*.79))}
.small .card-suit{font-size:min(23px,calc(var(--label)*.9))}
.card.back{background:repeating-linear-gradient(45deg,#90794f,#90794f 3px,#a58c5d 3px,#a58c5d 6px)}
@media(max-height:490px) and (orientation:landscape){.hand{padding-top:17px}.hand .card{height:78px}.hand .card .card-rank,.hand .card .joker-stack b{font-size:min(27px,calc(var(--label)*.79))}.hand .card .card-suit{font-size:min(28px,calc(var(--label)*.95))}.bottom .card{--label:15px}.bottom .card .joker-stack b{font-size:12px}}

/* V0.3: install menu, iPhone safe areas and finger-sized controls. */
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
button{-webkit-tap-highlight-color:transparent}
.hand{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:none;flex-shrink:0}
.hand .card{touch-action:none;-webkit-touch-callout:none}
.top,.actions,.footer,.selection-status,.portrait{flex-shrink:0}
.play-label,.notice{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu-panel{width:min(600px,100%);min-width:0;padding:18px 22px;overscroll-behavior:contain}
.app-icon{border-radius:15px;margin:0 auto 8px;display:block}
.menu-panel h1{font-size:clamp(20px,5vw,28px)}
.menu-panel p{margin:9px 0;line-height:1.45}
.menu-buttons,.settings-buttons{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.menu-panel button{min-height:44px;margin:0;font-size:18px}
.pwa-status{color:#d4ffd5!important;font-size:16px!important}
.menu-message{color:#ffe4a7!important;font-size:16px!important}
.app-settings{margin-top:14px;border-top:1px solid #8f805b;padding-top:8px;text-align:left}
.app-settings summary{cursor:pointer;min-height:44px;line-height:44px;text-align:center;font-size:18px;color:#ffedc1}
.settings-buttons{margin:8px 0}
.app-settings .fine{font-size:15px;line-height:1.5}
@media(orientation:landscape) and (max-height:500px){
 .screen{padding-top:max(4px,env(safe-area-inset-top));padding-bottom:max(4px,env(safe-area-inset-bottom));padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
 .top{min-height:34px;gap:8px;font-size:15px}.top button{min-height:38px;font-size:15px;padding:5px 12px}.top .brand{font-size:14px;letter-spacing:0}
 .table{grid-template-columns:minmax(80px,15%) minmax(0,1fr) minmax(80px,15%);grid-template-rows:32px minmax(0,1fr)}
 .bottom .card{width:29px;height:34px}.bottom .card{--label:16px}
 .center{gap:2px;justify-content:center;overflow:hidden}
 .played{min-height:49px}.played .card{height:49px}
 .status,.play-label{font-size:16px;line-height:20px;min-height:20px;margin:0}
 .notice{font-size:16px;line-height:20px;min-height:20px}
 .selection-status{font-size:14px;line-height:18px;min-height:18px;max-height:36px;overflow:hidden;padding:1px 2px}
 .actions{gap:9px;margin:3px 0}.actions button{min-height:44px;min-width:78px;padding:7px 15px;font-size:19px}
 .hand{min-height:98px;padding-top:17px;padding-bottom:3px}.hand .card{height:78px}
 .opponent b{font-size:19px}.opponent .role,.opponent .count{font-size:14px;line-height:17px}
 .footer{min-height:26px;font-size:14px;padding-top:1px}.footer button{min-height:28px;font-size:14px;padding:3px 9px}
 .counter{top:42px;max-width:98%}
 .menu-panel{padding:14px 20px}.menu-panel .app-icon{width:48px;height:48px;margin-bottom:4px}.menu-panel h1{margin-bottom:4px}
}
@media(orientation:portrait){
 .screen:not(.menu-screen){overflow-y:auto}
 .table{min-height:230px;flex-shrink:0}
 .portrait{padding:5px 0;font-size:14px}
 .top button{min-height:40px}.actions button{min-height:44px}
 .menu-panel{padding:18px 14px}
 .notice,.play-label{font-size:16px;line-height:21px;min-height:21px}
 .selection-status{font-size:14px;line-height:19px}
}
@media(orientation:landscape) and (max-height:500px){
 .center{gap:1px}
 .selection-status{white-space:nowrap;max-height:20px;overflow-x:auto;overflow-y:hidden}
}
@media(orientation:landscape) and (max-height:359px){
 .screen:not(.menu-screen){min-height:400px;overflow-y:auto}
}
