html, body { background-color: #03131C; font-family: 'Josefin Sans', sans-serif; }

:root {
  --surface-gradient: linear-gradient(to bottom, #0d3a45 0%, #0A3039 45%, #061e24 100%);
  --surface-gradient-active: linear-gradient(to bottom, #134652 0%, #0f3d48 48%, #0a3039 100%);
  --icon-gradient: linear-gradient(to bottom, #d4f878 0%, #91DC2C 42%, #2aaeb8 78%, #134652 100%);
  --icon-gradient-light: linear-gradient(to bottom, #ffffff 0%, #d4f878 50%, #91DC2C 100%);
}

.dash-icon {
  background: var(--icon-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.dash-icon-light {
  background: var(--icon-gradient-light);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.icon-surface {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-gradient-active);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.icon-surface--xs { width: 1.35rem; height: 1.35rem; border-radius: 0.375rem; font-size: 0.65rem; }
.icon-surface--sm { width: 1.75rem; height: 1.75rem; border-radius: 0.5rem; font-size: 0.8rem; }
.icon-surface--lg { width: 3.5rem; height: 3.5rem; border-radius: 9999px; font-size: 1.35rem; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #03131C; }
::-webkit-scrollbar-thumb { background: #0A3039; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #91DC2C; }

#sidebar {
  transition: width 0.3s ease;
  z-index: 50;
  background: var(--surface-gradient);
  border-right: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.04);
}
#main-content { transition: margin-left 0.3s ease; }

.nav-link:hover:not(.nav-link-active) {
  background: linear-gradient(to bottom, rgba(19, 70, 82, 0.55) 0%, rgba(10, 48, 57, 0.35) 100%);
}
.nav-link-active {
  background: var(--surface-gradient-active);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.07);
  color: #fff;
  font-weight: 600;
}

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  overflow: visible;
  background: var(--surface-gradient);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.04);
}
.app-header-menu {
  grid-column: 1;
  grid-row: 1;
}
.app-header-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  overflow: visible;
}
.header-winnings-ticker {
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.header-surface {
  background: var(--surface-gradient-active);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.header-icon-btn {
  background: var(--surface-gradient-active);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.header-icon-btn:hover {
  background: linear-gradient(to bottom, #164e5c 0%, #114651 48%, #0d3a45 100%);
}
.header-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: var(--surface-gradient-active);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
  transition: color 0.2s, background 0.2s;
}
.header-logout-btn:hover {
  color: #f87171;
  background: linear-gradient(to bottom, #164e5c 0%, #114651 48%, #0d3a45 100%);
}
@media (max-width: 639px) {
  .header-logout-btn {
    display: none;
  }
}
.header-user-menu {
  position: relative;
}
button.header-user-avatar {
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.header-user-avatar {
  background: var(--surface-gradient-active);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.notifications-unread-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 9999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
  border: 2px solid #03131C;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
  pointer-events: none;
  animation: notificationsUnreadBlink 1s ease-in-out infinite;
}
.notifications-unread-badge.hidden { display: none !important; }

@keyframes notificationsUnreadBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.1); }
}

.notifications-panel {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  z-index: 90;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}
.notifications-panel:not(.hidden) {
  pointer-events: auto;
}
.notifications-panel.hidden { display: none; }

.notifications-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: -1;
}
.notifications-panel:not(.hidden) .notifications-backdrop {
  display: block;
}

.notifications-dropdown {
  width: 100%;
  max-height: min(24rem, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.85rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.notifications-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notifications-loading,
.notifications-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.875rem;
  text-align: center;
}
.notifications-loading.hidden,
.notifications-empty.hidden,
.notifications-list.hidden { display: none !important; }

.notifications-list {
  overflow-y: auto;
  max-height: min(20rem, calc(100vh - 8rem));
}

.notifications-item {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.notifications-item:last-child { border-bottom: none; }

.notifications-item-body {
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
}

.notifications-item-time {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.38);
}

@media (max-width: 767px) {
  .notifications-panel {
    right: -0.5rem;
    width: min(22rem, calc(100vw - 1.5rem));
  }
  .notifications-dropdown {
    max-height: min(20rem, calc(100vh - 6rem));
  }
}

@keyframes headerScrollLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.header-winnings-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: headerScrollLeft 28s linear infinite;
}
.scroll-pause:hover .header-winnings-track {
  animation-play-state: paused;
}
.header-winning-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  margin-right: 0.65rem;
  border-radius: 9999px;
  background: var(--surface-gradient-active);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .app-header {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }
  .app-header-menu {
    grid-column: 1;
    grid-row: 1;
  }
  .app-header-actions {
    grid-column: 2;
    grid-row: 1;
  }
  .header-winnings-ticker {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
  }
  .header-winning-item {
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    margin-right: 0.45rem;
  }
  .header-winning-item img {
    width: 1.25rem;
    height: 1.25rem;
  }
  .header-winning-item span {
    font-size: 0.6875rem;
  }
  .header-winnings-track {
    animation-duration: 22s;
  }
}

body.nav-collapsed #sidebar { width: 5rem; }
body.nav-collapsed #main-content { margin-left: 5rem; }
body:not(.nav-collapsed) #sidebar { width: 16rem; }
body:not(.nav-collapsed) #main-content { margin-left: 16rem; }

body.nav-collapsed .nav-label { display: none; }
body.nav-collapsed .nav-logo-text { display: none; }
body.nav-collapsed .nav-payment { display: none; }
body.nav-collapsed .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
body.nav-collapsed #sidebar > div > .border-b {
  padding-left: 0.375rem;
  padding-right: 0.375rem;
}
body.nav-collapsed .sidebar-logo { width: 4.5rem; height: 4.5rem; max-width: 100%; }
body:not(.nav-collapsed) .sidebar-logo { width: 14rem; height: auto; max-height: 10rem; }

@media (max-width: 767px) {
  #sidebar { position: fixed; }
  body:not(.nav-collapsed) #sidebar { width: 16rem; }
  body:not(.nav-collapsed) #overlay { display: block; }
  body.nav-collapsed #sidebar { width: 0; overflow: hidden; }
  body.nav-collapsed #main-content {
    margin-left: 0;
    margin-right: -20px;
  }
  body:not(.nav-collapsed) #main-content { margin-left: 0; }
}

#overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 40; }

.lightning-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bolt {
  position: absolute; opacity: 0; color: #91DC2C;
  will-change: transform; animation-timing-function: ease-in-out; animation-iteration-count: infinite;
}
@keyframes floatA {
  0%   { transform: translate(0,0) rotate(0deg); opacity:0; }
  10%  { opacity:.10; }
  25%  { transform: translate(-3vw,-4vh) rotate(8deg); }
  50%  { transform: translate(2vw,-8vh) rotate(-5deg); }
  75%  { transform: translate(-4vw,-5vh) rotate(10deg); }
  90%  { opacity:.10; }
  100% { transform: translate(1vw,-12vh) rotate(-3deg); opacity:0; }
}
@keyframes floatB {
  0%   { transform: translate(0,0) rotate(0deg); opacity:0; }
  10%  { opacity:.10; }
  25%  { transform: translate(4vw,-3vh) rotate(-10deg); }
  50%  { transform: translate(-2vw,-7vh) rotate(6deg); }
  75%  { transform: translate(3vw,-4vh) rotate(-8deg); }
  90%  { opacity:.10; }
  100% { transform: translate(-1vw,-11vh) rotate(4deg); opacity:0; }
}
@keyframes floatC {
  0%   { transform: translate(0,0) rotate(0deg); opacity:0; }
  10%  { opacity:.10; }
  30%  { transform: translate(-5vw,-2vh) rotate(12deg); }
  55%  { transform: translate(3vw,-6vh) rotate(-7deg); }
  80%  { transform: translate(-2vw,-3vh) rotate(9deg); }
  90%  { opacity:.10; }
  100% { transform: translate(2vw,-10vh) rotate(-5deg); opacity:0; }
}

.dashboard-banner {
  position: relative;
  width: 100%;
  height: 10rem;
  overflow: hidden;
}
.dashboard-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.dashboard-banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 19, 28, 0.8);
  z-index: 1;
}
.dashboard-banner-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 1rem;
}
@media (min-width: 640px) {
  .dashboard-banner-content { padding: 0 1.5rem; }
}
@media (min-width: 1024px) {
  .dashboard-banner-content { padding: 0 2rem; }
}

