/* A sunlit coffeehouse. One design unit keeps the whole table on the first screen. */
:root{color-scheme:light;--ink:#343713;--cream:#fff4d7;--olive:#777b37;--mustard:#d7b339}
*{box-sizing:border-box}
body{margin:0;background:radial-gradient(ellipse at 50% 20%,#f4e6bc,#b5ad78 80%);color:var(--ink);font:15px system-ui,sans-serif}
main{margin:0 auto;max-width:850px}
.pi-scene{--u:min(calc(100vw / 390),calc(100svh / 844),1px);position:relative;width:calc(390 * var(--u));height:calc(844 * var(--u));margin:0 auto;isolation:isolate;background:#d7b339 url('../assets/play/pishti/coffeehouse.webp') center/100% 100% no-repeat;box-shadow:0 0 60px #4c46284d;overflow:hidden}
h1{position:absolute;top:calc(4 * var(--u));left:calc(19 * var(--u));width:calc(352 * var(--u));height:calc(121 * var(--u));margin:0;z-index:1}
h1 img{display:block;width:100%;height:100%;filter:drop-shadow(0 calc(3 * var(--u)) calc(2 * var(--u)) #3e321a66)}
.hud{position:absolute;top:calc(131 * var(--u));left:calc(15 * var(--u));width:calc(360 * var(--u));height:calc(58 * var(--u));display:grid;grid-template-columns:1fr .72fr 1fr;gap:calc(3 * var(--u));z-index:1}
.chip{background:url('../assets/play/pishti/score-plaque.webp') center/100% 100% no-repeat;text-align:center;padding:calc(9 * var(--u)) calc(8 * var(--u)) 0;font:bold calc(13 * var(--u))/1.1 Georgia,serif;text-transform:uppercase;filter:drop-shadow(0 calc(2 * var(--u)) calc(2 * var(--u)) #4f3e2866)}
.chip.you{grid-column:1;grid-row:1}.chip.deal{grid-column:2;grid-row:1}.chip.computer{grid-column:3;grid-row:1}
.chip b{display:block;font-size:calc(23 * var(--u));line-height:1.15}
.chip small{font-size:calc(14 * var(--u));font-weight:600}
#pi-status{position:absolute;top:calc(195 * var(--u));left:calc(32 * var(--u));width:calc(326 * var(--u));height:calc(43 * var(--u));display:flex;align-items:center;justify-content:center;margin:0;padding:calc(4 * var(--u)) calc(15 * var(--u));border:calc(2 * var(--u)) solid #f5de98;border-radius:calc(25 * var(--u));background:linear-gradient(#fff7df,#f0d799);box-shadow:0 calc(3 * var(--u)) calc(4 * var(--u)) #47361366,inset 0 calc(2 * var(--u)) #fff9e6;color:#343713;text-align:center;font:700 calc(13 * var(--u))/1.2 Georgia,serif;z-index:2}
.table{position:absolute;inset:calc(244 * var(--u)) calc(17 * var(--u)) auto;height:calc(465 * var(--u));border-radius:calc(48 * var(--u));touch-action:none;user-select:none;-webkit-user-select:none}
.table button{touch-action:none}
.tablehead{font:bold calc(13 * var(--u))/1.15 Georgia,serif;text-align:center}
#pi-computer{position:absolute;top:0;left:calc(74 * var(--u));width:calc(198 * var(--u));padding:calc(6 * var(--u)) calc(4 * var(--u));border-radius:calc(20 * var(--u));background:linear-gradient(#fff7df,#f3dfae);box-shadow:0 calc(2 * var(--u)) calc(4 * var(--u)) #68501980;text-transform:uppercase}
#pi-stock{position:absolute;top:calc(49 * var(--u));right:calc(5 * var(--u));width:calc(75 * var(--u));min-height:calc(56 * var(--u));padding:calc(10 * var(--u)) calc(4 * var(--u));background:#fff0cf;border:calc(2 * var(--u)) solid #f8e3ae;border-radius:calc(16 * var(--u));box-shadow:0 calc(3 * var(--u)) calc(3 * var(--u)) #5a431c66;font-size:calc(12 * var(--u));z-index:1}
#pi-stock b{display:block;font-size:calc(23 * var(--u));line-height:1}
.backs{position:absolute;top:calc(40 * var(--u));left:calc(62 * var(--u));width:calc(190 * var(--u));height:calc(75 * var(--u));display:flex;justify-content:center;align-items:center}
.back{flex:none;display:block;width:calc(51 * var(--u));height:calc(74 * var(--u));margin:0 calc(-3 * var(--u));background:url('../assets/play/pishti/card-back.webp') center/100% 100% no-repeat;transform:rotate(var(--tilt,0deg));filter:drop-shadow(0 calc(3 * var(--u)) calc(2 * var(--u)) #58421c88)}
.pile-area{position:absolute;top:calc(128 * var(--u));left:calc(48 * var(--u));width:calc(270 * var(--u));height:calc(110 * var(--u));display:flex;align-items:center;gap:calc(22 * var(--u))}
#pi-pile{position:relative;flex:none;width:calc(92 * var(--u));height:calc(110 * var(--u));display:flex;align-items:center;justify-content:flex-end}
.pile-back{position:absolute;width:calc(73 * var(--u));height:calc(104 * var(--u));top:calc(5 * var(--u));left:calc(var(--offset) * var(--u));background:url('../assets/play/pishti/card-back.webp') center/100% 100% no-repeat;transform:rotate(calc(var(--offset) * .45deg));filter:drop-shadow(0 calc(2 * var(--u)) calc(2 * var(--u)) #60491b80)}
.pile-info{color:#3c3d17;width:calc(133 * var(--u));text-align:center;font-size:calc(11 * var(--u));line-height:1.4;border-radius:calc(20 * var(--u));padding:calc(10 * var(--u)) calc(9 * var(--u));background:#fff1cfed;border:calc(2 * var(--u)) solid #f8e3ae;box-shadow:0 calc(3 * var(--u)) calc(4 * var(--u)) #5c431c66}
.pile-info b{display:block;font:bold calc(20 * var(--u))/1.2 Georgia,serif;margin-bottom:calc(4 * var(--u))}
.card{--tilt:0deg;position:relative;display:block;flex:none;width:calc(84 * var(--u));height:calc(134 * var(--u));min-height:0;margin:0;padding:0;border:0;border-radius:calc(9 * var(--u));color:#25251b;background:transparent url('../assets/play/pishti/card-face.webp') center/100% 100% no-repeat;font-family:Georgia,'Times New Roman',serif;box-shadow:0 calc(3 * var(--u)) calc(3 * var(--u)) #4e361b66;transform:translateY(var(--arc,0px)) rotate(var(--tilt));transition:transform .16s,box-shadow .16s}
.card.red{color:#ac3023}
.card *{pointer-events:none}
.card .corner{position:absolute;left:6%;top:5%;display:flex;flex-direction:column;align-items:center;line-height:.92;font-size:calc(21 * var(--u));font-weight:700;letter-spacing:-.06em}
.card .corner .suit{font-size:calc(16 * var(--u));letter-spacing:0}
.card .corner.bottom{top:auto;left:auto;right:6%;bottom:5%;transform:rotate(180deg)}
.card .pips{position:absolute;inset:20% 22% 20%;font-size:calc(25 * var(--u));line-height:1}
.card .pip{position:absolute;left:calc(var(--x) * 1%);top:calc(var(--y) * 1%);transform:translate(-50%,-50%) rotate(var(--flip,0deg))}
.card .pips.dense{font-size:calc(22 * var(--u))}
.card .pips.ace{font-size:calc(48 * var(--u))}
.court-art{position:absolute;left:26%;top:18%;width:48%;height:64%;object-fit:fill}
.card .key-hint{position:absolute;bottom:5%;left:44%;width:12%;font:600 calc(9 * var(--u))/1 system-ui,sans-serif;color:#6f633c}
.pile-card{width:calc(76 * var(--u));height:calc(110 * var(--u));z-index:1;transform:rotate(4deg)}
.pile-card .corner{font-size:calc(21 * var(--u))}.pile-card .corner .suit{font-size:calc(16 * var(--u))}
.pile-card .pips{font-size:calc(19 * var(--u))}
.pile-card .pips.ace{font-size:calc(42 * var(--u))}
.empty{display:flex;align-items:center;justify-content:center;width:calc(76 * var(--u));height:calc(108 * var(--u));border:calc(2 * var(--u)) dashed #7e6e2c;border-radius:calc(10 * var(--u));background:#d7aa3a80;color:#3f4019;font:bold calc(13 * var(--u))/1.4 Georgia,serif;text-align:center}
#pi-last{position:absolute;top:calc(244 * var(--u));left:calc(26 * var(--u));right:calc(26 * var(--u));height:calc(30 * var(--u));margin:0;color:#393714;text-shadow:0 1px #ffe19a;font-size:calc(10.5 * var(--u));font-weight:600;line-height:1.35;text-align:center}
.hand-label{position:absolute;top:calc(272 * var(--u));left:calc(47 * var(--u));right:calc(47 * var(--u));margin:0;padding:calc(5 * var(--u));border-radius:calc(20 * var(--u));background:linear-gradient(#fff8e1,#f3dc9d);box-shadow:0 calc(2 * var(--u)) calc(3 * var(--u)) #70561e80;text-align:center;font:bold calc(12 * var(--u))/1.2 Georgia,serif}
.hand{position:absolute;top:calc(309 * var(--u));left:calc(9 * var(--u));right:calc(9 * var(--u));min-height:calc(135 * var(--u));display:flex;justify-content:center;align-items:flex-start;gap:0}
.card.selected{z-index:2;transform:translateY(calc(-10 * var(--u))) rotate(var(--tilt));outline:calc(3 * var(--u)) solid #fff4be;outline-offset:calc(2 * var(--u));box-shadow:0 0 calc(15 * var(--u)) calc(5 * var(--u)) #ffd800,0 calc(6 * var(--u)) calc(8 * var(--u)) #60451c66}
.hand .card:disabled{cursor:default;filter:saturate(.85)}
.capture-counts{position:absolute;top:calc(452 * var(--u));left:calc(12 * var(--u));right:calc(38 * var(--u));display:flex;justify-content:space-between;gap:calc(6 * var(--u));font-size:calc(9.5 * var(--u));font-weight:600;color:#3e3816;background:#fff0c6ed;border-radius:calc(12 * var(--u));padding:calc(5 * var(--u)) calc(8 * var(--u))}
button{font:inherit;cursor:pointer;touch-action:manipulation}
button:focus-visible{outline:calc(3 * var(--u,1px)) solid #362d10;outline-offset:calc(4 * var(--u,1px))}
button:disabled{cursor:default}
.primary{position:absolute;top:calc(718 * var(--u));left:calc(45 * var(--u));width:calc(300 * var(--u));height:calc(70 * var(--u));padding:0 0 calc(4 * var(--u));border:0;border-radius:calc(30 * var(--u));background:transparent url('../assets/play/pishti/play-button.webp') center/100% 100% no-repeat;color:#30310e;text-shadow:0 calc(1 * var(--u)) #ffec9b;font:bold calc(26 * var(--u))/1 Georgia,serif;filter:drop-shadow(0 calc(4 * var(--u)) calc(3 * var(--u)) #64441988);z-index:3}
.primary:disabled{filter:saturate(.7) drop-shadow(0 calc(3 * var(--u)) calc(3 * var(--u)) #64441970);color:#68602e}
.primary:not(:disabled):active,.toolbar button:active{transform:translateY(calc(2 * var(--u)))}
.toolbar{position:absolute;top:calc(792 * var(--u));left:calc(47 * var(--u));right:calc(47 * var(--u));height:calc(46 * var(--u));display:flex;gap:calc(12 * var(--u));z-index:3}
.toolbar button{flex:1;min-width:0;margin:0!important;min-height:0!important;padding:calc(3 * var(--u)) calc(10 * var(--u)) calc(6 * var(--u))!important;border:0!important;border-radius:calc(22 * var(--u))!important;background:transparent url('../assets/play/pishti/plain-plaque.webp') center/100% 100% no-repeat!important;color:#3d3c16!important;font:bold calc(15 * var(--u))/1 Georgia,serif!important;text-transform:uppercase;box-shadow:none!important;filter:drop-shadow(0 calc(3 * var(--u)) calc(2 * var(--u)) #624a2966)}
.tea{position:absolute;right:calc(-14 * var(--u));top:calc(680 * var(--u));width:calc(68 * var(--u));height:calc(68 * var(--u));object-fit:contain;pointer-events:none;z-index:2;filter:drop-shadow(0 calc(3 * var(--u)) calc(2 * var(--u)) #52401888)}
#pi-summary{position:absolute;top:calc(130 * var(--u));left:calc(23 * var(--u));right:calc(23 * var(--u));padding:calc(20 * var(--u)) calc(18 * var(--u));border:calc(3 * var(--u)) solid #aaa154;border-radius:calc(20 * var(--u));background:#fff0cfeF;box-shadow:0 calc(5 * var(--u)) calc(10 * var(--u)) #5b441d66;z-index:4;font-size:calc(13 * var(--u));line-height:1.6}
#pi-summary>b{font:bold calc(25 * var(--u))/1.3 Georgia,serif;display:block;text-align:center;margin-bottom:calc(10 * var(--u))}
#pi-summary p{margin:calc(7 * var(--u)) 0}
[data-phase="dealEnd"] .pile-area,[data-phase="dealEnd"] .hand-label,[data-phase="dealEnd"] #pi-last,[data-phase="over"] .pile-area,[data-phase="over"] .hand-label,[data-phase="over"] #pi-last{visibility:hidden}
[data-phase="dealEnd"] #pi-status{font-size:calc(12 * var(--u))}
#pi-over{position:absolute;top:calc(22 * var(--u));left:calc(20 * var(--u));right:calc(20 * var(--u));padding:calc(18 * var(--u));background:#fff4d9f5;border:calc(3 * var(--u)) solid #777b37;border-radius:calc(24 * var(--u));text-align:center;z-index:5;box-shadow:0 calc(6 * var(--u)) calc(9 * var(--u)) #5b441d66}
#pi-over h2{font:bold calc(33 * var(--u))/1.15 Georgia,serif;margin:0 0 calc(9 * var(--u))}
#pi-over p{font-size:calc(13 * var(--u));margin:0 0 calc(12 * var(--u));line-height:1.5}
#pi-again{min-height:calc(47 * var(--u));width:calc(190 * var(--u));padding:calc(6 * var(--u));border:0;border-radius:calc(24 * var(--u));background:transparent url('../assets/play/pishti/play-button.webp') center/100% 100% no-repeat;color:#393a12;font:bold calc(19 * var(--u))/1 Georgia,serif}
[data-phase="over"] #pi-summary{top:calc(238 * var(--u));font-size:calc(11 * var(--u));padding:calc(11 * var(--u)) calc(15 * var(--u))}
[data-phase="over"] #pi-summary>b{font-size:calc(20 * var(--u));margin-bottom:calc(5 * var(--u))}
[data-winner="0"] #pi-over{border-color:#dbb536;background:#fff6d8}
[data-winner="1"] #pi-over{border-color:#797749;background:#f0ebd5}
[hidden],#pi-over[hidden]{display:none!important}
.reading{max-width:650px;margin:auto;padding:24px 22px 40px;line-height:1.7;background:#fff5dbea}
header{font-size:13px;margin-bottom:22px}a{color:#605719;text-underline-offset:3px}
.eyebrow{font-size:11px;letter-spacing:.15em;text-transform:uppercase;margin:0}
.intro{font:600 22px/1.4 Georgia,serif;margin:8px 0 16px}
.hint{font-size:12px;line-height:1.6;border-bottom:1px solid #d4c999;padding-bottom:20px}
.rules h2{font:700 27px Georgia,serif;margin-top:25px}.rules ul{padding-left:22px}.rules li{margin:12px 0}.rules b{color:#454218}
@media(prefers-reduced-motion:reduce){.card{transition:none}.primary:active,.toolbar button:active{transform:none}}
