/* ==========================================================
   Shared Modal Base — common modal patterns for Snake/Pong.
   Tetris has its own modal base in style.css (different scaling).
   ========================================================== */

/* --- Language toggle (EN/PL) used in modals --- */
.control-toggle {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  margin: 12px 0;
}
.control-toggle button {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Gemunu Libre', ui-sans-serif, system-ui;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: all .15s;
}
.control-toggle button.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.control-toggle button:hover:not(.active) {
  background: rgba(255,255,255,0.08);
}

/* --- Settings rows (shared by Snake/Pong lobby) --- */
.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.setting-group-sep {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 6px 0 22px;
}
.setting-label {
  font-size: 24px;
  color: rgba(255,255,255,0.55);
  width: 200px;
  min-width: 200px;
  flex-shrink: 0;
  font-weight: 600;
  white-space: nowrap;
}
.setting-range {
  flex: 1;
  accent-color: var(--block-accent, #60a5fa);
  cursor: pointer;
  height: 6px;
}
.setting-val {
  font-size: 24px;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}
.setting-input-num {
  width: 68px;
  padding: 8px 8px;
  font-size: 24px;
  font-weight: 700;
  font-family: 'Gemunu Libre', ui-sans-serif, system-ui;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  text-align: center;
  outline: none;
}
.setting-input-num:focus {
  border-color: rgba(255,255,255,0.4);
}
.setting-board-sep {
  font-size: 16px;
  color: rgba(255,255,255,0.3);
  font-weight: 700;
}

/* --- Modal columns (lobby layout) --- */
.modal-columns {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.modal-col-left { flex: 1; min-width: 0; }
.modal-col-right { flex: 1; min-width: 0; }
@media (max-width: 600px) {
  .modal-columns { flex-direction: column; gap: 16px; }
}

/* --- Gameover overlay shared structure --- */
.gameover-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gameover-overlay.hidden { display: none; }
.gameover-card {
  text-align: center;
  padding: 40px 50px;
  border-radius: 18px;
  background: rgba(10,12,16,0.97);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 20px 80px rgba(0,0,0,0.55);
  transform-origin: center;
  animation: modalIn .3s ease-out forwards;
}
.gameover-title {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 12px;
}
.gameover-sub {
  font-size: 22px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 28px;
}
.gameover-score {
  font-size: 96px;
  font-weight: 800;
  margin-bottom: 28px;
  line-height: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
}
.gameover-score .score-sep {
  color: rgba(255,255,255,0.3);
  font-size: 60px;
}
.gameover-detail {
  font-size: 18px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* --- Settings toggle in gameover --- */
.go-settings-toggle {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 8px 20px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 16px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: 'Gemunu Libre', ui-sans-serif, system-ui;
}
.go-settings-toggle:hover {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.3);
}
.go-settings-toggle .go-arrow {
  display: inline-block;
  transition: transform 0.25s;
}
.go-settings-toggle.is-open .go-arrow {
  transform: rotate(180deg);
}
.go-settings-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  margin-bottom: 8px;
}
.go-settings-body.is-open {
  max-height: 500px;
  overflow-y: auto;
}
