/* ============================================================
   CasinoMax — Dark Casino Theme
   Font: Rajdhani (headings) + Inter (body)
   ============================================================ */

/* ── Reset & Variables ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Core palette */
  --bg-deep:      #060A12;
  --bg-surface:   #09101c;
  --bg-card:      #0d1520;
  --bg-card-hover:#111c28;
  --bg-elevated:  #141f2e;

  /* Purple accent */
  --accent:       #302EBF;
  --accent-light: #4a48d4;
  --accent-glow:  rgba(48,46,191,.4);

  /* Gold accent */
  --gold:         #BF840F;
  --gold-light:   #d4980f;

  /* Green */
  --green:        #10b981;
  --green-light:  #34d399;

  /* Red */
  --red:          #ef4444;

  /* Text */
  --text-primary:   #f0eeff;
  --text-secondary: #9b98c0;
  --text-muted:     #55537a;

  /* Borders */
  --border:       rgba(255,255,255,.06);
  --border-light: rgba(255,255,255,.11);

  /* Sidebar */
  --sidebar-w:    248px;
  --sidebar-bg:   #060A12;

  /* Topbar */
  --topbar-h:     60px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Transition */
  --t: .18s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; }
img { max-width: 100%; display: block; }
svg { fill: currentColor; flex-shrink: 0; }

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

/* ── App Layout ────────────────────────────────────────── */
#app {
  display: flex;
  min-height: 100vh;
  /* Twardy limit - zadny element nie rozciagnie layoutu w prawo */
  max-width: 100vw;
  overflow-x: hidden;
}

/* ── Sidebar ────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 14px 18px 4px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--t), color var(--t);
  position: relative;
}
.nav-item:hover {
  background: rgba(48,46,191,.15);
  color: var(--text-primary);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(48,46,191,.5) 0%, rgba(48,46,191,.08) 100%);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #4a48d4, #302EBF);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(74,72,212,.6);
}
.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
}
.nav-item.active .nav-icon { opacity: 1; }

/* Sidebar user panel */
.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  flex-shrink: 0;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  transition: background var(--t), border-color var(--t);
  cursor: pointer;
}
.user-card:hover {
  background: rgba(109,40,217,.12);
  border-color: rgba(109,40,217,.3);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  flex: 1;
  min-width: 0;
  border-radius: var(--r-md);
  transition: none;
}
.user-info:hover { background: transparent; }
.user-avatar {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-avatar svg { width: 20px; height: 20px; fill: #fff; }
.user-details { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-balance {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--accent-light); font-weight: 600;
}

/* ── Main wrapper ──────────────────────────────────────── */
#main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s ease;
  /* Zapobiega rozciaganiu przez dzieci (ticker, siatka wygranych itp.) */
  overflow-x: hidden;
  min-width: 0;
}

/* ── Auth UI — widoczność zależna od stanu logowania ──── */

/* Niezalogowany: sidebar ukryty, topbar widoczny */
body.logged-out #sidebar        { transform: translateX(-100%); pointer-events: none; }
body.logged-out #main-wrapper   { margin-left: 0; }
body.logged-out #sidebar-user   { display: none; }
body.logged-out #topbar         { display: flex; }

/* Zalogowany: sidebar widoczny, topbar ukryty */
body.logged-in  #topbar         { display: none; }
body.logged-in  #sidebar-user   { display: flex; }

/* Domyślnie (przed załadowaniem JS) — traktuj jak niezalogowany */
#topbar         { display: flex; }
#sidebar-user   { display: none; }

/* ── Topbar (logged out) ──────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(8,8,19,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
}
.topbar-logo { display: flex; align-items: center; gap: 8px; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto; /* To wypchnie przyciski maksymalnie na prawo */
}
.logo-icon.small { width: 64px; height: 158px; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 600;
  transition: all var(--t);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #302EBF, #2220a0);
  color: #fff;
  box-shadow: 0 0 20px rgba(48,46,191,.5);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4a48d4, #302EBF);
  box-shadow: 0 0 30px rgba(74,72,212,.6);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,.15);
}
.btn-ghost:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.25); }
.btn-gold {
  background: linear-gradient(135deg, #BF840F, #a06e00);
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(191,132,15,.35);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 24px rgba(191,132,15,.5); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ── View container ────────────────────────────────────── */
#view-container {
  flex: 1;
  padding: 28px 28px 60px;
  overflow-x: hidden;
}

/* ── Section headings ──────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px; font-weight: 700;
}
.section-title svg { width: 22px; height: 22px; color: var(--accent-light); }
.view-all-link {
  font-size: 13px; font-weight: 500;
  color: var(--accent-light);
  transition: color var(--t);
}
.view-all-link:hover { color: #fff; }

/* ── Banner grid ───────────────────────────────────────── */
.banners-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

/* Welcome bonus banner */
.banner-welcome {
  background: linear-gradient(135deg, #0a0a2a 0%, #1a1870 50%, #0a0920 100%);
  border: 1px solid rgba(48,46,191,.3);
  border-radius: var(--r-xl);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.banner-welcome::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(48,46,191,.2) 0%, transparent 70%);
}
.banner-content { position: relative; z-index: 1; }
.banner-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  color: var(--accent-light);
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 8px;
}
.banner-tag svg { width: 14px; height: 14px; }
.banner-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 36px; font-weight: 700;
  line-height: 1.1; margin-bottom: 8px;
}
.banner-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.banner-img {
  width: 160px; height: 130px;
  object-fit: contain;
  position: relative; z-index: 1;
}
.banner-img-placeholder {
  width: 160px; height: 130px;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}

