/* Splitscreen-PROTOTYPEN 760 / 1152 (Tobias lør 26.09.2026, BIN-4671 + BIN-4677).
 *
 * Mål og farger fra mockupen «Anbefalt 26.09 · 760 / 1152» (verkstedet
 * ~/spillorama-vakt/splitscreen-terminal-22-09/, forslag-760 + solo-fane). Tallene er
 * design-px på 1920-terminalen; splitscreen-prototype.js skalerer --ssp-left/--ssp-right
 * proporsjonalt på smalere skjerm. Alt er skopet på html[data-ssp], som bare settes når
 * prototypen er aktiv — uten den er skallet bit for bit som før. */

/* ── Spillflaten ───────────────────────────────────────────────────────── */
/* #web-game-container har inline inset:0 og top/height fra skallets !important-regler —
   og spillklienten setter position:relative inline når den monterer. Da forskyver
   `right` bare boksen, så bredden settes eksplisitt og `right` nulles. Under 1300 px
   (nettbrett-skjermen) får fanen sin egen stripe til høyre (data-ssp-tab="edge"); på desktop
   står den innenfor chatten og spillflaten beholder full bredde (se .ssp-tab). I delt skjerm
   står Papir Bingo i venstre 760 px og spiller videre (spillet måler containeren selv og
   bygger oppsettet på nytt). */
html[data-ssp="tab"][data-ssp-tab="edge"] body:has(.lobby-back-bar.is-visible) #web-game-container {
  right: auto !important;
  width: calc(100% - var(--ssp-tab, 132px)) !important;
}
html[data-ssp="split"] body:has(.lobby-back-bar.is-visible) #web-game-container {
  right: auto !important;
  width: var(--ssp-left, 760px) !important;
}
/* Bare én splitscreen om gangen: ADR-0103-knappen viker mens prototypen deler skjermen. */
html[data-ssp="split"] #game-bar-split-btn { display: none !important; }

/* ── Kant-fanen (Papir Bingo alene) ────────────────────────────────────── */
.ssp-tab {
  position: fixed;
  top: var(--game-topbar-rendered-height, 101px);
  right: 0;
  bottom: 0;
  width: var(--ssp-tab, 132px);
  z-index: 905; /* over #web-game-container (900) og launch-splash (901/902) */
  box-sizing: border-box;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px 10px;
  border: 0;
  border-left: 3px solid #ff8fc7;
  background: #1d1230;
  box-shadow: -18px 0 36px -12px rgba(0, 0, 0, 0.75);
  font: 15px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #f4eefb;
  cursor: pointer;
  text-align: center;
}
/* Desktop (BIN-4677, mockupen «+ kant-fane»): fanen står INNENFOR chat-skinnen — bongene, fanen,
   chatten ytterst. Spill 1 har full bredde og holder selv av fanens plass
   (html[data-game-right-reserve]); --game-chat-rail-width er chatbredden Spill 1 skriver på body. */
