
/* ===== Flappy Bird Game: Leaderboard Styles ===== */
.rg2-lb-wrap {
  margin-top: 16px;
  background: #0f1226;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  color: #e8ecff;
}
.rg2-lb-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.rg2-lb-header h2 {
  margin: 0;
  font-size: 22px;
  color: #ffffff;
}
.rg2-lb-sub {
  font-size: 13px;
  color: #aab0d6;
}

/* Podium */
.rg2-lb-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 16px;
}
.rg2-lb-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.rg2-lb-card .rg2-lb-rank {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.rg2-lb-card .rg2-lb-rank span { margin-left: 6px; color: #aab0d6; font-weight: 600; }
.rg2-lb-card .rg2-lb-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  margin: 8px auto;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.22), rgba(255,255,255,0.06));
  color: #101327;
  font-weight: 800; font-size: 20px;
}
.rg2-lb-card .rg2-lb-name { font-weight: 600; font-size: 14px; color: #e8ecff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg2-lb-card .rg2-lb-score { margin-top: 4px; font-weight: 800; font-size: 16px; color: #ffd76a; }

/* Accents by rank */
.rg2-lb-card.first { box-shadow: 0 0 0 2px rgba(255,215,106,0.25) inset; }
.rg2-lb-card.second { box-shadow: 0 0 0 2px rgba(180,193,210,0.25) inset; }
.rg2-lb-card.third { box-shadow: 0 0 0 2px rgba(242,173,92,0.25) inset; }

/* Table */
.rg2-lb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 10px;
}
.rg2-lb-table thead th {
  background: #161a36;
  color: #000000;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 12px;
}
.rg2-lb-table thead th.right { text-align: right; }
.rg2-lb-table tbody tr:nth-child(odd) { background: rgba(255,255,255,0.03); }
.rg2-lb-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.06); }
.rg2-lb-table tbody td {
  padding: 10px 12px;
  color: #e8ecff;
  font-size: 14px;
}
.rg2-lb-table td.right { text-align: right; }
.rg2-lb-table td .badge {
  display: inline-block;
  background: #272b51;
  color: #bfc5ec;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

/* Tabs and meta */
.rg2-lb-tabs { display: flex; gap: 8px; margin: 8px 0 12px; }
.rg2-lb-tabs .rg2-tab {
  background: #161a36;
  color: #bfc5ec;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}
.rg2-lb-tabs .rg2-tab.active { background: #272b51; color: #fff; }
.rg2-lb-meta { font-size: 13px; color: #aab0d6; margin: 4px 0 10px; }
.hidden { display: none; }

/* Winner badges */
.rg2-winner, .rg2-winner-badge {
  display: inline-block;
  margin-left: 8px;
  background: linear-gradient(90deg, #ffd76a, #f2ad5c);
  color: #000000!important;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 800;
  font-size: 11px;
}

/* Prize Pool Section */
.rg2-prize-pool {
  background: linear-gradient(135deg, #1a1f3a 0%, #0f1226 100%);
  border: 2px solid #ffd76a;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 12px 0 20px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(255, 215, 106, 0.15);
}

.rg2-prize-pool h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #ffd76a;
  font-weight: 700;
}

.rg2-prize-amount {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  margin: 8px 0;
}

.rg2-prize-subtitle {
  font-size: 13px;
  color: #aab0d6;
  margin: 4px 0 0;
}

.rg2-prize-loading {
  color: #aab0d6;
  font-style: italic;
}

/* Archives */
.rg2-arch-ul { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.rg2-arch-item {
  background: #0f1226;
  color: #e8ecff;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.rg2-arch-item:hover { background: #161a36; }
.rg2-arch-header { font-weight: 700; margin: 6px 0 8px; color: #e8ecff; }

/* Responsive */
@media (max-width: 640px) {
  .rg2-lb-podium { grid-template-columns: 1fr; }
}

/* Top-up Modal Styles */
.rg2-topup-modal { position: fixed; inset: 0; z-index: 9999; }
.rg2-topup-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.6);
}
.rg2-topup-dialog {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 92%; max-width: 420px; background: #0f1226; color: #e8ecff;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  padding: 18px;
}
.rg2-topup-title { margin: 0 0 10px; font-size: 18px; color: #ffd76a; font-weight: 800; }
.rg2-topup-field { margin-bottom: 14px; }
.rg2-topup-field label { display: block; margin-bottom: 6px; font-weight: 700; color: #cfd5ff; }
.rg2-topup-amount-wrap { display: flex; align-items: center; gap: 8px; }
#rg2-topup-currency { display: inline-block; background: #272b51; color: #ffd76a; font-weight: 800; padding: 8px 10px; border-radius: 6px; }
#rg2-topup-amount { flex: 1; padding: 10px 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15); background: #161a36; color: #ffffff; font-size: 16px; }
.rg2-topup-dialog #rg2-topup-amount::placeholder { color: #ffffff !important; opacity: 1 !important; }
.rg2-topup-dialog #rg2-topup-amount::-webkit-input-placeholder { color: #ffffff !important; }
.rg2-topup-dialog #rg2-topup-amount::-moz-placeholder { color: #ffffff !important; opacity: 1 !important; }
.rg2-topup-dialog #rg2-topup-amount:-ms-input-placeholder { color: #ffffff !important; }
.rg2-topup-dialog #rg2-topup-amount::-ms-input-placeholder { color: #ffffff !important; }
.rg2-topup-hint { display: block; margin-top: 6px; color: #aab0d6; font-size: 12px; }
.rg2-topup-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.rg2-preset-btn { background: #272b51; color: #ffd76a; border: 1px solid rgba(255,255,255,0.15); padding: 6px 10px; border-radius: 6px; cursor: pointer; font-weight: 700; }
.rg2-preset-btn:hover { filter: brightness(1.05); }
.rg2-topup-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.rg2-btn-secondary { background: #272b51; color: #bfc5ec; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.rg2-btn-secondary:hover { filter: brightness(1.05); }
.rg2-btn-primary { background: #ffd76a; color: #111; border: none; padding: 10px 14px; border-radius: 6px; font-weight: 800; cursor: pointer; }
.rg2-btn-primary:hover { filter: brightness(0.98); }

/* Flappy Bird Game Styles */

#rg2-game-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
    border: 2px solid #000;
    box-sizing: border-box;
}

#rg2-game-canvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80vh;
    min-height: 360px; /* Ensure visible frame for guests and pre-game */
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 60%, #0f1226 100%);
}

#rg2-score {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 2;
}

/* See Leaderboard button (top-right, opposite of score) */
#rg2-see-leaderboard {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #111;
    background: #ffd76a;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 3; /* stays inside the game container */
}
#rg2-see-leaderboard:hover { filter: brightness(0.98); }
#rg2-see-leaderboard:active { transform: translateY(1px); }

#rg2-game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
    z-index: 9;
}

#rg2-game-over h2 {
    margin: 0 0 10px;
}

#rg2-restart-btn {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 10px;
}

#rg2-wallet-select {
    margin: 10px 0;
    padding: 5px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* ===== Runner Game: Leaderboard Styles (copied from Flappy Bird) ===== */
.rg2-lb-wrap {
  margin-top: 16px;
  background: #0f1226;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  color: #e8ecff;
}
.rg2-lb-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.rg2-lb-header h2 {
  margin: 0;
  font-size: 22px;
  color: #ffffff;
}
.rg2-lb-sub {
  font-size: 13px;
  color: #aab0d6;
}

/* Podium */
.rg2-lb-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 16px;
}
.rg2-lb-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.rg2-lb-card .rg2-lb-rank {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.rg2-lb-card .rg2-lb-rank span { margin-left: 6px; color: #aab0d6; font-weight: 600; }
.rg2-lb-card .rg2-lb-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  margin: 8px auto;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.22), rgba(255,255,255,0.06));
  color: #101327;
  font-weight: 800; font-size: 20px;
}
.rg2-lb-card .rg2-lb-name { font-weight: 600; font-size: 14px; color: #e8ecff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg2-lb-card .rg2-lb-score { margin-top: 4px; font-weight: 800; font-size: 16px; color: #ffd76a; }

/* Accents by rank */
.rg2-lb-card.first { box-shadow: 0 0 0 2px rgba(255,215,106,0.25) inset; }
.rg2-lb-card.second { box-shadow: 0 0 0 2px rgba(180,193,210,0.25) inset; }
.rg2-lb-card.third { box-shadow: 0 0 0 2px rgba(242,173,92,0.25) inset; }

/* Table */
.rg2-lb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 10px;
}
.rg2-lb-table thead th {
  background: #161a36;
  color: #000000;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 12px;
}
.rg2-lb-table thead th.right { text-align: right; }
.rg2-lb-table tbody tr:nth-child(odd) { background: rgba(255,255,255,0.03); }
.rg2-lb-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.06); }
.rg2-lb-table tbody td {
  padding: 10px 12px;
  color: #e8ecff;
  font-size: 14px;
}
.rg2-lb-table td.right { text-align: right; }
.rg2-lb-table td .badge {
  display: inline-block;
  background: #272b51;
  color: #bfc5ec;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

/* Tabs and meta */
.rg2-lb-tabs { display: flex; gap: 8px; margin: 8px 0 12px; }
.rg2-lb-tabs .rg2-tab {
  background: #161a36;
  color: #bfc5ec;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}
.rg2-lb-tabs .rg2-tab.active { background: #272b51; color: #fff; }
.rg2-lb-meta { font-size: 13px; color: #aab0d6; margin: 4px 0 10px; }
.hidden { display: none; }

/* Winner badges */
.rg2-winner, .rg2-winner-badge {
  display: inline-block;
  margin-left: 8px;
  background: linear-gradient(90deg, #ffd76a, #f2ad5c);
  color: #000000!important;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 800;
  font-size: 11px;
}

#rg2-leaderboard, #fbg-leaderboard {
    margin-top: 20px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    #rg2-game-container {
        max-width: 100%;
        border-width: 1px;
    }
    
    #rg2-score {
        font-size: 18px;
        padding: 3px 6px;
    }
    
    #rg2-game-over {
        padding: 10px;
    }
    
    #rg2-game-over h2 {
        font-size: 24px;
    }
    
    #rg2-restart-btn {
        font-size: 16px;
        padding: 8px 16px;
    }
}

/* Override: Make leaderboard table header text white */
#rg2-leaderboard .fbg-lb-table thead th,
#rg2-leaderboard .rg2-lb-table thead th {
  color: #ffffff !important;
}

/* Hide podium avatars (initials) */
#rg2-leaderboard .fbg-lb-avatar {
  display: none !important;
}
