/* Pinball overlays on chess.css + fit-viewport + jukebox */
:root {
  --pin-felt: #0b1220;
  --pin-ink: #e8eef8;
}

.dot.red { background: #e63946; }
.dot.blue { background: #457b9d; }

/* HUD chrome must sit above the absolute-fill WebGL canvas */
.board-chrome {
  position: absolute;
  top: 10px;
  left: 10px;
  right: calc(10px + 72px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
  max-height: min(42%, 280px);
  overflow: hidden;
}
.in-game-info {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.igi-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}
.igi-block {
  min-width: 4.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 12px;
  background: rgba(8, 12, 22, 0.92);
  border: 1px solid rgba(180, 210, 255, 0.16);
  color: var(--pin-ink);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.igi-block.igi-status { flex: 1 1 12rem; min-width: min(100%, 12rem); }
.igi-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #8a9bb8);
  margin-bottom: 0.1rem;
}
.igi-block strong {
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.2;
}
.igi-copy {
  pointer-events: auto;
  align-self: center;
  padding: 0.45rem 0.75rem !important;
  font-size: 0.78rem !important;
  background: rgba(8, 12, 22, 0.92) !important;
}
.igi-players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
}
.igi-seat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.88);
  border: 1px solid rgba(180, 210, 255, 0.14);
  color: #e8eef8;
  font-size: 0.74rem;
  font-weight: 700;
}
.igi-seat.you { border-color: #5b8def; }
.igi-seat.empty { opacity: 0.55; }

.score-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  width: 100%;
  max-width: 720px;
}
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.88);
  border: 1px solid rgba(180, 210, 255, 0.16);
  color: #e8eef8;
  font-size: 0.78rem;
  font-weight: 700;
}
.score-chip.lead { border-color: #5b8def; }

.aim-hint {
  margin: 0;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.78);
  color: #c9d7f0;
  font-size: 0.72rem;
  font-weight: 600;
}

.btn-game-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 22;
  padding: 0.45rem 0.8rem !important;
  font-size: 0.8rem !important;
  background: rgba(8, 12, 22, 0.92) !important;
  color: #e8eef8 !important;
  border: 1px solid rgba(180, 210, 255, 0.2) !important;
}

/* Flip / Plunge must float above the absolute canvas */
.board-actions {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 24;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  width: min(96%, 420px);
}
.board-actions .btn {
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  background: rgba(8, 12, 22, 0.92) !important;
  color: #e8eef8 !important;
  border: 1px solid rgba(180, 210, 255, 0.22) !important;
}
.board-actions .btn.primary {
  background: #1d4ed8 !important;
  border-color: #60a5fa !important;
}
.board-actions .btn:disabled {
  opacity: 0.45;
}

.pin-controls {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  flex-wrap: wrap;
  pointer-events: auto;
  width: 100%;
}

.pin-controls .btn {
  min-width: 4.5rem;
  min-height: 2.75rem;
  font-weight: 800;
}

.pin-controls .btn.pin-wide {
  min-width: 7rem;
  flex: 1 1 7rem;
}

html.fit-viewport body.is-playing .chess-canvas-wrap {
  touch-action: none;
}

.game-menu {
  position: absolute;
  top: 48px;
  right: 10px;
  z-index: 26;
  width: min(320px, calc(100% - 20px));
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(8, 12, 22, 0.96);
  border: 1px solid rgba(180, 210, 255, 0.18);
  color: #e8eef8;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.game-menu[hidden] { display: none !important; }
.game-menu-title {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 800;
}
.game-menu-title span {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #8a9bb8;
}
.game-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0.2rem 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(180, 210, 255, 0.12);
  background: rgba(20, 28, 48, 0.9);
  color: #e8eef8;
  cursor: pointer;
  font-size: 0.78rem;
}
.game-menu-sep {
  height: 1px;
  margin: 0.45rem 0;
  background: rgba(180, 210, 255, 0.12);
}
.game-menu-room,
.game-menu-analytics,
.game-menu-hint {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  color: #8a9bb8;
}

.game-over {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 8, 16, 0.55);
  backdrop-filter: blur(4px);
}
.game-over[hidden] { display: none !important; }
.game-over-card {
  width: min(420px, 94%);
  background: #0c1220;
  border: 1px solid rgba(180, 210, 255, 0.18);
  border-radius: 18px;
  padding: 1.15rem 1.2rem 1.25rem;
  text-align: center;
  color: #e8eef8;
}
.game-over-kicker {
  margin: 0 0 0.25rem;
  color: #8a9bb8;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.game-over-card h2 {
  margin: 0 0 0.35rem;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2rem, 5vw, 2.6rem);
  color: #60a5fa;
}
.game-over-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.game-menu-styles.styles-pinball {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  max-height: 40vh;
  overflow: auto;
  padding-right: 0.2rem;
}
.game-menu-styles.styles-pinball .cpu-pick {
  font-size: 0.72rem;
  padding: 0.35rem 0.4rem;
}
.style-filter {
  width: 100%;
  margin: 0.25rem 0;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(180, 210, 255, 0.18);
  background: #121a2c;
  color: #e8eef8;
  font-size: 0.78rem;
}
.style-count {
  margin: 0 0 0.35rem;
  font-size: 0.65rem;
  color: #8a9bb8;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.fit-viewport body.is-playing .hud,
html.fit-viewport body.is-playing .players,
html.fit-viewport body.is-playing .share,
html.fit-viewport body.is-playing .turn {
  display: none !important;
}

@media (max-width: 900px) {
  .board-chrome { right: 10px; }
  .pin-controls .btn {
    min-height: 3rem;
    font-size: 0.95rem;
  }
}
