/* Jema Game screen (Session 3): playing + watching. Scoped under #gameScreen.
   Colours come from the frame's segment variables (--jf-*). Glass = translucent fills; blur only on 3 panels.
   Meaning colours (win gold, called marker) stay fixed; atmosphere follows the segment. */
#gameScreen{position:relative;background:transparent;
  --jg-top:calc(env(safe-area-inset-top,0px) + 106px + var(--jf-dy));--jg-bot:calc(env(safe-area-inset-bottom,0px) + 62px);
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;color:rgb(var(--jf-text))}

/* stats flank the fixed top circle: 2 left, 2 right */
#gameScreen .jg-stats{position:absolute;z-index:5;left:8px;right:8px;top:calc(env(safe-area-inset-top,0px) + 14px + var(--jf-dy));
  display:grid;grid-template-columns:1fr 1fr 106px 1fr 1fr;gap:4px;align-items:center;pointer-events:none}
#gameScreen .jg-stat{grid-row:1;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;
  padding:7px 2px;border-radius:12px;background:rgba(var(--jf-top),.38);border:1px solid rgba(var(--jf-text),.18);
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
#gameScreen .jg-stat:nth-of-type(1){grid-column:1}#gameScreen .jg-stat:nth-of-type(2){grid-column:2}
#gameScreen .jg-stat:nth-of-type(3){grid-column:4}#gameScreen .jg-stat:nth-of-type(4){grid-column:5}
#gameScreen .jg-stat b{font-size:clamp(12px,3.4vw,15px);font-weight:900;line-height:1.1;font-variant-numeric:tabular-nums;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;color:rgb(var(--jf-text))}
#gameScreen .jg-stat i{font-style:normal;font-size:8px;letter-spacing:.5px;text-transform:uppercase;color:rgba(var(--jf-text),.72);margin-top:2px}

/* three columns: board | pipe | cards */
#gameScreen .jg-main{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,43fr) minmax(46px,14fr) minmax(0,43fr);
  gap:0;padding:var(--jg-top) 6px var(--jg-bot);overflow:hidden}
#gameScreen .jg-left,#gameScreen .jg-right{min-width:0;min-height:0;position:relative;display:flex;flex-direction:column;
  border-radius:14px;background:rgba(var(--jf-top),.30);border:1px solid rgba(var(--jf-text),.16);padding:6px 5px;gap:5px;overflow:hidden}
#gameScreen .jg-left{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
#gameScreen .jg-right{overflow-y:auto;overflow-x:hidden;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}

/* board */
#gameScreen .jg-head{display:flex;justify-content:space-between;align-items:center;font-size:9px;font-weight:900;letter-spacing:.8px;flex:0 0 auto}
#gameScreen .jg-count{color:rgba(var(--jf-text),.75)}
#gameScreen .jg-letters{display:grid;grid-template-columns:repeat(5,1fr);text-align:center;font-size:12px;font-weight:900;color:var(--jg-acc,rgb(var(--jf-bottom)));flex:0 0 auto}
#gameScreen .grid-wrapper{flex:1;min-height:0;display:flex}
/* vertical board: BINGO header + 15 rows x 5 columns, fills the panel height */
#gameScreen .all-numbers-grid{flex:1 1 auto;align-self:stretch;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:auto repeat(15,minmax(0,1fr));
  grid-auto-flow:row;gap:5px 4px;width:100%;height:100%;padding:0;margin:0}
#gameScreen .board-letter{display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:900;letter-spacing:.5px;padding-bottom:5px;margin-bottom:1px;border-bottom:2px solid rgba(var(--jf-text),.32);color:rgba(var(--jf-text),.95)}
#gameScreen .number-cell-small{display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;padding:0;margin:0;
  border-radius:5px;font-size:clamp(10px,3.2vw,13px);letter-spacing:0;font-weight:500;font-variant-numeric:tabular-nums;
  background:rgba(var(--jf-text),.05);color:rgba(var(--jf-text),.7);border:1px solid rgba(var(--jf-text),.12);box-shadow:none;animation:none}
#gameScreen .number-cell-small.called{background:var(--jg-acc,rgb(var(--jf-bottom))) !important;color:var(--jg-ink,#0d0d0d) !important;
  border-color:rgba(var(--jf-text),.55) !important;box-shadow:none !important;font-weight:900}
#gameScreen .number-cell-small.current-call{background:#fff8ec !important;color:#0d0d0d !important;border-color:#fff8ec !important;
  outline:2px solid #fff8ec;outline-offset:1px;animation:none !important;position:relative;z-index:1;transform:scale(1.08)}

/* glass pipe */
#gameScreen .jg-pipe-zone{position:relative;min-height:0;display:flex;justify-content:center;overflow:visible}
#gameScreen .jg-pipe{position:absolute;top:0;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,46px);border-radius:99px;
  border:1px solid rgba(var(--jf-text),.55);background:linear-gradient(90deg,rgba(var(--jf-bottom),.10),rgba(var(--jf-text),.22),rgba(var(--jf-bottom),.10));
  box-shadow:inset 0 0 7px rgba(var(--jf-text),.15),0 0 12px rgba(var(--jf-bottom),.18);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
