:root{font-family:Arial,'PingFang SC',sans-serif;color:#f9f3e5;background:#192c2b;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button{border:0;border-radius:10px;padding:8px 12px;min-height:44px;background:#ffffff16;color:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.4;cursor:default}button:active:not(:disabled){filter:brightness(1.12)}button:focus-visible,input:focus-visible{outline:3px solid #ffd57e;outline-offset:2px}.app{height:100svh;min-height:620px;padding:10px;display:flex;flex-direction:column;gap:8px}.toolbar{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-height:44px;font-size:13px;flex-wrap:wrap}.wordmark{margin-right:auto;font-size:16px;letter-spacing:1px;font-weight:800}.wordmark>span{color:#eac977}.toolbar label{display:flex;align-items:center;gap:4px;min-height:44px}.toolbar input{accent-color:#eac977;width:17px;height:17px}#save-note{font-size:12px;color:#ffbca8}.table{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 150px minmax(0,1fr);grid-template-rows:1fr 1fr;gap:10px}.player{border-radius:18px;min-width:0;min-height:0;padding:13px 15px;background:var(--color);box-shadow:inset 0 0 0 1px #ffffff14;position:relative}.color-0{--color:#315e85;--ink:#274d70}.color-1{--color:#a05c3d;--ink:#87492e}.color-2{--color:#347662;--ink:#255e4d}.color-3{--color:#766089;--ink:#624c75}.slot-0{grid-area:1/1}.slot-1{grid-area:1/3}.slot-2{grid-area:2/1}.slot-3{grid-area:2/3}.inner{height:100%;display:flex;flex-direction:column;position:relative;min-width:0}.facing .slot-0 .inner,.facing .slot-1 .inner{transform:rotate(180deg)}.active{box-shadow:inset 0 0 0 3px #ffda8e,0 0 20px #ffda8e13}.player header{display:flex;align-items:center;gap:3px;min-height:36px}.handle{font-size:25px;padding:0;min-height:34px;min-width:25px;touch-action:none;user-select:none;-webkit-user-select:none}.player input{min-width:0;width:45%;padding:4px;border:0;border-radius:5px;background:transparent;color:inherit;font-size:17px;font-weight:700}.player input:focus{background:#ffffff1a}.turn-mark{margin-left:auto;font-size:12px;color:#ffe29b}.numbers{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 0}.numbers>div{display:flex;align-items:baseline;gap:10px}.numbers small{font-size:11px;opacity:.8}.numbers strong{font-size:42px;line-height:1.15;font-variant-numeric:tabular-nums}.wallet{display:grid;grid-template-columns:auto auto;align-items:center;gap:2px 9px;padding:5px 9px;min-width:100px;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.wallet>span{font-size:11px}.wallet b{font-size:22px;color:#ffe29b}.wallet small{grid-column:1/-1;font-size:10px}.wallet.revealed{background:#ffde95;color:#263b34}.wallet.revealed b{color:#263b34}.collection{flex:1;overflow:auto;display:flex;flex-wrap:wrap;gap:7px;align-content:center;padding:6px 0;min-height:50px}.run{display:flex;align-items:center;flex-wrap:wrap;gap:3px;border-radius:7px;background:#ffffff0d;padding:3px}.mini-card{background:#fff8e9;color:var(--ink);display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:35px;height:52px;padding:4px 5px;font-size:24px;font-weight:750;border-radius:6px;box-shadow:0 2px 0 #0002}.mini-card small{font-size:8px}.mini-card.linked{background:#ffffff24;color:#ffffffc9;font-size:20px;box-shadow:none;min-width:29px}.empty-hand{margin:auto;font-size:13px;color:#ffffff66}.actions{display:flex;gap:8px;min-height:53px;margin-top:5px}.actions button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}.actions small{font-size:11px;font-weight:400}.pass{border:1px solid #ffffff65;background:#14282a30}.take{background:#f6d38a;color:#493f25}.rest,.math{margin:auto;font-size:12px;color:#ffffffa6}.math{font-size:18px}.math b{color:#ffdf96;font-size:28px}.middle{grid-area:1/2/3/3;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:17px;min-height:0;text-align:center}.deck-label{font-size:12px;color:#aec2b7}.offer{width:100%;padding:0 10px}.reverse{transform:rotate(180deg)}.offer-card{height:132px;background:#f8e8bc;border:5px solid #e6c886;border-radius:15px;color:#304c42;display:flex;align-items:center;justify-content:center;font-size:64px;font-weight:800;box-shadow:0 5px 0 #0c1b1744}.offer-card.back{background:#345348;color:#e9cc8f;border:3px dashed #7c9583}.pot{margin-top:8px;color:#f2d794;font-size:24px;font-weight:700}.pot small{display:block;font-size:10px;font-weight:400;color:#a8bba9}.coin{font-size:20px;color:#eabc60}.middle-footer{font-size:12px;color:#a8bba9;line-height:1.6;max-width:100%;overflow-wrap:anywhere}.middle-footer b{font-size:14px;color:#f6dfa8}.busy .actions{pointer-events:none;opacity:.6}.feedback{position:absolute;inset:32px 0 55px;display:flex;align-items:center;justify-content:center;z-index:5;background:#1a302bba;color:#ffe4a4;border-radius:12px;font-weight:800;font-size:clamp(20px,2.5vw,34px);pointer-events:none;animation:feedback .48s both}.feedback.take{color:#334d3d;background:#f5dfa3eb}.feedback.start{animation-duration:.7s}.dragging{opacity:.55}.drop{outline:4px dashed #ffe6a4;outline-offset:-6px}dialog{border:0;border-radius:18px;padding:20px;background:#fbf7ed;color:#273e37;width:min(680px,94vw);max-height:92svh;box-shadow:0 24px 80px #0007}dialog::backdrop{background:#0a191bcc;backdrop-filter:blur(4px)}dialog button{background:#e5dfd1;color:#30423a}dialog header{display:flex;align-items:center;justify-content:space-between}dialog h2{margin:5px 0;font-size:24px}.rules-copy{font-size:15px;line-height:1.65}.rules-copy a{color:#266a56}#result{width:min(740px,96vw);padding:10px;overflow:auto}#result-content{display:flex;flex-direction:column;gap:18px}.result-face{padding:10px 12px;border:1px solid #e5decf;border-radius:12px}.result-face>small{display:block;text-align:center;color:#7f897e;font-size:11px}.result-face h2{text-align:center;font-size:22px;margin:4px 0 8px}.result-row{display:grid;grid-template-columns:1fr auto 45px;align-items:center;gap:10px;padding:6px 8px;border-radius:6px;font-size:14px}.result-row span{font-size:11px;color:#6e796f}.result-row>b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.result-row strong{text-align:right;font-size:24px}.result-row.winner{background:#e9d69d}.result-face footer{display:flex;gap:8px;margin-top:8px}.result-face footer button{flex:1}#history li{font-size:14px;padding:6px 0;line-height:1.5}@keyframes feedback{0%{opacity:0;transform:scale(.92)}25%,75%{opacity:1;transform:scale(1)}100%{opacity:0}}
@media(max-height:720px){.app{min-height:580px}.middle{gap:10px}.offer-card{height:108px;font-size:53px}.numbers strong{font-size:34px}.mini-card{height:44px;font-size:21px}.player{padding:9px 12px}.result-face{padding:5px 8px}.result-row{padding:3px 6px}.result-face h2{font-size:18px}.result-face footer button{min-height:36px}.result-row strong{font-size:20px}#result-content{gap:10px}.numbers{padding:2px 0}.actions{min-height:48px}}
@media(max-width:850px){.app{padding:6px}.table{grid-template-columns:minmax(0,1fr) 110px minmax(0,1fr);gap:6px}.player{padding:8px}.player input{font-size:14px}.turn-mark{font-size:10px}.numbers>div{display:block}.numbers strong{font-size:30px;display:block}.numbers small{font-size:10px}.wallet{min-width:85px;padding:4px}.offer{padding:0 3px}.offer-card{font-size:50px;height:105px}.actions button{padding:5px}.actions b{font-size:13px}.actions small{font-size:9px}.toolbar{gap:4px}.wordmark{font-size:12px}.mini-card{min-width:27px;height:40px;font-size:20px}.mini-card.linked{min-width:24px;font-size:17px}.collection{gap:4px}.run{padding:2px;gap:2px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* Larger shared card and real-size token piles, readable from both sides. */
.table{grid-template-columns:minmax(0,1fr) clamp(220px,27vw,310px) minmax(0,1fr)}.middle{gap:10px}.offer{padding:0 12px}.offer-card{height:clamp(145px,23vh,205px);font-size:clamp(72px,8vw,100px);border-width:6px}.pot{margin-top:8px;font-size:30px;line-height:1}.pot>b{font-size:36px}.pot>small{font-size:12px;margin:4px 0 7px}.coin-pile{display:flex;gap:4px;flex-wrap:wrap;justify-content:center;max-width:245px;margin:auto;min-height:24px}.gold-coin{display:inline-block;width:21px;height:21px;border-radius:50%;background:radial-gradient(circle at 30% 25%,#ffefaf,#e8b64b 68%,#af772b);border:2px solid #f5d78b;box-shadow:inset 0 0 0 2px #be8f38,0 2px 0 #966220;flex-shrink:0}.wallet{cursor:default}.flying{position:fixed;z-index:1000;pointer-events:none;left:var(--x);top:var(--y);animation:travel .65s cubic-bezier(.25,.6,.35,1) both;animation-delay:var(--delay)}.flying.gold-coin{width:27px;height:27px}.flying-card{width:78px;height:108px;background:#f8e8bc;color:#304c42;border:4px solid #e6c886;border-radius:12px;font-size:44px;font-weight:800;display:flex;align-items:center;justify-content:center;box-shadow:0 12px 25px #0004}.received .wallet,.received .collection{animation:arrive .4s ease-out}.paid .wallet{animation:arrive .3s ease-out}@keyframes travel{0%{opacity:0;transform:translate(-50%,-50%) rotate(var(--rotate)) scale(.85)}12%{opacity:1}50%{transform:translate(calc(-50% + var(--dx)*.5),calc(-50% + var(--dy)*.5 - 35px)) rotate(var(--rotate)) scale(1.12)}90%{opacity:1}100%{opacity:0;transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) rotate(var(--rotate)) scale(.7)}}@keyframes arrive{0%{filter:brightness(1.65)}100%{filter:brightness(1)}}
@media(max-height:720px){.offer-card{height:130px;font-size:76px}.middle{gap:7px}.pot>b{font-size:28px}.pot>small{font-size:10px;margin:3px 0 5px}.gold-coin{width:17px;height:17px}.coin-pile{gap:3px;min-height:18px}}@media(max-width:850px){.table{grid-template-columns:minmax(0,1fr) 190px minmax(0,1fr)}.offer{padding:0 5px}.offer-card{height:130px;font-size:70px}.pot>b{font-size:27px}.gold-coin{width:17px;height:17px}.coin-pile{gap:3px}}
/* Keep even all 44 coins visible without pushing either offer off-screen. */
.offer-card{height:clamp(145px,20vh,180px)}.coin-pile{display:grid;grid-template-columns:repeat(11,minmax(0,1fr));gap:3px;max-width:235px}.coin-pile .gold-coin{width:100%;max-width:18px;height:auto;aspect-ratio:1;justify-self:center}.coin-pile:empty{height:18px}@media(max-height:720px),(max-width:850px){.offer-card{height:130px}.coin-pile .gold-coin{max-width:16px}}

.wallet{width:55%;max-width:220px;grid-template-columns:1fr auto}.wallet-coins{grid-column:1/-1;display:grid;grid-template-columns:repeat(11,minmax(0,1fr));gap:3px;width:100%;margin:3px 0;min-height:15px}.wallet-coins .gold-coin{width:100%;max-width:16px;height:auto;aspect-ratio:1;justify-self:center;border-width:1px}.mini-card.connectable{background:#ffe493;color:#493912;outline:3px solid #fff3bf;box-shadow:0 0 15px #ffe08a99;position:relative;z-index:1;animation:connection-glow 1.6s ease-in-out infinite}.collection{padding:9px 4px}.run{gap:5px}@keyframes connection-glow{0%,100%{box-shadow:0 0 8px #ffe08a66}50%{box-shadow:0 0 19px #ffe08abb}}@media(max-width:850px){.wallet{width:58%;padding:4px}.wallet-coins{gap:2px}.wallet-coins .gold-coin{max-width:13px}.mini-card.connectable{outline-width:2px}}

/* Full-height table; shared controls stay behind the central gear. */
.app{padding:6px;gap:0}.middle{display:grid;grid-template-rows:minmax(0,1fr) 46px minmax(0,1fr);gap:5px;align-items:center;justify-items:center;width:100%}.offer{min-height:0}.center-tools{display:flex;align-items:center;justify-content:center;gap:4px}.settings-toggle{width:46px;height:46px;padding:11px;border-radius:50%;background:#ffffff12;color:#d2dfd4}.settings-toggle svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}.deck-badge{display:flex;align-items:center;justify-content:center;gap:12px;height:30px;margin-bottom:7px;color:#d3dfce}.deck-badge b{font-size:20px;letter-spacing:1px;font-variant-numeric:tabular-nums}.deck-icon{position:relative;display:inline-block;width:19px;height:24px;border:2px solid #d6c38f;border-radius:4px;background:#3b5147;box-shadow:-3px -3px 0 -1px #3b5147,-3px -3px 0 1px #a79873,-6px -6px 0 -1px #3b5147,-6px -6px 0 1px #7f795f}.deck-icon:after{content:'';position:absolute;inset:4px;border:1px solid #d6c38f70;border-radius:2px}#save-note:not(:empty){position:fixed;left:50%;top:6px;transform:translateX(-50%);z-index:100;background:#192c2b;padding:6px 10px;border-radius:8px}#settings{width:min(380px,90vw)}.settings-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}.settings-controls button,.settings-controls label{min-height:52px;display:flex;align-items:center;justify-content:center;gap:8px;border-radius:10px;background:#e5dfd1}.settings-controls input{width:20px;height:20px;accent-color:#347662}.settings-controls #new{grid-column:1/-1;background:#ead69e}@media(max-height:720px){.deck-badge{height:25px;margin-bottom:6px}.deck-badge b{font-size:18px}.deck-icon{width:16px;height:20px}.middle{gap:3px}}

/* Avatars travel with each player when seats are exchanged. */
.player header{gap:8px}.handle{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:50%;background:transparent;flex-shrink:0}.avatar{display:block;width:44px;height:44px;border-radius:50%;object-fit:cover;border:2px solid #ffffffa0;pointer-events:none;-webkit-user-drag:none}.player input{flex:1;width:0}.turn-mark{flex-shrink:0}.result-name{display:flex;align-items:center;gap:8px}.result-name .avatar{width:30px;height:30px;flex-shrink:0}.result-name span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:inherit;font-size:inherit}@media(max-width:850px){.player header{gap:5px}.handle,.avatar{width:38px;height:38px;min-width:38px;min-height:38px}}

/* Opening deal: show the complete set, hide faces, remove nine, shuffle. */
.opening-shuffle{position:fixed;inset:0;z-index:1100;background:#192c2bf5;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;touch-action:none;animation:shuffle-enter .2s ease-out}.shuffle-caption{color:#e9d69d;font-size:22px;font-weight:700;letter-spacing:5px}.shuffle-spread{position:relative;width:min(920px,94vw);height:min(420px,65svh)}.shuffle-card{position:absolute;left:calc((var(--col) + .5)*100%/11);top:calc((var(--row) + .5)*100%/3);width:7.5%;height:28%;perspective:700px;transform:translate(-50%,-50%);transition:left .5s ease,top .5s ease,transform .5s ease,opacity .5s ease;transition-delay:var(--stagger)}.shuffle-flip{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .5s ease;transition-delay:var(--stagger)}.shuffle-front,.shuffle-back{position:absolute;inset:0;border:3px solid #dfc183;border-radius:9px;backface-visibility:hidden;-webkit-backface-visibility:hidden;box-shadow:0 3px 8px #0004}.shuffle-front{display:flex;align-items:center;justify-content:center;background:#fff1ce;color:#304c42;font-size:clamp(20px,3vw,38px);font-weight:800}.shuffle-back{transform:rotateY(180deg);background:repeating-linear-gradient(45deg,#3c6554 0 5px,#345949 5px 10px)}.shuffle-back:after{content:'';position:absolute;inset:7px;border:1px solid #d6c38f;border-radius:4px}.flipped .shuffle-flip{transform:rotateY(180deg)}.removing .remove-card{transform:translate(-50%,-50%) translateY(-65vh) rotate(18deg);opacity:0}.gathered .shuffle-card:not(.remove-card){left:50%;top:50%;transform:translate(-50%,-50%) rotate(var(--angle))}.shuffling .shuffle-card:not(.remove-card){animation:deck-riffle .24s ease-in-out 3 alternate;animation-delay:var(--stagger)}.opening-shuffle.finished{opacity:0;transition:opacity .25s}@keyframes deck-riffle{from{transform:translate(-50%,-50%) rotate(var(--angle))}to{transform:translate(calc(-50% + var(--jitter)),calc(-50% - 25px)) rotate(0deg)}}@keyframes shuffle-enter{from{opacity:0}to{opacity:1}}

.round-count{font-size:11px;color:#a8bba9;letter-spacing:0}.result-row strong small{display:block;font-size:9px;font-weight:400;color:#6e796f}.result-row>span{max-width:240px;line-height:1.5}.result-row{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr) 48px}

.player.starter-light{box-shadow:inset 0 0 0 5px #ffe69b,0 0 28px #ffd26899;filter:brightness(1.22)}.player.starter-picked{box-shadow:inset 0 0 0 6px #fff1b5,0 0 40px #ffd268;animation:starter-win .35s ease-in-out 2 alternate}@keyframes starter-win{to{filter:brightness(1.55)}}

.sitting-out{filter:saturate(.25);opacity:.68}.roster-label{font-size:10px;max-width:55px;color:#ffe29b}.roster-label:empty{display:none}.avatar-toggle{padding:0;background:transparent;min-width:38px;width:38px;height:38px;min-height:38px;flex-shrink:0}.avatar-toggle img{width:38px;height:38px;object-fit:cover;border:2px solid #ffffff88;border-radius:50%;pointer-events:none}

.profile-dialog{width:min(440px,94vw);padding:20px}.profile-dialog header{display:flex;align-items:center;justify-content:space-between}.profile-tabs{display:flex;gap:6px;margin:12px 0}.profile-tabs button{flex:1;min-width:0;padding:5px;font-size:12px;overflow:hidden;text-overflow:ellipsis}.profile-tabs .selected{background:#e9c576;color:#263b34}.profile-editor{display:grid;gap:12px}.profile-editor img{width:90px;height:90px;border-radius:50%;object-fit:cover;justify-self:center}.profile-editor input[type=text]{width:100%;padding:12px;border:1px solid #aaa;border-radius:8px;color:#263b34;background:#fff;font-size:18px}.profile-editor label{display:grid;gap:8px}.profile-editor input[type=file]{width:100%;font-size:14px}.profile-note{font-size:12px;color:#6e796f;margin:0}.profile-error{color:#a22;font-size:13px}.duo .sitting-out{display:none!important}
.table.duo{grid-template-columns:minmax(0,1fr) clamp(220px,27vw,310px) minmax(0,1fr)}.table.duo .player[data-duo-seat="0"]{grid-area:1/1/3/2}.table.duo .player[data-duo-seat="1"]{grid-area:1/3/3/4}.table.duo .player .inner{transform:none}.table.duo.facing .player[data-duo-seat="0"] .inner{transform:rotate(180deg)}.table.duo .mini-card{min-width:48px;height:70px;font-size:32px}.table.duo .collection{align-content:center}.table.duo .actions{min-height:66px}

/* Keep the iPad table fixed; scrolling remains available inside dialogs. */
html{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}body{position:fixed;inset:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}.game-shell,.app{height:100%;min-height:0;overflow:hidden;overscroll-behavior:none;touch-action:none}.board,.table{min-height:0;overscroll-behavior:none}dialog{touch-action:pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}dialog input,dialog button{touch-action:manipulation}

.player-count{display:flex;align-items:center;justify-content:center;gap:22px;margin-top:12px}.player-count button{min-width:46px;font-size:24px}.profile-tabs{flex-wrap:wrap}.profile-tabs button{flex:1 0 21%}.many .player{grid-column:var(--seat-col);grid-row:var(--seat-row)}.many .player input{font-size:13px}.many .player header{gap:3px}.many .player{padding:8px}.many .player .inner,.many .player .player-inner{transform:none}.many.facing .player[data-upper="true"] .inner,.many.table-mode .player[data-upper="true"] .player-inner{transform:rotate(180deg)}.many .avatar,.many .handle,.many .avatar-toggle,.many .avatar-toggle img{width:30px;height:30px;min-width:30px;min-height:30px}.many .turn-mark{font-size:9px}.solo .player{grid-area:1/1/3/-1}.solo .player .player-inner,.solo .player .inner{transform:none}
.table.many:not(.duo){grid-template-columns:repeat(var(--seat-cols),minmax(0,1fr));grid-template-rows:minmax(0,1fr) 145px minmax(0,1fr);gap:6px}.table.many:not(.duo) .player[data-upper="false"]{grid-row:3}.table.many .middle{grid-area:2/1/3/-1;display:flex;flex-direction:row;gap:20px}.table.many .offer{width:180px;padding:0;display:grid;grid-template-columns:76px 1fr;gap:4px;align-items:center}.table.many .offer-card{height:90px;font-size:48px;grid-column:1;grid-row:2}.table.many .deck-badge{grid-column:1/-1;margin:0;height:25px}.table.many .pot{grid-column:2;grid-row:2}.table.many .coin-pile{grid-template-columns:repeat(11,minmax(0,1fr));gap:1px}.table.many .pot>small{font-size:9px}.table.many .numbers strong{font-size:27px}.table.many .numbers>div{display:block}.table.many .mini-card{min-width:25px;height:36px;font-size:20px}.table.many .actions button{font-size:12px;padding:4px}.table.many .actions small{font-size:9px}.table.many .numbers{padding:0}.table.many .collection{min-height:35px}.table.solo{grid-template-columns:minmax(0,1fr) 230px}.table.solo .player{grid-area:1/1/3/2}.table.solo .middle{grid-area:1/2/3/3}