.game-card {
  box-shadow: 0 0 0 2px #5a3e05, 0 0 0 3.5px #D4AF37, 0 0 0 5px #5a3e05;
}
.game-card:hover {
  box-shadow: 0 0 0 2px #8B6914, 0 0 0 3.5px #FFD700, 0 0 0 5px #8B6914;
  transform: translateY(-3px);
}

.game-creds-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
}

.game-creds-section {
  position: relative;
  padding: 0.85rem 0.75rem 0.65rem;
}

.game-creds-label {
  position: absolute;
  top: 0;
  left: 0.65rem;
  transform: translateY(-50%);
  padding: 0 0.35rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  background: #0a2f38;
  border-radius: 100px;
  line-height: 1.2;
}

.btn-deposit {
  background: linear-gradient(to bottom, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 55%), #1e88c8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 2px 6px rgba(0,0,0,0.25);
}
.btn-withdraw,
.btn-link-old {
  background: linear-gradient(to bottom, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 55%), #91DC2C;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 2px 6px rgba(0,0,0,0.25);
}
.btn-cancel {
  background: linear-gradient(to bottom, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 55%), #ef4444;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 2px 6px rgba(0,0,0,0.25);
}
.btn-alt-payout-picker {
  background: linear-gradient(to bottom, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 55%), #1e88c8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 2px 6px rgba(0,0,0,0.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.btn-alt-payout-picker.border-accent {
  border-color: #c9a84c;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 0 0 1px rgba(201, 168, 76, 0.45), 0 2px 6px rgba(0,0,0,0.25);
}
.btn-alt-payout-save {
  background: linear-gradient(to bottom, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 55%), #91DC2C;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 2px 6px rgba(0,0,0,0.25);
  color: #0a2f38;
}
.btn-create {
  background: linear-gradient(to bottom, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 55%), #7C3AED;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 2px 6px rgba(0,0,0,0.25);
}
.btn-wallet-refresh {
  background: linear-gradient(to bottom, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 55%), #7C3AED;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 2px 6px rgba(0,0,0,0.25);
  color: #fff;
  transition: opacity 0.2s;
}
.btn-wallet-refresh:hover {
  opacity: 0.9;
}
.btn-wallet-refresh:disabled {
  opacity: 0.65;
  cursor: wait;
}

