/* =====================================================
   GameHub — styles complémentaires iPortfolio
   ===================================================== */

:root {
  --gh-primary: #e94560;
  --gh-accent:  #08d9d6;
  --gh-gold:    #ffd700;
  --gh-success: #53ebb1;
  --gh-error:   #ff6b6b;
  --gh-warning: #ffd166;
}

/* ── Coin balance dans la sidebar ── */
.sidebar-balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255,215,0,.12);
  border: 1px solid rgba(255,215,0,.3);
  border-radius: 30px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 15px;
  color: var(--gh-gold);
  margin: 12px 20px;
}
.sidebar-balance i { font-size: 18px; }

/* ── Stats cards (dashboard) ── */
.gh-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.gh-stat-card {
  background: var(--surface-color, #1a1f2e);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.gh-stat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.gh-stat-card i { font-size: 2rem; color: var(--gh-primary); margin-bottom: 10px; display: block; }
.gh-stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--heading-color, #fff); }
.gh-stat-card .stat-label { font-size: 13px; color: var(--default-color, rgba(255,255,255,.6)); margin-top: 4px; }

/* ── Game cards grid ── */
.gh-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}
.gh-game-card {
  background: var(--surface-color, #1a1f2e);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.gh-game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  border-color: var(--gh-primary);
}
.gh-game-card-image {
  height: 140px;
  background: linear-gradient(135deg, #0f0f1a, #16213e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
}
.gh-game-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gh-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .3px;
}
.gh-game-card-body { padding: 18px; }
.gh-game-card-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--heading-color, #fff); }
.gh-game-card-body p  { font-size: 13px; color: var(--default-color, rgba(255,255,255,.6)); margin-bottom: 14px; line-height: 1.5; }

/* ── Transactions ── */
.gh-tx-list { display: flex; flex-direction: column; gap: 0; }
.gh-tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.gh-tx-item:last-child { border-bottom: none; }
.gh-tx-icon { font-size: 1.4rem; margin-right: 12px; }
.gh-tx-desc { font-size: 14px; font-weight: 500; color: var(--heading-color, #fff); }
.gh-tx-date { font-size: 12px; color: var(--default-color, rgba(255,255,255,.5)); margin-top: 2px; }
.gh-tx-amount { font-size: 15px; font-weight: 700; }
.gh-tx-amount.positive { color: var(--gh-success); }
.gh-tx-amount.negative { color: var(--gh-error); }

/* ── Gift cards ── */
.gh-gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.gh-gift-card {
  background: var(--surface-color, #1a1f2e);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.gh-gift-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.gh-gift-card.disabled { opacity: .55; pointer-events: none; }
.gh-gift-img {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f1a, #1a1a2e);
  overflow: hidden;
}
.gh-gift-img img { width: 100%; height: 100%; object-fit: cover; }
.gh-gift-img span { font-size: 3.5rem; }
.gh-gift-body { padding: 16px; }
.gh-gift-name { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--heading-color, #fff); }
.gh-gift-desc { font-size: 12px; color: var(--default-color, rgba(255,255,255,.55)); margin-bottom: 12px; }
.gh-gift-cost {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}
.gh-gift-cost-value { font-weight: 700; color: var(--gh-gold); }
.gh-gift-stock { font-size: 11px; color: var(--default-color, rgba(255,255,255,.5)); }

/* ── Auth pages ── */
.gh-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--background-color, #040b14);
}
.gh-auth-card {
  background: var(--surface-color, #1a1f2e);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.gh-auth-logo {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--gh-primary), var(--gh-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gh-auth-card h1 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--heading-color, #fff);
}
.gh-auth-card .subtitle {
  text-align: center;
  color: var(--default-color, rgba(255,255,255,.6));
  font-size: 14px;
  margin-bottom: 28px;
}
.gh-form-group { margin-bottom: 18px; }
.gh-form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--heading-color, #fff); }
.gh-form-group input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  color: var(--heading-color, #fff);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.gh-form-group input:focus { border-color: var(--gh-primary); }
.gh-btn-full { display: block; width: 100%; padding: 13px; border: none; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 600; transition: all .2s; }
.gh-btn-primary {
  background: linear-gradient(135deg, var(--gh-primary), #c73550);
  color: #fff;
}
.gh-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(233,69,96,.4); }
.gh-auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--default-color, rgba(255,255,255,.6)); }
.gh-auth-footer a { color: var(--gh-accent); font-weight: 600; }
.gh-alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; display: none; }
.gh-alert.show { display: block; }
.gh-alert-error   { background: rgba(255,107,107,.12); border: 1px solid #ff6b6b; color: #ff6b6b; }
.gh-alert-success { background: rgba(83,235,177,.12);  border: 1px solid #53ebb1; color: #53ebb1; }

/* ── Modal ── */
.gh-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.7);
  display: none; align-items: center; justify-content: center;
}
.gh-modal-overlay.active { display: flex; }
.gh-modal {
  background: var(--surface-color, #1a1f2e);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 32px;
  width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.gh-modal h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; color: var(--heading-color, #fff); }
.gh-modal-cost {
  background: rgba(255,215,0,.1);
  border: 1px solid rgba(255,215,0,.3);
  border-radius: 8px; padding: 14px;
  text-align: center; margin: 12px 0;
}
.gh-modal-cost span { font-size: 1.5rem; font-weight: 800; color: var(--gh-gold); }
.gh-modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.gh-modal-actions button { flex: 1; padding: 11px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; }
.gh-btn-cancel   { background: rgba(255,255,255,.08); color: var(--heading-color, #fff); }
.gh-btn-confirm  { background: var(--gh-primary); color: #fff; }

/* ── Toast ── */
.gh-toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 99999;
  background: #1a1f35; color: #fff; border-radius: 12px;
  padding: 14px 22px; font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
  animation: ghSlideIn .35s cubic-bezier(.21,1.02,.73,1);
  max-width: 340px; display: flex; align-items: center; gap: 4px;
  border: 1px solid rgba(255,255,255,.08);
}
.gh-toast.success { border-left: 4px solid #53ebb1; background: #0d2b22; }
.gh-toast.error   { border-left: 4px solid #ff6b6b; background: #2b0d0d; }
.gh-toast.warning { border-left: 4px solid #ffd166; background: #2b2008; }
.gh-toast.info    { border-left: 4px solid var(--gh-accent); }
@keyframes ghSlideIn {
  from { opacity:0; transform: translateX(60px) scale(.95); }
  to   { opacity:1; transform: translateX(0)    scale(1);   }
}

/* ── Loading spinner ── */
.gh-loading {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,.5);
  display: none; align-items: center; justify-content: center;
}
.gh-loading.active { display: flex; }
.gh-spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,.1);
  border-top-color: var(--gh-primary);
  border-radius: 50%;
  animation: ghSpin .8s linear infinite;
}
@keyframes ghSpin { to { transform: rotate(360deg); } }

/* ── Game topbar (pages jeux) ── */
.gh-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  background: rgba(15,15,26,.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 0 20px; height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.gh-topbar-back {
  color: rgba(255,255,255,.7); text-decoration: none;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
  transition: color .2s;
}
.gh-topbar-back:hover { color: #fff; }
.gh-topbar-title { font-weight: 700; font-size: 16px; color: #fff; }
.gh-topbar-balance {
  background: rgba(255,215,0,.1); border: 1px solid rgba(255,215,0,.25);
  border-radius: 20px; padding: 5px 14px;
  font-size: 14px; font-weight: 700; color: var(--gh-gold);
  display: flex; align-items: center; gap: 6px;
}

/* ── Tabs ── */
.gh-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.gh-tab {
  padding: 9px 20px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.gh-tab.active { background: var(--gh-primary); color: #fff; }
.gh-tab:not(.active) { background: rgba(255,255,255,.07); color: rgba(255,255,255,.7); }

/* ── Table ── */
.gh-table-wrap { overflow-x: auto; }
.gh-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gh-table th {
  padding: 10px 14px; text-align: left;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.5);
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.gh-table td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--heading-color, #fff); }
.gh-table tr:last-child td { border-bottom: none; }

/* ── Misc ── */
.hidden { display: none !important; }
.text-gold { color: var(--gh-gold); }
.text-success { color: var(--gh-success); }
.text-error { color: var(--gh-error); }

/* ── Responsive fixes ── */
@media (max-width: 1199px) {
  body.gh-game-page { padding-top: 52px; }
}
@media (min-width: 1200px) {
  body.gh-game-page { padding-top: 52px; }
}
