/* ============================================================
   20-mode-select.css — Game mode / package picker (matches Telegram-style menu)
   ============================================================ */

.mode-select {
  position: fixed;
  inset: 0;
  z-index: 25000;
  background: #0a0c10;
  display: flex;
  flex-direction: column;
  padding: 0;
  opacity: 1;
  transition: opacity 0.35s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mode-select.hide {
  opacity: 0;
  pointer-events: none;
}

.mode-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 16px 10px;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mode-top-spacer {
  flex: 1;
  min-width: 0;
}

/* Brand / bot handle intentionally removed from the stake picker */

.mode-lang {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mode-lang-btn {
  border: 1px solid #2a9d4a;
  background: transparent;
  color: #e6edf3;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.mode-lang-btn.active {
  background: #2a9d4a;
  color: #fff;
  border-color: #2a9d4a;
}

.mode-menu-btn {
  background: transparent;
  border: none;
  color: #8b949e;
  font-size: 22px;
  padding: 4px 6px;
  cursor: pointer;
  line-height: 1;
}

.mode-body {
  flex: 1;
  padding: 28px 18px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.mode-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #e6edf3;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.mode-card {
  background: linear-gradient(145deg, #12161e 0%, #0e1218 100%);
  border: 1px solid #243041;
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 50%, rgba(42,157,74,0.08), transparent 55%);
  pointer-events: none;
}

.mode-card:active {
  transform: scale(0.98);
}

.mode-card:hover,
.mode-card:focus-visible {
  border-color: #2a9d4a;
  box-shadow: 0 0 0 1px rgba(42,157,74,0.35);
  outline: none;
}

.mode-card-info {
  flex: 1;
  min-width: 0;
}

.mode-card-price {
  font-size: 20px;
  font-weight: 800;
  color: #f0f3f6;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.mode-card-desc {
  font-size: 13px;
  color: #8b949e;
  line-height: 1.4;
}

/* Live pool preview: how much this tier's CURRENT round has already collected, updated the
   instant anyone (on either tier) buys a card - see setTierPreview()/renderTierPreview() in
   js/06-online.js. Sits in the gap between the price text and the arrow button so it reads
   at a glance, with no need to open the round first. Hidden in offline/demo mode (no server
   round to show) - body.online is only added once onlineConnect() actually runs. */
.mode-card-pool {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
  min-width: 56px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(240, 193, 75, 0.08);
}

body.online .mode-card-pool {
  display: flex;
}

.mode-card-pool .mcp-label {
  font-size: 10px;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mode-card-pool .mcp-val {
  font-size: 14px;
  font-weight: 800;
  color: #f0c14b;
  white-space: nowrap;
}

/* Replayed every time the amount actually grows (setTierPreview) - a quick, self-contained
   pop, not a loop, so it draws the eye to a real change instead of nagging. */
.mode-card-pool.pulse {
  animation: modePoolPulse 0.4s ease-out;
}

@keyframes modePoolPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .mode-card-pool.pulse { animation: none; }
}

.mode-card-go {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #2a9d4a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(42,157,74,0.35);
  transition: background 0.15s, transform 0.15s;
}

.mode-card:active .mode-card-go {
  transform: scale(0.92);
}

.mode-footer {
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: #5a6270;
  margin-top: auto;
}

/* When mode select is visible, hide the rest of the app chrome */
body.mode-picking .header,
body.mode-picking .select-chrome,
body.mode-picking #phase-select,
body.mode-picking #phase-game,
body.mode-picking #card-preview,
body.mode-picking #select-footer,
body.mode-picking .bottom-nav,
body.mode-picking #tab-home > .header {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ---- Hamburger dropdown menu ---- */
.mode-dropdown {
  position: fixed;
  top: 56px;
  right: 12px;
  z-index: 30000;
  min-width: 220px;
  background: #151a22;
  border: 1px solid #2a3340;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04);
  padding: 8px 0;
  animation: modeDdIn 0.18s ease;
}

@keyframes modeDdIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.mode-dd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 18px;
  background: transparent;
  border: none;
  color: #e6edf3;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.mode-dd-item:active,
.mode-dd-item:hover {
  background: rgba(42, 157, 74, 0.15);
}

.mode-dd-item span:first-child {
  width: 22px;
  text-align: center;
  opacity: 0.85;
}

.mode-dd-divider {
  height: 1px;
  background: #2a3340;
  margin: 6px 0;
}

.mode-dd-danger {
  color: #f85149;
}

.mode-dd-danger:hover {
  background: rgba(248, 81, 73, 0.12);
}

/* Backdrop when menu is open */
.mode-dd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29900;
  background: rgba(0,0,0,0.35);
}
