/* سين جيم: laid out for a phone turned sideways and mirrored to a TV. Team 1 teal (dark text), team 2 red (light text). */
body.sjwide #app{max-width:1500px}
.sjChip{display:inline-block;padding:4px 14px;border-radius:999px;font-weight:700}
.sjChip.t0,.sjCatTag.t0,.sjOwner.t0{background:var(--teal);color:var(--resolve)}.sjChip.t1,.sjCatTag.t1,.sjOwner.t1{background:var(--red);color:var(--clarity)}
.sjPick{border-radius:12px;padding:12px 16px;display:flex;align-items:center;gap:10px;font-size:18px}
.sjPick.t0{background:var(--teal);color:var(--resolve)}.sjPick.t1{background:var(--red);color:var(--clarity)}
.sjCount{margin-inline-start:auto;font-family:var(--display);background:rgba(0,0,0,.2);padding:2px 12px;border-radius:999px}
.sjChosen{display:flex;flex-direction:column;gap:6px}
.sjChosenRow{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.sjCatTag{padding:3px 10px;border-radius:8px;font-size:14px}
.sjTabs{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px}
.sjTabs button{flex:none;padding:8px 14px;border-radius:999px;background:var(--surface);font-weight:700;white-space:nowrap}
.sjTabs button.on{background:var(--auth);color:var(--clarity)}
.sjIcon{display:inline-grid;place-items:center;width:40px;height:40px;color:var(--auth)}
.sjIcon svg{width:100%;height:100%}
.sjIcon.used{opacity:.25}
.sjIcon.big{width:80px;height:80px}
/* the draw: a roulette in the middle of the screen, as big as the height allows */
.sjWheelStage{flex:1;min-height:0;display:grid;grid-template:minmax(0,1fr)/minmax(0,1fr);place-items:center}
.sjWheel{position:relative;height:100%;max-width:100%;aspect-ratio:1}
.sjDisc{display:block;width:100%;height:100%}
.sjTurn{transform-origin:100px 100px}
.sjDisc .rim{fill:var(--resolve)}
.sjDisc path{stroke:var(--clarity);stroke-width:1.2}
.sjDisc path.t0{fill:var(--teal)}.sjDisc path.t1{fill:var(--red)}
.sjDisc .pegs circle{fill:var(--gold)}
.sjDisc text{font-family:var(--display);font-weight:700;text-anchor:middle;dominant-baseline:middle}
.sjDisc text.t0{fill:var(--resolve)}.sjDisc text.t1{fill:var(--clarity)}
.sjDisc .hub{fill:var(--resolve);stroke:var(--clarity);stroke-width:2}.sjDisc .hubDot{fill:var(--gold)}
.sjTurn.spin{animation:sjSpin var(--ms) cubic-bezier(.12,.8,.18,1) both}
@keyframes sjSpin{from{transform:rotate(0deg)}to{transform:rotate(var(--to))}}
.sjPointer{position:absolute;top:-3%;left:50%;width:10%;aspect-ratio:5/6;transform:translateX(-50%);background:var(--resolve);clip-path:polygon(0 0,100% 0,50% 100%)}
.sjDrawFoot{flex:none;display:flex;align-items:center;justify-content:center;gap:clamp(10px,2vw,24px);min-height:clamp(52px,14vh,120px)}
.sjDrawFoot .btn{font-size:clamp(16px,4vh,34px);min-height:clamp(48px,12vh,100px);padding:0 1.4em;border-radius:clamp(10px,2vh,18px)}
.sjDrawWin{font-family:var(--display);font-size:clamp(20px,6vh,52px);line-height:1.3;padding:.1em .9em;border-radius:999px}
.sjDrawWin.t0{background:var(--teal);color:var(--resolve)}.sjDrawWin.t1{background:var(--red);color:var(--clarity)}
.sjDrawWait{font-size:clamp(16px,4vh,32px);color:var(--muted)}
@media (max-width:620px){.sjWheel{height:auto;width:min(86vw,440px)}}
.sjTopBtns{flex:none;gap:6px}.sjTopBtns>*{flex:none}
.sjScores{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.sjTeam{border-radius:14px;padding:10px 14px;display:flex;flex-direction:column;gap:6px;outline:4px solid transparent;outline-offset:3px}
.sjTeam.t0{background:var(--teal);color:var(--resolve)}.sjTeam.t1{background:var(--red);color:var(--clarity)}
.sjTeam.turn{outline-color:var(--resolve)}
.sjTeamTop{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:18px}
.sjTurnTag{font-size:12px;background:var(--gold);color:var(--resolve);padding:2px 10px;border-radius:999px;font-weight:700}
.sjScoreRow{display:flex;align-items:center;justify-content:center;gap:14px}
.sjScore{font-family:var(--display);font-size:40px;min-width:3ch;text-align:center;font-variant-numeric:tabular-nums}
.sjScoreRow button{width:34px;height:34px;border-radius:50%;font-size:20px;line-height:1}
.sjTeam.t0 .sjScoreRow button{background:rgba(255,255,255,.4)}.sjTeam.t1 .sjScoreRow button{background:rgba(0,0,0,.22)}
.sjLifeRow{display:flex;justify-content:center;gap:6px}
.sjLifeRow .sjIcon{width:30px;height:30px;color:var(--gold)}
.sjBoard{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.sjTile{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:6px;padding:8px;border-radius:14px;background:var(--surface)}
.sjCol{display:flex;flex-direction:column;gap:6px}
.sjVal{width:64px;flex:1;min-height:44px;border-radius:10px;background:var(--gold);color:var(--resolve);font-family:var(--display);font-size:20px;display:grid;place-items:center;transition:transform .12s}
.sjVal:hover{transform:translateY(-2px)}
.sjVal.done{background:var(--sunk);color:rgba(35,31,32,.4);text-decoration:line-through}
.sjVal.done.t0{background:rgba(98,155,166,.4);color:var(--resolve)}.sjVal.done.t1{background:rgba(163,43,56,.25);color:var(--resolve)}
.sjVal.empty{visibility:hidden}
.sjFace{border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center;padding:10px 6px;min-height:150px;color:#fff;background-size:cover;background-position:center}
.sjFace b{font-family:var(--display);font-size:20px;line-height:1.3}
.sjSec{font-size:11px;opacity:.8}
.sjOwner{font-size:11px;padding:1px 8px;border-radius:999px}
/* each section takes one secondary colour when its category has no photograph yet */
.sjFace.s0,.sjCat.s0{background-color:var(--sage)}.sjFace.s1,.sjCat.s1{background-color:var(--teal)}
.sjFace.s2,.sjCat.s2{background-color:var(--ochre)}.sjFace.s3,.sjCat.s3{background-color:var(--red)}
.sjFace.s4,.sjCat.s4{background-color:var(--lilac)}.sjFace.s5,.sjCat.s5{background-color:var(--coral)}
.sjFace.s6,.sjCat.s6{background-color:var(--auth)}.sjFace.s7,.sjCat.s7{background-color:var(--rose)}
/* light secondaries take dark text (guideline p. 29 keeps white for the darker ones) */
.sjFace:is(.s0,.s1,.s5,.s7):not([style]),.sjCat:is(.s0,.s1,.s5,.s7):not([style]){color:var(--resolve)}
.sjQTop{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.sjQCat{font-family:var(--display);font-size:22px;color:var(--auth)}
.sjQVal{font-family:var(--display);font-size:20px;background:var(--gold);color:var(--resolve);padding:2px 14px;border-radius:999px}
.sjQTop .sjChip{margin-inline-start:auto}
.sjQ{border-radius:18px;padding:28px 22px;display:flex;flex-direction:column;gap:18px;align-items:center;text-align:center;background:var(--surface);min-height:240px;justify-content:center}
.sjQText{font-size:clamp(22px,3.4vw,46px);line-height:1.6;font-weight:700;max-width:30ch;text-wrap:balance}
.sjQImg{width:min(100%,560px);aspect-ratio:10/7;background:var(--resolve);border-radius:12px;overflow:hidden;display:grid;place-items:center}
.sjQImg svg,.sjQImg img{width:100%;height:100%;display:block}
.sjQImg img{object-fit:cover;transition:filter .6s,transform .6s}
/* a logo's written name sits under a frosted patch until the answer is shown */
.sjQImg{position:relative}
.qPic{position:absolute;inset:0;display:block}
.qPic img{width:100%;height:100%;display:block}
.qMask{position:absolute;border-radius:10px;-webkit-backdrop-filter:blur(var(--qb,28px));backdrop-filter:blur(var(--qb,28px));background:rgba(244,234,218,.82)}
.sjQImg.open .qMask{display:none}
.sjQImg.blur img{filter:blur(var(--b));transform:scale(1.1)}
.sjOn{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
.sjOn span{background:var(--gold);color:var(--resolve);font-weight:700;padding:2px 12px;border-radius:999px;font-size:14px}
.sjAnswer{display:flex;flex-direction:column;gap:4px;background:var(--gold);color:var(--resolve);padding:12px 28px;border-radius:14px;animation:flip .4s ease both}
.sjAnswer small{color:var(--auth)}
.sjAnswer b{font-family:var(--display);font-size:clamp(24px,3.6vw,48px);line-height:1.4}
.sjClock{width:110px;height:110px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--surface);border:4px solid var(--auth)}
.sjClock b{font-family:var(--display);font-size:40px;line-height:1;font-variant-numeric:tabular-nums;direction:ltr}
.sjClock small{font-size:12px;color:var(--muted)}
.sjClock.low{border-color:var(--coral)}.sjClock.over{border-color:var(--red);background:var(--red)}
.sjClock.over b,.sjClock.over small{color:var(--clarity)}
.sjLifeBar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:center}
.sjWho{display:flex;flex-direction:column;align-items:center;gap:10px}
.sjWho p{font-size:18px}
.sjWhoBtns{display:grid;grid-template-columns:1fr auto 1fr;gap:10px;width:min(100%,760px)}
.btn.sjT0{background:var(--teal);color:var(--resolve)}.btn.sjT1{background:var(--red);color:var(--clarity)}
.sjOverlay{position:fixed;inset:0;z-index:40;background:rgba(35,31,32,.9);display:grid;place-items:center;padding:20px}
.sjSearchBox{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;font-size:22px}
.sjSearchBox b{font-family:var(--display);font-size:120px;line-height:1;color:var(--accent);font-variant-numeric:tabular-nums}
.sjFinal{display:flex;gap:16px;flex-wrap:wrap;justify-content:center}
.sjFinalTeam{display:flex;flex-direction:column;align-items:center;gap:4px;padding:14px 30px;border-radius:14px;opacity:.8}
.sjFinalTeam.t0{background:var(--teal);color:var(--resolve)}.sjFinalTeam.t1{background:var(--red);color:var(--clarity);box-shadow:0 0 0 2px var(--clarity)}
.sjFinalTeam span{font-family:var(--display);font-size:44px}
.sjFinalTeam.win{opacity:1;box-shadow:0 0 0 4px var(--gold)}
@media (max-width:1000px){.sjBoard{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:620px){
  .sjBoard{grid-template-columns:1fr}
  .sjFace{min-height:110px}
  .sjVal{width:56px;font-size:17px}
  .sjScore{font-size:30px}
  .sjWhoBtns{grid-template-columns:1fr}
}
.sjQImg{width:min(100%,560px,calc(42vh * 10 / 7))}
/* a phone turned sideways (and the TV showing it) is short: tighten everything so the board fits */
@media (max-height:540px){
  body.sjwide #app{gap:8px}
  body.sjwide .top h2{font-size:16px}
  body.sjwide .iconBtn{padding:5px 10px}
  .sjScores{gap:8px}
  .sjTeam{flex-direction:row;align-items:center;justify-content:space-between;padding:6px 12px;gap:8px}
  .sjTeamTop{gap:6px}
  .sjScoreRow{gap:8px}
  .sjScoreRow button{width:28px;height:28px;font-size:17px}
  .sjBoard{gap:8px}
  .sjTile{padding:5px;gap:5px}
  .sjCol{gap:4px}
  .sjVal{min-height:28px;border-radius:7px}
  .sjFace{min-height:0;padding:4px}
  .sjCats{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
  .sjCat{min-height:90px}
}
@media (max-height:540px) and (min-width:700px){.sjBoard{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* setup: both teams pick categories and lifelines on one screen */
.sjSetup{width:100%;max-width:1240px;margin-inline:auto;display:flex;flex-direction:column;gap:14px}
.sjSetTeams{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.sjSetTeam{border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:10px;background:var(--surface)}
.sjSetHead{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 14px;border-radius:10px;font-size:20px}
.sjSetTeam.t0 .sjSetHead{background:var(--teal);color:var(--resolve)}.sjSetTeam.t1 .sjSetHead{background:var(--red);color:var(--clarity)}
.sjSetHead span{font-size:13px;opacity:.9}
.sjSlots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.sjSlot{min-height:54px;border-radius:10px;border:2px dashed rgba(107,78,69,.35);display:flex;align-items:center;justify-content:center;gap:6px;text-align:center;padding:6px;color:var(--muted);font-size:14px}
.sjSlot.full{border-style:solid;border-color:var(--auth);color:var(--fg);font-weight:700;background:var(--clarity)}
.sjSlot i{font-style:normal;opacity:.6}
.sjSetLabel{display:flex;justify-content:space-between;font-size:14px;color:var(--muted)}
.sjLifePick{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.sjLifeChip{display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px 4px;border-radius:12px;font-size:12px;font-weight:700;line-height:1.3;color:var(--fg)}
.sjLifeChip.on{background:rgba(245,215,88,.35)}
.sjRing{display:grid;place-items:center;width:52px;height:52px;border-radius:50%;padding:10px;color:var(--auth);background:var(--surface);border:2px solid var(--auth)}
.sjRing svg{width:100%;height:100%}
.sjLifeChip.on .sjRing,.sjLifeBtn.on .sjRing{background:var(--gold);color:var(--resolve);border-color:var(--resolve)}
.sjReady{font-size:18px;min-height:56px}
.sjSecTitle{font-size:20px;color:var(--auth);margin-top:6px}
.sjCats{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}
.sjCat{position:relative;display:flex;flex-direction:column;gap:6px;align-items:center;justify-content:flex-end;text-align:center;aspect-ratio:16/9;padding:12px;border-radius:14px;color:#fff;background-size:cover;background-position:center;border:3px solid transparent;overflow:hidden;transition:transform .15s}
.sjCat b{font-family:var(--display);font-size:22px;line-height:1.3}
.sjCat:not(:disabled):not(.soon):hover{transform:translateY(-3px)}
.sjCat:disabled{opacity:.45}
.sjCat.soon{opacity:.4;filter:grayscale(.6)}
.sjCat.soon small{background:rgba(0,0,0,.55);color:#fff;padding:1px 10px;border-radius:999px}
.sjCatOwner{position:absolute;top:8px;inset-inline-start:8px;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:700}
.sjCatOwner.t0{background:var(--teal);color:var(--resolve)}.sjCatOwner.t1{background:var(--red);color:var(--clarity)}
/* lifelines on the question screen */
.sjLifeBtn{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:12px;font-weight:700;color:var(--fg);min-width:76px}
.sjLifeBtn .sjRing{width:56px;height:56px}
.sjLifeBtn:disabled{opacity:.25}
.sjLifeRow .sjRing{width:34px;height:34px;padding:6px;border-width:1.5px;border-color:var(--resolve)}
.sjLifeRow .sjRing.used{opacity:.25;filter:grayscale(1)}
@media (max-width:760px){.sjSetTeams{grid-template-columns:1fr}.sjLifePick{grid-template-columns:repeat(5,minmax(0,1fr))}.sjCats{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}.sjCat b{font-size:17px}}
@media (max-height:540px){.sjSetTeam{padding:8px;gap:6px}.sjSetHead{font-size:16px;padding:5px 10px}.sjSlot{min-height:38px;font-size:12px}.sjRing{width:40px;height:40px;padding:7px}.sjLifeChip{font-size:10px;padding:4px 2px}.sjReady{min-height:44px}}
.sjRing.big{width:110px;height:110px;padding:22px}
/* the board and the question each fill one screen. A phone turned sideways mirrors exactly this to the TV, so sizes follow
   the screen's height (vh): the same share of the picture on a phone 390px tall and on a laptop 1080px tall */
body.sjwide #app{max-width:1900px;padding-block:20px 12px}
.sjScreen{display:flex;flex-direction:column;gap:clamp(8px,2vh,18px)}
.sjBoard{grid-template-rows:repeat(2,minmax(0,1fr))}
.sjTile{min-height:0}
.sjVal{width:clamp(60px,5vw,100px);font-size:clamp(18px,3.4vh,34px)}
.sjFace{min-height:0;height:100%}
.sjFace b{font-size:clamp(18px,3.4vh,36px)}
.sjSec,.sjOwner{font-size:clamp(11px,1.5vh,16px)}
@media (min-width:621px){
  .sjScreen{height:calc(100vh - 32px);height:calc(100dvh - 32px)}
  .sjScreen .sjBoard{flex:1;min-height:0}
}
@media (max-width:1000px){.sjBoard{grid-template-rows:repeat(3,minmax(0,1fr))}}
@media (max-width:620px){.sjBoard{grid-template-rows:none}.sjFace{min-height:110px}}
@media (max-height:540px) and (min-width:700px){.sjBoard{grid-template-rows:repeat(2,minmax(0,1fr))}}

/* the scores: whose turn it is reads from the sofa, and the other team steps back */
.sjTeam:not(.turn){opacity:.5}
.sjTeamTop{font-size:clamp(16px,4.4vh,32px)}
.sjTurnTag{font-size:clamp(12px,3vh,22px)}
.sjScore{font-size:clamp(24px,7vh,60px)}
.sjLifeRow .sjRing{width:clamp(28px,6.5vh,52px);height:clamp(28px,6.5vh,52px)}

/* the question screen in three bands: who and how much, the question, the clock with the controls */
.sjQTop{flex:none;gap:clamp(8px,2vw,20px)}
.sjQCat{font-size:clamp(18px,6vh,52px);line-height:1.2}
.sjQVal{font-size:clamp(18px,6vh,52px);line-height:1.2;padding:.05em .6em}
.sjQTurn{margin-inline-start:auto;font-size:clamp(16px,5.5vh,46px);font-weight:700;line-height:1.3;padding:.1em .8em;border-radius:999px}
.sjQTurn.t0{background:var(--teal);color:var(--resolve)}.sjQTurn.t1{background:var(--red);color:var(--clarity)}
.sjQ{flex:1;min-height:0;overflow:hidden;padding:clamp(12px,3vh,36px);gap:clamp(10px,3vh,32px)}
.sjQMain{display:flex;flex-direction:column;align-items:center;gap:clamp(8px,2.4vh,24px);min-width:0}
.sjQText{font-size:calc(var(--qs,1) * clamp(20px,min(4vw,8.5vh),76px));line-height:1.5;max-width:34ch}
.sjAnswer b{font-size:calc(var(--qs,1) * clamp(22px,min(4.4vw,9vh),84px))}
.sjAnswer small{font-size:clamp(12px,2.6vh,22px)}
.sjOn span{font-size:clamp(12px,3vh,24px)}
.sjQ.withImg{flex-direction:row;justify-content:center}
.sjQ.withImg .sjQMain{flex:1}
.sjQ.withImg .sjQImg{flex:none;height:100%;width:auto;max-width:48%}
.sjQFoot{flex:none;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:clamp(8px,2vw,28px)}
.sjQFoot .sjLifeBar{justify-self:start;flex-wrap:nowrap;gap:clamp(6px,1.4vw,18px)}
.sjLifeLab{font-size:clamp(12px,3vh,22px);color:var(--muted);max-width:7em;line-height:1.3}
.sjLifeBtn{font-size:clamp(11px,2.8vh,22px);min-width:0;gap:.3em}
.sjLifeBtn .sjRing{width:clamp(40px,13vh,112px);height:clamp(40px,13vh,112px);padding:20%}
.sjClock{width:clamp(72px,22vh,200px);height:clamp(72px,22vh,200px);border-width:clamp(3px,.9vh,8px)}
.sjClock b{font-size:clamp(26px,9vh,84px)}
.sjClock small{font-size:clamp(11px,2.6vh,22px)}
.sjHost{justify-self:end;display:flex;gap:clamp(6px,1.2vw,16px)}
.sjHost .btn{font-size:clamp(14px,3.6vh,32px);min-height:clamp(44px,12vh,100px);padding:0 1.1em;border-radius:clamp(10px,2vh,18px)}
.sjWho{flex:none;gap:clamp(6px,2vh,18px)}
.sjWho p{font-size:clamp(16px,4vh,34px)}
.sjWhoBtns{width:min(100%,1200px)}
.sjWhoBtns .btn{font-size:clamp(16px,4.6vh,42px);min-height:clamp(48px,13vh,110px);border-radius:clamp(10px,2vh,18px)}
@media (max-width:620px){
  .sjQ.withImg{flex-direction:column}
  .sjQ.withImg .sjQImg{height:auto;width:100%;max-width:none}
  .sjQFoot{grid-template-columns:1fr;justify-items:center}
  .sjQFoot .sjLifeBar,.sjHost{justify-self:center}
}

.sjCredits{margin:10px 0 0;padding-right:18px;display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--muted);overflow-wrap:anywhere}
.sjCredits a{color:var(--auth)}

/* shared categories: no team colours on them */
.sjSetCats{border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:10px;background:var(--surface)}
.sjSetCats .sjSetLabel b{color:var(--auth);font-size:18px}
.sjSlots.six{grid-template-columns:repeat(6,minmax(0,1fr))}
.sjCat.on{border-color:var(--gold);box-shadow:0 0 0 2px var(--resolve)}
.sjCatNum{position:absolute;top:8px;inset-inline-start:8px;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--gold);color:var(--resolve);font-weight:800}
@media (max-width:760px){.sjSlots.six{grid-template-columns:repeat(3,minmax(0,1fr))}}