.modal-panel,
.surface-panel {
  background: var(--surface-gradient);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 40px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.08);
}

#walletDepositAmount {
  background-color: #061e24;
  color: #fff;
}
#walletDepositAmount option {
  background-color: #061e24;
  color: #fff;
}

.wallet-withdraw-input {
  width: 100%;
  background-color: #061e24;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  transition: border-color 0.2s;
}
.wallet-withdraw-input:focus {
  outline: none;
  border-color: #91DC2C;
}
.wallet-withdraw-input::placeholder { color: rgba(255,255,255,0.25); }

/* DataTables dark theme */
.dataTables_wrapper { color: rgba(255,255,255,0.85); font-family: 'Josefin Sans', sans-serif; }
table.dataTable { border-collapse: collapse !important; width: 100% !important; }
.tx-page h1 {
  color: rgba(255, 255, 255, 0.82);
}
.surface-panel table.dataTable thead th {
  background: linear-gradient(to bottom, #061e24 0%, rgba(3, 19, 28, 0.92) 100%);
  color: rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}
table.dataTable thead th {
  background: rgba(6, 30, 36, 0.9);
  color: rgba(255,255,255,0.38);
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem !important;
}
table.dataTable tbody td {
  background: #0A3039;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  padding: 0.85rem 1rem !important;
  font-size: 0.875rem;
}
.surface-panel table.dataTable tbody td {
  background: transparent;
}
table.dataTable tbody tr:hover td { background: #0d3a45; }
.surface-panel table.dataTable tbody tr:hover td {
  background: rgba(19, 70, 82, 0.35);
}
table.dataTable.no-footer { border-bottom: none; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { color: rgba(255,255,255,0.5); font-size: 0.8rem; margin-top: 1rem; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: #061e24;
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.35rem 0.6rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: #0A3039 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.7) !important;
  border-radius: 0.5rem !important;
  margin: 0 2px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #91DC2C !important;
  color: #03131C !important;
  border-color: #91DC2C !important;
  font-weight: 700;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #0d3a45 !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.15) !important;
}
.dataTables_processing {
  background: rgba(10,48,57,0.95) !important;
  color: #91DC2C !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}

.tx-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}
.tx-status-pending { color: #60a5fa; }
.tx-status-paid    { color: #4ade80; }
.tx-status-failed  { color: #f87171; }

.tx-game-cell { display: inline-flex; align-items: center; gap: 0.5rem; }
.tx-game-cell img { width: 1.5rem; height: 1.5rem; border-radius: 0.25rem; object-fit: cover; flex-shrink: 0; }