#gameScreen .jg-pipe:before{content:"";position:absolute;top:6px;bottom:6px;left:7px;width:2px;border-radius:2px;background:rgba(var(--jf-text),.45)}
#gameScreen .jg-track{position:absolute;top:0;bottom:6px;left:50%;transform:translateX(-50%);width:min(100%,46px);display:flex;
  flex-direction:column-reverse;align-items:center;justify-content:flex-start;pointer-events:none}
#gameScreen .jg-ball{flex:0 0 auto;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font-size:14px;font-weight:900;
  font-variant-numeric:tabular-nums;color:var(--jg-ink,#0d0d0d);border:2px solid rgb(var(--jf-text));
  /* note 2: no shine/gradient highlight, flat fill so the number (--jg-ink, picked for contrast against --jg-acc) is always readable */
  background:var(--jg-acc,rgb(var(--jf-bottom)));
  box-shadow:0 3px 8px rgba(0,0,0,.35);will-change:transform}
#gameScreen .jg-pipe-cap{position:absolute;bottom:10px;left:50%;transform:translateX(-50%) rotate(180deg);writing-mode:vertical-rl;
  font-size:7px;letter-spacing:1.4px;color:rgba(var(--jf-text),.55);white-space:nowrap;z-index:0;display:none}

/* right column */
#gameScreen .card-grid-container{flex:1;justify-content:flex-start;min-height:0;display:flex;flex-direction:column;gap:6px;overflow:visible;padding:0;margin:0;
  background:none;border:0;box-shadow:none;width:100%;max-width:none;align-items:stretch}
#gameScreen .jg-history{flex:0 0 auto;display:block;padding:0;margin:0;gap:0;background:none}
#gameScreen .jg-hist-bar{display:flex;align-items:center;gap:5px;height:38px;border-radius:99px;padding:3px 4px;
  background:rgba(var(--jf-top),.45);border:1px solid rgba(var(--jf-text),.18)}
#gameScreen .jg-launch{display:none}
#gameScreen .jg-hist-mid{flex:1;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch}
#gameScreen .jg-hist-mid::-webkit-scrollbar{display:none}
#gameScreen .jg-slider{display:flex;gap:4px;align-items:center;width:max-content}
#gameScreen .slider-number{width:28px;height:28px;min-width:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-size:10px;font-weight:800;background:rgba(var(--jf-text),.16);color:rgb(var(--jf-text));box-shadow:none;border:1px solid rgba(var(--jf-text),.25)}
#gameScreen .jg-curr{flex:0 0 auto;min-width:36px;height:30px;padding:0 6px;border-radius:99px;display:flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:900;white-space:nowrap;background:var(--jg-acc,rgb(var(--jf-bottom)));color:var(--jg-ink,#0d0d0d)}

#gameScreen .jg-card{flex:0 0 auto;display:flex;flex-direction:column;gap:3px;width:100%;padding:5px;border-radius:10px;
  background:rgba(var(--jf-top),.45);border:1px solid rgba(var(--jf-text),.22);margin:0}
#gameScreen .dual-card-label{margin:0;font-size:8px;font-weight:900;letter-spacing:1px;text-transform:uppercase;color:rgba(var(--jf-text),.8);text-align:left}
/* Session 4a: card header uses the winner card's header style (winner.css .jw-bh, row 1 of the 6x5 card) */
#gameScreen .jg-card-letters{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;margin-bottom:0;width:100%;box-sizing:border-box;text-align:center}
#gameScreen .jg-card-letters span{text-align:center;background:#d7d7d2;color:#222;border-radius:3px;padding:3px 0;font-size:clamp(8px,2.1vw,10px);font-weight:700}
#gameScreen .jg-card-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));gap:2px;
  width:100%;max-width:none;max-height:none;aspect-ratio:1/1;margin:0;padding:0}
#gameScreen #cardGridContainer .card-cell{display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;aspect-ratio:auto;
  padding:0;margin:0;border-radius:4px;font-size:clamp(9px,3vw,13px);font-weight:800;font-variant-numeric:tabular-nums;transform:none;
  background:rgba(var(--jf-text),.14);color:rgb(var(--jf-text));border:1px solid rgba(var(--jf-text),.28) !important;box-shadow:none;
  touch-action:manipulation;cursor:pointer;-webkit-tap-highlight-color:transparent}