/* VIP banner */
.banner-vip {
  background: linear-gradient(135deg, #1c1407 0%, #2e2005 50%, #1c1407 100%);
  border: 1px solid rgba(191,132,15,.2);
  border-radius: var(--r-xl);
  padding: 24px 28px;
  display: flex; justify-content: space-between; align-items: center;
  overflow: hidden; position: relative;
}
.banner-vip::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(191,132,15,.12) 0%, transparent 70%);
}
.banner-vip .banner-tag { color: var(--gold); }
.banner-vip .banner-title { color: var(--text-primary); }
.vip-badge {
  font-family: 'Rajdhani', sans-serif;
  font-size: 64px; font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(191,132,15,.5);
  position: relative; z-index: 1;
  letter-spacing: -2px;
}

/* ── Recent Wins ────────────────────────────────────────── */
.wins-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
.win-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t);
}
.win-card:hover { border-color: var(--border-light); }
.win-multiplier {
  position: absolute; top: 8px; right: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
}
.win-card-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.win-card-game { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.win-card-thumb {
  width: 100%; height: 56px;
  background: var(--bg-elevated);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  object-fit: cover;
}
.win-amount {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px; font-weight: 700;
  color: var(--green);
}
.win-time {
  font-size: 10px; color: var(--text-muted);
  display: flex; align-items: center; gap: 3px; margin-top: 4px;
}
.win-time svg { width: 10px; height: 10px; }

/* ── Game Cards ─────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.games-grid-5 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.games-grid-6 { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
  cursor: pointer;
  min-width: 0;
}
.game-card:hover {
  transform: translateY(-5px);
  border-color: rgba(48,46,191,.5);
  box-shadow: 0 8px 36px rgba(0,0,0,.5), 0 0 16px rgba(48,46,191,.2);
}
.game-thumb {
  position: relative;
  width: 100%; padding-top: 75%;
  background: var(--bg-elevated);
  overflow: hidden;
}
.game-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.game-card:hover .game-thumb img { transform: scale(1.05); }
.game-thumb-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
}
.game-badges {
  position: absolute; top: 8px; left: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 3px;
}
.badge svg { width: 9px; height: 9px; }
.badge-popular { background: var(--accent); color: #fff; }
.badge-new      { background: #059669; color: #fff; }
.badge-hot      { background: #dc2626; color: #fff; }
.badge-live     { background: #16a34a; color: #fff; }

.live-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .6; transform: scale(.8); }
}

.game-info { padding: 12px; }
.game-name  { font-size: 14px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-provider { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.game-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.game-rtp {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 3px;
}
.game-rtp svg { width: 11px; height: 11px; color: var(--accent-light); }
.btn-fav {
  background: transparent; border: none;
  color: var(--text-muted); padding: 2px;
  transition: color var(--t), transform var(--t);
}
.btn-fav:hover { color: var(--gold); transform: scale(1.2); }
.btn-fav svg { width: 16px; height: 16px; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
}
.modal-backdrop.hidden { display: none; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 440px; max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
  z-index: 1001;
  animation: modal-in .2s ease;
  overflow: hidden;
}
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-header {
  padding: 24px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 24px; font-weight: 700;
}
.modal-close {
  width: 32px; height: 32px;
  background: var(--bg-elevated); border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
}
.modal-close:hover { background: var(--accent); color: #fff; }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 20px 24px 28px; }
.modal-footer { padding: 0 24px 24px; text-align: center; font-size: 13px; color: var(--text-secondary); }

/* ── Form ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: .3px; }
.form-input {
  width: 100%;
  background: rgba(10,10,25,.8);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: inherit; font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(48,46,191,.25);
}
.form-input.error { border-color: var(--red); }
.form-error { font-size: 11px; color: var(--red); margin-top: 4px; }

.form-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text-muted); font-size: 12px;
}
.form-divider::before, .form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Toast ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 2000;
  pointer-events: none;
  /* Prevent toasts from overflowing screen width */
  max-width: calc(100vw - 48px);
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  min-width: 280px; max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  pointer-events: all;
  animation: toast-in .25s ease, toast-out .3s ease forwards;
  animation-delay: 0s, 3.7s;
}
@keyframes toast-in  { from { opacity:0; transform: translateX(30px); } to { opacity:1; transform: translateX(0); } }
@keyframes toast-out { from { opacity:1; transform: translateX(0); }   to { opacity:0; transform: translateX(30px); } }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-icon svg { width: 18px; height: 18px; }
.toast.success .toast-icon svg { fill: var(--green); }
.toast.error   .toast-icon svg { fill: var(--red); }
.toast.info    .toast-icon svg { fill: var(--accent-light); }
.toast.warning .toast-icon svg { fill: var(--gold); }
.toast-title   { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.toast-message { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* ── Page header ────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 32px; font-weight: 700;
  margin-bottom: 4px;
}
.page-subtitle { font-size: 14px; color: var(--text-secondary); }

/* ── Profile ────────────────────────────────────────────── */
.profile-hero {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 24px;
}
.profile-avatar-lg {
  width: 80px; height: 80px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 36px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px; font-weight: 700;
}
.profile-email { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.profile-vip {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #78350f, #451a03);
  border: 1px solid rgba(191,132,15,.3);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px; font-weight: 600; color: var(--gold);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  text-align: center;
}
.stat-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px; font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--text-secondary); }

