:root{font-family:Vazirmatn,Tahoma,Arial,sans-serif;color-scheme:dark;--bg:#15120e;--panel:#211d18;--raised:#2c2720;--ink:#f5efe2;--muted:#b8b0a0;--line:#423c32;--green:#4ade80;--gold:#e8c189;--danger:#f29487;--felt:#173b30;--card:#fcf7ec;--card-ink:#202c35;--red:#b6313c}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-size:15px;line-height:1.7}button,input{font:inherit}button{cursor:pointer;touch-action:manipulation;border:1px solid var(--line);background:var(--raised);color:var(--ink);border-radius:12px;min-height:44px;padding:10px 18px;transition:background .15s,transform .15s}button:disabled{cursor:default;opacity:.48}button,input{outline-offset:4px}button:focus-visible,input:focus-visible{outline:2px solid var(--green)}button:hover:not(:disabled){background:#383128}button.primary{color:#10251a;background:var(--green);border-color:var(--green);font-weight:700}button.primary:hover:not(:disabled){background:#86efac}button.quiet{background:transparent}button.danger{color:var(--danger)}.icon-button{padding:0;width:44px;font-size:25px}.muted{color:var(--muted)}h1,h2,h3,p{margin:0}h1{font-size:clamp(28px,4vw,42px);line-height:1.5}h2{font-size:20px}svg{width:22px;height:22px;fill:currentColor;vertical-align:middle}.brand-mark{width:42px;height:42px;border:1px solid var(--gold);color:var(--gold);border-radius:14px;display:grid;place-items:center;font-size:24px;font-weight:700;font-family:Georgia,serif}
.shell{width:100%;max-width:1200px;margin:auto;padding:22px 28px 30px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:25px}.brand{display:flex;align-items:center;gap:12px}.brand small{display:block;color:var(--muted);font-size:12px}.top-actions{display:flex;align-items:center;gap:10px}.connection{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:7px}.dot{width:7px;height:7px;border-radius:50%;background:var(--gold)}.dot.online{background:var(--green)}.hero{display:grid;grid-template-columns:1fr auto;align-items:center;gap:30px;padding:24px 0 36px;border-bottom:1px solid var(--line)}.eyebrow{font-size:12px;letter-spacing:.1em;color:var(--gold);margin-bottom:6px}.hero p{max-width:500px;color:var(--muted);margin-top:12px}.hero-art{display:flex;direction:ltr;padding:20px 28px}.hero-art .card{position:relative;margin-left:-35px;transform:rotate(-12deg)}.hero-art .card:nth-child(2){transform:translateY(-12px)}.hero-art .card:nth-child(3){transform:rotate(12deg)}.hero-art .card:first-child{margin-left:0}.lobby-grid{display:grid;grid-template-columns:310px 1fr;gap:30px;margin-top:28px}.create-panel{align-self:start;padding:22px;background:var(--panel);border:1px solid var(--line);border-radius:20px}.create-panel label{display:block;margin:18px 0 7px}.create-panel input[type=text]{width:100%;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:10px;min-height:48px;padding:10px 12px}.create-panel .checkbox{display:flex;gap:9px;align-items:center;margin:15px 0}.checkbox input{accent-color:var(--green);width:18px;height:18px}.create-panel button{width:100%;margin-top:8px}.small{font-size:12px}.section-title{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:16px}.table-list{display:grid;gap:12px}.table-row{display:flex;justify-content:space-between;gap:15px;align-items:center;border-bottom:1px solid var(--line);padding:18px 0}.table-row:first-child{padding-top:3px}.table-row h3{font-size:16px}.table-row p{font-size:12px;color:var(--muted);margin-top:5px}.own-tag{color:var(--green);font-size:11px;margin-inline-start:8px}.empty{padding:32px 20px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:16px}.empty p{margin-top:8px}.boot{min-height:65vh;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:16px;padding:24px}.boot h1{font-size:24px}.boot p{color:var(--muted);max-width:450px}.boot .brand-mark{width:58px;height:58px}
.match-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.match-head h1{font-size:21px}.scoreboard{display:flex;align-items:center;gap:18px;border:1px solid var(--line);border-radius:14px;padding:7px 18px}.score-team{text-align:center;min-width:60px}.score-team small{color:var(--muted);font-size:11px;display:block}.score-team strong{font-size:23px;font-variant-numeric:tabular-nums}.score-divider{color:var(--line);font-size:24px}.match-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;color:var(--muted);font-size:13px;margin-bottom:12px}.trump-label{color:var(--gold);display:flex;align-items:center;gap:7px}.board{position:relative;isolation:isolate;display:grid;grid-template-columns:minmax(85px,1fr) minmax(180px,2fr) minmax(85px,1fr);grid-template-rows:86px minmax(195px,1fr) 84px;grid-template-areas:". top ." "left center right" ". bottom .";gap:8px;min-height:400px;max-width:880px;margin:auto}.board:before{content:"";position:absolute;inset:42px 20px 40px;border:5px solid #594835;outline:1px solid #897254;border-radius:42%;background:var(--felt);z-index:-1}.board:after{content:"";position:absolute;inset:60px 40px;border:1px solid #527c693d;border-radius:42%;z-index:-1}.seat{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;min-width:0;position:relative}.seat.top{grid-area:top}.seat.right{grid-area:right}.seat.left{grid-area:left}.seat.bottom{grid-area:bottom}.avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:var(--raised);border:2px solid var(--line);font-weight:700;position:relative}.seat.is-turn .avatar{border-color:var(--green);outline:4px solid #4ade801c}.avatar .dot{position:absolute;bottom:-1px;right:0;outline:3px solid var(--bg)}.seat-name{max-width:140px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px;font-weight:600}.seat-meta{font-size:11px;color:var(--muted)}.seat .king{color:var(--gold)}.empty-seat{border:1px dashed #73897e;min-width:78px;min-height:64px;background:#17382ddd;font-size:12px;padding:8px}.ready-label{color:var(--green)}.table-center{grid-area:center;position:relative;display:flex;align-items:center;justify-content:center;text-align:center;min-width:0;padding:5px}.center-info{max-width:300px}.center-info h2{font-size:19px;margin-bottom:8px}.center-info p{font-size:12px;color:#c1d3c6}.center-info button{margin-top:16px}.trump-picker{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:18px}.trump-picker button{background:var(--card);color:var(--card-ink);width:52px;height:56px;padding:0}.trump-picker button.red{color:var(--red)}.trump-picker svg{width:32px;height:32px}.trick{position:relative;width:220px;height:215px;direction:ltr}.trick-card{position:absolute;left:calc(50% - 31px);top:calc(50% - 46px);animation:card-in .18s ease-out}.trick-card.pos-0{transform:translateY(35px)}.trick-card.pos-1{transform:translateX(47px) rotate(8deg)}.trick-card.pos-2{transform:translateY(-35px)}.trick-card.pos-3{transform:translateX(-47px) rotate(-8deg)}.card{display:inline-flex;flex-direction:column;position:relative;align-items:flex-start;justify-content:space-between;flex-shrink:0;width:72px;height:105px;padding:6px 8px;border:1px solid #c9c1b0;border-radius:9px;background:var(--card);color:var(--card-ink);font-weight:700;font-family:Georgia,serif;line-height:1.15;direction:ltr}.card.red{color:var(--red)}.card .corner{display:flex;flex-direction:column;align-items:center;font-size:20px}.card .corner svg{width:15px;height:15px}.card .pip{align-self:center;position:absolute;inset:35px 0 auto;display:flex;justify-content:center}.card .pip svg{width:32px;height:32px}.card .lower{transform:rotate(180deg);align-self:flex-end;opacity:.8;font-size:12px}.trick .card{width:63px;height:91px}.trick .card .pip{inset:30px 0 auto}.trick .card .pip svg{width:26px;height:26px}.hand-wrap{margin:16px auto 0;max-width:900px}.hand-caption{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;color:var(--muted);min-height:30px;padding:0 8px}.hand{display:flex;justify-content:center;direction:ltr;isolation:isolate;padding:22px 25px 8px;min-height:145px}.hand .card{margin-left:-24px;min-height:105px;transition:transform .15s,opacity .15s;box-shadow:-2px 0 4px #0002}.hand .card:first-child{margin-left:0}.hand .card:not(:disabled):hover,.hand .card:focus-visible{transform:translateY(-13px);z-index:2;background:var(--card)}.hand .card:disabled{opacity:.48}.hand .card.is-trump{border-bottom:4px solid var(--gold)}.hand .card:focus-visible{outline:3px solid var(--green)}.hand-empty{padding:12px;text-align:center;color:var(--muted);font-size:13px}.round-score{font-size:30px;color:var(--gold);margin:8px 0}.clock{font-variant-numeric:tabular-nums;color:var(--gold)}.status-line{min-height:30px;color:var(--muted);font-size:12px;text-align:center;margin:6px 0}.match-footer{display:flex;justify-content:center;gap:12px;margin-top:14px}.match-footer button{font-size:12px}
dialog{color:var(--ink);background:var(--panel);border:1px solid var(--line);border-radius:20px;max-width:460px;width:calc(100% - 32px);padding:24px;max-height:85vh;overflow:auto}dialog::backdrop{background:#090b09b8}.dialog-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.rules{padding-inline-start:24px;color:var(--muted)}.rules li{margin:12px 0}.friend-row{display:flex;align-items:center;gap:12px;width:100%;text-align:start;margin-top:10px}.friend-row .friend-info{flex:1}.friend-row small{display:block;color:var(--muted);font-size:11px}.friend-row .invite-arrow{color:var(--green)}#notice{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);padding:12px 20px;background:var(--raised);border:1px solid var(--gold);border-radius:12px;max-width:calc(100% - 32px);z-index:20;text-align:center;font-size:13px}#notice[hidden]{display:none}
@keyframes card-in{from{opacity:.3}to{opacity:1}}
@media(max-width:700px){.shell{padding:14px 12px 18px}.topbar{margin-bottom:14px}.top-actions{gap:6px}.brand small{display:none}.brand strong{font-size:13px}.hero{gap:15px;padding:18px 0 24px}.hero-art{padding:10px 12px}.hero-art .card{width:55px;height:80px;margin-left:-31px}.hero-art .card .pip{inset:28px 0 auto}.hero-art .card .pip svg{width:24px;height:24px}.hero p{font-size:13px}.lobby-grid{grid-template-columns:1fr;gap:24px;margin-top:20px}.create-panel{padding:18px}.create-panel label{margin-top:12px}.match-head{gap:8px}.match-head h1{font-size:17px}.scoreboard{gap:8px;padding:5px 10px}.score-team{min-width:48px}.score-team strong{font-size:20px}.board{grid-template-columns:78px minmax(120px,1fr) 78px;grid-template-rows:76px 170px 76px;min-height:338px;gap:0}.board:before{inset:32px 3px 32px;border-width:4px}.board:after{inset:45px 15px}.trick{width:174px;height:170px}.trick .card{width:53px;height:78px;padding:5px}.trick .card .pip{inset:27px 0 auto}.trick-card{left:calc(50% - 26px);top:calc(50% - 39px)}.trick-card.pos-0{transform:translateY(27px)}.trick-card.pos-1{transform:translateX(35px) rotate(8deg)}.trick-card.pos-2{transform:translateY(-27px)}.trick-card.pos-3{transform:translateX(-35px) rotate(-8deg)}.avatar{width:38px;height:38px}.seat-name{max-width:85px;font-size:11px}.seat-meta{font-size:10px}.center-info h2{font-size:15px}.center-info p{font-size:11px}.center-info button{padding:8px 11px;font-size:12px}.trump-picker{gap:5px}.trump-picker button{width:44px;height:48px}.trump-picker svg{width:25px;height:25px}.hand{padding:17px 9px 4px;min-height:110px}.hand .card{width:53px;height:82px;min-height:82px;padding:5px 6px;margin-left:-29px}.hand .card .corner{font-size:17px}.hand .card .corner svg{width:12px;height:12px}.hand .card .pip{inset:29px 0 auto}.hand .card .pip svg{width:23px;height:23px}.hand .card .lower{font-size:10px}.hand-caption{font-size:10px}.hand-wrap{margin-top:6px}.match-toolbar{font-size:11px}.connection{font-size:10px}.brand-mark{width:34px;height:34px}.status-line{font-size:11px}.match-footer{margin-top:8px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
html[data-theme=light]{color-scheme:light;--bg:#f6f1e7;--panel:#fdfaf4;--raised:#efe8da;--ink:#28251f;--muted:#71695b;--line:#d5ccbb;--green:#15803d;--gold:#916120;--danger:#b42318}.board .center-info,.board .center-info h2{color:#f5efe2}.board .center-info button.primary{color:#10251a;background:#4ade80}
.hand .card:disabled{opacity:1}.hand .card.illegal{opacity:.45}.match-head>div:first-child{min-width:0;flex:1}.match-head h1,.table-row h3{overflow-wrap:anywhere}.table-row>div:first-child{min-width:0;flex:1}
@media(max-width:700px){.hand .card{width:clamp(42px,13vw,53px);margin-left:clamp(-31px,-7vw,-24px)}.hand .card:first-child{margin-left:0}}
/* Physical seat positions must agree with the positions used for cards.
   The next player is on the viewer's right (anticlockwise play). */
.board{direction:ltr}.seat,.center-info{direction:rtl}