#gameScreen #cardGridContainer .card-cell:hover{transform:none;box-shadow:none !important;border-color:rgba(var(--jf-text),.28) !important}
#gameScreen #cardGridContainer .card-cell.marked,#gameScreen #cardGridContainer .card-cell.free{
  background:var(--jg-acc,rgb(var(--jf-bottom)));color:var(--jg-ink,#0d0d0d);border-color:rgba(var(--jf-text),.7) !important;font-weight:900;box-shadow:none}
#gameScreen #cardGridContainer .card-cell.free{font-size:clamp(7px,2vw,9px);letter-spacing:.2px}

/* swipe for BINGO */
/* Session 6: BINGO pill button, "A" badge = auto-mark on (label only; the AUTO switch stays) */
#gameScreen .jg-swipe{position:relative;flex:0 0 33px;height:33px;align-self:stretch;width:100%;box-sizing:border-box;border-radius:99px;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;
  background:#1a1a1a;border:1px solid rgba(var(--jf-text),.3);cursor:pointer;display:grid;place-items:center}
/* Session 12: invisible touch extension, 33px pill + 11px below = 44px tap area (below only, so it never covers the bottom row of cells) */
#gameScreen .jg-swipe::after{content:"";position:absolute;left:0;right:0;top:0;bottom:-11px}
#gameScreen .jg-swipe:active{transform:scale(.97)}
#gameScreen .jg-swipe-label{font-size:11px;font-weight:900;letter-spacing:.8px;white-space:nowrap;color:#fff;pointer-events:none}
#gameScreen .jg-bingo-badge{display:none;position:absolute;right:6px;top:50%;transform:translateY(-50%);width:18px;height:18px;border-radius:50%;place-items:center;background:#f2b632;color:#17130b;font-size:10px;font-weight:900;pointer-events:none}
#gameScreen .jg-card.auto-on .jg-bingo-badge{display:grid}
#gameScreen .jg-swipe.done{background:#f2b632;border-color:#fff8ec}
#gameScreen .jg-swipe.done .jg-swipe-label{color:#17130b}
#gameScreen .jg-swipe.done .jg-bingo-badge{background:#17130b;color:#f2b632}
#gameScreen .jg-swipe:focus-visible{outline:2px solid rgb(var(--jf-text));outline-offset:2px}

/* watching mode: eyes block fills the right column, cards/history hidden by xindex's setWatchMode */
#gameScreen #watchModeEyes{padding:4px;gap:8px;text-align:center}
#gameScreen .watch-badge-wrap{width:min(110px,30vw);height:min(110px,30vw)}
#gameScreen .watch-badge-pulse{border-color:rgba(var(--jf-text),.4)}
#gameScreen .watch-badge-core{background:radial-gradient(circle at 38% 35%,rgb(var(--jf-surface)),rgb(var(--jf-top)));border-color:rgba(var(--jf-text),.35)}
#gameScreen .watch-badge-label{font-size:10px;letter-spacing:2px;color:rgb(var(--jf-text))}
#gameScreen .watch-badge-dot{background:var(--jg-acc,rgb(var(--jf-bottom)))}
#gameScreen .jg-watch-note{font-size:9px;line-height:1.4;color:rgba(var(--jf-text),.75);padding:6px;border-radius:8px;
  background:rgba(var(--jf-top),.4);border:1px solid rgba(var(--jf-text),.14)}

/* way back to rooms (the old header circle is gone) */
#gameScreen .jg-rooms{position:fixed;z-index:6;left:10px;bottom:calc(env(safe-area-inset-bottom,0px) + 1.2vh + 4px);height:36px;padding:0 14px;border-radius:99px;
  font:800 11px/1 -apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:.4px;color:rgb(var(--jf-text));
  background:rgba(var(--jf-top),.55);border:1px solid rgba(var(--jf-text),.3);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);cursor:pointer}

@media(max-height:640px){#gameScreen{--jg-top:calc(env(safe-area-inset-top,0px) + 100px + var(--jf-dy));--jg-bot:calc(env(safe-area-inset-bottom,0px) + 54px)}
  #gameScreen .jg-ball{width:34px;height:34px;font-size:12px}}
@media(prefers-reduced-motion:reduce){#gameScreen *{transition:none !important;animation:none !important}}

/* left section tabs (Session 4 add-on, from the unified ongame page): 75 BOARD | 10 CARDS. Swipe left/right also switches. */
#gameScreen .jg-tabs{display:flex;gap:4px;flex:0 0 auto}
#gameScreen .jg-tabs button{flex:1;min-width:0;padding:5px 2px;border-radius:7px;font:800 8px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;letter-spacing:.3px;white-space:nowrap;cursor:pointer;
  border:1px solid rgba(var(--jf-text),.22);background:rgba(var(--jf-top),.4);color:rgba(var(--jf-text),.85)}
#gameScreen .jg-tabs button.active{background:var(--jg-acc,rgb(var(--jf-bottom)));color:var(--jg-ink,#0d0d0d);border-color:rgb(var(--jf-text))}
#gameScreen .jg-cards-view{display:none;flex:1;min-height:0;flex-direction:column;gap:5px}
#gameScreen #leftPanel.show-cards .jg-cards-view{display:flex}
#gameScreen #leftPanel.show-cards>.jg-head,#gameScreen #leftPanel.show-cards>.jg-letters,#gameScreen #leftPanel.show-cards>.grid-wrapper{display:none}
#gameScreen .jg-player-grid{flex:1;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));gap:4px;overflow:hidden}
#gameScreen .jg-pc{min-width:0;min-height:0;display:flex;flex-direction:column;padding:3px 2px;border-radius:5px;background:#f5f0e5;color:#161616;
  border:2px solid transparent;box-shadow:0 3px 8px rgba(0,0,0,.35);animation:jgPcIn .4s ease-out backwards}
