/* Coffeehouse Tarneeb. All scene measurements share a phone-sized design unit. */
*{box-sizing:border-box}
:root{color-scheme:dark;--ivory:#fff0cd;--brass:#cba263;--wine:#700f24;--u:min(calc(100vw / 390),calc(100svh / 844))}
body{margin:0;background:#27150f;color:var(--ivory);font-family:Georgia,'Times New Roman',serif}
main{max-width:none;margin:0;padding:0}
button{font:inherit;cursor:pointer;touch-action:none}
button:focus-visible{outline:3px solid #fff4c4;outline-offset:3px}
button:disabled{cursor:default}
[hidden]{display:none!important}
.scene{position:relative;isolation:isolate;width:calc(390 * var(--u));height:calc(844 * var(--u));margin:0 auto;overflow:hidden;background:#5b211c url('../assets/play/tarneeb/coffeehouse.webp') center/100% 100% no-repeat;box-shadow:0 0 80px #110600;touch-action:none}
.scene *{touch-action:none}
h1{position:absolute;z-index:2;left:calc(5 * var(--u));top:calc(6 * var(--u));width:calc(380 * var(--u));height:calc(87 * var(--u));margin:0;line-height:1}
h1 img{display:block;width:100%;height:100%;object-fit:fill;filter:drop-shadow(0 4px 4px #200900b0)}
.hud{position:absolute;z-index:2;top:calc(100 * var(--u));left:calc(14 * var(--u));right:calc(14 * var(--u));display:grid;grid-template-columns:1.3fr 1fr 1fr;gap:calc(5 * var(--u));font-size:calc(13 * var(--u));line-height:1.05;text-align:center}
.hud>div{display:flex;align-items:center;justify-content:center;gap:calc(5 * var(--u));min-height:calc(33 * var(--u));border:calc(1.5 * var(--u)) solid var(--brass);border-radius:calc(13 * var(--u));background:linear-gradient(#8e2433,#4a0715);box-shadow:inset 0 0 0 2px #3c170d,0 3px 4px #240b06}
.hud>div:nth-child(1),.hud>div:nth-child(2){position:relative;height:calc(40 * var(--u));background:url('../assets/play/tarneeb/button-ivory.webp') center/100% 100%;border:0;color:#510c18;font-weight:bold;font-size:calc(14 * var(--u));box-shadow:none}
.hud>div:nth-child(1){grid-column:1/3;margin-right:calc(59 * var(--u))}
.hud>div:nth-child(2){position:absolute;top:0;right:0;width:calc(178 * var(--u))}
.hud>div:nth-child(n+3){grid-row:2}
.hud b{font-size:calc(17 * var(--u));font-variant-numeric:tabular-nums}
.hud .us b,.hud .them b{font-size:calc(25 * var(--u))}
#tb-bid{font-size:calc(12 * var(--u));max-width:calc(74 * var(--u))}
#tb-status{position:absolute;z-index:3;left:calc(44 * var(--u));right:calc(44 * var(--u));top:calc(447 * var(--u));height:calc(64 * var(--u));margin:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:calc(8 * var(--u)) calc(13 * var(--u));border:calc(2 * var(--u)) solid var(--brass);border-radius:calc(18 * var(--u));background:linear-gradient(#871e2c,#4b0c19);box-shadow:inset 0 0 0 2px #3a130c,0 3px 8px #260804;font-size:calc(12 * var(--u));font-weight:600;line-height:1.3}
.table{position:absolute;left:0;right:0;top:calc(186 * var(--u));height:calc(260 * var(--u))}
.seat{position:absolute;text-align:center;width:calc(98 * var(--u));font-size:calc(10 * var(--u));color:var(--ivory);line-height:1.2;text-shadow:0 1px 2px #240007}
.seat.n{top:0;left:calc(125 * var(--u));width:calc(140 * var(--u))}
.seat.w{top:calc(100 * var(--u));left:calc(16 * var(--u))}
.seat.e{top:calc(100 * var(--u));right:calc(16 * var(--u))}
.seat b{display:block;background:linear-gradient(#8d2532,#4b0c16);border:calc(1.5 * var(--u)) solid var(--brass);border-radius:calc(14 * var(--u));padding:calc(4 * var(--u)) 0;box-shadow:0 2px 4px #240900;font-size:calc(13 * var(--u));white-space:nowrap}
.seat.turn b{background:linear-gradient(#fff3d2,#dfb77a);color:#650c22;box-shadow:0 0 calc(10 * var(--u)) #ffdd9a}
.tag{display:inline-block;padding:calc(1 * var(--u)) calc(4 * var(--u));font-size:calc(9 * var(--u));line-height:1.5}
.seat-cards{position:relative;margin:calc(3 * var(--u)) auto;width:calc(35 * var(--u));height:calc(46 * var(--u))}
.seat-cards img{display:block;width:100%;height:100%;border-radius:calc(3 * var(--u));box-shadow:0 2px 4px #240700}
.seat-cards span{position:absolute;left:calc(-8 * var(--u));right:calc(-8 * var(--u));bottom:calc(2 * var(--u));background:#4d0718e8;border-radius:3px;padding:calc(2 * var(--u)) 0;font-size:calc(10 * var(--u));white-space:nowrap}
.call{font-weight:bold;min-height:1.25em;display:inline-block}
.call.hi{color:#ffe2a2}
.trick{position:absolute;left:calc(100 * var(--u));top:calc(100 * var(--u));width:calc(190 * var(--u));height:calc(170 * var(--u))}
.trick .slot{position:absolute;transform:translate(-50%,-50%)}
.trick .s0{left:50%;top:76%;z-index:4}.trick .s1{left:76%;top:50%;z-index:3}.trick .s2{left:50%;top:24%;z-index:1}.trick .s3{left:24%;top:50%;z-index:2}
.trick .mid{position:absolute;left:50%;top:56%;transform:translate(-50%,-50%);font-size:calc(15 * var(--u));color:#ffebc8;text-align:center;max-width:100%;width:calc(140 * var(--u));line-height:1.4;text-shadow:0 2px 3px #26050c;pointer-events:none}
.me{position:absolute;top:calc(516 * var(--u));left:calc(26 * var(--u));right:calc(26 * var(--u));height:calc(27 * var(--u));display:flex;align-items:center;justify-content:center;gap:calc(5 * var(--u));border:1px solid #bd905b;border-radius:calc(15 * var(--u));background:linear-gradient(#801c2d,#4e0b19);font-size:calc(11 * var(--u));white-space:nowrap;box-shadow:0 2px 4px #240900}
.me b{font-size:calc(17 * var(--u))}.me.turn b{color:#ffe2a0}
.hand{position:absolute;left:calc(16 * var(--u));right:calc(16 * var(--u));top:calc(554 * var(--u));display:flex;flex-wrap:wrap;align-content:flex-start;justify-content:center;gap:calc(8 * var(--u)) calc(5 * var(--u));min-height:calc(155 * var(--u))}
.card{position:relative;flex:none;width:calc(46 * var(--u));height:calc(71 * var(--u));min-height:0;padding:0;border:0;border-radius:calc(5 * var(--u));background:#f4e3bb url('../assets/play/tarneeb/card-face.webp') center/100% 100%;color:#251510;font-family:Georgia,'Times New Roman',serif;box-shadow:0 calc(3 * var(--u)) calc(4 * var(--u)) #260b06b0;transition:transform .12s}
.card .r{position:absolute;z-index:2;left:calc(4 * var(--u));top:calc(3 * var(--u));font-size:calc(17 * var(--u));line-height:1;font-weight:bold}
.card .s{position:absolute;z-index:2;left:calc(4 * var(--u));top:calc(20 * var(--u));font-size:calc(15 * var(--u));line-height:1}
.card .big{position:absolute;right:calc(6 * var(--u));bottom:calc(7 * var(--u));font-size:calc(29 * var(--u));line-height:1}
.card.red{color:#a10d23}
.card .court{position:absolute;right:calc(3 * var(--u));bottom:calc(4 * var(--u));width:calc(29 * var(--u));height:calc(43 * var(--u));object-fit:fill;mix-blend-mode:multiply}
.card:has(.court) .big{font-size:calc(12 * var(--u));right:calc(3 * var(--u));bottom:calc(2 * var(--u));z-index:2}
.card.trumpc::after{content:'';position:absolute;inset:calc(1.5 * var(--u));border-radius:calc(4 * var(--u));box-shadow:inset 0 0 0 calc(1.5 * var(--u)) #d5a542;pointer-events:none}
.card.sel{transform:translateY(calc(-6 * var(--u)));outline:calc(2 * var(--u)) solid #fff3c2;box-shadow:0 0 calc(12 * var(--u)) #ffe094}
.card.win{outline:calc(3 * var(--u)) solid #95dba2;box-shadow:0 0 calc(12 * var(--u)) #90dfa3}
.card.illegal{filter:brightness(.62) saturate(.6)}
button.card:not(:disabled):hover{transform:translateY(calc(-6 * var(--u)))}
.controls{position:absolute;left:calc(17 * var(--u));right:calc(17 * var(--u));top:calc(721 * var(--u));height:calc(68 * var(--u))}
.pane{display:flex;align-items:center;justify-content:center;gap:calc(5 * var(--u));flex-wrap:wrap}
.pane .lbl{width:100%;text-align:center;font-size:calc(12 * var(--u));line-height:1.2;margin-bottom:calc(3 * var(--u));text-shadow:0 1px 3px #200a03}
.pane button,.toolbar button,#tb-over-btn{background:transparent url('../assets/play/tarneeb/button-burgundy.webp') center/100% 100%;border:0;color:var(--ivory);font-weight:bold;text-shadow:0 1px 1px #300600;min-height:calc(44 * var(--u));padding:calc(6 * var(--u)) calc(10 * var(--u));font-size:calc(17 * var(--u));border-radius:calc(22 * var(--u))}
.pane .gold,.toolbar button,#tb-over-btn{background-image:url('../assets/play/tarneeb/button-ivory.webp');color:#5d1020;text-shadow:none}
.pane button:disabled{filter:brightness(.78);color:#e4cdab}
#tb-bids{gap:calc(3 * var(--u))}#tb-bids button{width:calc(41 * var(--u));padding:0;font-size:calc(18 * var(--u))}#tb-bids button[data-bid="0"]{font-size:calc(13 * var(--u))}
#tb-bids .cur,#tb-trump .cur{outline:calc(2 * var(--u)) solid #fff1bf;outline-offset:1px}
#tb-trump{transform:translateY(calc(-3 * var(--u)))}
#tb-trump .lbl{font-size:calc(10.5 * var(--u));white-space:nowrap}
#tb-trump button{width:calc(79 * var(--u));height:calc(44 * var(--u));padding:calc(4 * var(--u)) calc(1 * var(--u));font-size:calc(11.5 * var(--u));line-height:1.15;white-space:nowrap}
#tb-trump button[data-suit="2"]{width:calc(100 * var(--u))}
#tb-trump .red{color:#ffccd0}
#tb-play{gap:calc(10 * var(--u))}#tb-go{width:calc(225 * var(--u));height:calc(62 * var(--u));font-size:calc(20 * var(--u));line-height:1.05}#tb-hint{width:calc(115 * var(--u));height:calc(62 * var(--u));font-size:calc(24 * var(--u))}
.toolbar{position:absolute;top:calc(795 * var(--u));left:calc(48 * var(--u));right:calc(48 * var(--u));display:flex;gap:calc(15 * var(--u));justify-content:center;margin:0}
.toolbar button{flex:1;white-space:nowrap;font-size:calc(15 * var(--u));padding:calc(7 * var(--u)) calc(15 * var(--u));min-height:calc(39 * var(--u))}
#tb-over{position:absolute;z-index:8;inset:calc(188 * var(--u)) calc(20 * var(--u)) calc(134 * var(--u));display:flex;flex-direction:column;justify-content:center;align-items:center;gap:calc(24 * var(--u));background:linear-gradient(#670f23,#370b16);border:calc(3 * var(--u)) double #d7ad6e;border-radius:calc(26 * var(--u));padding:calc(20 * var(--u));box-shadow:0 8px 30px #20070aba;text-align:center}
#tb-over p{margin:0;font-size:calc(20 * var(--u));line-height:1.35;color:var(--ivory)}
.tally{width:100%;border-collapse:collapse;font-size:calc(14 * var(--u));font-variant-numeric:tabular-nums}
.tally td,.tally th{padding:calc(9 * var(--u)) calc(3 * var(--u));border-bottom:1px solid #ae775a}
.tally th:first-child,.tally td:first-child{text-align:left}.tally tr:last-child{font-size:calc(19 * var(--u));font-weight:bold;color:#ffe3ad}
#tb-over-btn{min-width:calc(190 * var(--u));font-size:calc(22 * var(--u));min-height:calc(54 * var(--u))}
.reading{max-width:780px;margin:auto;padding:28px 22px 50px;font-family:system-ui,sans-serif;font-size:15px;line-height:1.65;color:#e7d4bd}
.reading header{font-size:13px;margin-bottom:24px}.reading a{color:#f3c791}.reading h2{font-size:24px;color:#fff0d3}.reading ul{padding-left:22px}.reading li{margin:12px 0}.reading p{margin:18px 0}
#tb-status{flex-direction:column;gap:calc(3 * var(--u));font-size:calc(10.5 * var(--u));line-height:1.15;padding:calc(5 * var(--u)) calc(9 * var(--u))}
#tb-status::before{content:attr(data-heading);display:block;font-size:calc(23 * var(--u));line-height:1;font-weight:bold;letter-spacing:calc(.5 * var(--u));text-shadow:0 2px 1px #2c0710}
.hand .card{height:calc(80 * var(--u))}
.hand .card .r{font-size:calc(19 * var(--u))}
.hand .card .big{font-size:calc(34 * var(--u))}
.hand .card .court{height:calc(50 * var(--u));width:calc(31 * var(--u))}
.hand .card:has(.court) .big{font-size:calc(12 * var(--u))}
.controls{top:calc(730 * var(--u))}
#tb-go,#tb-hint{width:calc(168 * var(--u));height:calc(60 * var(--u));font-size:calc(23 * var(--u))}
#tb-go:disabled{font-size:calc(16 * var(--u))}
.hud::after{content:'';position:absolute;z-index:-1;left:0;right:0;top:calc(45 * var(--u));height:calc(33 * var(--u));background:linear-gradient(#8e2433,#4a0715);border:calc(1.5 * var(--u)) solid var(--brass);border-radius:calc(16 * var(--u));box-shadow:inset 0 0 0 2px #3c170d,0 3px 4px #240b06}
.hud>div:nth-child(n+3){background:none;border:0;box-shadow:none}
.hud>div:nth-child(4){border-radius:0;border-left:1px solid #cba26380;border-right:1px solid #cba26380}
.seat.n>div:has(.call){position:absolute;top:calc(57 * var(--u));left:calc(-25 * var(--u));width:calc(60 * var(--u))}
.seat.n>div:last-child{position:absolute;top:calc(57 * var(--u));right:calc(-25 * var(--u));width:calc(60 * var(--u))}
.trick{top:calc(94 * var(--u));height:calc(158 * var(--u))}
.trick .card{width:calc(56 * var(--u));height:calc(84 * var(--u))}
.trick .card .court{width:calc(36 * var(--u));height:calc(53 * var(--u))}
.trick .s1{transform:translate(-50%,-50%) rotate(13deg)}
.trick .s3{transform:translate(-50%,-50%) rotate(-13deg)}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
