/* Jackaroo FX: cards, characters, board effects. Loaded after jackaroo.css and only overrides presentation. */

/* ---------- Cards: real faces, corner indices, a back for the deal flip ---------- */
.fx .hand{gap:0;padding:34px 0 14px;perspective:900px}
.fx .playing-card{--r:0deg;--arc:0px;--lift:0px;width:86px;height:122px;margin:0 -6px;padding:0;background:none;border:0;box-shadow:none;transform:translateY(calc(var(--arc) + var(--lift))) rotate(var(--r));transform-origin:50% 120%;transition:transform .35s cubic-bezier(.2,1.4,.4,1),filter .3s;z-index:1}
.fx .playing-card:hover:not(:disabled){--lift:-14px;z-index:3}
.fx .playing-card.selected{--lift:-26px;outline:0;z-index:4}
.fx .playing-card.unplayable{opacity:1;filter:grayscale(.85) brightness(.92)}
/* Explicit sizes: inset:0 alone collapses to zero height inside a <button> in Chrome. */
.pc-inner{position:absolute;top:0;left:0;width:100%;height:100%;transform-style:preserve-3d;will-change:transform}
.pc-face{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:11px;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.pc-front{background:linear-gradient(160deg,#fffef9,#f3efe2);border:1px solid #d9d2bd;box-shadow:0 6px 14px #12352c22,inset 0 0 0 4px #fffef9,inset 0 0 0 5px #e7dfc8;color:#1f3a33;display:grid;place-items:center}
.playing-card.red .pc-front,.fx-ghost.red{color:#b8402f}
.pc-back{transform:rotateY(180deg);background:#173f39;border:1px solid #0d2826;box-shadow:inset 0 0 0 4px #e8dfc6,inset 0 0 0 6px #173f39,inset 0 0 0 7px #c9b98f}
.pc-back::before{content:"J";position:absolute;inset:0;display:grid;place-items:center;font:800 34px/1 Georgia;color:#dced88;background:repeating-linear-gradient(45deg,transparent 0 6px,#ffffff0c 6px 7px);border-radius:inherit}
.pc-corner{position:absolute;display:flex;flex-direction:column;align-items:center;line-height:1;font-family:Georgia,serif}
.pc-corner b{font-size:19px;font-weight:700}.pc-corner i{font-style:normal;font-size:14px;margin-top:2px}
.pc-corner.tl{top:8px;left:8px}.pc-corner.br{bottom:8px;right:8px;transform:rotate(180deg)}
.pc-pip{font-size:44px;line-height:1}.pc-pip.ace{font-size:58px;filter:drop-shadow(0 3px 0 #0000000f)}
.pc-art{width:46px;height:46px;fill:currentColor;opacity:.92}
.fx .playing-card .pc-tag{position:absolute;bottom:-20px;right:auto;left:0;right:0;text-align:center;font:700 10px Arabic;color:#5d7a3c}
.fx-myturn .playing-card:not(.unplayable):not(:disabled) .pc-front{box-shadow:0 6px 14px #12352c22,inset 0 0 0 4px #fffef9,inset 0 0 0 5px #e7dfc8,0 0 0 2px #b6d45c,0 0 18px #c6e36b88}
.fx .playing-card.selected .pc-front{box-shadow:0 18px 26px #12352c33,inset 0 0 0 4px #fffef9,inset 0 0 0 5px #e7dfc8,0 0 0 3px #668343}
.fx-myturn{box-shadow:0 0 0 2px #c6e36b,0 10px 40px #9bc33a33;transition:box-shadow .4s}
.fx-ghost{position:fixed;z-index:60;pointer-events:none;border-radius:11px}

/* ---------- Pile in the middle of the board ---------- */
.fx #lastCard{display:none}
.fx-pile{position:relative;width:44px;height:60px;margin:4px auto}
.fx-mini{position:absolute;inset:0;border-radius:6px;background:linear-gradient(160deg,#fffef9,#eee8d6);border:1px solid #cfc6ad;box-shadow:0 4px 10px #0006;color:#1f3a33;display:flex;flex-direction:column;align-items:center;justify-content:center;font-family:Georgia,serif;line-height:1;transform:rotate(var(--rot,0deg))}
.fx-mini b{font-size:18px}.fx-mini i{font-style:normal;font-size:18px}
.fx-mini.red{color:#b8402f}
.fx-pile.burning .fx-mini:last-child{animation:burn 1.1s ease-out forwards}
@keyframes burn{0%{filter:none}30%{filter:sepia(1) saturate(4) hue-rotate(-20deg) brightness(1.2);box-shadow:0 0 24px #ff7a00}100%{filter:sepia(1) brightness(.25);opacity:.25;transform:rotate(var(--rot)) scale(.8) translateY(-8px)}}

/* ---------- Board overlay ---------- */
.fx-board{position:absolute;inset:0;width:100%;height:auto;pointer-events:none;overflow:visible}
.fx-timer{transition:stroke-dashoffset .2s linear,stroke .4s}
.fx-halo{transform-box:fill-box;transform-origin:center;animation:halo 1.6s ease-in-out infinite}
@keyframes halo{0%,100%{transform:scale(.92);stroke-opacity:.9}50%{transform:scale(1.08);stroke-opacity:.35}}
.fx-pop{font:800 30px Kufi,Arial;text-anchor:middle;paint-order:stroke;stroke:#0b2725;stroke-width:6px;stroke-linejoin:round}
.board-stone{cursor:default}
.board-stone:hover .marble{filter:brightness(1.15)}

/* Big "your turn" banner across the board */
.fx-banner{position:absolute;inset:44% -2%;z-index:5;pointer-events:none;display:flex;flex-direction:column;align-items:center;justify-content:center;background:linear-gradient(90deg,transparent,#143e38f2 18%,#143e38f2 82%,transparent);color:#dced88}
.fx-banner strong{font:800 clamp(34px,5vw,56px)/1.3 Kufi;text-shadow:0 4px 0 #0b2725}
.fx-banner span{font-size:13px;color:#d6e6c0}

/* ---------- Characters on the player cards ---------- */
.fx .player{display:grid;grid-template-columns:44px minmax(0,1fr);column-gap:10px;align-items:center;position:relative;transition:transform .3s,box-shadow .3s}
.fx .player>*:not(.fx-avwrap):not(.fx-fan){grid-column:2}
.fx-avwrap{grid-row:1/span 4;width:44px;height:44px;border-radius:50%;overflow:hidden;box-shadow:0 0 0 2px var(--seat-color),0 4px 10px #0002;background:#fff}
.fx-av{display:block;width:100%;height:100%}
.fx .player.turn{transform:translateY(-3px)}
.fx .player.turn .fx-avwrap{animation:avpulse 1.2s ease-in-out infinite}
@keyframes avpulse{50%{box-shadow:0 0 0 4px var(--lime),0 0 18px var(--lime)}}
.fx-fan{position:absolute;top:-10px;left:10px;display:flex;direction:ltr}
.fx-fan i{width:12px;height:17px;margin-left:-6px;border-radius:2px;background:#173f39;border:1px solid #e8dfc6;box-shadow:0 1px 2px #0003;transform:rotate(calc((var(--n,0) - 2) * 8deg))}
.fx-fan i:nth-child(1){--n:0}.fx-fan i:nth-child(2){--n:1}.fx-fan i:nth-child(3){--n:2}.fx-fan i:nth-child(4){--n:3}.fx-fan i:nth-child(5){--n:4}

/* Speech bubbles */
.fx-layer{position:fixed;inset:0;pointer-events:none;z-index:50}
.fx-bubble{position:fixed;transform:translate(-50%,-100%);background:#fffef6;color:#173b38;border:1px solid #d6dcc8;border-radius:14px;padding:7px 12px;font:700 12px/1.6 Arabic;white-space:nowrap;box-shadow:0 8px 20px #0b272522}
.fx-bubble::after{content:"";position:absolute;bottom:-6px;left:50%;width:10px;height:10px;background:inherit;border-right:1px solid #d6dcc8;border-bottom:1px solid #d6dcc8;transform:translateX(-50%) rotate(45deg)}
.fx-confetti{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:70}

/* Sound toggle */
.fx-sound{display:inline-flex;align-items:center;gap:6px;background:#e3ead3;color:#264a36;border:1px solid #c9d7b7;border-radius:30px;padding:8px 13px;font-size:12px;font-weight:700}
.fx-sound[aria-pressed="false"]{background:transparent;color:#7a876c}

/* Lobby and buttons get a little spring */
.fx .primary,.fx .secondary{transition:transform .25s cubic-bezier(.2,1.6,.4,1),background .2s}
.fx .primary:active,.fx .secondary:active,.fx .move-option:active{transform:scale(.96)}
.fx .move-option{transition:transform .2s,background .2s,border-color .2s}
.fx .move-option:hover{transform:translateY(-2px)}

@media(max-width:760px){
 .fx .playing-card{width:62px;height:90px;margin:0 -7px}
 .pc-corner b{font-size:14px}.pc-corner i{font-size:11px}
 .pc-pip{font-size:30px}.pc-pip.ace{font-size:40px}.pc-art{width:32px;height:32px}
 .fx .hand{padding:28px 0 16px}
 .fx .player{grid-template-columns:34px minmax(0,1fr);column-gap:7px}
 .fx-avwrap{width:34px;height:34px}
 .fx-pile{width:30px;height:42px}.fx-mini b,.fx-mini i{font-size:12px}
 .fx-pop{font-size:38px}
 .fx-sound small{display:none}
}
@media(prefers-reduced-motion:reduce){.fx .playing-card{transition:none}}

.fx .wordmark small{white-space:nowrap}

/* ---------- Drag and drop ---------- */
.fx-can{cursor:grab;touch-action:none}
.fx-can .marble{stroke:#dced88;stroke-width:3;animation:can 1s ease-in-out infinite alternate}
@keyframes can{from{stroke-opacity:.35}to{stroke-opacity:1}}
.fx-picked{cursor:grabbing}
.fx-picked .marble{stroke:#fff;stroke-width:3.5;animation:none}
.fx-target{cursor:pointer}
.fx-target-ring{fill:#dced8822;stroke:#dced88;stroke-width:3;stroke-dasharray:5 4;transform-box:fill-box;transform-origin:center;animation:spin 6s linear infinite}
.fx-target-dot{fill:#dced88;opacity:.75}
.fx-target.hot .fx-target-ring{fill:#dced8866;stroke-width:5;stroke-dasharray:none}
.fx-target-chip{direction:ltr;unicode-bidi:bidi-override;font-weight:700;font-family:Georgia,serif;text-anchor:middle;fill:#fffef6;paint-order:stroke;stroke:#0b2725;stroke-width:5px;stroke-linejoin:round}
@keyframes spin{to{transform:rotate(360deg)}}
.fx-picker{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:80;pointer-events:auto;background:#fffdf7;border:1px solid #d6dcc8;border-radius:18px;padding:18px;display:grid;gap:8px;min-width:min(320px,88vw);box-shadow:0 30px 70px #0b272555}
.fx-picker strong{font:700 16px Kufi;margin-bottom:4px}
.fx-picker button{display:flex;align-items:center;gap:12px;background:#f1f3e7;border:1px solid #dce3cf;border-radius:10px;padding:10px 12px;text-align:right;color:var(--green)}
.fx-picker button:hover{background:#e2eccb;border-color:#7b9754}
.fx-picker small{font-size:12px}
.fx-picker .fx-picker-x{justify-content:center;background:transparent;border:0;font-size:12px;color:#7a876c}
.fx-chip{direction:ltr;unicode-bidi:isolate;font:700 18px Georgia;min-width:44px;text-align:center;background:#fff;border:1px solid #d9d2bd;border-radius:6px;padding:4px 6px;color:#1f3a33}
.fx-chip.red{color:#b8402f}
/* The move list hides behind its button; it opens by itself for burns and 10/Q moves that have no stone to drag. */
.fx-drag #movePanel{display:none}
.fx-drag.fx-panel-auto #movePanel,.fx-drag.fx-panel-open #movePanel{display:block}
.fx-listbtn{background:transparent;border:1px solid #cdd5c4;border-radius:30px;padding:6px 12px;font-size:11px;font-weight:700;color:#486442}
.fx-panel-open .fx-listbtn{background:#284c3b;color:#e7f69c;border-color:#284c3b}
.fx .hand-title{flex-wrap:wrap}

/* ---------- Character picker ---------- */
.fx-avpick{display:flex;align-items:center;gap:12px;width:100%;margin-top:16px;background:#f1f3e7;border:1px dashed #b9c6a4;border-radius:12px;padding:10px 12px;text-align:right;color:var(--green)}
.fx-avpick:hover{background:#e7eddb;border-style:solid}
.fx-avpick svg,.fx-avq{width:46px;height:46px;flex:none;border-radius:50%}
.fx-avq{display:grid;place-items:center;background:#dfe6d2;font:800 22px Kufi;color:#6d7f5a}
.fx-avpick strong{display:block;font-size:13px}.fx-avpick small{display:block;font-size:11px;color:#6d7772}
.fx-avwrap.fx-mine{cursor:pointer}
.fx-avwrap.fx-mine:hover{box-shadow:0 0 0 3px var(--lime),0 4px 10px #0002}
.fx-avdlg{max-width:520px}
.fx-avclose{position:absolute;left:15px;top:10px;background:transparent;font-size:30px;color:var(--green)}
.fx-avtabs{display:flex;background:#eaece2;padding:4px;border-radius:10px;margin:14px 0 18px}
.fx-avtabs button{flex:1;padding:10px;border-radius:8px;background:transparent;color:#697666;font-weight:700}
.fx-avtabs [aria-selected=true]{background:var(--green);color:#fff}
.fx-avgrid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}
.fx-avgrid button{aspect-ratio:1;border-radius:50%;padding:0;background:none;box-shadow:0 0 0 2px #d9ded3;transition:transform .25s cubic-bezier(.2,1.6,.4,1),box-shadow .2s;overflow:hidden}
.fx-avgrid button:hover{transform:translateY(-4px) scale(1.06)}
.fx-avgrid [aria-checked=true]{box-shadow:0 0 0 4px var(--green)}
.fx-avgrid svg{display:block;width:100%;height:100%}

/* Music toggle shares the sound pill look */
.fx-music[aria-pressed="true"]{background:#284c3b;color:#e7f69c;border-color:#284c3b}
@media(max-width:760px){.fx-music small{display:none}.fx-avgrid{gap:7px}}

/* ---------- Partner and team marks ---------- */
.fx-ally-ring{fill:none;stroke:#dced88;stroke-width:2.6;stroke-dasharray:3.5 2.5}
.fx-team-base{fill:#dced880f;stroke:#dced8855;stroke-width:1.5;stroke-dasharray:4 4}
.fx-team-label{font:700 15px Arabic,Arial;text-anchor:middle;fill:#dced88;paint-order:stroke;stroke:#0b2725;stroke-width:4px}
.fx-actbar{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;min-height:0}
.fx-actbtn{background:#ef8753;color:#2b1205;border-radius:30px;padding:10px 18px;font-weight:800;font-size:13px;box-shadow:0 8px 20px #ef875355}
.fx-actbtn.hot{animation:pulse 1.2s ease-in-out infinite}
@keyframes pulse{50%{box-shadow:0 0 0 6px #ef875333,0 8px 20px #ef875355}}
.fx-actnote{font-size:12px;font-weight:700;background:#ffffff14;border:1px solid #ffffff22;border-radius:30px;padding:7px 14px}

/* ---------- Full-screen table ----------
   #tableView becomes one grid that fills the viewport. The wrappers jackaroo.js renders (.game-grid, .table-area,
   #players) use display:contents, so seats, board and hand sit directly on that grid. The grid itself is LTR so the
   "left" and "right" seats match the board's geometry; everything inside it stays RTL. */
html.fx-game,html.fx-game body{height:100%;overflow:hidden;overscroll-behavior:none}
.fx-game .topbar,.fx-game footer{display:none}
.fx-game #tableView{position:fixed;inset:0;z-index:20;direction:ltr;display:grid;gap:6px 14px;overflow:hidden;
 padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
 background:radial-gradient(ellipse at 50% 42%,#21503f 0%,#143a33 48%,#0a201e 100%);color:#eef3e2;
 grid-template-columns:minmax(150px,1fr) auto minmax(150px,1fr);
 grid-template-rows:auto auto minmax(0,1fr) auto;
 grid-template-areas:"hud hud hud" ". top ." "left board right" "me hand .";
 grid-template-columns:minmax(150px,1fr) minmax(0,auto) minmax(150px,1fr);
 --bs:min(calc(100vw - 2 * clamp(150px,18vw,260px) - 48px),calc(100dvh - 268px));
 --cw:clamp(58px,9.6vh,94px)}
.fx-game #tableView>*{direction:rtl}
.fx-game .game-grid,.fx-game .table-area,.fx-game .players-grid{display:contents}
/* Top bar: room name, code, invite, sound, music, full screen, menu */
.fx-game .room-heading{grid-area:hud;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0;margin:0;max-width:none}
.fx-game .room-heading .eyebrow{display:none}
.fx-game .room-heading h1{font-size:15px;margin:0;color:#eef3e2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fx-game .room-controls{flex-wrap:nowrap;gap:8px;width:auto}
.fx-game .room-code{background:#ffffff14;color:#dced88;padding:8px 10px;font-size:14px}
.fx-game .room-controls .secondary{min-height:38px;padding:8px 14px;font-size:12px;color:#eef3e2;border-color:#ffffff33}
.fx-game .room-controls .secondary:hover{background:#ffffff14}
.fx-hud{display:flex;gap:6px;align-items:center}
.fx-game .fx-sound{background:#ffffff14;color:#eef3e2;border-color:#ffffff26;padding:7px 11px}
.fx-game .fx-sound small{display:none}
.fx-game .fx-music[aria-pressed="true"]{background:#dced88;color:#143e38}
.fx-hudbtn{font-size:16px;line-height:1;min-width:38px;justify-content:center}
.fx .fx-hud .fx-hudbtn{display:none}.fx-game .fx-hud .fx-hudbtn{display:inline-flex}.fx-game .fx-hud .fx-hudbtn[hidden]{display:none}
/* Board */
.fx-game .board-shell{grid-area:board;width:var(--bs);max-width:none;margin:0;align-self:center;justify-self:center;min-height:0}
.fx-game .board-center strong{font-size:clamp(10px,calc(var(--bs) / 38),17px)}
.fx-game .board-center #timer{font-size:clamp(14px,calc(var(--bs) / 26),26px)}
/* Seats on their real sides */
.fx-game .player{background:#0b2523d9;border:1px solid #ffffff1c;border-top:3px solid var(--seat-color);color:#eef3e2;min-width:0;width:clamp(150px,16vw,230px);border-radius:14px;padding:10px 12px;box-shadow:0 10px 30px #0005}
.fx-game .player small{color:#b9cbb0}
.fx-game .player.turn{background:#dced88;color:#143e38;box-shadow:0 0 0 3px #dced8866,0 10px 30px #0006}
.fx-game .player.turn small{color:#2e5a3e}
.fx-game .player button{color:#dced88;font-weight:700}
.fx-game .player.fx-pos-top{grid-area:top;justify-self:center}
.fx-game .player.fx-pos-left{grid-area:left;align-self:center;justify-self:end}
.fx-game .player.fx-pos-right{grid-area:right;align-self:center;justify-self:start}
.fx-game .player.fx-pos-bottom{grid-area:me;align-self:end;justify-self:end}
.fx .player.fx-ally{border-color:#dced8888;box-shadow:0 0 0 2px #dced8855}
.fx .player.fx-ally::after{content:"🤝 شريكك";position:absolute;top:-11px;right:10px;background:#dced88;color:#143e38;font:800 10px/1.8 Arabic;padding:0 9px;border-radius:20px;box-shadow:0 2px 6px #0003}
.fx .player.fx-me::after{content:"أنت";position:absolute;top:-11px;right:10px;background:#416fee;color:#fff;font:800 10px/1.8 Arabic;padding:0 9px;border-radius:20px}
/* Hand: resting on the board's lower edge */
.fx-game .hand-area,.fx-game .lobby-controls{grid-area:hand;justify-self:center;align-self:start}
.fx-game .hand-area{background:none;border:0;padding:0;margin:calc(var(--cw) * -.42) 0 0;position:relative;z-index:6;box-shadow:none;width:min(100%,640px)}
.fx-game .hand-area.fx-myturn{box-shadow:none}
.fx-game .hand-title{justify-content:center;gap:8px;margin-bottom:4px}
.fx-game .hand-title h2{display:none}
.fx-game #handTip{background:#0b2523d9;border:1px solid #ffffff22;color:#dced88;border-radius:30px;padding:5px 14px;font-size:12px;font-weight:700}
.fx-game .hand{padding:6px 0 2px}
.fx-game .playing-card{width:var(--cw);height:calc(var(--cw) * 1.42);margin:0 calc(var(--cw) * -.07)}
.fx-game .pc-corner b{font-size:calc(var(--cw) * .22)}.fx-game .pc-corner i{font-size:calc(var(--cw) * .16)}
.fx-game .pc-pip{font-size:calc(var(--cw) * .5)}.fx-game .pc-pip.ace{font-size:calc(var(--cw) * .66)}
.fx-game .pc-art{width:calc(var(--cw) * .52);height:calc(var(--cw) * .52)}
.fx-game .playing-card .pc-tag{color:#dced88;bottom:-18px}
.fx-game .move-panel{background:#f6f4ec;color:var(--ink);border-radius:14px;padding:12px;margin-top:22px;max-height:40dvh;overflow:auto}
.fx-game .lobby-controls{margin-top:14px}
.fx-game .lobby-controls .secondary{color:#eef3e2;border-color:#ffffff40}
.fx-game .lobby-controls .text-btn{color:#dced88}
.fx-game .winner-panel{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:30;width:min(520px,92vw);margin:0;box-shadow:0 30px 80px #000a;border:1px solid #dced8855}
/* Drawer: log, rules and "leave" */
.fx-game .table-aside{position:fixed;top:0;bottom:0;right:0;width:min(340px,88vw);z-index:45;display:block;background:#f6f4ec;color:var(--ink);padding:58px 16px 20px;overflow:auto;transform:translateX(105%);transition:transform .45s cubic-bezier(.2,.9,.2,1);box-shadow:-20px 0 60px #0007}
.fx-drawer .table-aside{transform:none}
.fx-drawer-x{position:absolute;left:14px;top:10px;background:transparent;font-size:30px;color:var(--green)}
.fx .fx-leave{display:block;width:100%;margin:10px 0;padding:12px;border:1px solid #e4b7a6;border-radius:10px;color:#9b3d23;text-align:center}
.fx .table-aside .fx-listbtn{width:100%;margin-top:6px;padding:11px}
.fx-game .side-note{display:none}

/* Portrait (phones held upright, narrow windows) */
@media (orientation:portrait),(max-aspect-ratio:1/1){
 .fx-game #tableView{grid-template-columns:1fr 1fr 1fr;grid-template-rows:auto auto minmax(0,1fr) auto auto;
  grid-template-areas:"hud hud hud" "left top right" "board board board" "hand hand hand" "me me me";
  --bs:min(calc(100vw - 16px),calc(100dvh - 330px));--cw:clamp(50px,15vw,72px);gap:8px 6px}
 .fx-game .player{width:auto;padding:7px 8px;grid-template-columns:30px minmax(0,1fr);column-gap:6px}
 .fx-game .player .fx-avwrap{width:30px;height:30px}
 .fx-game .player strong{font-size:11px}
 .fx-game .player small{font-size:9px}
 .fx-game .player.fx-pos-left,.fx-game .player.fx-pos-right,.fx-game .player.fx-pos-top{justify-self:stretch;align-self:stretch}
 /* Your own seat shrinks to a one-line chip under the hand, so it never covers the cards. */
 .fx-game .player.fx-pos-bottom{justify-self:center;align-self:end;width:auto;max-width:80vw;padding:4px 12px 4px 8px;margin-top:4px}
 .fx-game .player.fx-pos-bottom small{display:none}
 .fx-game .hand-area{padding-bottom:20px}
 .fx-game .room-heading h1{display:none}
 .fx-game .room-controls .secondary{padding:8px 10px}
 .fx-game .room-code{font-size:12px;letter-spacing:1px;padding:7px 8px}
 .fx-game .hand-area{width:100%}
}
/* Phones turned sideways: seats stack on the left, hand on the right */
@media (orientation:landscape) and (max-height:560px){
 .fx-game #tableView{grid-template-columns:minmax(120px,1fr) auto minmax(190px,1.25fr);grid-template-rows:auto repeat(4,minmax(0,1fr));
  grid-template-areas:"hud hud hud" "top board hand" "left board hand" "right board hand" "me board hand";
  --bs:min(calc(100dvh - 58px),calc(100vw - 340px));--cw:clamp(42px,12.5vh,60px);gap:4px 10px}
 .fx-game .player{width:100%;padding:5px 8px;grid-template-columns:28px minmax(0,1fr);column-gap:6px;align-self:center!important;justify-self:stretch!important}
 .fx-game .player .fx-avwrap{width:28px;height:28px}
 .fx-game .player small{display:none}
 .fx-game .hand-area,.fx-game .lobby-controls{align-self:center;margin:0}
 .fx-game .room-heading h1{display:none}
}

/* ---------- Frames around a face (rented, or the wheel-only "luck" frame) ---------- */
.fx-avwrap{position:relative}
.fx-avwrap[data-frame]{padding:3px;overflow:hidden}
.fx-avwrap[data-frame]::before{content:"";position:absolute;inset:-40%;z-index:0}
.fx-avwrap[data-frame] svg{position:relative;z-index:1;border-radius:50%}
.fx-avwrap[data-frame=gold]::before{background:conic-gradient(#fff3b0,#e0a92b,#fff3b0,#b77d10,#fff3b0);animation:spin 4s linear infinite}
.fx-avwrap[data-frame=neon]::before{background:conic-gradient(#00f0ff,#7b5cff,#ff3cac,#00f0ff);animation:spin 2.5s linear infinite;filter:saturate(1.4)}
.fx-avwrap[data-frame=neon]{box-shadow:0 0 14px #7b5cffaa,0 0 0 1px #00f0ff}
.fx-avwrap[data-frame=fire]::before{background:conic-gradient(#ffdd55,#ff7a00,#e5331d,#ff7a00,#ffdd55);animation:spin 1.6s linear infinite}
.fx-avwrap[data-frame=fire]{box-shadow:0 0 16px #ff7a00aa}
.fx-avwrap[data-frame=diamond]::before{background:conic-gradient(#e8f7ff,#9bd8ff,#ffffff,#c6b8ff,#e8f7ff);animation:spin 5s linear infinite}
.fx-avwrap[data-frame=diamond]{box-shadow:0 0 12px #bfe6ffcc}
.fx-avwrap[data-frame=luck]::before{background:conic-gradient(#e5533d,#FFC247,#dced88,#55caca,#416fee,#b06ad9,#e5533d);animation:spin 3s linear infinite}

/* ---------- Card backs: your hand, and the face-down fans next to each seat ---------- */
.pc-back[data-back]::before{content:"";background:none}
.pc-back[data-back=night],.fx-fan[data-back=night] i,.fx-backprev[data-back=night]{background:radial-gradient(circle at 30% 25%,#fff 0 1px,transparent 1.5px) 0 0/14px 14px,radial-gradient(circle at 70% 60%,#ffe9a8 0 1px,transparent 1.5px) 0 0/19px 19px,linear-gradient(160deg,#1d2b5c,#0b1430)}
.pc-back[data-back=gold],.fx-fan[data-back=gold] i,.fx-backprev[data-back=gold]{background:repeating-linear-gradient(45deg,#f6d36b 0 6px,#d8a92c 6px 12px)}
.pc-back[data-back=sadu],.fx-fan[data-back=sadu] i,.fx-backprev[data-back=sadu]{background:linear-gradient(135deg,#1d1d22 25%,transparent 25%) -6px 0/12px 12px,linear-gradient(225deg,#1d1d22 25%,transparent 25%) -6px 0/12px 12px,linear-gradient(315deg,#1d1d22 25%,transparent 25%) 0 0/12px 12px,linear-gradient(45deg,#1d1d22 25%,transparent 25%) 0 0/12px 12px,repeating-linear-gradient(0deg,#b8322b 0 10px,#f1e6cf 10px 13px)}
.pc-back[data-back=falcon],.fx-fan[data-back=falcon] i,.fx-backprev[data-back=falcon]{background:linear-gradient(150deg,#00C2FF,#0B3DFF 60%,#0B1B2B)}
.pc-back[data-back=falcon]::after,.fx-backprev[data-back=falcon]::after{content:"ENGO";position:absolute;inset:0;display:grid;place-items:center;font:900 15px/1 Arial;letter-spacing:2px;color:#FFC247}
.pc-back[data-back=rainbow],.fx-fan[data-back=rainbow] i,.fx-backprev[data-back=rainbow]{background:linear-gradient(160deg,#e5533d,#FFC247,#dced88,#55caca,#416fee,#b06ad9)}
.pc-back[data-back]{box-shadow:inset 0 0 0 4px #fffef6,inset 0 0 0 5px #d9d2bd}

/* ---------- Personal table styles (only on your own screen) ---------- */
.fx-table-night .fx-game #tableView,.fx-game.fx-table-night #tableView{background:radial-gradient(ellipse at 50% 40%,#203063 0%,#121b3d 55%,#070b1d 100%)}
.fx-table-night #gameBoard .board-svg>rect:nth-of-type(2){fill:#16224a}
.fx-table-night #gameBoard .board-svg>circle[r="130"]{fill:#1b2a59}
.fx-game.fx-table-desert #tableView{background:radial-gradient(ellipse at 50% 40%,#6b4a2a 0%,#4a321c 55%,#2b1c0f 100%)}
.fx-table-desert #gameBoard .board-svg>rect:nth-of-type(2){fill:#8a5e33}
.fx-table-desert #gameBoard .board-svg>circle[r="130"]{fill:#9b6b3c}
.fx-table-desert #gameBoard .hole{fill:#4b311a}
.fx-game.fx-table-marble #tableView{background:radial-gradient(ellipse at 50% 40%,#3c4148 0%,#24282e 55%,#121417 100%)}
.fx-table-marble #gameBoard .board-svg>rect:nth-of-type(2){fill:#e9e6df}
.fx-table-marble #gameBoard .board-svg>circle[r="130"]{fill:#d6d1c6}
.fx-table-marble #gameBoard .hole{fill:#9d978b}
.fx-table-marble .board-center{color:#2a2f36}.fx-table-marble .board-center #timer{color:#3d6a1f}

/* ---------- Shop dialog ---------- */
.fx-shop{max-width:860px;width:calc(100% - 24px);padding:26px 24px}
.fx-shop-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap}
.fx-shop-head h2{margin:2px 0 0}
.fx-balance{display:flex;align-items:center;gap:8px;background:#e8efda;border-radius:30px;padding:6px 6px 6px 14px}
.fx-balance b{font:800 20px Georgia}.fx-balance span{font-size:12px;color:#617654}
.fx-topup{background:var(--green);color:var(--lime);border-radius:30px;padding:7px 14px;font-weight:700;font-size:12px}
.fx-shop-tabs{display:flex;gap:6px;overflow-x:auto;margin:18px 0 6px;padding-bottom:4px;scrollbar-width:none}
.fx-shop-tabs button{flex:none;background:#eaece2;color:#536a4c;border-radius:30px;padding:9px 16px;font-weight:700;font-size:13px}
.fx-shop-tabs [aria-selected=true]{background:var(--green);color:#fff}
.fx-shop-body{min-height:260px}
.fx-shop-body h3{font-size:13px;margin:16px 0 8px;color:#536a4c}
.fx-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:10px}
.fx-tile{position:relative;display:flex;flex-direction:column;gap:6px;background:#fff;border:1px solid #dde3d3;border-radius:14px;padding:8px;transition:border-color .2s,transform .25s cubic-bezier(.2,1.6,.4,1)}
.fx-tile:hover{transform:translateY(-3px)}
.fx-tile.selected{border-color:var(--green);box-shadow:0 0 0 2px var(--green)}
.fx-tile-pick{display:flex;flex-direction:column;align-items:center;gap:4px;background:none;padding:4px;color:var(--ink);text-align:center}
.fx-tile-pick>svg,.fx-tile-pick>.fx-avwrap{width:64px;height:64px;border-radius:50%}
.fx-tile-pick strong{font-size:12px}.fx-tile-pick small{font-size:10px;color:#6d7772}
.fx-tile.locked .fx-tile-pick>svg,.fx-tile.locked .fx-tile-pick>span{filter:saturate(.75)}
.fx-tile.locked::after{content:"🔒";position:absolute;top:6px;left:8px;font-size:12px}
.fx-rent{background:#ef8753;color:#2b1205;border-radius:9px;padding:7px 6px;font-weight:800;font-size:11px}
.fx-confirm{position:absolute;inset:0;z-index:2;background:#fffdf7f5;border-radius:14px;padding:10px;display:flex;flex-direction:column;justify-content:center;gap:8px;text-align:center}
.fx-confirm p{font-size:11px;line-height:1.7;margin:0}
.fx-confirm div{display:flex;gap:6px;justify-content:center}
.fx-confirm .primary,.fx-confirm .secondary{min-height:34px;padding:6px 10px;font-size:11px;gap:4px}
.fx-backprev{position:relative;display:block;width:46px;height:64px;border-radius:7px;background:#173f39;box-shadow:inset 0 0 0 3px #e8dfc6,0 4px 8px #0002;overflow:hidden}
.fx-tableprev{display:block;width:70px;height:56px;border-radius:12px;border:4px solid #c9ad80;background:#204b41}
.fx-tableprev[data-table=night]{background:#16224a}.fx-tableprev[data-table=desert]{background:#8a5e33}.fx-tableprev[data-table=marble]{background:linear-gradient(135deg,#f1eee8,#d9d4ca 40%,#f4f2ee 60%,#cfc9bc)}
.fx-prev{display:block;width:64px;height:64px;border-radius:50%;overflow:hidden}
.fx-shop-note{margin-top:14px}

/* The wheel */
.fx-wheel{display:grid;grid-template-columns:minmax(0,300px) 1fr;gap:22px;align-items:center;padding:8px 0}
.fx-wheel-disc svg{width:100%;height:auto;filter:drop-shadow(0 12px 20px #0003)}
.fx-wheel-t{font:800 10px Arabic,Arial;text-anchor:middle;fill:#143e38}
.fx-wheel-side{display:grid;gap:12px;justify-items:start}
.fx-wheel-status{font-weight:800;font-size:15px;margin:0}
.fx-wheel-result{font:800 18px Kufi;color:#2f6b3a;margin:0;min-height:1.6em}
.fx-shopbtn{gap:6px}
@media(max-width:760px){.fx-wheel{grid-template-columns:1fr;justify-items:center}.fx-wheel-side{justify-items:center;text-align:center}.fx-tiles{grid-template-columns:repeat(3,1fr)}.fx-shopbtn small{display:none}.fx-shop{padding:22px 14px}}

/* ---------- Nothing covers anything ----------
   The hand no longer tucks under the board, the turn banner lives inside the empty centre circle,
   and speech bubbles drop below the top seat instead of covering the top bar. */
.fx-game .hand-area{margin:4px 0 0;padding-bottom:26px}
.fx-banner{inset:39% 31%;border-radius:50%;background:radial-gradient(circle,#143e38f2 0 60%,#143e3800 72%)}
.fx-banner strong{font-size:clamp(22px,calc(var(--bs,600px) / 16),46px)}
.fx-banner span{font-size:clamp(9px,calc(var(--bs,600px) / 60),12px);max-width:80%;text-align:center}
.fx-bubble.below{transform:translate(-50%,0)}
.fx-bubble.below::after{bottom:auto;top:-6px;transform:translateX(-50%) rotate(225deg)}
.fx-defs{position:absolute;width:0;height:0;overflow:hidden}

/* ---------- Seats invite a tap ---------- */
.fx-game .player{cursor:pointer}
.fx-game .player:hover{border-color:#ffffff44}
.fx-splat{position:absolute;inset:-6px;border-radius:16px;background:radial-gradient(circle at 40% 45%,#e5333dcc 0 18%,transparent 19%),radial-gradient(circle at 62% 60%,#e5333dbb 0 12%,transparent 13%),radial-gradient(circle at 30% 70%,#c41f2abb 0 8%,transparent 9%);pointer-events:none;animation:splat 2.6s ease-out forwards}
@keyframes splat{0%{transform:scale(.4)}12%{transform:scale(1.05)}80%{opacity:1}100%{opacity:0}}
.fx-crowned{position:absolute;top:-24px;right:12px;font-size:26px;font-style:normal;animation:crown 3.5s ease-out forwards;filter:drop-shadow(0 0 6px #FFC247)}
@keyframes crown{0%{transform:translateY(-30px);opacity:0}15%{transform:translateY(0);opacity:1}85%{opacity:1}100%{opacity:0}}

/* ---------- Emotes and thrown things ---------- */
.fx-emote{position:fixed;transform:translate(-50%,-110%);display:flex;flex-direction:column;align-items:center;gap:2px;pointer-events:none;z-index:55}
.fx-emote span{font-size:44px;line-height:1;filter:drop-shadow(0 6px 10px #0006)}
.fx-emote small{background:#fffef6;color:#173b38;border-radius:20px;padding:3px 10px;font:800 12px/1.7 Arabic;white-space:nowrap;box-shadow:0 6px 16px #0003}
.fx-emote.glow span{filter:drop-shadow(0 0 10px #FFC247) drop-shadow(0 0 22px #FFC24799)}
.fx-emote.slimy span{filter:hue-rotate(60deg) saturate(1.6) drop-shadow(0 6px 8px #5d6b34)}
.fx-proj{position:fixed;width:46px;height:46px;transform:translate(-50%,-50%);display:grid;place-items:center;font-size:38px;line-height:1;pointer-events:none;z-index:56;filter:drop-shadow(0 6px 8px #0006)}
.fx-proj svg{width:100%;height:100%}
.fx-proj-legend{filter:drop-shadow(0 0 10px #FFC247)}
.fx-proj-gross{filter:hue-rotate(40deg) drop-shadow(0 4px 6px #5d6b34)}
.fx-trail,.fx-drip{position:fixed;width:10px;height:10px;border-radius:50%;pointer-events:none;z-index:55;transform:translate(-50%,-50%)}
.fx-trail{background:radial-gradient(#fff6c8,#FFC24700)}
.fx-drip{background:#8fd16a;border-radius:50% 50% 50% 0}
.fx-hit{position:fixed;transform:translate(-50%,-50%);z-index:57;pointer-events:none;font:900 22px Kufi;color:#fff;paint-order:stroke;-webkit-text-stroke:5px #0b2725;white-space:nowrap}
.fx-hit-rose,.fx-hit-coffee,.fx-hit-crown{color:#dced88}
.fx-hit-whip,.fx-hit-slipper,.fx-hit-agal,.fx-hit-boom{color:#ffcf6b}

/* ---------- Reaction menu ---------- */
.fx-react-menu{position:fixed;z-index:65;width:min(330px,92vw);background:#fffdf7;color:#173b38;border:1px solid #d6dcc8;border-radius:16px;padding:12px;box-shadow:0 24px 60px #0b272566;display:grid;gap:8px}
.fx-rm-head{display:flex;justify-content:space-between;align-items:center}
.fx-rm-head strong{font:800 14px Kufi}
.fx-rm-x{background:none;font-size:24px;line-height:1;color:#173b38}
.fx-rm-row{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.fx-rm-row button{display:flex;flex-direction:column;align-items:center;gap:2px;background:#f1f3e7;border:1px solid #dce3cf;border-radius:12px;padding:7px 4px;font-size:24px;line-height:1.1}
.fx-rm-row button:hover{background:#e2eccb;transform:translateY(-2px)}
.fx-rm-row button svg{width:30px;height:30px}
.fx-rm-row small{font:700 9px Arabic;color:#536a4c}
.fx-rm-row button.locked{opacity:.75;filter:grayscale(.5)}
.fx-rm-label{font-size:11px;font-weight:800;color:#7a876c;margin:2px 0 0}
.fx-rm-mute{background:none;border-top:1px solid #e3e8d8;padding-top:8px;font-size:11px;font-weight:700;color:#7a876c}

/* ---------- Shop: stone and reaction previews ---------- */
.fx-stoneprev{width:52px;height:52px}
.fx-reactprev{display:grid;place-items:center;width:56px;height:56px;font-size:38px;background:#f1f3e7;border-radius:50%}
.fx-reactprev svg{width:38px;height:38px}
.fx-skin-pearl .stone-number{fill:#3a3340}
.fx-skin-lava .marble{animation:lava 1.6s ease-in-out infinite alternate}
@keyframes lava{from{filter:drop-shadow(0 0 2px #ff6a00)}to{filter:drop-shadow(0 0 7px #ff6a00)}}
.fx-skin-crystal .marble{filter:drop-shadow(0 0 4px #9fe8ff)}

/* ---------- Regional table surroundings ---------- */
.fx-game.fx-table-najd #tableView{background:radial-gradient(ellipse at 50% 40%,#6e2a20 0%,#4a1a14 55%,#22100c 100%)}
.fx-game.fx-table-hijaz #tableView{background:radial-gradient(ellipse at 50% 40%,#25645f 0%,#163f3c 55%,#0b2422 100%)}
.fx-game.fx-table-asir #tableView{background:radial-gradient(ellipse at 50% 40%,#3a5b8c 0%,#24406a 55%,#122440 100%)}
.fx-game.fx-table-sharqiya #tableView{background:radial-gradient(ellipse at 50% 40%,#11607e 0%,#0a3f55 55%,#052230 100%)}
.fx-game.fx-table-shamal #tableView{background:radial-gradient(ellipse at 50% 40%,#3d2f55 0%,#251c36 55%,#120d1c 100%)}
.fx-table-asir .board-center{color:#3a2a1a}.fx-table-asir .board-center #timer{color:#2e7a3e}
.fx-tableprev[data-table=najd]{background:repeating-linear-gradient(90deg,#7a1d18 0 8px,#f1e6cf 8px 11px,#111 11px 14px)}
.fx-tableprev[data-table=hijaz]{background:repeating-linear-gradient(45deg,#1e5450 0 6px,#8a5a2b 6px 8px),#1e5450}
.fx-tableprev[data-table=asir]{background:linear-gradient(135deg,#f2c230 25%,#2e9e5b 25% 50%,#d23c3c 50% 75%,#2a5bd7 75%)}
.fx-tableprev[data-table=sharqiya]{background:radial-gradient(circle at 30% 30%,#fff 0 3px,transparent 4px),radial-gradient(circle at 70% 60%,#fff 0 3px,transparent 4px),#0d4a63}
.fx-tableprev[data-table=shamal]{background:repeating-linear-gradient(90deg,#151215 0 6px,#d8cbb0 6px 12px)}

.fx-game .board-shell{max-height:100%}

/* Small phones: one-line seats and buttons, cards sized by screen height, and your own seat chip steps aside
   (you are marked "أنت" on the board), so the board keeps a playable size. */
@media (orientation:portrait),(max-aspect-ratio:1/1){
 .fx-game #shareRoom{white-space:nowrap}
 .fx-game .player strong{white-space:nowrap}
 .fx-game .player small:not(:first-of-type){display:none}
 .fx-game #tableView{--cw:clamp(42px,min(14vw,8.2vh),72px)}
}
@media (orientation:portrait) and (max-height:760px),(max-aspect-ratio:1/1) and (max-height:760px){
 .fx-game .player.fx-pos-bottom{display:none}
 .fx-game .room-code{display:none}
 .fx-game .fx-hud{gap:4px}.fx-game .fx-hud .fx-sound{padding:6px 8px}
 .fx-game .player{padding:5px 7px}
 .fx-game .player small{display:none}
 .fx-game #handTip{font-size:11px;padding:3px 10px}
 .fx-game .hand-area{padding-bottom:16px}
}