#gameScreen .jg-pc.mine{border-color:rgb(242,182,50)}
#gameScreen .jg-pc-name{font-size:clamp(7px,2vw,9px);font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:2px}
#gameScreen .jg-pc-head{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1px;text-align:center;font-size:clamp(5px,1.5vw,7px);font-weight:700;color:#222}
#gameScreen .jg-pc-head b{background:#d7d7d2;border-radius:2px;padding:1px 0;font-weight:700}
#gameScreen .jg-pc-cells{flex:1;min-height:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));gap:1px}
#gameScreen .jg-pc-cells span{display:grid;place-items:center;background:#e4ded0;border-radius:1px;font-size:clamp(5px,1.7vw,8px);overflow:hidden;font-variant-numeric:tabular-nums}
#gameScreen .jg-pc-cells span.hit{background:rgb(242,182,50);color:#17130b;font-weight:900}
#gameScreen .jg-cards-hint{flex:0 0 auto;font-size:7px;letter-spacing:.6px;text-align:center;color:rgba(var(--jf-text),.7)}
@keyframes jgPcIn{from{opacity:0;transform:rotateY(80deg) scale(.92)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){#gameScreen .jg-pc{animation:none}}

/* ═══════════════════════════════════════════════════════════════
   Session 5 — Speed in-game 10-card grid (360×740 / 390×844)
   ═══════════════════════════════════════════════════════════════ */

.speed-game-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* never more than 2 cards in a row */
  gap: 6px;
  width: 100%;
  max-width: 100%;
  padding: 4px 2px 8px;
  box-sizing: border-box;
}

@media (max-width: 380px) {
  .speed-game-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
}

.sgc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 3px 5px;
  border-radius: 8px;
  border: 1px solid rgba(var(--jf-text), .22);
  background: rgba(var(--jf-top), .45);              /* sky segment colours, like the 75 board */
  min-width: 0;
}
.sgc-card.sgc-won {
  border-color: var(--jg-acc, rgb(var(--jf-bottom)));
  box-shadow: 0 0 0 2px var(--jg-acc, rgb(var(--jf-bottom))), 0 0 14px rgba(var(--jf-text), .3);
  background: rgba(var(--jf-top), .7);
  position: relative;
}
.sgc-win-badge {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 800;
  color: var(--jg-ink, #0d0d0d);
  background: var(--jg-acc, rgb(var(--jf-bottom)));
  padding: 1px 5px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 2;
}
.sgc-title {
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 700;
  color: rgba(var(--jf-text), .95);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sgc-face {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(6, 1fr);                /* 5x6: header row (B I N G O) + 5 number rows */
  gap: 1px;
  width: 100%;
  aspect-ratio: 5 / 6.6;                             /* the old 5 / 5.8 plus one header row */
  background: rgba(var(--jf-top), .55);
  border-radius: 3px;
  padding: 1px;
}
.sgc-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(8px, 2.2vw, 10px);
  font-weight: 700;
  color: rgba(var(--jf-text), .92);
  overflow: hidden;
  background: rgba(var(--jf-text), .12);
  border-radius: 2px;
  min-width: 0;
  line-height: 1;
}
.sgc-head {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(8px, 2.1vw, 10px);
  font-weight: 800;
  background: #d7d7d2;                               /* same bone header as the classic card, winner card and 10-cards view */
  color: #222;
  border-radius: 2px;
  min-width: 0;
  line-height: 1;
}
.sgc-cell.free {
  background: var(--jg-acc, rgb(var(--jf-bottom)));
  color: var(--jg-ink, #0d0d0d);
}
.sgc-cell.marked {
  background: var(--jg-acc, rgb(var(--jf-bottom)));  /* same fill as a called number on the 75 board */
  color: var(--jg-ink, #0d0d0d);
  font-weight: 900;
  text-decoration: none;
}

/* Speed: classic dual card blocks hidden when multi dock is live */
.card-grid-container.speed-multi #cardBlock1,
.card-grid-container.speed-multi #cardBlock2 {
  display: none !important;
}

/* Ensure swipe is fully gone when hidden via style */
.jg-swipe[aria-hidden="true"] {
  display: none !important;
}

/* Phase Two S4: AUTO toggle above the 5x5 card. Auto on: the BINGO pill shows the A badge and taps on cells are ignored. */
#gameScreen .jg-auto{display:flex;justify-content:flex-end;margin:0}
#gameScreen .jg-auto-btn{display:flex;align-items:center;gap:6px;padding:3px 2px;margin:0;background:none;border:0;cursor:pointer;color:rgba(var(--jf-text),.9);-webkit-tap-highlight-color:transparent}
#gameScreen .jg-auto-label{font-size:9px;font-weight:900;letter-spacing:1px}
#gameScreen .jg-auto-track{position:relative;display:block;width:32px;height:17px;border-radius:99px;border:1px solid rgba(var(--jf-text),.5);background:rgba(var(--jf-text),.14);transition:background .18s}
#gameScreen .jg-auto-track b{position:absolute;top:1px;left:1px;width:13px;height:13px;border-radius:50%;background:rgb(var(--jf-text));transition:transform .18s}
#gameScreen .jg-auto-btn[aria-checked="true"] .jg-auto-track{background:var(--jg-acc,rgb(var(--jf-bottom)));border-color:var(--jg-acc,rgb(var(--jf-bottom)))}
#gameScreen .jg-auto-btn[aria-checked="true"] .jg-auto-track b{transform:translateX(15px);background:var(--jg-ink,#0d0d0d)}
#gameScreen .jg-card.auto-on .bingo-button{display:none !important} /* Session 6: the pill stays visible in auto mode (badge shows) */
#gameScreen #cardGridContainer .jg-card.auto-on .card-cell{pointer-events:none}

/* ═══ Phase Two S6: swipe between the 75 Board and the 10 cards (view dots, white-glove hint, ? button) ═══ */
#gameScreen #leftPanel{touch-action:pan-y;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#gameScreen .jg-dots{display:flex;justify-content:center;gap:5px;flex:0 0 auto;margin:-1px 0}
#gameScreen .jg-dots i{width:14px;height:3px;border-radius:2px;background:rgba(var(--jf-text),.28);transition:background .2s,width .2s}
#gameScreen .jg-dots i.on{width:22px;background:rgb(242,182,50)}
#gameScreen .jg-pc.won{border-color:#fff;box-shadow:inset 0 0 0 2px rgb(242,182,50),0 3px 8px rgba(0,0,0,.35)}
#gameScreen .jg-glove{position:absolute;left:0;right:0;top:66%;height:84px;z-index:4;pointer-events:none;display:none;flex-direction:column;align-items:center;justify-content:flex-start;
  --gx:min(62px,15vw)}
#gameScreen .jg-glove.on{display:flex}
#gameScreen .jg-glove-hand{position:absolute;top:8px;left:50%;width:34px;height:41px;margin-left:-17px;fill:#fff;stroke:#9aa3b2;stroke-width:1.3;stroke-linejoin:round;filter:drop-shadow(0 3px 5px rgba(0,0,0,.55));
  animation:none}
