/* ============================================
   EZBER CASINO — FULL UI
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:         #0d0d14;
  --surface:    #13131f;
  --sidebar-bg: #0f0f1a;
  --card:       #1a1a2e;
  --card-hover: #1e1e35;
  --border:     #2a2a45;
  --primary:    #f5c518;
  --primary-dk: #d4a900;
  --accent:     #7c3aed;
  --accent-lt:  #9d5ef5;
  --success:    #22c55e;
  --danger:     #ef4444;
  --warn:       #f59e0b;
  --text:       #e8e8f0;
  --muted:      #7070a0;
  --sidebar-w:  260px;
  --topbar-h:   60px;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 4px 24px rgba(0,0,0,.45);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============================================
   LAYOUT
   ============================================ */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-brand .brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .5px;
  background: linear-gradient(135deg, var(--primary) 0%, #ff8c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* nav sections */
.sidebar-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-section-title {
  padding: 0 18px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: #a0a0c8;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-link:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
}

.sidebar-link.active {
  background: rgba(245,197,24,.08);
  color: var(--primary);
  border-left-color: var(--primary);
}

.sidebar-link .link-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link .link-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* providers in sidebar */
.provider-list {
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
}

.provider-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 18px;
  font-size: 13px;
  color: #9090b8;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
  gap: 8px;
}

.provider-item:hover {
  background: rgba(255,255,255,.03);
  color: var(--text);
}

.provider-item.active {
  background: rgba(124,58,237,.1);
  color: var(--accent-lt);
  border-left-color: var(--accent);
}

.provider-item .p-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-item .p-count {
  font-size: 11px;
  background: rgba(255,255,255,.07);
  border-radius: 10px;
  padding: 1px 6px;
  flex-shrink: 0;
}

/* sidebar user block */
.sidebar-user {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sidebar-user .avatar {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  color: #fff;
}

.sidebar-user .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user .user-balance {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.sidebar-auth {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.topbar-search {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  gap: 8px;
  height: 38px;
}

.topbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  width: 200px;
  font-size: 14px;
}

.topbar-search input::placeholder { color: var(--muted); }
.topbar-search .search-icon { color: var(--muted); font-size: 15px; }

/* ── PAGE CONTENT ── */
.page-content {
  padding: 24px;
  flex: 1;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  text-align: center;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: #111;
}
.btn-primary:hover { background: #ffd033; box-shadow: 0 0 20px rgba(245,197,24,.35); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-lt); box-shadow: 0 0 20px rgba(124,58,237,.4); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(245,197,24,.06); }

.btn-ghost {
  background: rgba(255,255,255,.05);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,.1); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #ff5555; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-full { width: 100%; }

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  background: linear-gradient(135deg, #1a0a3e 0%, #0d0d14 50%, #1a1408 100%);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(124,58,237,.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: 200px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(245,197,24,.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,.2);
  border: 1px solid rgba(124,58,237,.4);
  color: var(--accent-lt);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 44px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 40%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 16px;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-wrap: wrap;
}

.hero-stat .stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.hero-stat .stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .title-icon {
  font-size: 20px;
}

/* ============================================
   GAME GRID / CARDS
   ============================================ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.games-grid.large {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.game-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
  group: true;
}

.game-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
  border-color: rgba(245,197,24,.35);
}

.game-card .card-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #0a0a18;
}

.game-card .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.game-card:hover .card-img-wrap img {
  transform: scale(1.06);
}

.game-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  opacity: 0;
  transition: opacity .2s;
}

.game-card:hover .card-overlay {
  opacity: 1;
}

.card-play-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #111;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background .15s;
}

.card-play-btn:hover { background: #ffd033; }

.game-card .card-body {
  padding: 10px 12px;
}

.game-card .card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}

.game-card .card-provider {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card .card-rtp {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,.75);
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ============================================
   FILTERS / TABS
   ============================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
  text-decoration: none;
}

.filter-tab:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: rgba(255,255,255,.2);
}

.filter-tab.active {
  background: rgba(245,197,24,.12);
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tab .tab-count {
  background: rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 0 5px;
  font-size: 10px;
}

.filter-tab.active .tab-count {
  background: rgba(245,197,24,.2);
}

/* search input row */
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  gap: 10px;
  height: 44px;
  transition: border-color .15s;
}

.search-input-wrap:focus-within {
  border-color: var(--primary);
}

.search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.search-input-wrap input::placeholder { color: var(--muted); }
.search-input-wrap .s-icon { color: var(--muted); }

/* ============================================
   FORMS / AUTH
   ============================================ */
.form-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
}

.form-logo {
  text-align: center;
  margin-bottom: 28px;
}

.form-logo .logo-text {
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-logo .logo-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.tab-switcher {
  display: flex;
  background: var(--card);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
}

.tab-switcher a {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: background .13s, color .13s;
}

.tab-switcher a.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #a0a0c0;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}

.form-input:focus {
  border-color: var(--primary);
}

.form-input::placeholder { color: var(--muted); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

select.form-input {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237070a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ============================================
   FLASH / ALERTS
   ============================================ */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flash.success { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.3); color: #4ade80; }
.flash.error   { background: rgba(239,68,68,.15);  border: 1px solid rgba(239,68,68,.3);  color: #f87171; }
.flash.info    { background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.3); color: #60a5fa; }
.flash.warn    { background: rgba(245,158,11,.15); border: 1px solid rgba(245,158,11,.3); color: #fbbf24; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 14px;
  opacity: .4;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}

/* ============================================
   PLAY PAGE / GAME IFRAME
   ============================================ */
.play-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #000;
}

.play-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 50px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.play-topbar .game-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
}

.play-topbar .balance-chip {
  background: rgba(245,197,24,.12);
  border: 1px solid rgba(245,197,24,.3);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.game-frame-wrap {
  flex: 1;
  position: relative;
}

.game-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================
   STATS STRIP
   ============================================ */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-card .s-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-card .s-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   UTILITY
   ============================================ */
.text-muted   { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.chip-gold   { background: rgba(245,197,24,.15); color: var(--primary); border: 1px solid rgba(245,197,24,.3); }
.chip-purple { background: rgba(124,58,237,.15); color: var(--accent-lt); border: 1px solid rgba(124,58,237,.3); }
.chip-green  { background: rgba(34,197,94,.15);  color: var(--success); border: 1px solid rgba(34,197,94,.3); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 220px;
  }

  .hero h1 { font-size: 30px; }
  .hero { padding: 28px 20px; }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .page-content { padding: 16px; }
}

@media (max-width: 600px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
}