/* ============================================================
   Play2Earn USDT — App Styles  v2 (shared hosting fix)
   ============================================================ */

:root {
  --p2e-bg:      #0d0f1a;
  --p2e-surface: #161929;
  --p2e-card:    #1e2235;
  --p2e-border:  #2a3050;
  --p2e-gold:    #f4c542;
  --p2e-green:   #22c55e;
  --p2e-accent:  #7c3aed;
  --p2e-text:    #e2e8f0;
  --p2e-muted:   #64748b;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--p2e-bg);
  color: var(--p2e-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  margin: 0;
}

/* ── Navbar ───────────────────────────────────────────────── */
.p2e-nav {
  background: rgba(13,15,26,.97) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--p2e-border);
  z-index: 1030;
}

/* ── Main padding (under fixed navbar) ────────────────────── */
.p2e-main {
  padding-top: 72px;
  padding-bottom: 2rem;
  min-height: calc(100vh - 60px);
}

/* ── Footer ───────────────────────────────────────────────── */
.p2e-footer {
  background: var(--p2e-surface) !important;
  border-top: 1px solid var(--p2e-border) !important;
}

/* ── Cards ────────────────────────────────────────────────── */
.p2e-card {
  background: var(--p2e-card);
  border: 1px solid var(--p2e-border);
  border-radius: 12px;
  transition: border-color .2s, transform .15s;
}
.p2e-card:hover { border-color: var(--p2e-gold); transform: translateY(-2px); }

/* ── Game Grid ────────────────────────────────────────────── */
.game-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 600px)  { .game-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .game-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .game-grid { grid-template-columns: repeat(5, 1fr); } }

.game-thumb {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
  border-radius: 8px 8px 0 0;
  display: block;
}
.game-card { cursor: pointer; overflow: hidden; }
.game-card .game-body { padding: .5rem .7rem; }
.game-card h6 {
  font-size: .82rem; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-card .badge { font-size: .65rem; }

/* ── Game Player Overlay ──────────────────────────────────── */
/* FONTOS: display:none külön, flex-direction külön */
#game-player-wrap {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: #000;
  display: none;          /* alapból rejtett */
  flex-direction: column;
}
#game-player-wrap.active {
  display: flex !important;  /* visible during gameplay */
}

#game-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  min-height: 0;
  display: block;
}

/* ── Game HUD (alsó sáv) ──────────────────────────────────── */
#game-hud {
  background: rgba(0,0,0,.9);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .4rem .75rem;
  font-size: .82rem;
  flex-shrink: 0;
  border-top: 1px solid var(--p2e-border);
  min-height: 44px;
}
#game-hud .pts-live   { color: var(--p2e-gold); font-weight: 700; }
#game-hud .timer-bar  {
  flex: 1; height: 6px;
  background: var(--p2e-border);
  border-radius: 3px; overflow: hidden;
  min-width: 60px;
}
#game-hud .timer-fill {
  height: 100%; background: var(--p2e-gold); border-radius: 3px;
  transition: width .5s linear;
  width: 0%;
}

/* ── Captcha Modal ────────────────────────────────────────── */
.captcha-modal .modal-content {
  background: var(--p2e-card);
  border: 1px solid var(--p2e-border);
  border-radius: 12px;
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  background: var(--p2e-card);
  border: 1px solid var(--p2e-border);
  border-radius: 12px;
  padding: 1.1rem;
  text-align: center;
}
.stat-card .stat-val   { font-size: 1.6rem; font-weight: 700; color: var(--p2e-gold); line-height: 1.2; }
.stat-card .stat-label { color: var(--p2e-muted); font-size: .75rem; margin-top: .2rem; }

/* ── Level bar ────────────────────────────────────────────── */
.level-bar { height: 8px; border-radius: 4px; }

/* ── Auth form ────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 80px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.auth-box {
  background: var(--p2e-card);
  border: 1px solid var(--p2e-border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%; max-width: 420px;
}

/* ── Form inputs ──────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--p2e-surface) !important;
  border-color: var(--p2e-border) !important;
  color: var(--p2e-text) !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--p2e-gold) !important;
  box-shadow: 0 0 0 .2rem rgba(244,197,66,.15) !important;
  background: var(--p2e-surface) !important;
}
.form-control::placeholder { color: var(--p2e-muted); }
.input-group-text {
  background: var(--p2e-surface) !important;
  border-color: var(--p2e-border) !important;
  color: var(--p2e-muted);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-gold {
  background: var(--p2e-gold);
  color: #000;
  border: none;
  font-weight: 600;
}
.btn-gold:hover { background: #ddb22e; color: #000; }
.btn-primary    { background: var(--p2e-accent); border-color: var(--p2e-accent); }
.btn-warning    { color: #000; }

/* ── Tables ───────────────────────────────────────────────── */
.table-dark { --bs-table-bg: var(--p2e-card); --bs-table-border-color: var(--p2e-border); }

/* ── Admin sidebar ────────────────────────────────────────── */
.admin-sidebar {
  background: var(--p2e-surface);
  border-right: 1px solid var(--p2e-border);
  min-height: calc(100vh - 56px);
  width: 200px;
  flex-shrink: 0;
}
.admin-sidebar .nav-link {
  color: var(--p2e-muted);
  padding: .55rem 1rem;
  border-radius: 8px;
  font-size: .875rem;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  color: var(--p2e-text);
  background: var(--p2e-card);
}

/* ── Reward popup ─────────────────────────────────────────── */
.reward-pop {
  position: fixed; bottom: 70px; right: 16px;
  background: var(--p2e-gold); color: #000;
  padding: .35rem .8rem; border-radius: 20px;
  font-weight: 700; font-size: .88rem;
  animation: popUp .7s ease forwards;
  pointer-events: none; z-index: 10000;
}
@keyframes popUp {
  0%   { opacity: 0; transform: translateY(16px); }
  20%  { opacity: 1; transform: translateY(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-16px); }
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--p2e-bg); }
::-webkit-scrollbar-thumb { background: var(--p2e-border); border-radius: 3px; }

/* ── Utilities ────────────────────────────────────────────── */
.text-gold    { color: var(--p2e-gold) !important; }
.bg-surface   { background: var(--p2e-surface) !important; }
.border-p2e   { border-color: var(--p2e-border) !important; }
.rounded-12   { border-radius: 12px; }

/* ── Hero section ─────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--p2e-surface) 0%, #1a0e35 100%);
  border-bottom: 1px solid var(--p2e-border);
  padding: 1.5rem 0 1.25rem;
}
.hero-section h1 {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 800;
}
.glow-text { text-shadow: 0 0 24px rgba(244,197,66,.45); }

/* ── Mobile tweaks ────────────────────────────────────────── */
@media (max-width: 575px) {
  #game-hud {
    flex-wrap: wrap;
    gap: .4rem;
    padding: .35rem .5rem;
    font-size: .78rem;
  }
  #game-hud .timer-bar { min-width: 100%; order: 10; }
  .stat-card .stat-val { font-size: 1.3rem; }
}