#gameScreen .jg-glove.go .jg-glove-hand{animation:jgGlove 1s ease-in-out both}
#gameScreen .jg-glove.goback .jg-glove-hand{animation:jgGloveBack 1s ease-in-out both}
#gameScreen .jg-glove-txt{position:absolute;top:56px;font:800 8px/1 -apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:1.5px;color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.8)}
@keyframes jgGlove{0%{transform:translateX(var(--gx)) scale(1);opacity:0}15%{opacity:1}25%{transform:translateX(var(--gx)) scale(.9)}85%{transform:translateX(calc(var(--gx)*-1)) scale(.9);opacity:1}100%{transform:translateX(calc(var(--gx)*-1)) scale(1);opacity:0}}
@keyframes jgGloveBack{0%{transform:translateX(calc(var(--gx)*-1)) scale(1);opacity:0}15%{opacity:1}25%{transform:translateX(calc(var(--gx)*-1)) scale(.9)}85%{transform:translateX(var(--gx)) scale(.9);opacity:1}100%{transform:translateX(var(--gx)) scale(1);opacity:0}}

/* Session 3: Watching has no BINGO control of any kind, whatever route brought the player here */
html[data-jema-screen="watching"] #gameScreen .jg-swipe,
html[data-jema-screen="watching"] #gameScreen .bingo-button{display:none !important}

/* Session 4: the round-start hint is one fast A->B->A (1 s in total), each leg 0.45 s */
#gameScreen .jg-glove.fast.go .jg-glove-hand{animation-duration:.45s}
#gameScreen .jg-glove.fast.goback .jg-glove-hand{animation-duration:.45s}

/* Change 16 part 2: four corner pills, same rules/positions as the card picker (copied scope) */
#gameScreen .jema-pill{position:fixed; z-index:35; height:clamp(40px,6vh,46px); display:flex; align-items:center; gap:8px;
  overflow:hidden; white-space:nowrap; cursor:pointer; font-family:inherit; color:var(--jema-text);
  background:linear-gradient(150deg,var(--jema-bg2),var(--jema-bg));
  border:1px solid var(--jema-accent-dim); box-shadow:0 2px 0 rgba(0,0,0,.4);
  -webkit-appearance:none; appearance:none; text-align:left;
  transition:width .38s cubic-bezier(.25,1,.5,1);
  -webkit-backdrop-filter:blur(10px) saturate(1.15); backdrop-filter:blur(10px) saturate(1.15);}