html[data-ssp-tab="inside-chat"] .ssp-tab { right: var(--game-chat-rail-width, 0); }
.ssp-tab:hover { background: #241640; }
.ssp-tab:focus-visible { outline: 3px solid #ff8fc7; outline-offset: -3px; }
.ssp-tab-badge {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ff8fc7;
}
.ssp-tab-games { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.ssp-tab-game { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ssp-tab-game img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.8), 0 0 0 1px color-mix(in srgb, var(--a) 35%, transparent);
}
.ssp-tab-name {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.8);
}
.ssp-tab-pull {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 8px;
  border-radius: 10px;
  background: linear-gradient(#ff9ecd, #e0609f);
  color: #2a0a1c;
}
.ssp-tab-chev { font-size: 22px; line-height: 1; font-weight: 900; }
.ssp-tab-pull-text { font-size: 13px; font-weight: 800; line-height: 1.2; }
.ssp-tab-hint { font-size: 11.5px; line-height: 1.35; color: rgba(255, 255, 255, 0.62); }

/* ── Høyrepanelet (delt skjerm) ────────────────────────────────────────── */
.ssp-panel {
  position: fixed;
  top: var(--game-topbar-rendered-height, 101px);
  right: 0;
  bottom: 0;
  width: calc(var(--ssp-divider, 8px) + var(--ssp-right, 1152px));
  z-index: 905;
  display: flex;
  background: #120a1c;
  color: #f4eefb;
  font: 14px/1.35 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.ssp-panel *,
.ssp-confirm * { box-sizing: border-box; }
.ssp-divider {
  flex: 0 0 var(--ssp-divider, 8px);
  background: linear-gradient(rgba(224, 182, 90, 0.34), rgba(224, 182, 90, 0.08));
}
.ssp-column {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
/* Spillet: resten av høyden over båndet (1152 × ~811). Lucky Bingo/Bingo Deal monteres
   med stageLayout 'splitscreen-panel' (BIN-4675): låst desktop-scene, og høyden den ikke
   trenger spres over lagene. Host-elementet fyller boksen (inset:0), som i lobbyens
   inline-sti. */
.ssp-game {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #000;
}
.ssp-game-host { position: absolute; inset: 0; }
.ssp-game-loader,
.ssp-game-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: rgba(244, 238, 251, 0.85);
  background: #120a1c;
}
.ssp-game-message p { margin: 0; max-width: 420px; }

/* Bunnbåndet: lukkeknapper til venstre, «Velg databingo» til høyre. */
.ssp-band {
  flex: 0 0 var(--ssp-band, 171px);
  height: var(--ssp-band, 171px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 12px 14px;
  background: linear-gradient(#1a0f24, #120a1c);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.ssp-band-close {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.ssp-close-btn {
  flex: 1 1 0;
  max-height: 70px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ssp-close-btn:hover { background: rgba(255, 255, 255, 0.13); }
.ssp-close-btn:focus-visible { outline: 3px solid #ff8fc7; outline-offset: 2px; }
.ssp-close-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ssp-close-text b { font-size: 16.5px; font-weight: 800; }
.ssp-close-text small {
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.62);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ssp-close-x { margin-left: auto; font-size: 20px; opacity: 0.8; }
.ssp-ico { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; }
.ssp-ico span { font-size: 12px; color: rgba(255, 255, 255, 0.5); }
.ssp-ico i {
  display: inline-flex;
  width: 36px;
  height: 22px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.ssp-ico i::before,
.ssp-ico i::after { content: ""; display: block; height: 100%; }
.ssp-ico .ssp-ico-split::before { width: 40%; background: #e0b65a; }
.ssp-ico .ssp-ico-split::after { width: 60%; background: #ff8fc7; }
.ssp-ico .ssp-ico-s1::before { width: 100%; background: #e0b65a; }
.ssp-ico .ssp-ico-db::before { width: 100%; background: #ff8fc7; }

.ssp-band-games {
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.ssp-band-k {
  display: block;
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
/* Fire kort i bredden; flere blas med pilene eller sveip (Tobias 03.10.2026, fem databingo-spill). */
.ssp-band-pager { position: relative; min-width: 0; }
.ssp-band-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 30px) / 4);
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.ssp-band-list::-webkit-scrollbar { display: none; }
.ssp-band-list .ssp-card { scroll-snap-align: start; }
.ssp-band-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(18, 10, 28, 0.9);
  color: #f4eefb;
  font: 800 24px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.ssp-band-nav--prev { left: -10px; }
.ssp-band-nav--next { right: -10px; }
.ssp-band-nav[hidden] { display: none; }
.ssp-band-nav:hover { border-color: #6ee7e0; }
.ssp-band-nav:focus-visible { outline: 3px solid #ff8fc7; outline-offset: 2px; }
.ssp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #2b1d45;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ssp-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 87px;
  object-fit: cover;
  border-radius: 7px;
}
.ssp-card-name {
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ssp-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(18, 10, 28, 0.85);
  color: #f4eefb;
}
.ssp-card-badge[hidden] { display: none; }
.ssp-card[aria-current="true"] { border-color: #6ee7e0; cursor: default; }
.ssp-card[aria-current="true"] .ssp-card-badge { background: #6ee7e0; color: #0d2b29; }
.ssp-card:not([aria-current="true"]):not(:disabled):hover { border-color: var(--a); }
.ssp-card:focus-visible { outline: 3px solid #ff8fc7; outline-offset: 2px; }
.ssp-card:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Bekreftelse over panelet som lukkes ───────────────────────────────── */
.ssp-confirm {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(8, 4, 5, 0.74);
  font: 15px/1.5 Inter, system-ui, sans-serif;
}
/* Venstre side: over Papir Bingo-flaten (egen fixed-flate, ikke inne i spillet). */
.ssp-confirm--left {
  position: fixed;
  top: var(--game-topbar-rendered-height, 101px);
  left: 0;
  bottom: 0;
  right: auto;
  width: var(--ssp-left, 760px);
  z-index: 906;
}
.ssp-confirm-card {
  width: 100%;
  max-width: 480px;
  padding: 24px 26px;
  border-radius: 14px;
  background: #3a1822;
  border: 1px solid rgba(224, 182, 90, 0.45);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9);
  color: #f6f0e2;
}
.ssp-panel .ssp-confirm-card {
  background: #2b1d45;
  border-color: rgba(255, 143, 199, 0.45);
  color: #f4eefb;
}
.ssp-confirm-card h4 { margin: 0 0 8px; font-size: 21px; font-weight: 800; }
.ssp-confirm-card p { margin: 0 0 12px; font-size: 15px; color: rgba(246, 240, 226, 0.8); }
.ssp-confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
.ssp-confirm-actions button {
  flex: 1 1 0;
  min-height: 48px;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.ssp-btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(246, 240, 226, 0.88);
}
.ssp-btn-go {
  border: 1px solid #f0c352;
  background: linear-gradient(#f5cd6a, #dda32c);
  color: #331d02;
}
.ssp-panel .ssp-btn-go {
  border-color: #ff9ecd;
  background: linear-gradient(#ff9ecd, #e0609f);
  color: #2a0a1c;
}
