*{box-sizing:border-box} :root{color-scheme:dark;--bg:#0c1210;--panel:#151e1a;--panel2:#1b2922;--text:#f3f7f3;--muted:#9baea2;--gold:#e4bd65;--red:#e55c61;--green:#5dd39e} body{margin:0;background:radial-gradient(ellipse at top,#1c3026 0,#0c1210 56%);color:var(--text);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100vh;padding:env(safe-area-inset-top) 14px calc(24px + env(safe-area-inset-bottom));}button,select{font:inherit}button{cursor:pointer;border:0;color:inherit;touch-action:manipulation}.topbar{max-width:960px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:18px 2px 10px}.eyebrow{font-size:10px;letter-spacing:.18em;color:var(--muted);font-weight:800}h1{font-size:28px;letter-spacing:-.04em;margin:3px 0}.live-dot{display:inline-block;width:8px;height:8px;background:var(--green);border-radius:50%;vertical-align:middle;box-shadow:0 0 12px #5dd39e}.icon-button{background:#24332b;border:1px solid #35483c;border-radius:12px;padding:10px 12px;font-weight:800}.icon-button span{margin-left:5px}.status-row{max-width:960px;margin:10px auto;display:flex;justify-content:space-between;align-items:center;font-size:12px}.pill{background:#203c2d;border:1px solid #37674b;color:#b7f4ce;border-radius:999px;padding:7px 10px;font-weight:700}.muted,.hint,.small-note{color:var(--muted);font-size:11px}.table-wrap{max-width:960px;margin:0 auto}.felt{height:390px;position:relative;border-radius:190px;background:radial-gradient(ellipse,#176046 0,#10452f 60%,#0c3425 100%);border:11px solid #493525;box-shadow:inset 0 0 0 4px #7d5a3a,0 15px 35px #0007;overflow:hidden}.felt-rim{position:absolute;inset:12px;border:1px solid #ffffff26;border-radius:170px;pointer-events:none}.table-center{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);text-align:center}.pot-label{font-size:10px;letter-spacing:.2em;color:#c4dfcf}.pot-value{font-size:27px;font-weight:900;margin:3px 0 10px}.checks-pile{background:transparent;display:flex;align-items:center;flex-direction:column;gap:5px}.check-stack{position:relative;width:55px;height:29px}.check-stack i{position:absolute;left:7px;top:0;width:42px;height:12px;border-radius:50%;background:#f2e8c8;border:2px solid #c6b581;box-shadow:0 3px 0 #9b875a}.check-stack i:nth-child(2){top:7px}.check-stack i:nth-child(3){top:14px}.checks-caption{font-size:9px;letter-spacing:.1em;color:#dceee3}.checks-caption b{background:#e4bd65;color:#1a201b;border-radius:10px;padding:2px 5px}.player{position:absolute;min-width:100px;text-align:center;background:#0b1b14d9;border:1px solid #ffffff28;border-radius:14px;padding:7px 10px;box-shadow:0 5px 14px #0003}.player-top{top:12px;left:50%;transform:translateX(-50%)}.player-bottom{bottom:12px;left:50%;transform:translateX(-50%)}.player-left{left:12px;top:50%;transform:translateY(-50%)}.player-right{right:12px;top:50%;transform:translateY(-50%)}.avatar{font-size:24px}.player-name{font-size:11px;font-weight:800;white-space:nowrap}.player-balance{font-size:11px;color:var(--gold);margin-top:3px;font-weight:800}.active-player{border-color:var(--gold);box-shadow:0 0 0 2px #e4bd6524}.wallet-card{max-width:960px;margin:15px auto 0;padding:17px;background:linear-gradient(145deg,#19251f,#111915);border:1px solid #2c3e33;border-radius:22px;box-shadow:0 12px 30px #0003}.wallet-head{display:flex;align-items:center;justify-content:space-between}.wallet-head h2{font-size:30px;margin:3px 0 0;letter-spacing:-.04em}.private-tag{font-size:10px;border:1px solid #3b5947;color:#b9dfc7;border-radius:999px;padding:6px 8px}.chip-piles{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:18px 0}.chip-pile{text-align:center;background:#101713;border:1px solid #293a30;border-radius:13px;padding:10px 4px 8px}.chips{height:42px;display:flex;align-items:flex-end;justify-content:center;position:relative;margin-bottom:7px}.chip{width:28px;height:28px;border-radius:50%;border:4px dashed #ffffffb0;box-shadow:0 3px 0 #0005;position:absolute;bottom:calc(var(--n)*3px);background:var(--chip)}.chip-count{font-size:11px;font-weight:800}.chip-value{font-size:10px;color:var(--muted);margin-top:2px}.wallet-actions{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px}.primary,.secondary,.danger{border-radius:12px;padding:13px 10px;font-size:11px;font-weight:900;letter-spacing:.04em}.primary{background:var(--gold);color:#1c211b}.secondary{background:#26362c;border:1px solid #3b5142}.danger{background:#492328;border:1px solid #8e3f45;color:#ffb8b9}.hint{margin-top:12px;line-height:1.5}.drawer{position:fixed;z-index:10;right:0;top:0;bottom:0;width:min(390px,100%);background:#101813;border-left:1px solid #304238;box-shadow:-15px 0 45px #0009;padding:22px;overflow:auto}.drawer-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.drawer h2,.modal h2{margin:4px 0;font-size:22px}.menu-action{display:block;width:100%;text-align:left;background:#1b2921;border:1px solid #304438;border-radius:14px;padding:15px;margin:10px 0;font-weight:900}.menu-action span{display:block;font-size:11px;color:var(--muted);font-weight:500;margin-top:5px}.hidden{display:none!important}.modal{position:fixed;z-index:20;inset:0;background:#050907c9;display:flex;align-items:center;justify-content:center;padding:14px;backdrop-filter:blur(8px)}.modal-card{width:min(500px,100%);max-height:92vh;overflow:auto;background:#141e18;border:1px solid #34483a;border-radius:22px;padding:20px;box-shadow:0 25px 80px #0009}.field-label{display:block;font-size:12px;color:var(--muted);margin:8px 0}.modal select{width:100%;padding:12px;border-radius:10px;background:#0c130f;color:var(--text);border:1px solid #3a4e40}.change-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}.change-columns h3{font-size:11px;letter-spacing:.1em;color:var(--muted)}.chip-row{display:grid;grid-template-columns:1fr auto auto;gap:5px;align-items:center;margin:8px 0;font-size:12px}.step-btn{width:28px;height:28px;border-radius:8px;background:#2a3b30;font-weight:900}.qty{min-width:20px;text-align:center;font-weight:900}.change-total{display:grid;grid-template-columns:1fr auto;gap:7px;font-size:12px;border-top:1px solid #2d4034;margin:16px 0;padding-top:12px}.change-total span{color:var(--muted)}.error-line{min-height:18px;color:#ff9b9e;font-size:12px;margin-bottom:8px}.full{width:100%}.countdown{font-size:42px;font-weight:900;color:var(--gold);text-align:center;margin:16px}.proposal-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.check-list{padding-left:24px}.check-list li{padding:8px;border-bottom:1px solid #29392f}.toast{position:fixed;z-index:40;bottom:calc(20px + env(safe-area-inset-bottom));left:50%;transform:translate(-50%,20px);background:#e8f3eb;color:#102018;border-radius:12px;padding:11px 15px;font-size:12px;font-weight:800;opacity:0;pointer-events:none;transition:.2s;max-width:90vw;text-align:center}.toast.show{opacity:1;transform:translate(-50%,0)}@media(min-width:700px){main{padding:0 16px}.felt{height:460px}.player{min-width:130px;padding:10px 14px}.player-name{font-size:12px}.wallet-card{padding:22px}.chip-piles{gap:14px}}@media(max-width:420px){.felt{height:345px;border-width:8px}.player{min-width:78px;padding:6px 7px}.player-name{font-size:9px}.player-balance{font-size:10px}.avatar{font-size:20px}.player-left{left:5px}.player-right{right:5px}.wallet-actions{grid-template-columns:1fr 1fr}.wallet-actions .danger{grid-column:1/-1}.wallet-head h2{font-size:27px}.private-tag{font-size:9px}.change-columns{gap:8px}.modal-card{padding:16px}}
.allin-flash .felt{animation:allinPulse .8s ease-in-out 1}@keyframes allinPulse{0%,100%{box-shadow:inset 0 0 0 4px #7d5a3a,0 15px 35px #0003}50%{box-shadow:inset 0 0 0 5px #f35b63,0 0 38px #f35b6377,0 15px 35px #0003}}

/* Multiplayer v0.4 */
.lobby-card{max-width:560px;margin:22px auto}
.lobby-card input,.lobby-card select{width:100%;box-sizing:border-box;background:#222d28;border:1px solid #52635a;color:#fff;border-radius:10px;padding:13px 14px;margin:6px 0 14px;font:inherit}
.full{width:100%}
.lobby-separator{text-align:center;color:#9ca9a1;margin:14px 0}
.copy-code{background:transparent;color:inherit;border:1px solid currentColor;border-radius:6px;padding:3px 7px;margin-left:6px;font-size:11px}
.player .player-name{max-width:120px;overflow-wrap:anywhere}
.player.empty-player{opacity:.55}
#lobbyError{margin-top:10px}

/* Persistent host invite + QR v0.5 */
.host-invite{display:flex;align-items:center;justify-content:space-between;gap:22px;margin:14px 0 18px;padding:18px 20px;border:1px solid #46775c;border-radius:16px;background:linear-gradient(135deg,#172c23,#1c2722);box-shadow:0 8px 24px #0003}
.host-invite.hidden{display:none}
.invite-copy{min-width:0;flex:1}
.invite-copy h2{margin:5px 0;font-size:1.1rem}
.invite-copy p{color:#c2d0c6;margin:7px 0 13px;font-size:.9rem}
.host-room-code{font-size:clamp(2rem,5vw,3rem);font-weight:850;letter-spacing:.16em;line-height:1.25;color:#fff}
.invite-qr-wrap{flex:0 0 150px;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;color:#c2d0c6;font-size:.72rem}
#roomQr{width:136px;height:136px;background:white;padding:7px;border-radius:8px;display:flex;align-items:center;justify-content:center}
#roomQr img,#roomQr canvas{max-width:100%;height:auto!important}
@media(max-width:560px){.host-invite{align-items:flex-start;padding:14px;gap:10px}.invite-qr-wrap{flex-basis:112px;font-size:.65rem}#roomQr{width:100px;height:100px;padding:5px}.host-room-code{letter-spacing:.1em}.invite-copy p{font-size:.8rem}}

/* v0.6: expandable Host invite panel */
.invite-toggle{display:inline-flex;align-items:center;justify-content:center;gap:9px;margin-left:auto;padding:10px 14px;border:1px solid #47775d;border-radius:12px;background:#20392c;color:#d8f5e2;font:inherit;font-weight:750;cursor:pointer;white-space:nowrap}
.invite-toggle.hidden{display:none}
.invite-link-icon{display:inline-flex;align-items:center;justify-content:center;width:25px;height:25px;border-radius:7px;background:#315a43;font-size:1.15rem;font-weight:900;line-height:1;transform:rotate(-35deg)}
.invite-chevron{font-size:1.15rem;line-height:1;margin-left:2px}
#hostInvite{margin-top:12px}
#hostInvite.hidden{display:none}
@media(max-width:560px){.invite-toggle{gap:6px;padding:8px 10px;font-size:.82rem}.invite-link-icon{width:22px;height:22px}}

/* v0.7 compact single-line game information */
.room-info-line{display:flex;align-items:center;gap:10px;min-height:44px;margin:12px 0 16px;flex-wrap:nowrap;width:100%;box-sizing:border-box}
.room-info-line.hidden{display:none}
.room-info-line .pill,.room-info-line .role-pill{display:inline-flex;align-items:center;justify-content:center;min-height:40px;box-sizing:border-box;white-space:nowrap;margin:0}
.room-info-line .role-pill{padding:8px 14px}
.room-info-line .invite-toggle{height:40px;min-height:40px;padding:0 13px;margin:0;box-sizing:border-box;font-size:.92rem;line-height:1;gap:7px;border-radius:999px;flex:0 0 auto}
.room-info-line .invite-link-icon{width:22px;height:22px;font-size:1rem}
.room-info-line .invite-chevron{font-size:1rem}
.room-info-line .connection-status{margin-left:auto;white-space:nowrap;font-size:.9rem}
@media(max-width:700px){
 .room-info-line{gap:7px;flex-wrap:wrap}
 .room-info-line .invite-toggle{font-size:.82rem;padding:0 10px;gap:5px}
 .room-info-line .pill,.room-info-line .role-pill{min-height:38px;padding:7px 10px;font-size:.82rem}
 .room-info-line .connection-status{margin-left:0;font-size:.82rem}
}

/* Fiches v0.9: tavolo ovale compatto, prospettiva e fiches 3D, privacy */
.table-wrap{max-width:1000px;margin:4px auto 0;perspective:1300px}
.felt{height:clamp(245px,38vw,390px);border-radius:50% / 45%;border:13px solid #422b1d;background:radial-gradient(ellipse at 48% 40%,#17704b 0%,#0d5238 57%,#083522 100%);box-shadow:inset 0 0 0 3px #b37c42,inset 0 12px 35px #021d12a8,0 13px 0 #2d1c16,0 23px 24px #000a;transform:rotateX(8deg);transform-style:preserve-3d;overflow:visible}
.felt:before{content:'';position:absolute;inset:3px;border-radius:inherit;box-shadow:inset 0 0 0 3px #261710,inset 0 0 0 6px #ab713d;pointer-events:none}
.felt-rim{inset:20px;border-radius:50% / 45%;border-color:#ffffff24}
.table-center{z-index:1;top:48%;display:flex;flex-direction:column;align-items:center;gap:4px}
.pot-label{font-weight:850;font-size:10px}.pot-value{order:2;margin:3px 0 0;text-shadow:0 2px 7px #000a;font-size:clamp(19px,3vw,31px)}
.pot-chips{order:1;position:relative;width:110px;height:63px;filter:drop-shadow(0 8px 5px #001d13aa)}
.pot-chip{--face:#c13b38;--edge:#6b1515;position:absolute;width:42px;height:27px;left:34px;top:16px;border-radius:50%;background:radial-gradient(ellipse at 35% 26%,#ffffff70,transparent 55%),repeating-conic-gradient(from 12deg,#f3ede0 0 14deg,var(--face) 14deg 52deg,#f3ede0 52deg 65deg,var(--face) 65deg 90deg);border:3px solid var(--face);box-shadow:0 4px 0 var(--edge),0 6px 0 #e8e4d6,0 9px 0 var(--edge),0 11px 4px #0008;transform:rotate(-15deg)}
.pc-blue{--face:#236cae;--edge:#173960;left:4px;top:21px;transform:rotate(22deg)}.pc-red{--face:#c33d3a;--edge:#732323;left:33px;top:5px}.pc-green{--face:#22895b;--edge:#165437;left:65px;top:20px;transform:rotate(18deg)}.pc-black{--face:#353d44;--edge:#181d21;left:53px;top:4px}.pc-front{left:33px;top:27px;transform:rotate(10deg)}
.player{z-index:2;min-width:95px;padding:7px 9px;background:linear-gradient(145deg,#0a2118f5,#071610f5);border:1px solid #e8d7a43c;box-shadow:0 5px 10px #0008;backdrop-filter:blur(3px)}
.player-balance:empty{display:none}.player-balance{font-size:10px;color:#c4d8cb}.active-player{border-color:var(--gold)}
@media(max-width:600px){.table-wrap{margin-top:15px}.felt{height:clamp(210px,55vw,300px);border-width:8px;transform:rotateX(5deg)}.felt-rim{inset:12px}.player{min-width:66px;max-width:84px;padding:5px 4px;border-radius:11px}.player-name{font-size:9px;white-space:normal}.player-top{top:8px}.player-bottom{bottom:8px}.player-left{left:4px}.player-right{right:4px}.avatar{font-size:19px}.player-balance{font-size:8px}.pot-chips{transform:scale(.77);margin:-8px 0}.table-center{top:49%}.pot-label{font-size:8px}.pot-value{font-size:19px}}
@media(max-width:380px){.player{max-width:72px;min-width:60px}.table-center{transform:translate(-50%,-50%) scale(.86)}}

/* v1.0: host is a table controller, no visible wallet or wagering controls */
.join-primary{background:#16834d;color:#fff;border:1px solid #4cd68a;border-radius:12px;font-weight:850;padding:14px 18px;box-shadow:0 5px 16px #0003}
.join-primary:hover{background:#1a995b}
.player-bottom.host-spectator-seat{border-color:#4e7a61;opacity:.85}

/* v1.1 - floating chips, no boxes, compact touch interactions */
#playerWallet .wallet-actions.gesture-fallback{display:none!important}
.chip-piles{display:flex;justify-content:space-around;align-items:flex-end;gap:5px}
.chip-pile{flex:1;min-width:0;background:transparent!important;border:0!important;box-shadow:none!important;padding:4px 0!important;touch-action:pan-y;user-select:none;-webkit-user-select:none;cursor:pointer}
.chip-pile .chips{height:72px;align-items:center;margin-bottom:5px}
.chip-pile .chip-3d{position:relative;bottom:auto;width:62px;height:62px;max-width:90%;display:flex;align-items:center;justify-content:center;border:7px dashed #ffffffaa;box-shadow:inset 0 3px 5px #ffffff66,inset 0 -5px 8px #0007,0 5px 0 color-mix(in srgb,var(--chip),#000 42%),0 9px 12px #0009;transform:perspective(140px) rotateX(18deg);font-style:normal}
.chip-3d b{font-size:clamp(11px,2.6vw,15px);font-weight:900;color:#151b17;text-shadow:0 1px 1px #ffffff55;white-space:nowrap;letter-spacing:-.04em}
.chip-count{font-size:14px!important}
.empty-chip{opacity:.28;pointer-events:none}
.table-center{cursor:pointer}
#walletTotal{touch-action:manipulation;user-select:none;-webkit-user-select:none}
@media(max-width:420px){.chip-pile .chip-3d{width:53px;height:53px;border-width:6px}.chip-pile .chips{height:62px}}

/* v1.2 gesture feedback and three-second correction prompt */
.touch-chip{touch-action:none!important;-webkit-touch-callout:none}
.bet-edit-overlay{position:fixed;z-index:120;bottom:max(24px,env(safe-area-inset-bottom));left:12px;right:12px;display:flex;justify-content:center;pointer-events:none;opacity:1;transition:opacity .25s}
.bet-edit-overlay.hidden{display:none!important}.bet-edit-overlay.fading{opacity:0}
.bet-edit-card{width:min(440px,100%);background:#10271f;border:1px solid #71ab88;border-radius:18px;box-shadow:0 12px 36px #000b;padding:18px;color:white;pointer-events:auto;text-align:center}
#betEditAmount{font-size:28px;font-weight:800;margin:8px 0}.bet-edit-track{height:8px;border-radius:10px;background:#52665a;overflow:hidden;margin:12px 0}
#betEditProgress{height:100%;background:#e9c46d;width:100%}.bet-edit-actions{display:flex;gap:10px}.bet-edit-actions button{flex:1;padding:12px}

/* v1.3: altezza pila proporzionale al numero di fiches, massimo 50px */
.chip-pile .stack-display{height:122px;display:flex;align-items:flex-end;justify-content:center;position:relative;overflow:visible;margin-bottom:8px}
.chip-pile .stack-side{position:absolute;bottom:9px;width:min(62px,86%);height:var(--stack-height);border-radius:0 0 48% 48% / 0 0 13px 13px;background:repeating-linear-gradient(to bottom,transparent 0px,transparent 5px,#0005 6px,#ffffff3b 7px,transparent 8px),linear-gradient(90deg,#0008,var(--chip) 24%,var(--chip) 65%,#0008);box-shadow:inset 8px 0 8px #0003,inset -7px 0 8px #0003,0 7px 12px #0008;transform:translateY(0);pointer-events:none}
.chip-pile .stack-display .chip-3d{position:absolute;bottom:calc(5px + var(--stack-height));left:50%;transform:translateX(-50%) perspective(140px) rotateX(19deg);z-index:1;transition:bottom .25s ease}
.chip-pile .stack-side{transition:height .25s ease}
.chip-pile.empty-chip .stack-side{height:0}
@media(max-width:420px){.chip-pile .stack-display{height:112px}.chip-pile .stack-side{width:min(53px,88%)}}
