/* Copper / Petrol and Amber / Indigo. Contrast is measured, not inferred from hue. */
body[data-theme=iran]{--bg:#0c2432;--surface:#133747;--soft:#1d4655;--ink:#fff5e6;--muted:#c4d9df;--accent:#f0b599;--accent2:#92ddd0;--onaccent:#172b36;--line:#8aafb459;--evo-surface:#123440;--evo-ink:#fff5e6;--evo-wash:#1b4250;--evo-gold:#f0b599;--stage-hi:#f9d0b4;--stage-lo:#e9a788;--stage-btn-ink:#172b36;--stage-edge:#ffd7ba;--stage-depth:#965c49;--stage-felt:#153e49;--stage-rim:#deab7f}
body[data-theme=modern]{--bg:#111d35;--surface:#1c2e4c;--soft:#29415e;--ink:#f7f5ed;--muted:#c6d9e9;--accent:#f4cb83;--accent2:#98deee;--onaccent:#182c43;--line:#9bb3cf59;--evo-surface:#1b2d48;--evo-ink:#f7f5ed;--evo-wash:#29415e;--evo-gold:#f4cb83;--stage-hi:#ffe0a7;--stage-lo:#eeb762;--stage-btn-ink:#182c43;--stage-edge:#ffebbd;--stage-depth:#987034;--stage-felt:#203655;--stage-rim:#91becb}
.button.primary,.salon-play.salon-entry,[data-theme=modern] .salon-play.salon-entry{background:linear-gradient(125deg,var(--stage-hi),var(--stage-lo));color:var(--stage-btn-ink);border:1px solid var(--stage-edge);box-shadow:inset 0 1px 0 #fff8,0 3px 0 var(--stage-depth),0 8px 16px #0003;border-radius:16px;text-shadow:none;transition:transform .14s,box-shadow .14s}
.salon-play b,.salon-play small{color:var(--stage-btn-ink)}.salon-play-icon{border-color:#31455166;background:#3145510d}.button.primary:active:not(:disabled),.salon-play:active{transform:translateY(2px);box-shadow:inset 0 1px 0 #fff5,0 1px 0 var(--stage-depth),0 3px 9px #0002}.button.secondary{background:linear-gradient(125deg,var(--soft),var(--surface));color:var(--ink);border:1px solid #96c8cb99;box-shadow:inset 0 1px 0 #defff012,0 4px 8px #0002;border-radius:15px}.button.quiet{color:var(--accent2)}.button:focus-visible,button:focus-visible{outline:3px solid var(--accent2);outline-offset:3px}
.round{background:var(--surface);border-color:#8fafbd88;color:var(--ink);box-shadow:inset 0 1px 0 #ffffff0e,0 4px 10px #0002}.salon-home{background:transparent}#app{background:radial-gradient(ellipse at 10% 10%,#447e8630,transparent 60%),var(--bg)}.salon-cover.mirror-cover{border-bottom-color:var(--line)}.mirror-entry{border-color:var(--stage-rim);background:radial-gradient(ellipse at 5% 0%,#467b8355,transparent 65%),linear-gradient(110deg,#193d4a,#112436)}.mirror-entry em{color:var(--accent)}
/* All available WebView space becomes the table; system bars hide only in-game. */
body.on-table #app{width:100%;max-width:none;height:100dvh;min-height:0;background:var(--stage-felt);box-shadow:none}
body.on-table #topbar{position:absolute;inset:0 0 auto;height:62px;min-height:0;padding:9px 10px;z-index:10;background:transparent!important;pointer-events:none}
body.on-table #topbar>.round{pointer-events:auto;width:42px;height:42px;min-width:42px;border-radius:14px;background:#102c3be8}
body.on-table .table-heading{position:absolute;top:65px;left:50%;transform:translateX(-50%);width:auto;max-width:65%;font-size:11px;line-height:1.5;color:var(--muted);pointer-events:none;white-space:nowrap}
body.on-table .table-heading small{display:none}body.on-table #screen{height:100%;width:100%;overflow:hidden;flex:1}body.on-table #scenery{display:none}
#screen .stage-table.game{position:relative;width:100%;height:100%;min-height:0;padding:0;display:block;isolation:isolate;background:radial-gradient(ellipse at 49% 37%,#41776d30,transparent 69%),repeating-linear-gradient(45deg,#c2ddd803 0 1px,transparent 1px 4px),linear-gradient(150deg,#102e3a,var(--stage-felt) 45%,#0d2638)!important}
#screen .stage-table.game:before{content:'';position:absolute;inset:5px 5px 10px;border:1px solid color-mix(in srgb,var(--stage-rim) 70%,transparent);border-radius:28px;box-shadow:inset 0 0 0 3px #091b26,0 0 0 3px #091b26, inset 0 0 0 4px #c3a77e25;pointer-events:none;z-index:-1}
#screen .stage-table.game .scorebar{position:absolute;top:6px;left:50%;transform:translateX(-50%);width:min(268px,calc(100% - 118px));height:55px;min-height:0;padding:3px 8px;z-index:8;gap:7px;background:linear-gradient(110deg,#0b2333e8,#16394be8)!important;border:1px solid #adc8c14d;border-radius:17px;box-shadow:inset 0 1px 0 #effff610,0 6px 13px #001b2444;overflow:visible}
.stage-table.game .team-score{font-size:11px;line-height:1.1;min-width:34px;white-space:nowrap}.stage-table.game .team-score b{font-size:22px;line-height:1.2;color:#fff5e6}.stage-table.game .team-score small{font-size:9px;line-height:1.5;color:#c7dbe0}.stage-table.game .salon-trick-pips{display:none}.stage-table.game .trump{display:grid;grid-template-columns:auto auto;align-items:center;justify-content:center;column-gap:4px;font-size:12px;line-height:1.2;white-space:nowrap}.stage-table.game .trump>.suit{font-size:24px;line-height:1}.stage-table.game .trump small{grid-column:1/-1;font-size:9px;height:20px;min-height:0;line-height:1.5}.stage-table.game .mirror-table-goal{padding:0 7px;min-height:20px;font-size:10px}
#screen .stage-table.game .arena{position:absolute;inset:0 0 calc(var(--stage-hand) + var(--stage-controls) + var(--stage-power));min-height:0;width:100%;background:transparent!important;isolation:auto;overflow:visible}
#screen .stage-table.game .arena:before{inset:0;border:0!important;box-shadow:none!important;background:none!important;border-radius:0}
#screen .stage-table.game .arena-mark{display:flex;width:100px;height:100px;left:calc(50% - 50px);top:calc(56% - 50px);opacity:.10;color:var(--stage-rim)}.stage-table.game .arena-mark svg{width:100%;height:100%}
.stage-table.game .seat{width:76px;z-index:4}.stage-table.game .seat-2{top:97px;left:calc(50% - 38px)}.stage-table.game .seat-1{right:9px;top:47%}.stage-table.game .seat-3{left:9px;top:47%}.stage-table.game .seat .portrait,.stage-table.game .seat .avatar-human{width:48px;height:48px;border-radius:50%;border:1px solid #d2b58a;box-shadow:0 0 0 3px #0b2532,0 5px 15px #0005}.stage-table.game .seat.active .portrait,.stage-table.game .seat.active .avatar-human{outline:none;box-shadow:0 0 0 3px #0b2532,0 0 0 5px var(--accent2),0 0 22px #93deca33}.stage-table.game .seat .name{font-size:13px;line-height:1.5;background:#092735d9;color:#fff2df;padding:2px 5px;border-radius:7px;margin-top:5px;max-width:100%}.stage-table.game .seat .role{font-size:10px;line-height:1.5;color:#c7dade;margin-top:3px}.stage-table.game .seat .mini-hand{display:none}.stage-table.game .seat .crown{top:-13px;right:9px;color:var(--accent)}
.stage-table.game .trick:empty:after{display:none}.stage-table.game .trick-card{width:var(--stage-trick-w);height:var(--stage-trick-h);left:calc(50% - var(--stage-trick-w)/2);top:calc(59% - var(--stage-trick-h)/2);border-radius:8px;box-shadow:inset 0 0 0 1px #d7cab5,0 2px 0 #aca391,0 5px 0 #726e60,0 10px 18px #0005}
.stage-table.game .trick-card.p0{transform:translateY(var(--stage-spread-y)) rotate(-6deg)}.stage-table.game .trick-card.p2{transform:translateY(calc(-1 * var(--stage-spread-y))) rotate(4deg)}.stage-table.game .trick-card.p1{transform:translateX(var(--stage-spread-x)) rotate(9deg)}.stage-table.game .trick-card.p3{transform:translateX(calc(-1 * var(--stage-spread-x))) rotate(-9deg)}.stage-table.game .trick-card .corner{font-size:19px;line-height:1.08}.stage-table.game .trick-card .corner .pip{font-size:18px}.stage-table.game .trick-card.won{outline:2px solid var(--accent2);outline-offset:2px}
.stage-table.game .turn-label{bottom:10px;max-width:92%;font-size:13px!important;line-height:1.7;padding:6px 13px;background:#102c3ce8;color:#e6f4f2;border:1px solid #c5d9d466;box-shadow:0 5px 12px #0002}.stage-table.game .turn-label.salon-turn-active{background:#dcf1e6;color:#123a39;border-color:#caffea;box-shadow:0 4px 12px #0003}
#screen .stage-table.game .hand-zone{position:absolute;inset:auto 0 var(--stage-controls);height:var(--stage-hand);padding:0;border:0;background:linear-gradient(0deg,#0a2439cc,#0c2c3a33 85%,transparent)!important;z-index:5;overflow:visible}.stage-table.game .hand-caption{height:var(--stage-caption);font-size:12px;line-height:1.5;padding:0 9px;color:#d8e9e6;align-items:center;display:flex;justify-content:center}.stage-table.game .hand-cards{height:calc(var(--stage-hand) - var(--stage-caption));width:100%;perspective:1000px}.stage-table.game .hand-card{width:var(--stage-card-w);height:var(--stage-card-h);border-radius:7px;transform:rotate(0);transform-origin:center bottom;touch-action:none;box-shadow:inset 0 0 0 1px #d3cab5,0 1px 0 #9b927e,0 3px 0 #b8ac95,0 7px 14px #0006}.stage-table.game .hand-card.row0{top:0}.stage-table.game .hand-card.row1{top:var(--stage-row)}.stage-table.game .hand-card .corner{font-size:19px;line-height:1.05}.stage-table.game .hand-card .corner .pip{font-size:17px}.stage-table.game .hand-card.selected{transform:translateY(-10px)!important;box-shadow:0 0 0 3px var(--accent2),0 0 18px #98e1d633,0 12px 18px #0006!important}.stage-table.game .hand-card.dimmed{opacity:.72;filter:brightness(.8) saturate(.6)}
#screen .stage-table.game .controls{position:absolute;inset:auto 0 0;height:var(--stage-controls);padding:6px 12px 10px;gap:10px;background:linear-gradient(0deg,#071d30f5,#102e3b88)!important;z-index:6;border:0}.stage-table.game .controls .button{min-height:46px;font-size:15px;line-height:1.5;border-radius:15px}.stage-table.game .controls .round{min-width:48px;height:47px;border-radius:15px;background:#234753;color:#d8eee9;border:1px solid #8fc7ca99}.stage-table.game .controls .button:disabled{background:#294753;color:#cededf;border:1px solid #7e9fae88;box-shadow:inset 0 1px 0 #ffffff0d}
#screen .stage-table.game .power-tray{position:absolute;inset:auto 0 calc(var(--stage-hand) + var(--stage-controls));height:var(--stage-power);min-height:0;max-height:var(--stage-power);padding:5px 12px;z-index:6;background:linear-gradient(90deg,#0d293733,#173b47dd,#0d293733)!important;border:0;gap:7px}.stage-table.game .power-control{background:#254957;border:1px solid #93b7b977;border-radius:13px}.stage-table.game .power-control b{font-size:13px;color:#f5efde}.stage-table.game .power-control small{font-size:11px;color:#cde4e2}.stage-table.game .arcana-energy{position:absolute;inset:62px 12px auto;height:28px;padding:2px 7px;z-index:6;background:transparent!important;border:0;font-size:11px;color:#a7ded4}.stage-table.arcana-table .seat-2{top:105px}.stage-table.game .salon-last-trick{position:absolute;inset:auto 8px 45px auto;max-width:105px;font-size:10px;background:#102d3ad9;border-color:#90b4b666;min-height:31px;padding:4px 7px;z-index:5}.stage-table.game .salon-last-trick svg{width:14px}.stage-table.game .goal-banner{position:absolute;inset:64px 16px auto;height:29px;z-index:6;background:#122b39;border:1px solid #90b5b266;font-size:12px}.stage-table.stage-puzzle .seat-2{top:112px}.stage-table.game .timer-bar{position:absolute;inset:60px 68px auto;height:3px;z-index:10}
.stage-table.stage-mirror:after{content:'✧';position:absolute;top:77px;left:calc(50% - 9px);color:var(--accent2);font-size:18px;pointer-events:none}.stage-hakem-note{color:var(--accent2);font-size:14px;line-height:1.8;text-align:center}
.stage-flying-card{position:fixed;z-index:1000;pointer-events:none;border-radius:8px;box-shadow:0 18px 24px #0006;will-change:transform}
.stage-table.stage-compact .seat .portrait,.stage-table.stage-compact .seat .avatar-human{width:36px;height:36px}.stage-table.stage-compact .seat .name{font-size:12px}.stage-table.stage-compact .seat .role{font-size:9px}.stage-table.stage-compact .seat-2{top:88px}.stage-table.stage-compact .hand-caption{font-size:11px}.stage-table.stage-compact .turn-label{font-size:12px!important;padding-block:4px;bottom:6px}.stage-table.stage-compact .trick-card .corner{font-size:16px}.stage-table.stage-compact .trick-card .corner .pip{font-size:15px}
.stage-table.stage-short .seat{width:61px}.stage-table.stage-short .seat-1{right:5px;top:48%}.stage-table.stage-short .seat-3{left:5px;top:48%}.stage-table.stage-short .seat-2{left:calc(50% - 64px);width:128px;top:86px;display:flex;align-items:center;justify-content:center;gap:7px;flex-direction:row}.stage-table.stage-short .seat-2 .role{display:none}.stage-table.stage-short .seat-2 .name{max-width:83px;margin:0;font-size:11px}.stage-table.stage-short .seat-2 .crown{top:-10px;right:6px}.stage-table.stage-short .seat-2 .portrait{width:30px;height:30px}.stage-table.stage-short .hand-card .corner{font-size:16px}.stage-table.stage-short .hand-card .corner .pip{font-size:15px}.stage-table.stage-short .controls{padding:3px 9px 6px;gap:7px}.stage-table.stage-short .controls .button{font-size:13px;min-height:44px}.stage-table.stage-short .controls .round{min-width:42px;height:44px}.stage-table.stage-short .salon-last-trick{bottom:36px;font-size:9px;max-width:89px;min-height:27px}
.stage-table.stage-short.arcana-table .seat-2{top:94px}.stage-table.stage-short.arcana-table .trick-card{top:calc(66% - var(--stage-trick-h)/2)}.stage-table.stage-short.arcana-table .power-control b{font-size:11px}.stage-table.stage-short.arcana-table .power-control small{font-size:10px}.stage-table.stage-short .arcana-energy{font-size:10px;height:25px;inset-inline:5px}.stage-table.stage-short.stage-puzzle .seat-2{top:102px}
@media(max-width:359px){.stage-table.game .seat{width:64px}.stage-table.game .seat-1{right:5px}.stage-table.game .seat-3{left:5px}.stage-table.game .team-score{font-size:10px}.stage-table.game .team-score b{font-size:19px}.stage-table.game .trump{font-size:10px}.stage-table.game .trump>.suit{font-size:21px}.stage-table.game .scorebar{gap:3px!important;padding-inline:6px!important}.stage-table.game .trump small{font-size:9px}.stage-table.game .hand-caption{font-size:10px}}
@media(min-width:600px){.stage-table.game .seat{width:100px}.stage-table.game .seat .portrait,.stage-table.game .seat .avatar-human{width:62px;height:62px}.stage-table.game .seat .name{font-size:17px}.stage-table.game .seat .role{font-size:12px}.stage-table.game .seat-1{right:5%}.stage-table.game .seat-3{left:5%}.stage-table.game .seat-2{left:calc(50% - 50px)}.stage-table.game .controls{padding-inline:max(20px,calc((100% - 620px)/2))!important}}
.reduced .button.primary,.reduced .salon-play{transition:none}@media(prefers-reduced-motion:reduce){.button.primary,.salon-play{transition:none}}
.stage-table.game.stage-short .seat-2{width:128px}.stage-title-hidden{display:none!important}

.stage-table.game.stage-compact .seat-2{left:calc(50% - 64px);width:128px;top:86px;display:flex;align-items:center;justify-content:center;gap:7px;flex-direction:row}.stage-table.game.stage-compact .seat-2 .role{display:none}.stage-table.game.stage-compact .seat-2 .name{max-width:83px;margin:0;font-size:11px}.stage-table.game.stage-compact .seat-2 .portrait{width:30px;height:30px}.stage-table.game.stage-compact.arcana-table .seat-2{top:94px}.stage-table.game.stage-compact.arcana-table .trick-card{top:calc(64.7% - var(--stage-trick-h)/2)}.stage-table.game.stage-compact.stage-puzzle .seat-2{top:102px}
