*{box-sizing:border-box}body{margin:0;background:#101416;color:#eef2ed;font:15px system-ui,sans-serif}header{display:flex;align-items:center;gap:18px;padding:18px 5%;border-bottom:1px solid #303a36;background:#171d20}header strong{color:#e8c46f;letter-spacing:2px;font-size:21px}header span{font-size:11px;color:#9eaaa6}header button{margin-left:auto}main{max-width:1440px;margin:auto;padding:20px}.panel{background:#1a2224;border:1px solid #34413e;border-radius:16px;padding:18px}.auth{max-width:420px;margin:7vh auto}.auth label{display:block;margin:14px 0;color:#b8c6c0}.auth input{display:block;width:100%;margin-top:6px}input,button{font:inherit;border-radius:8px;padding:12px;border:1px solid #4c6258}input{background:#101719;color:white;min-width:0}button{background:#e4bf67;color:#1c211d;font-weight:700;cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}.secondary{background:#263b35;color:white}.danger{background:#72383b;color:white}.layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:16px}.status,.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.status{justify-content:space-between;margin-bottom:14px}.table{position:relative;min-height:460px;border:12px solid #45382b;border-radius:45%;background:radial-gradient(ellipse,#24724d,#10452f 75%);box-shadow:inset 0 0 0 3px #b58d50,inset 0 0 60px #09281b,0 10px 30px #0008;margin:14px 0 20px}.center{text-align:center;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:65%}.brand{color:#c9ddc244;font-size:24px;letter-spacing:3px;font-weight:bold}.cards{display:flex;justify-content:center;gap:4px}.card{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;width:43px;height:59px;border-radius:6px;background:#f7f6f0;color:#181b20;font-weight:800;font-size:20px;box-shadow:0 2px 4px #0005}.red{color:#bd293a}.back{background:repeating-linear-gradient(45deg,#384a75,#384a75 4px,#243350 4px,#243350 8px);color:#eee;border:2px solid #dce0e8}.seat{position:absolute;transform:translate(-50%,-50%);width:112px;text-align:center;background:#142421f2;border:1px solid #6a8172;border-radius:10px;padding:6px;font-size:12px;overflow-wrap:anywhere}.seat.active{border:2px solid #ffdb73;box-shadow:0 0 14px #ffdb7377}.seat.fold{opacity:.5}.seat .card{width:30px;height:40px;font-size:15px}.seat strong{display:block}.actions .row{margin:8px 0}#chat{height:190px;overflow:auto;overflow-wrap:anywhere}#chatForm{display:flex;gap:5px}#chatForm input{width:100%}#history{max-height:220px;overflow:auto}#error{color:#ff9f9f;text-align:center;white-space:pre-wrap}#result{color:#f5d584} [hidden]{display:none!important}@media(max-width:850px){.layout{grid-template-columns:1fr}.table{min-height:420px}header span{display:none}}@media(max-width:520px){main{padding:8px}.table{min-height:480px;border-width:7px;border-radius:35%;margin:8px 4px}.seat{width:76px;font-size:10px;padding:4px}.seat .card{width:24px;height:32px;font-size:13px}.center{width:76%}.center .card{width:36px;height:49px;font-size:17px}.brand{font-size:16px}.panel{padding:10px}button{padding:10px;font-size:13px}.actions input{width:135px}}
/* Club 2.0 */
body{background:radial-gradient(ellipse at 50% 0%,#20332d 0%,#0b1215 55%);min-height:100vh;color:#f3f4ef}header{background:#10191c;border-bottom:1px solid #b38b463d}.auth{max-width:450px;padding:32px;box-shadow:0 24px 75px #0008;border-color:#ad8d4e55}.auth h1{font-size:30px;margin:8px 0}.auth:before{content:'♠  ♥  ♣  ♦';display:block;color:#e4bf67;letter-spacing:12px;font-size:28px}.auth button{width:100%;margin-top:9px}.hint{font-size:13px;color:#a9bdb4;line-height:1.5}.table{min-height:520px;margin:30px 22px 35px;border:14px solid #30231c;background:radial-gradient(ellipse,#287b52,#0c3929 80%);box-shadow:inset 0 0 0 3px #b58d50,inset 0 0 70px #051c14,0 15px 40px #0009}.table:before{content:'';position:absolute;inset:11%;border:1px solid #d5d9ad40;border-radius:45%;pointer-events:none}.seat{background:linear-gradient(145deg,#233831,#101b1a);box-shadow:0 5px 12px #0006;z-index:2}.seat.own{border-color:#66cba0}.seat.active{border-color:#ffdb73;box-shadow:0 0 18px #ffdb7377}.seat strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card{background:linear-gradient(145deg,#fff,#ecece4);border:1px solid #d9dacd;position:relative;justify-content:space-evenly;line-height:1}.card .rank{font-size:.85em}.card .suit{font-size:1.25em}.card.back{background:repeating-linear-gradient(45deg,#203b58,#203b58 4px,#315578 4px,#315578 8px)}.center .card{width:48px;height:66px}.center h2{color:#ffe0a0;margin:12px 0 4px}.status{background:#182725;padding:12px 15px;border:1px solid #354c43;border-radius:10px}#timer{color:#f0cf83;font-weight:bold}.actions{border-color:#63543a}button:focus-visible,input:focus-visible{outline:2px solid #f6d388;outline-offset:2px}button:hover:not(:disabled){filter:brightness(1.12)}details{margin:15px 0;color:#b8c6c0}summary{cursor:pointer;color:#e4bf67}aside h3{color:#e4bf67}#result:not(:empty){padding:10px;background:#22392e;border-radius:8px;margin-bottom:10px} @media(max-width:850px){.table{min-height:540px}}@media(max-width:520px){.auth{padding:22px}.table{min-height:570px;margin:20px 8px;border-width:7px}.seat{width:70px}.seat .card{width:23px;height:33px}.center{width:66%}.center .card{width:clamp(23px,8vw,36px);height:46px}.center h2{font-size:17px}.brand{font-size:12px}.actions .row button{flex:1 1 auto}.status{font-size:12px}header{padding:14px}.card .suit{font-size:1.1em}}
/* V3 — responsive arena */
:root{color-scheme:dark;--gold:#eac77b;--line:#27343d;--muted:#a0b1bc}body{background:radial-gradient(ellipse at 50% -20%,#172d34,#080b11 65%);font-variant-numeric:tabular-nums}header{position:sticky;top:0;z-index:9;backdrop-filter:blur(15px);background:#0b111aeF;gap:12px;padding:12px clamp(12px,3vw,40px)}header #sound{margin-left:auto}header #logout{margin-left:0}header strong{font-size:clamp(14px,2vw,22px)}main{max-width:1560px;padding:clamp(8px,2vw,24px)}.panel,.status{background:linear-gradient(145deg,#141d28,#0c131c);border-color:var(--line);box-shadow:0 12px 34px #0004}.auth{margin:8vh auto;border:1px solid #8c733e;box-shadow:0 0 80px #b99b3320}.auth h1{font-size:clamp(23px,5vw,34px)}button{transition:transform .15s,filter .15s,box-shadow .15s;min-height:42px}button:active:not(:disabled){transform:scale(.96)}button:hover:not(:disabled){box-shadow:0 0 15px #eac77b30}.layout{grid-template-columns:minmax(0,1fr) minmax(250px,320px);align-items:start}.layout>div,aside{min-width:0}.table{min-height:0;height:clamp(450px,52vw,620px);margin:24px 12px 26px;border:10px solid #23212a;background:radial-gradient(ellipse,#176450,#083529 75%);box-shadow:inset 0 0 0 2px #9a8149,inset 0 0 90px #0008,0 0 40px #1ae0a310,0 15px 35px #0009;isolation:isolate}.table:after{content:'';position:absolute;inset:0;border-radius:inherit;background:repeating-linear-gradient(45deg,transparent 0 3px,#00000009 3px 4px);pointer-events:none;z-index:-1}.seat{width:clamp(84px,10vw,132px);padding:6px 4px;background:linear-gradient(145deg,#202e3b,#0d1720);border:1px solid #4b6570;font-size:clamp(10px,1.1vw,13px)}.seat.active{animation:glow 1.7s ease-in-out infinite}.seat.own{border-color:#5bd7ba}.seat strong{color:#fff}.seat .money{color:#f0ce81;white-space:nowrap}.seat .wager{font-size:.9em;color:#a5b9c6}.seat .card{width:clamp(23px,3vw,34px);height:clamp(32px,4vw,46px)}.center{width:58%;z-index:1}.center .card{width:clamp(28px,4.5vw,56px);height:clamp(40px,6vw,76px)}.card.dealt{animation:deal .32s both}.center h2{font-size:clamp(15px,2.5vw,26px)}.brand{font-size:clamp(10px,1.7vw,23px)}#phase{color:#c0dcd1;font-size:12px}#progress{height:4px;background:#273643;width:100%;border-radius:9px;overflow:hidden}#progress i{display:block;background:linear-gradient(90deg,#27c9a0,#f0ca78);height:100%;transition:width .8s linear}.actions .row{display:flex;gap:7px}.actions .row button{flex:1 1 auto}.actions input{flex:1 1 120px;width:100px}.quick{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}.quick button{min-height:32px;padding:6px 8px;font-size:12px;background:#1e2d3a;color:#e5edf3;border-color:#34495a}#chat{height:220px;overscroll-behavior:contain;display:flex;flex-direction:column;gap:6px}#chat p{margin:0;padding:8px 10px;background:#1b2935;border-radius:4px 12px 12px 12px;overflow-wrap:anywhere;font-size:13px}#chat p.mine{background:#17433c;border-radius:12px 4px 12px 12px}#chat p.fresh{animation:chatIn .3s ease-out}#chat b{display:block;font-size:11px;color:#eac77b;margin-bottom:3px}aside h3{font-size:15px;margin:14px 0 10px}aside h3:first-child{margin-top:0}#ranking p,#history p{font-size:12px;background:#111e28;padding:8px;border-radius:6px;margin:5px 0}.sideDivider{border-top:1px solid var(--line);margin-top:18px}#burst{pointer-events:none;position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:5}#burst span{position:absolute;left:50%;top:50%;font-size:24px;animation:confetti 1.4s ease-out both}#result:not(:empty){background:#183b35;border:1px solid #48745d}#error:not(:empty){position:fixed;bottom:10px;left:50%;transform:translateX(-50%);z-index:20;background:#47232a;border:1px solid #a24a55;border-radius:9px;padding:12px;max-width:90%;width:max-content} @keyframes deal{from{opacity:0;transform:translateY(-12px) rotate(-6deg)}to{opacity:1;transform:none}}@keyframes glow{50%{box-shadow:0 0 22px #ffdb73aa}}@keyframes chatIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}@keyframes confetti{to{transform:translate(var(--x),var(--y)) rotate(300deg);opacity:0}}@media(max-width:1000px){.layout{grid-template-columns:1fr}.table{height:clamp(440px,65vw,590px)}aside{display:block}#chat{height:200px}}@media(max-width:600px){header span{display:none}header button{font-size:11px;padding:6px;min-height:34px}.table{height:auto;min-height:0;border-radius:24px;margin:8px 0 12px;border-width:6px;padding:12px 6px;display:flex;flex-direction:column;gap:12px}.center{position:relative;left:auto;top:auto;transform:none;width:100%;order:-1;padding:10px 0;min-height:110px}#players{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.seat{position:relative;left:auto!important;top:auto!important;transform:none;width:100%;min-height:68px;font-size:10px;padding:4px}.seat.own{grid-column:1/-1;order:10;display:flex;align-items:center;justify-content:space-around;gap:4px;min-height:46px}.seat .card{width:24px;height:32px}.center .card{width:clamp(32px,10vw,48px);height:52px}.actions{padding:8px}.actions button{font-size:12px;min-height:44px}.status{padding:8px;font-size:12px;margin:5px 0}.auth{margin:5vh auto}.table:before{display:none}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
/* V4: fixed arena, independently scrolling drawers */
body.playing{height:100dvh;overflow:hidden;display:flex;flex-direction:column}body.playing header{flex:none;padding:6px 12px;min-height:44px}body.playing main{flex:1;min-height:0;width:100%;padding:5px 8px;display:flex;flex-direction:column}#game{flex:1;min-height:0;display:flex;flex-direction:column;gap:5px}.status{flex:none;margin:0;padding:5px 9px;font-size:12px;gap:4px}.layout{display:flex;flex:1;min-height:0;flex-direction:column;gap:5px;align-items:stretch}.arena{display:flex;flex:1;min-height:0;flex-direction:column;gap:5px}.table{flex:1;height:auto;min-height:0;margin:0 8px;border-width:6px;overflow:hidden}.actions{flex:none;padding:5px 8px}.actions .row{margin:3px 0;gap:4px}.actions button,.actions input{min-height:34px;padding:5px 8px;font-size:12px}.actions #turnHint{font-size:11px;line-height:1.2}.actions #result:not(:empty){padding:4px;margin:0;font-size:11px;max-height:34px;overflow:auto}.dock{display:flex;flex:none;gap:5px;padding-bottom:env(safe-area-inset-bottom)}.dock button{flex:1;min-height:36px;padding:5px;font-size:12px}.myturn .dock{opacity:.45;pointer-events:none}.myturn #timer{color:#62f4b8}#progress i{transition:width .1s linear}#progress.urgent i{background:#ff465d}#drawer{position:fixed;z-index:15;right:8px;bottom:calc(50px + env(safe-area-inset-bottom));width:min(390px,calc(100% - 16px));max-height:min(65dvh,550px);overflow:auto;overscroll-behavior:contain;box-shadow:0 10px 60px #000c;border-color:#67734d;animation:chatIn .2s ease-out}#drawer #chat{height:clamp(65px,24dvh,240px)}#closeDrawer{float:right;min-height:30px;padding:4px 8px;font-size:12px}#unread:not(:empty){background:#ad3445;border-radius:20px;padding:2px 6px;color:#fff}#menuControls{clear:both}.seat .cards:empty,.seat .wager:empty{display:none}.seat.active{background:#263d35}.seat.fold{opacity:.48}
@media(max-width:700px){.table{margin:0;border-radius:20px;display:grid;grid-template-rows:minmax(65px,1fr) auto;padding:5px;gap:3px}.center{position:relative;transform:none;left:auto;top:auto;width:100%;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2px;order:-1}.center .brand{font-size:10px}.center h2{margin:3px 0;font-size:15px}.center .card{width:clamp(22px,9vw,42px);height:clamp(29px,7dvh,52px);font-size:16px}#players{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;align-content:end}.seat{position:relative;left:auto!important;top:auto!important;transform:none;width:100%;min-height:0;padding:2px;font-size:10px;line-height:1.15}.seat.own{grid-column:1/-1;display:flex;align-items:center;justify-content:space-around;order:10;min-height:32px}.seat .card{width:19px;height:25px;font-size:12px}.seat .money,.seat .wager{font-size:9px}.seat .wager{white-space:nowrap}.table:before{display:none}.actions input{flex:1 1 75px;width:75px}.actions .row button{flex:1 1 auto}.actions #turnHint{white-space:normal} }
@media(max-height:480px) and (orientation:landscape){.layout{flex-direction:row}.arena{flex-direction:row}.actions{width:32%;overflow:auto}.dock{width:78px;flex-direction:column}.table{min-width:0}.seat{width:65px;font-size:9px;padding:2px}.seat .card{width:17px;height:23px;font-size:10px}.center .card{width:24px;height:34px;font-size:13px}.center h2{font-size:14px}.brand{font-size:10px}#drawer{bottom:8px;max-height:85dvh}}
@media(max-width:700px) and (max-height:620px) and (orientation:portrait){.seat .card{width:15px;height:19px;font-size:10px}.seat{font-size:9px}.center .card{height:32px;width:24px;font-size:13px}.seat.own{min-height:25px}.actions button,.actions input{min-height:29px;font-size:10px}.dock button{min-height:30px}.table{grid-template-rows:minmax(45px,1fr) auto}.center .brand{display:none}}

#menuControls{display:grid;gap:8px}.myturn .dock button{pointer-events:none} @media(max-width:700px) and (orientation:landscape){#players{grid-template-columns:repeat(5,minmax(0,1fr))}.seat.own{grid-column:auto;display:block}.table{grid-template-rows:minmax(45px,1fr) auto}.seat{width:100%}.center .brand{display:none}}

/* V5: viewport bounded shell, safe area and compact dock */
html:has(body.playing){overflow:hidden;height:100%;}
body.playing{position:fixed;inset:0 auto auto 0;width:100%;height:var(--arena-height,100dvh);min-height:0;max-height:var(--arena-height,100dvh);padding:env(safe-area-inset-top) env(safe-area-inset-right) calc(env(safe-area-inset-bottom) + 10px) env(safe-area-inset-left);}
body.playing main{margin:0 auto;min-height:0;flex:1 1 0;overflow:hidden;padding:6px 10px 8px;}
body.playing #game,body.playing .layout,body.playing .arena{flex:1 1 0;min-height:0;overflow:hidden;}
body.playing .table{flex:1 1 0;min-height:0;max-height:100%;margin:0;}
body.playing .dock{padding:0;flex-shrink:0;}
body.playing header{gap:8px;}body.playing header strong{font-size:clamp(13px,4vw,21px);}
body.playing .actions{max-height:45%;overflow:auto;}
body.playing #drawer{bottom:calc(60px + env(safe-area-inset-bottom));max-height:calc(var(--arena-height,100dvh) - 130px);}
#bot{width:100%;margin-top:8px;}
@media(max-width:700px){body.playing .table{grid-template-rows:minmax(0,1fr) auto;}.center .card{height:clamp(24px,5dvh,44px);}.seat strong{max-width:100%;text-overflow:ellipsis;overflow:hidden;}.actions .row{flex-wrap:nowrap;}.actions .row button{min-width:0;font-size:clamp(9px,2.8vw,12px);padding:4px;}.actions input{min-width:0;flex:1;width:65px;}.dock button{font-size:11px;min-height:36px;}.seat .cards{gap:2px;}}
@media(max-height:480px) and (orientation:landscape){body.playing #drawer{bottom:8px;max-height:calc(var(--arena-height,100dvh) - 60px)}body.playing .actions{max-height:100%;}.dock button{min-height:28px;}}