#gameScreen .jema-pill.open{z-index:41;}
#gameScreen .jema-pill:focus-visible{outline:2px solid var(--jema-accent); outline-offset:2px;}
#gameScreen .jema-pill-l{left:var(--safe-l); border-left:none; border-radius:0 999px 999px 0; padding:0 14px 0 10px;}
#gameScreen .jema-pill-r{right:var(--safe-r); border-right:none; border-radius:999px 0 0 999px; padding:0 10px 0 14px; flex-direction:row-reverse;}
#gameScreen .jema-pill-top{top:calc(var(--safe-t) + 4.6vh + var(--jf-dy));}
#gameScreen .jema-pill-bot{bottom:calc(var(--safe-b) + 1.2vh);}
#gameScreen .jema-pill-ico{font-size:18px; line-height:1; flex-shrink:0; min-width:22px; text-align:center;}
#gameScreen .jema-pill-txt{display:flex; flex-direction:column; justify-content:center; line-height:1.15;}
#gameScreen .jema-pill-k{display:none; font-size:9px; font-weight:700; color:var(--jema-text-dim); letter-spacing:.3px;}
#gameScreen .jema-inline{display:inline;}
#gameScreen .jema-pill-v{font-size:14px; font-weight:900; font-variant-numeric:tabular-nums;}
#gameScreen .jema-pill.open .jema-pill-k{display:block;}
/* Change 18: expanded = icon + label + value (default); collapsed = icon only */
#gameScreen .jema-pill:not(.open) .jema-pill-txt,#gameScreen .jema-pill:not(.open) .jema-pill-plus{display:none;}
#gameScreen .jema-pill-of{font-size:11px; font-weight:700; color:var(--jema-text-dim); margin-left:1px;}
#gameScreen .jema-pill-plus{flex-shrink:0; width:24px; height:24px; border-radius:50%; display:grid; place-items:center; font-size:17px; font-weight:900; line-height:1;
  background:var(--jema-accent); color:var(--jema-bg);}

#gameScreen .jg-stats{display:none}   /* old strip: ids stay in the DOM for the game code, the pills show the values */
html[data-jema-screen="winner"] #gameScreen .jema-pill{display:none!important}   /* none of the four on the Winner screen */
/* the four corner pills own the bottom corners (as on the picker); the old tab bar and its ▲ reveal button would sit on the Stake pill */
html[data-jema-screen="ongame"] #bottomNav,html[data-jema-screen="ongame"] #bottomNavReveal,html[data-jema-screen="watching"] #bottomNav,html[data-jema-screen="watching"] #bottomNavReveal{display:none!important}

/* ═══ Session 12: Classic UI (per-card AUTO, board fold, two-card spacing). Classic only; Speed untouched. ═══ */
/* card top row: "Card N" label left, that card's own AUTO switch right */
#gameScreen .jg-card-top{display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:22px}
#gameScreen .jg-card-top .jg-auto{margin:0 0 0 auto}
#gameScreen .jg-card .jg-auto-btn{min-height:22px}
/* equal columns: header and number face share the same five 1fr tracks and the same gap */
#gameScreen .jg-card-letters,#gameScreen .jg-card-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:2px}
#gameScreen .jg-card-letters span{min-width:0;overflow:hidden}
/* two cards: one tighter rule for BOTH cards (one-card sizing is unchanged) */
#gameScreen #cardGridContainer.dual{gap:12px}
#gameScreen #cardGridContainer.dual .jg-card{padding:4px 3px;gap:2px}
/* left/right padding is 3px at most, same for the header row and the five number rows (one card or two) */
#gameScreen #cardGridContainer .jg-card{padding-left:3px;padding-right:3px}
/* two cards: xindex-02-core.css shrinks the number grid to 80% wide (centred) while the header stays 100%, so the rows looked narrower than B I N G O.
   Both now span the full card width, same 2px gap. */
#gameScreen #cardGridContainer.dual .jg-card-grid{width:100%;max-width:none;max-height:none;margin:0;gap:2px}
#gameScreen #rightPanel.jg-classic{padding-left:3px;padding-right:3px}

/* bottom-left pill: count (21/75) is the big line, the latest call (N-36) the small one */
#gameScreen #jgCallPill .jema-pill-call{font-size:10px; font-weight:800; color:var(--jema-text-dim);}
#gameScreen #jgCallPill .jema-pill-v{font-size:17px;}
#gameScreen #jgCallPill .jema-pill-of{font-size:13px; font-weight:800; color:var(--jema-text);}

/* ═══ Layout session (10 Nov 2026): fixed proportions, zero cropping ═══
   Y 94.5% = bottom limit (5.5% empty strip, old Android nav bars). Panels, pipe: Y 18.5% to Y 91.2%.
   The strip 91.2%-94.5% (3.3%) holds the bottom row: Call pill | profile circle + mute | Stake pill.
   All of it is in vh (dvh where supported) so the proportions hold on every screen height. */
#gameScreen{
  --jg-top:max(calc(var(--jema-vh,1vh)*18.5),calc(env(safe-area-inset-top,0px) + 130px));   /* 130 = top circle bottom (34+92) + 4: only wins on screens under ~700px tall, so the circle never covers a panel */
  --jg-bot:max(calc(var(--jema-vh,1vh)*8.8),calc(env(safe-area-inset-bottom,0px) + var(--jema-band,3.3vh)));
}
/* board, pipe and right panel are three cells of ONE grid row: same top, same bottom. The pipe fills its cell, centred between the two panels. */
#gameScreen .jg-main{align-items:stretch}
#gameScreen .jg-pipe-zone{align-self:stretch;height:100%}
#gameScreen .jg-pipe{top:0;bottom:0;height:100%}
#gameScreen .jg-pipe:before{top:6px;bottom:6px}