.balance-card {
  background: linear-gradient(135deg, #090920, #19187a);
  border: 1px solid rgba(48,46,191,.35);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.balance-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.balance-amount {
  font-family: 'Rajdhani', sans-serif;
  font-size: 42px; font-weight: 700;
  color: var(--text-primary);
}
.balance-currency { font-size: 20px; color: var(--accent-light); margin-right: 6px; }
.balance-actions { display: flex; gap: 10px; }

/* Transaction history */
.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.tx-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tx-icon svg { width: 18px; height: 18px; }
.tx-icon.deposit  { background: rgba(16,185,129,.15); color: var(--green); }
.tx-icon.win      { background: rgba(16,185,129,.15); color: var(--green); }
.tx-icon.bet      { background: rgba(239,68,68,.15);  color: var(--red); }
.tx-icon.bonus    { background: rgba(48,46,191,.15); color: var(--accent-light); }
.tx-icon.withdrawal { background: rgba(191,132,15,.15); color: var(--gold); }
.tx-meta { flex: 1; min-width: 0; }
.tx-desc { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tx-amount {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px; font-weight: 700;
  text-align: right; flex-shrink: 0;
}
.tx-amount.positive { color: var(--green); }
.tx-amount.negative { color: var(--red); }

/* ── Coming soon modal (game view) ─────────────────────── */
.coming-soon-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; text-align: center; gap: 20px;
}
.coming-soon-icon {
  width: 100px; height: 100px;
  background: linear-gradient(135deg, var(--accent), #4c1d95);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  box-shadow: 0 0 40px var(--accent-glow);
}
.coming-soon-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 36px; font-weight: 700;
}
.coming-soon-desc { font-size: 15px; color: var(--text-secondary); max-width: 360px; line-height: 1.6; }

/* ── Generic page content ───────────────────────────────── */
.promo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.promo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: transform var(--t), border-color var(--t);
}
.promo-card:hover { transform: translateY(-3px); border-color: var(--border-light); }
.promo-card-header {
  height: 140px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.promo-card-body { padding: 16px; }
.promo-card-title { font-family: 'Rajdhani', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.promo-card-desc  { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; }

/* Leaderboard */
.lb-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  width: 100%;
}
.lb-table th, .lb-table td {
  padding: 14px 20px; text-align: left;
}
.lb-table th {
  background: var(--bg-elevated);
  font-size: 11px; font-weight: 600;
  color: var(--text-muted); letter-spacing: .8px; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.lb-table td { border-bottom: 1px solid var(--border); font-size: 14px; }
.lb-table tr:last-child td { border-bottom: none; }
.lb-table tr:hover td { background: rgba(255,255,255,.02); }
.lb-rank {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px; font-weight: 700;
  color: var(--text-muted); width: 40px;
}
.lb-rank.gold   { color: var(--gold); }
.lb-rank.silver { color: #94a3b8; }
.lb-rank.bronze { color: #b45309; }

/* ── VIP levels ─────────────────────────────────────────── */
.vip-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  margin-bottom: 24px;
}
.vip-level-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 14px; text-align: center;
  transition: border-color var(--t), transform var(--t);
}
.vip-level-card:hover { transform: translateY(-3px); border-color: var(--border-light); }
.vip-level-card.current {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(191,132,15,.2);
}
.vip-emoji { font-size: 36px; margin-bottom: 10px; }
.vip-lvl-name { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.vip-lvl-pts  { font-size: 12px; color: var(--text-muted); }

/* ── Tournament ─────────────────────────────────────────── */
.tournament-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tournament-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px;
  transition: border-color var(--t), transform var(--t);
}
.tournament-card:hover { transform: translateY(-3px); border-color: var(--accent-light); }
.tournament-prize {
  font-family: 'Rajdhani', sans-serif;
  font-size: 32px; font-weight: 700; color: var(--gold);
  margin-bottom: 4px;
}
.tournament-name  { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.tournament-meta  { font-size: 12px; color: var(--text-muted); }
.tournament-timer {
  display: flex; gap: 8px; margin-top: 12px;
}
.timer-box {
  background: var(--bg-elevated);
  border-radius: var(--r-sm);
  padding: 6px 10px; text-align: center; flex: 1;
}
.timer-val { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; }
.timer-lbl { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-green { color: var(--green); }
.text-gold  { color: var(--gold); }
.text-red   { color: var(--red); }
.text-muted { color: var(--text-muted); }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-10 { gap: 10px; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; width: 100%;
}
.tab-bar {
  display: flex; gap: 4px;
  background: var(--bg-elevated);
  border-radius: var(--r-lg); padding: 4px;
  margin-bottom: 20px; width: fit-content;
}
.tab-btn {
  background: transparent; border: none;
  color: var(--text-muted);
  padding: 8px 18px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 600;
  transition: background var(--t), color var(--t);
}
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-btn:hover:not(.active) { color: var(--text-primary); }

/* ── Announcements / Support ─────────────────────────────── */
.announcement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 12px;
}
.announcement-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase;
  border-radius: 4px; padding: 2px 8px; display: inline-block;
  color: var(--accent-light); margin-bottom: 8px;
}
.announcement-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.announcement-body  { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.announcement-date  { font-size: 11px; color: var(--text-muted); margin-top: 10px; }
/* Styl dla treści HTML z edytora WYSIWYG */
.announcement-rich h1, .announcement-rich h2, .announcement-rich h3 {
  color: var(--text-primary); font-family: 'Rajdhani', sans-serif; margin: 10px 0 6px;
}
.announcement-rich p { margin: 0 0 8px; }
.announcement-rich ul, .announcement-rich ol { padding-left: 20px; margin-bottom: 8px; }
.announcement-rich li { margin-bottom: 4px; }
.announcement-rich strong { color: var(--text-primary); }
.announcement-rich a { color: var(--accent-light); }
.announcement-rich blockquote {
  border-left: 3px solid var(--accent); padding-left: 12px;
  color: var(--text-muted); margin: 8px 0;
}
.announcement-rich code {
  background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
}


/* ── Sidebar logout button ──────────────────────────────── */
.btn-logout-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: #f87171;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.btn-logout-sidebar:hover {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.4);
  color: #fca5a5;
}
.btn-logout-sidebar svg { fill: currentColor; }

/* ── Remember Me checkbox ───────────────────────────────── */
.remember-row {
  margin: 4px 0 16px;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.checkbox-custom {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  background: var(--bg-elevated);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), border-color var(--t);
  position: relative;
}
.checkbox-label input:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}
.checkbox-label:hover .checkbox-custom {
  border-color: var(--accent-light);
}

/* ── Bonus cards ──────────────────────────────────────────── */
.bonus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.bonus-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
  display: flex; flex-direction: column;
}
.bonus-card:hover {
  transform: translateY(-4px);
  border-color: rgba(48,46,191,.4);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.bonus-card.claimed { opacity: .6; }
.bonus-card-header {
  height: 120px;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
  position: relative;
  overflow: hidden;
}
.bonus-card-header::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,.5));
}
.bonus-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  padding: 3px 8px; border-radius: 20px;
  z-index: 1;
}
.bonus-badge.auto { background: var(--green); }
.bonus-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.bonus-type-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent-light);
  margin-bottom: 6px;
}
.bonus-title { font-family: 'Rajdhani', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.bonus-desc  { font-size: 12px; color: var(--text-secondary); line-height: 1.5; flex: 1; margin-bottom: 14px; }
.bonus-meta  {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.bonus-pill {
  background: var(--bg-elevated); border-radius: 20px;
  padding: 3px 10px; font-size: 11px; color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 4px;
}
.bonus-pill.highlight { background: rgba(48,46,191,.2); color: var(--accent-light); }
.bonus-eligibility {
  font-size: 11px; color: var(--red); margin-bottom: 10px;
  display: flex; align-items: center; gap: 4px;
}
.bonus-eligibility.ok { color: var(--green); }

/* Active bonus progress bar */
.bonus-progress-wrap {
  background: var(--bg-elevated);
  border-radius: 4px; height: 6px; margin: 6px 0 4px; overflow: hidden;
}
.bonus-progress-bar {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width .4s ease;
}

/* My bonuses list */
.my-bonus-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 10px;
}
.my-bonus-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.my-bonus-icon.active    { background: rgba(48,46,191,.2); }
.my-bonus-icon.completed { background: rgba(16,185,129,.2); }
.my-bonus-icon.expired   { background: rgba(239,68,68,.1); }
.my-bonus-meta { flex: 1; min-width: 0; }
.my-bonus-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.my-bonus-status {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; margin-bottom: 6px;
}
.my-bonus-status.active    { color: var(--accent-light); }
.my-bonus-status.completed { color: var(--green); }
.my-bonus-status.expired   { color: var(--text-muted); }
.my-bonus-amount { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: var(--gold); }

/* ── Leaderboard real ─────────────────────────────────────── */
.lb-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.lb-header {
  display: grid;
  grid-template-columns: 50px 1fr 130px 130px 100px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  font-size: 11px; font-weight: 600;
  color: var(--text-muted); letter-spacing: .8px; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.lb-row {
  display: grid;
  grid-template-columns: 50px 1fr 130px 130px 100px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background var(--t);
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255,255,255,.02); }
.lb-row.me { background: rgba(48,46,191,.08); border-left: 3px solid var(--accent); }
.lb-rank-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px; font-weight: 700;
  color: var(--text-muted);
}
.lb-rank-num.r1 { color: #BF840F; }
.lb-rank-num.r2 { color: #94a3b8; }
.lb-rank-num.r3 { color: #b45309; }
.lb-player { display: flex; align-items: center; gap: 10px; }
.lb-avatar {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.lb-username { font-size: 14px; font-weight: 600; }
.lb-vip { font-size: 10px; color: var(--text-muted); }
.lb-val { font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700; }
.lb-val.green { color: var(--green); }
.lb-bets { font-size: 13px; color: var(--text-secondary); }

/* ── VIP real ─────────────────────────────────────────────── */
.vip-progress-section {
  background: linear-gradient(135deg, #1c1407, #2e2005);
  border: 1px solid rgba(191,132,15,.2);
  border-radius: var(--r-xl);
  padding: 28px;
  margin-bottom: 24px;
}
.vip-current-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(191,132,15,.15);
  border: 1px solid rgba(191,132,15,.3);
  border-radius: 20px; padding: 6px 16px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px; font-weight: 700; color: var(--gold);
  margin-bottom: 16px;
}
.vip-progress-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-secondary); margin-bottom: 8px;
}
.vip-progress-track {
  background: var(--bg-deep);
  border-radius: 8px; height: 10px; overflow: hidden;
}
.vip-progress-fill {
  height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, var(--gold), #BF840F);
  transition: width .6s ease;
}
.vip-perks-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 20px;
}
.vip-perk {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
}
.vip-perk-icon { color: var(--gold); font-size: 16px; }

/* ── Realtime win ticker ─────────────────────────────────── */
.win-ticker {
  display: flex; overflow: hidden;
  background: rgba(48,46,191,.06);
  border: 1px solid rgba(48,46,191,.15);
  border-radius: var(--r-lg);
  padding: 10px 16px; gap: 24px;
  margin-bottom: 20px;
  position: relative;
  /* Prevent ticker from pushing layout wider */
  max-width: 100%;
  width: 100%;
  contain: layout;
}
.win-ticker::before {
  content: '🔴 LIVE';
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: var(--red);
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  padding: 2px 8px; border-radius: 4px;
  z-index: 1;
}
.win-ticker-inner {
  display: flex; gap: 32px;
  padding-left: 60px;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
  /* Isolate scroll animation from document layout */
  will-change: transform;
}
.win-ticker-inner:hover { animation-play-state: paused; }
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.win-ticker-item { font-size: 13px; }
.win-ticker-item .wt-name { color: var(--accent-light); font-weight: 600; }
.win-ticker-item .wt-amt  { color: var(--green); font-weight: 700; }

/* ── Admin panel ─────────────────────────────────────────── */
.admin-bonus-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 120px 80px 120px 120px;
  align-items: center; gap: 12px;
  margin-bottom: 8px;
  transition: border-color var(--t);
}
.admin-bonus-row:hover { border-color: var(--border-light); }
.admin-bonus-title { font-size: 14px; font-weight: 600; }
.admin-bonus-type  { font-size: 11px; color: var(--accent-light); text-transform: uppercase; letter-spacing: .5px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
}
.status-pill.active   { background: rgba(16,185,129,.15); color: var(--green); }
.status-pill.inactive { background: rgba(239,68,68,.15);  color: var(--red); }
.admin-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Referral section ─────────────────────────────────────── */
.referral-box {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-bottom: 24px;
}
.referral-code-display {
  display: flex; align-items: center; gap: 12px; margin: 16px 0;
}
.referral-code {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px; font-weight: 700;
  letter-spacing: 4px;
  background: var(--bg-deep);
  border: 2px dashed var(--accent);
  border-radius: var(--r-md);
  padding: 12px 24px;
  color: var(--accent-light);
  flex: 1; text-align: center;
}
.stats-bar {
  display: flex; gap: 16px; margin-top: 16px;
}
.stats-bar-item {
  flex: 1; background: var(--bg-elevated);
  border-radius: var(--r-md); padding: 12px;
  text-align: center;
}
.stats-bar-val   { font-family: 'Rajdhani', sans-serif; font-size: 24px; font-weight: 700; color: var(--gold); }
.stats-bar-label { font-size: 11px; color: var(--text-muted); }

/* ── Dzienny bonus popup + Koło fortuny ─────────────────── */
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
@keyframes wheel-spin-anim { from { transform:rotate(0deg); } to { transform:rotate(var(--wheel-end-deg,1800deg)); } }

.wheel-wrapper { position:relative; width:300px; height:300px; margin:0 auto 20px; }
.wheel-canvas  { border-radius:50%; display:block; }
.wheel-pointer {
  position:absolute; top:-18px; left:50%; transform:translateX(-50%);
  width:0; height:0;
  border-left:14px solid transparent;
  border-right:14px solid transparent;
  border-top:28px solid #f59e0b;
  filter:drop-shadow(0 2px 6px rgba(245,158,11,.6));
}
.wheel-center-btn {
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:62px; height:62px; border-radius:50%;
  background:linear-gradient(135deg,#7c3aed,#5b21b6);
  border:3px solid #a78bfa;
  color:#fff; font-size:13px; font-weight:800; cursor:pointer;
  box-shadow:0 0 20px rgba(124,58,237,.5);
  transition:transform .1s;
}
.wheel-center-btn:hover:not(:disabled) { transform:translate(-50%,-50%) scale(1.08); }
.wheel-center-btn:disabled { opacity:.5; cursor:not-allowed; }