/* bottom row: compact single-line pills that fit the 3.3% strip and end at 94.5% */
#gameScreen .jema-pill-bot{bottom:var(--jema-pad-bot,5.5vh);height:var(--jema-band,3.3vh);min-height:0;gap:5px;padding-top:0;padding-bottom:0;box-sizing:border-box}
#gameScreen .jema-pill-bot::after{content:"";position:absolute;left:0;right:0;top:-8px;bottom:-8px}   /* tap area only, draws nothing */
#gameScreen .jema-pill-bot .jema-pill-ico{font-size:min(16px,calc(var(--jema-band,3.3vh)*.6));min-width:0}
#gameScreen .jema-pill-bot .jema-pill-txt{flex-direction:row;align-items:center;gap:4px;line-height:1}
#gameScreen .jema-pill-bot .jema-pill-k{font-size:min(9px,calc(var(--jema-band,3.3vh)*.36));line-height:1}
#gameScreen .jema-pill-bot .jema-pill-v,#gameScreen #jgCallPill .jema-pill-v{font-size:min(14px,calc(var(--jema-band,3.3vh)*.5));line-height:1;display:flex;align-items:baseline}
#gameScreen #jgCallPill .jema-pill-call{font-size:min(10px,calc(var(--jema-band,3.3vh)*.36))}
#gameScreen #jgCallPill .jema-pill-of{font-size:min(11px,calc(var(--jema-band,3.3vh)*.4))}
/* the old "‹ Rooms" button sat under the Call pill at the bottom-left; it would now cross the strip, so it is off (hardware/Telegram back still returns to the lobby) */
#gameScreen .jg-rooms{display:none}

/* right panel adapts to the height instead of cropping: card number grids (and their B I N G O row) get a height cap.
   Constants = panel height (72.7vh) minus the history bar and the fixed parts of each card (label, AUTO, BINGO pill, gaps). */
#gameScreen #cardGridContainer .jg-card-letters,#gameScreen #cardGridContainer .jg-card-grid{align-self:center;width:min(100%,calc(var(--jema-vh,1vh)*72.7 - 170px))}
#gameScreen #cardGridContainer.dual .jg-card-letters,#gameScreen #cardGridContainer.dual .jg-card-grid{width:min(100%,calc((var(--jema-vh,1vh)*72.7 - 284px)/2))}
@media(max-height:620px){#gameScreen #cardGridContainer .card-cell{font-size:clamp(7px,2.4vw,9px)}}   /* short screens: smaller number text so five rows can shrink with the height cap */

/* ── Speed: first winning pattern (public/js/screens/speed-pattern.js). A card wins with 2 patterns; at the 2nd only the winner screen shows. ── */
#gameScreen{--p1-gold:242,182,50}
@keyframes jgP1Shake{0%,24%,100%{transform:none}4%{transform:translateX(-1.6px) rotate(-.9deg)}8%{transform:translateX(1.6px) rotate(.9deg)}12%{transform:translateX(-1.2px) rotate(-.6deg)}16%{transform:translateX(1.2px) rotate(.6deg)}20%{transform:translateX(-.6px) rotate(-.3deg)}}
/* 10 CARDS panel: pattern cells = black number on white, card shakes a little */
#gameScreen .jg-pc.p1{animation:jgP1Shake 2.6s ease-in-out infinite;box-shadow:0 0 0 1px rgb(var(--p1-gold)),0 0 8px rgba(var(--p1-gold),.55)}
#gameScreen .jg-pc-cells span.pat{background:#fff;color:#000;font-weight:900;box-shadow:inset 0 0 0 1px rgba(0,0,0,.35)}
/* my cards (sky-synced): gold border on every sky, pattern cells gold, shake */
.sgc-card.sgc-p1{border:2px solid rgb(var(--p1-gold,242,182,50));box-shadow:0 0 0 1px rgba(var(--p1-gold,242,182,50),.55),0 0 12px rgba(var(--p1-gold,242,182,50),.6);animation:jgP1Shake 2.6s ease-in-out infinite}
.sgc-cell.sgc-pat{background:rgb(var(--p1-gold,242,182,50));color:#17130b;font-weight:900;box-shadow:inset 0 0 0 1px rgba(60,40,0,.55)}
@media(prefers-reduced-motion:reduce){#gameScreen .jg-pc.p1,.sgc-card.sgc-p1{animation:none}}

/* ── Speed: info loop in the top circle + win-pattern reference in the right bar (public/js/screens/speed-info.js) ── */
/* top circle: the border/dial stays, the called number gives way to the info loop */
#jemaTopCircle .jf-info{display:none;position:absolute;inset:0;border-radius:50%;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  pointer-events:none;transition:opacity .22s,transform .22s}
html.jema-sp-on #jemaTopCircle .jf-info{display:flex}
html.jema-sp-on #jemaTopCircle .jf-main,html.jema-sp-on #jemaTopCircle .jf-label{opacity:0}
#jemaTopCircle .jf-info.out{opacity:0;transform:scale(.85)}
#jemaTopCircle .ji-a,#jemaTopCircle .ji-b{font-size:8px;line-height:1.1;letter-spacing:.6px;font-weight:800;color:rgba(var(--jf-text),.8)}
#jemaTopCircle .ji-m{font-size:30px;line-height:1.05;font-weight:900;color:rgb(var(--p1-gold,242,182,50));text-shadow:0 1px 6px rgba(0,0,0,.35)}
#jemaTopCircle .jf-info.sm .ji-m{font-size:26px}
/* right bar: mini bingo card in a circle (replaces the call chips) */
.sp-ref{display:none}
html.jema-sp-on #gameScreen .jg-hist-bar{height:54px;justify-content:center;gap:10px}
html.jema-sp-on #gameScreen .jg-hist-mid,html.jema-sp-on #gameScreen .jg-curr{display:none}
html.jema-sp-on #gameScreen .sp-ref{display:flex;align-items:center;justify-content:center;gap:10px}
.sp-chip{font-style:normal;width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:900;
  background:rgba(var(--jf-text),.16);color:rgb(var(--jf-text));border:1px solid rgba(var(--jf-text),.28);transition:background .2s,color .2s,transform .2s}
.sp-chip.lit{background:rgb(var(--p1-gold,242,182,50));color:#17130b;border-color:transparent;transform:scale(1.15)}
.sp-circle{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:rgba(var(--jf-top),.7);border:2px solid rgba(var(--jf-text),.3);transition:border-color .2s,box-shadow .2s}
.sp-ref.win .sp-circle{border-color:rgb(var(--p1-gold,242,182,50));box-shadow:0 0 0 2px rgba(var(--p1-gold,242,182,50),.45),0 0 14px rgba(var(--p1-gold,242,182,50),.85)}
.sp-grid{display:grid;grid-template-columns:repeat(5,5px);grid-template-rows:repeat(5,5px);gap:1.5px}
.sp-grid b{display:block;border-radius:50%;background:rgba(var(--jf-text),.22);transition:background .15s,transform .15s,opacity .3s}
.sp-grid b.free{background:rgba(var(--jf-text),.5)}
.sp-grid b.p1{background:rgb(var(--p1-gold,242,182,50));transform:scale(1.15)}
.sp-grid b.p2{background:#fff;transform:scale(1.15);box-shadow:0 0 3px rgba(255,255,255,.9)}
.sp-grid b.both{background:#fff;box-shadow:0 0 0 1.5px rgb(var(--p1-gold,242,182,50));transform:scale(1.2)}
.sp-ref.win .sp-grid b.p1,.sp-ref.win .sp-grid b.p2,.sp-ref.win .sp-grid b.both{background:rgb(var(--p1-gold,242,182,50));box-shadow:0 0 4px rgba(var(--p1-gold,242,182,50),.9)}
.sp-grid b.fade{opacity:.15}
@keyframes spShake{0%,100%{transform:none}15%{transform:translateX(-2px) rotate(-3deg)}35%{transform:translateX(2px) rotate(3deg)}55%{transform:translateX(-1.5px) rotate(-2deg)}75%{transform:translateX(1px) rotate(1.5deg)}}
.sp-ref.shake .sp-circle{animation:spShake .5s ease-in-out 1}
@media(prefers-reduced-motion:reduce){.sp-ref.shake .sp-circle{animation:none}}

/* ── Session 19: Speed, all held cards (up to 10 = 5 rows of 2) fit the right panel, none cut off.
   The dock takes the height left under the pattern bar and splits it into equal rows (--sgc-rows, set by game.js); each card fills its row
   (face no longer fixed to an aspect ratio) and a row never grows past 120px, so 1-4 cards keep a normal size. Numbers shrink with the screen height. ── */
#gameScreen .card-grid-container.speed-multi .speed-game-cards{flex:1 1 0;min-height:0;overflow:hidden;align-content:start;
  grid-template-rows:repeat(var(--sgc-rows,5),minmax(0,1fr));padding-bottom:2px}
#gameScreen .speed-game-cards .sgc-card{min-height:0;max-height:120px;overflow:hidden;box-sizing:border-box;padding:3px 3px 3px}
#gameScreen .speed-game-cards .sgc-title{flex:0 0 auto;line-height:1.1;font-size:clamp(8px,calc(var(--jema-vh,1vh)*1.3),11px)}
#gameScreen .speed-game-cards .sgc-face{flex:1 1 0;min-height:0;aspect-ratio:auto}
#gameScreen .speed-game-cards .sgc-cell,#gameScreen .speed-game-cards .sgc-head{font-size:clamp(6px,calc(var(--jema-vh,1vh)*1.25),10px)}

/* Watching circle = inline animated SVG (js/jema-watch.js), different each game, coloured by the sky theme.
   Inline = no file URL: nothing to open, download or copy on long-press. Not pressable, not selectable. */
#gameScreen .watch-badge-wrap,#gameScreen .watch-art,#gameScreen .watch-art *{pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-drag:none}
#gameScreen .watch-art{width:100%;height:100%;display:block}
#gameScreen .watch-art svg{width:100%;height:100%;display:block;overflow:visible}
