/* Stake-inspired Design System */
:root {
    --stake-bg-primary: #162936;
    --stake-bg-secondary: #203645;
    --stake-bg-tertiary: #2c475a;
    --stake-bg-inset: #101f2b;
    --stake-text-primary: #f1f7fb;
    --stake-text-secondary: #b6cddd;
    --stake-text-muted: #9eb8ca;
    --stake-accent: #74cfe7;
    --stake-accent-hover: #a3e6f6;
    --stake-action: #176dcc;
    --stake-action-hover: #1765b7;
    --stake-border: #375365;
    --stake-sidebar-width: 240px;
    --stake-navbar-height: 60px;
    --stake-content-width: 1200px;
    --stake-content-gutter: 24px;
    --stake-layout-transition: 300ms ease;
}

:root[data-theme="classic"] {
    --stake-bg-primary: #0f1410;
    --stake-bg-secondary: #1a1f2e;
    --stake-bg-tertiary: #2d3748;
    --stake-bg-inset: #121922;
    --stake-text-secondary: #c1cbd6;
    --stake-text-muted: #a5b3c3;
    --stake-accent: #00d4aa;
    --stake-accent-hover: #46e8c8;
    --stake-action: #007761;
    --stake-action-hover: #00816a;
    --stake-border: #415066;
}

:root[data-theme]:not(:where([data-theme="ocean"], [data-theme="classic"])) {
    --theme-saturation: 30%;
    --stake-bg-primary: hsl(var(--theme-hue) var(--theme-saturation) 14%);
    --stake-bg-secondary: hsl(var(--theme-hue) var(--theme-saturation) 19%);
    --stake-bg-tertiary: hsl(var(--theme-hue) var(--theme-saturation) 25%);
    --stake-bg-inset: hsl(var(--theme-hue) var(--theme-saturation) 10%);
    --stake-border: hsl(var(--theme-hue) var(--theme-saturation) 33%);
    --stake-text-secondary: hsl(var(--theme-hue) var(--theme-saturation) 83%);
    --stake-text-muted: hsl(var(--theme-hue) var(--theme-saturation) 74%);
    --stake-accent: hsl(var(--theme-hue) var(--theme-saturation) 72%);
    --stake-accent-hover: hsl(var(--theme-hue) var(--theme-saturation) 83%);
    --stake-action: hsl(var(--theme-hue) var(--theme-saturation) 33%);
    --stake-action-hover: hsl(var(--theme-hue) var(--theme-saturation) 38%);
}

:root[data-theme="graphite"] {
    --theme-saturation: 7%;
}

/* Base Styles */
.stake-body {
    background-color: var(--stake-bg-primary);
    color: var(--stake-text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Sidebar */
.stake-sidebar {
    position: fixed;
    left: 0;
    top: var(--stake-navbar-height);
    width: var(--stake-sidebar-width);
    height: calc(100vh - var(--stake-navbar-height));
    background-color: var(--stake-bg-inset);
    border-right: 1px solid var(--stake-border);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--stake-border) transparent;
    z-index: 1000;
    transition: width var(--stake-layout-transition);
}

.stake-sidebar-content {
    padding: 16px 0 0 16px;
}

.stake-sidebar-tabs {
    display: flex;
    padding: 0 16px 16px 16px;
    gap: 8px;
}

.stake-sidebar-tab {
    flex: 1;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--stake-text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stake-sidebar-tab.active {
    background-color: var(--stake-accent);
    color: #000;
}

.stake-sidebar-tab:hover:not(.active) {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

.stake-sidebar-section {
    margin-bottom: 8px;
}

.stake-sidebar-header {
    padding: 16px 20px 8px 20px;
    color: var(--stake-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stake-sidebar-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--stake-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.stake-sidebar-item:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

.stake-sidebar-item i {
    margin-right: 8px;
    width: 16px;
    font-size: 14px;
    flex-shrink: 0;
}

.stake-sidebar-item-content {
    display: flex;
    align-items: center;
    flex: 1;
}

.stake-sidebar-expandable {
    position: relative;
}

.stake-sidebar-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
    margin-left: auto;
    width: 12px;
    flex-shrink: 0;
}

.stake-sidebar-expandable.expanded .stake-sidebar-arrow {
    transform: rotate(180deg);
}

.stake-sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: var(--stake-bg-primary);
}

.stake-sidebar-submenu.expanded {
    max-height: 300px;
}

.stake-sidebar-submenu-item {
    padding: 8px 20px 8px 48px;
    color: var(--stake-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stake-sidebar-submenu-item:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

.stake-sidebar-divider {
    height: 1px;
    background-color: var(--stake-border);
    margin: 16px 20px;
}

/* Top Navigation */
.stake-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--stake-navbar-height);
    background-color: var(--stake-bg-primary);
    border-bottom: 1px solid var(--stake-bg-inset);
    transition: margin-right var(--stake-layout-transition),
        padding-inline-start var(--stake-layout-transition);
    z-index: 1001;
}

.stake-nav-container {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 16px;
    position: relative;
}

.stake-nav-far-left {
    display: flex;
    align-items: center;
    margin-right: 16px;
}

.stake-menu-toggle {
    background: none;
    border: none;
    color: var(--stake-text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.stake-menu-toggle:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

.stake-nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.stake-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--stake-accent);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.stake-logo:hover {
    color: var(--stake-accent-hover);
}

.stake-nav-tabs {
    display: flex;
    gap: 4px;
}

.stake-nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--stake-text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stake-nav-tab:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

.stake-nav-tab.active {
    background-color: var(--stake-accent);
    color: #000;
}

.stake-nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.stake-center-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stake-currency-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    border-radius: 8px;
    color: var(--stake-text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stake-currency-dropdown:hover {
    border-color: var(--stake-accent);
}

.stake-currency-symbol {
    color: var(--stake-accent);
    font-weight: 600;
}

.stake-currency-menu {
    min-width: 200px;
}

.stake-nav-far-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stake-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--stake-text-secondary);
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stake-icon-btn:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

.stake-user-icons {
    display: flex;
    align-items: center;
    gap: inherit;
}

.stake-theme-menu {
    width: min(290px, calc(100vw - 24px));
    padding: 12px;
    background: var(--stake-bg-secondary);
    border: 1px solid var(--stake-border);
    color: var(--stake-text-primary);
    box-shadow: 0 12px 26px #0005;
}

.stake-theme-title {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.stake-theme-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.stake-theme-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--stake-text-primary);
    background: transparent;
    font-size: 12px;
    text-align: left;
}

.stake-theme-option::before {
    content: "";
    flex: 0 0 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--swatch);
}

.stake-theme-option:hover,
.stake-theme-option[aria-pressed="true"] {
    background: var(--stake-bg-tertiary);
}

.stake-theme-option[aria-pressed="true"] {
    border-color: var(--stake-accent);
}

.stake-user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--stake-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 600;
    font-size: 12px;
}

/* Search Bar */
.stake-search-bar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--stake-bg-secondary);
    border-bottom: 1px solid var(--stake-border);
    padding: 16px;
    z-index: 1000;
}

.stake-search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.stake-search-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--stake-text-muted);
}

.stake-search-container input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    border-radius: 8px;
    color: var(--stake-text-primary);
    font-size: 16px;
}

.stake-search-container input::placeholder {
    color: var(--stake-text-muted);
}

.stake-search-container input:focus {
    outline: none;
    border-color: var(--stake-accent);
}

.stake-search-close {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--stake-text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.stake-search-close:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

/* Buttons */
.stake-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stake-btn-primary {
    background-color: var(--stake-action);
    color: #fff;
}

.stake-btn-primary:hover {
    background-color: var(--stake-action-hover);
    color: #fff;
}

.stake-btn-secondary {
    background-color: transparent;
    color: var(--stake-text-secondary);
    border: 1px solid var(--stake-border);
}

.stake-btn-secondary:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

.stake-btn-wallet {
    background-color: var(--stake-action);
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
}

.stake-btn-wallet:hover {
    background-color: var(--stake-action-hover);
}

/* Wallet button responsive elements */
.stake-btn-wallet .wallet-icon {
    display: none; /* Hidden on desktop */
}

.stake-btn-wallet .wallet-text {
    display: inline; /* Shown on desktop */
}

/* Auth Buttons */
.stake-auth-buttons {
    display: flex;
    gap: 12px;
}

/* User Section */
.stake-user-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Hide user icons for guests */
.stake-nav-far-right #user-icons-section.d-none {
    display: none !important;
}

.stake-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: var(--stake-bg-tertiary);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.stake-balance-amount {
    color: var(--stake-accent);
}

.stake-balance i {
    color: var(--stake-text-muted);
    cursor: pointer;
}

.stake-user-menu {
    background: none;
    border: none;
    cursor: pointer;
}

.stake-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--stake-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 600;
    font-size: 14px;
}

.stake-settings {
    padding: 8px;
    color: var(--stake-text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.stake-settings:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

/* Main Content */
.stake-main {
    margin-left: var(--stake-sidebar-width);
    margin-top: var(--stake-navbar-height);
    margin-right: 0;
    min-height: calc(100vh - var(--stake-navbar-height));
    transition: margin-right var(--stake-layout-transition), margin-left var(--stake-layout-transition);
}

.stake-main.chat-open {
    margin-right: 350px;
}

/* Push navbar when chat is open */
.stake-navbar.chat-open {
    margin-right: 350px;
}

.stake-content {
    max-width: calc(var(--stake-content-width) + var(--stake-content-gutter) * 2);
    margin-inline: auto;
    padding: var(--stake-content-gutter);
}

.stake-body .btn-primary {
    background-color: var(--stake-action);
    border-color: var(--stake-action);
}

.stake-body .btn-primary:is(:hover, :focus, :active):not(:disabled) {
    background-color: var(--stake-action-hover);
    border-color: var(--stake-action-hover);
}

.stake-body .game-container :is(.form-control, .form-select, .input-group-text) {
    background-color: var(--stake-bg-inset);
    border-color: var(--stake-border);
    color: var(--stake-text-primary);
}

.game-container .game-stats {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.game-container .game-stats .stat-item {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 3px 0;
    overflow-wrap: anywhere;
}

/* Profile Section */
.stake-profile-section {
    margin-bottom: 32px;
}

.stake-profile-card {
    background-color: var(--stake-bg-secondary);
    border: 1px solid var(--stake-border);
    border-radius: 12px;
    padding: 24px;
}

.stake-profile-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stake-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 700;
    font-size: 24px;
}

.stake-profile-details h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.stake-vip-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--stake-text-secondary);
}

.stake-progress-bar {
    flex: 1;
    height: 6px;
    background-color: var(--stake-bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.stake-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    transition: width 0.3s ease;
}

.stake-profile-stats {
    display: flex;
    gap: 16px;
}

.stake-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: var(--stake-bg-tertiary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.stake-stat i {
    color: var(--stake-accent);
}

/* Sections */
.stake-section {
    margin-bottom: 40px;
}

.stake-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.stake-section-header i {
    color: var(--stake-accent);
}

/* Games Grid */
.stake-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.stake-originals-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 138px;
    gap: 14px;
    justify-content: start;
    overflow-x: auto;
    margin: -9px -4px 0;
    padding: 9px 4px 8px;
    list-style: none;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 4px;
    scrollbar-width: thin;
}

.game-card {
    min-width: 0;
    scroll-snap-align: start;
}

.game-card-cover {
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    background-color: #213743;
}

.game-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

a.game-card-cover:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.game-card-status {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    color: #b1bad3;
    font-size: 12px;
    line-height: 16px;
}

.game-card-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #1fff20;
}

.game-card {
    position:relative; z-index:0;
    --game-card-hover-glow:0 0 0 2px color-mix(in srgb,var(--stake-accent) 85%,transparent),
        0 0 16px color-mix(in srgb,var(--stake-accent) 75%,transparent),
        0 -4px 30px color-mix(in srgb,var(--stake-accent) 50%,transparent);
}
.game-card-status { position:relative; z-index:1; }
.game-card-cover { position:relative; transform-origin:center bottom; transition:transform 180ms cubic-bezier(.2,.65,.3,1),box-shadow 180ms ease; }
.game-card:focus-within { z-index:5; }
a.game-card-cover:focus-visible { transform:translateY(-3px) scale(1.08); box-shadow:var(--game-card-hover-glow); }
@media (hover:hover) and (pointer:fine) {
    .game-card:hover { z-index:5; }
    a.game-card-cover:hover { transform:translateY(-3px) scale(1.08); box-shadow:var(--game-card-hover-glow); }
    /* Reserve paint space inside scrolling rows without moving their content or changing card sizes. */
    .stake-originals-grid { margin:-30px -20px -12px; padding:30px 20px 20px; scroll-padding-inline:20px; }
}
@media (prefers-reduced-motion:reduce) {
    .game-card-cover { transition-duration:90ms; }
}

/* Modals */
.stake-modal {
    background-color: var(--stake-bg-secondary);
    border: 1px solid var(--stake-border);
    border-radius: 12px;
}

.stake-modal-header {
    background-color: var(--stake-bg-secondary);
    border-bottom: 1px solid var(--stake-border);
    padding: 20px 24px;
}

.stake-modal-header .modal-title {
    color: var(--stake-text-primary);
    font-size: 18px;
    font-weight: 600;
}

.stake-btn-close {
    background: none;
    border: none;
    color: var(--stake-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.stake-btn-close:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

.stake-modal-body {
    padding: 24px;
}

.stake-modal-footer {
    background-color: var(--stake-bg-secondary);
    border-top: 1px solid var(--stake-border);
    padding: 20px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Form Styles */
.stake-form-group {
    margin-bottom: 20px;
}

.stake-form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--stake-text-primary);
    font-size: 14px;
    font-weight: 500;
}

.stake-form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    border-radius: 8px;
    color: var(--stake-text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.stake-form-control:focus {
    outline: none;
    border-color: var(--stake-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--stake-accent) 10%, transparent);
}

.stake-form-control::placeholder {
    color: var(--stake-text-muted);
}

.stake-form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.stake-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--stake-accent);
}

.stake-checkbox-label {
    color: var(--stake-text-secondary);
    font-size: 14px;
    cursor: pointer;
}

/* Dropdown */
.stake-dropdown {
    background-color: var(--stake-bg-secondary);
    border: 1px solid var(--stake-border);
    border-radius: 8px;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stake-dropdown .dropdown-item {
    color: var(--stake-text-secondary);
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.stake-dropdown .dropdown-item:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

.stake-dropdown .dropdown-divider {
    border-color: var(--stake-border);
    margin: 8px 0;
}

/* Profile Menu */
.stake-profile-menu {
    min-width: 200px;
    max-height: none;
    overflow-y: visible;
}

/* Currency Menu */
.stake-currency-menu {
    min-width: 250px;
}

.currency-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.currency-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.currency-info i {
    width: 16px;
    font-size: 14px;
    color: var(--stake-accent);
}

.currency-balance {
    font-weight: 600;
    color: var(--stake-text-primary);
    font-family: 'Courier New', monospace;
}

.currency-details {
    text-align: right;
}

.currency-name {
    font-size: 12px;
    color: var(--stake-text-muted);
}

/* Menu collapsed state */
.stake-sidebar.collapsed {
    width: 60px;
}

.stake-sidebar.collapsed .stake-sidebar-header span,
.stake-sidebar.collapsed .stake-sidebar-item span {
    display: none;
}

.stake-sidebar.collapsed .stake-sidebar-header,
.stake-sidebar.collapsed .stake-sidebar-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.stake-main.sidebar-collapsed {
    margin-left: 60px;
}

/* Tab text hiding for collapsed state */
.stake-nav-tabs.collapsed .stake-tab-text {
    display: none;
}

.stake-nav-tabs.collapsed .stake-nav-tab {
    padding: 8px;
    min-width: 40px;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stake-nav-center {
        max-width: 300px;
    }

    .stake-tab-text {
        display: none;
    }

    .stake-nav-tab {
        padding: 8px;
        min-width: 40px;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .stake-sidebar {
        transform: translateX(-100%);
        transition: transform var(--stake-layout-transition);
        width: var(--stake-sidebar-width);
    }

    .stake-sidebar.open {
        transform: translateX(0);
    }

    .stake-main {
        margin-left: 0;
    }

    .stake-nav-center {
        display: flex;
        gap: 8px;
    }

    /* Show user section but modify wallet button */
    .stake-nav-center #user-section {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Make wallet button icon-only on mobile */
    .stake-nav-center .stake-btn-wallet {
        min-width: 36px;
        width: 36px;
        height: 36px;
        padding: 0;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide wallet text on mobile */
    .stake-nav-center .stake-btn-wallet .wallet-text {
        display: none;
    }

    /* Show wallet icon on mobile */
    .stake-nav-center .stake-btn-wallet .wallet-icon {
        display: block;
    }

    /* Currency dropdown mobile adjustments */
    .stake-nav-center .stake-currency-dropdown {
        padding: 6px 8px;
        font-size: 12px;
        min-width: auto;
    }

    .stake-nav-center .stake-balance-amount {
        font-size: 12px;
    }

    .stake-nav-center .stake-currency-symbol {
        font-size: 14px;
    }

    .stake-nav-left {
        gap: 12px;
    }

    .stake-nav-tabs {
        display: none;
    }

    .stake-nav-far-right {
        gap: 4px;
    }

    .stake-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* Plinko Game Styles */
.game-container {
    background-color: var(--stake-bg-secondary);
    border: 1px solid var(--stake-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--stake-border);
}

.game-title {
    color: var(--stake-text-primary);
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-title i {
    color: var(--stake-accent);
}

.game-info {
    display: flex;
    gap: 8px;
}

.bet-controls {
    margin-bottom: 24px;
}

.bet-amount-input {
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    color: var(--stake-text-primary);
}

.bet-amount-input:focus {
    background-color: var(--stake-bg-tertiary);
    border-color: var(--stake-accent);
    color: var(--stake-text-primary);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--stake-accent) 25%, transparent);
}

.bet-buttons .btn {
    margin-right: 4px;
}

.bet-button {
    background-color: var(--stake-accent);
    color: #000;
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.bet-button:hover {
    background-color: var(--stake-accent-hover);
    color: #000;
}

.bet-button:disabled {
    background-color: var(--stake-border);
    color: var(--stake-text-muted);
    cursor: not-allowed;
}





.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

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

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--stake-accent);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--stake-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-bets {
    max-height: 400px;
    overflow-y: auto;
}

.bet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--stake-border);
}

.bet-item:last-child {
    border-bottom: none;
}

.bet-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bet-amount {
    font-weight: 600;
    color: var(--stake-text-primary);
}

.bet-multiplier {
    font-size: 12px;
    color: var(--stake-text-secondary);
}

.bet-result {
    font-weight: 600;
}

.bet-result.win {
    color: #28a745;
}

.bet-result.loss {
    color: #dc3545;
}

.fairness-info {
    font-size: 14px;
}

.fairness-info .form-control {
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    color: var(--stake-text-primary);
    font-size: 12px;
}

.fairness-info .form-control:focus {
    background-color: var(--stake-bg-tertiary);
    border-color: var(--stake-accent);
    color: var(--stake-text-primary);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--stake-accent) 25%, transparent);
}

/* General Layout */
.plinko-container {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    padding: 8px;
    background-color: var(--stake-bg-secondary);
    border-radius: 13px;
}

/* Wrapper ensures grid and left panel are side-by-side */
.plinko-container-wrapper {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 10px;
}

/* Left Panel */
.plinko-left {
    background-color: var(--stake-bg-tertiary);
    padding: 13px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    border-radius: 13px;
    gap: 10px;
}

/* Form Labels */
.form-label {
    color: var(--stake-text-primary);
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

/* Input Fields and Buttons */
.input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-control, .form-select {
    background-color: var(--stake-bg-primary);
    color: var(--stake-text-primary);
    border: 1px solid var(--stake-border);
    border-radius: 5px;
    padding: 8px;
}

.form-control:focus, .form-select:focus {
    outline: none;
    box-shadow: 0 0 5px var(--stake-accent);
}

/* Buttons */
.btn-sm {
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.btn-secondary {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
    border: none;
}

.btn-secondary:hover {
    background-color: var(--stake-border);
}

.play-button {
    color: #000;
    background-color: var(--stake-accent);
    width: 100%;
    height: 50px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.play-button:hover {
    background-color: var(--stake-accent-hover);
}

/* Grid Parent */
.grid-parent {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 760px;
    background-color: var(--stake-bg-primary);
    border-top-right-radius: 3px;
    overflow: hidden;
}

/* Color Picker */
.color-selector {
    background-color: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    height: 40px;
}

/* Range Slider */
#speed-slider {
    width: 100%;
}

/* Manual/Auto Toggle */
.manual-auto-toggle {
    display: flex;
    background-color: var(--stake-bg-primary);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 15px;
}

.toggle-btn {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--stake-text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.toggle-btn.active {
    background-color: var(--stake-accent);
    color: #000;
}

.toggle-btn:hover:not(.active) {
    background-color: var(--stake-border);
    color: var(--stake-text-primary);
}

/* Bottom Controls */
.plinko-bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--stake-bg-primary);
    border-top: 1px solid var(--stake-border);
    margin-top: 10px;
    border-radius: 0 0 13px 13px;
}

.bottom-controls-left,
.bottom-controls-right {
    display: flex;
    gap: 10px;
}

.bottom-controls-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--stake-text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-icon:hover {
    background-color: var(--stake-border);
    color: var(--stake-text-primary);
}

.stake-logo {
    font-size: 18px;
    font-weight: bold;
    color: var(--stake-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Fairness Modal Styles */
#fairnessModal .modal-content {
    background-color: var(--stake-bg-secondary);
    border: 1px solid var(--stake-border);
    border-radius: 8px;
}

#fairnessModal .modal-header {
    background-color: var(--stake-bg-tertiary);
    border-bottom: 1px solid var(--stake-border);
    color: var(--stake-text-primary);
}

#fairnessModal .modal-title {
    color: var(--stake-text-primary);
    font-weight: 600;
}

#fairnessModal .btn-close {
    filter: invert(1);
}

#fairnessModal .nav-tabs {
    border-bottom: 1px solid var(--stake-border);
}

#fairnessModal .nav-tabs .nav-link {
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    color: var(--stake-text-secondary);
    margin-right: 5px;
    border-radius: 8px 8px 0 0;
}

#fairnessModal .nav-tabs .nav-link.active {
    background-color: var(--stake-accent);
    border-color: var(--stake-accent);
    color: #000;
}

#fairnessModal .nav-tabs .nav-link:hover:not(.active) {
    background-color: var(--stake-border);
    color: var(--stake-text-primary);
}

#fairnessModal .modal-body {
    background-color: var(--stake-bg-secondary);
    color: var(--stake-text-primary);
}

#fairnessModal .form-label {
    color: var(--stake-text-primary);
    font-weight: 500;
    margin-bottom: 8px;
}

#fairnessModal .form-control {
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    color: var(--stake-text-primary);
}

#fairnessModal .form-control:focus {
    background-color: var(--stake-bg-tertiary);
    border-color: var(--stake-accent);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--stake-accent) 25%, transparent);
    color: var(--stake-text-primary);
}

#fairnessModal .btn-outline-secondary {
    border-color: var(--stake-border);
    color: var(--stake-text-secondary);
}

#fairnessModal .btn-outline-secondary:hover {
    background-color: var(--stake-border);
    border-color: var(--stake-border);
    color: var(--stake-text-primary);
}

#fairnessModal .btn-primary {
    background-color: var(--stake-accent);
    border-color: var(--stake-accent);
    color: #000;
}

#fairnessModal .btn-primary:hover {
    background-color: var(--stake-accent-hover);
    border-color: var(--stake-accent-hover);
}

#fairnessModal .fairness-section {
    margin-bottom: 20px;
}

#fairnessModal .fairness-section h6 {
    color: var(--stake-text-primary);
    font-weight: 600;
    margin-bottom: 15px;
}

#fairnessModal .fairness-section p {
    color: var(--stake-text-secondary);
    margin-bottom: 15px;
}

#fairnessModal .fairness-section ul {
    color: var(--stake-text-secondary);
    padding-left: 20px;
}

#fairnessModal .fairness-section li {
    margin-bottom: 8px;
}

#fairnessModal .alert-info {
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-accent);
    color: var(--stake-text-primary);
}

#fairnessModal .modal-footer {
    background-color: var(--stake-bg-tertiary);
    border-top: 1px solid var(--stake-border);
    justify-content: center;
}

#fairnessModal .stake-logo-small {
    color: var(--stake-accent);
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 1px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .plinko-container-wrapper {
        flex-direction: column-reverse;
    }

    .plinko-left {
        min-width: auto;
        width: 100%;
        margin-bottom: 10px;
    }

    .plinko-bottom-controls {
        padding: 10px 15px;
    }
    .grid-parent {
        min-height: 500px;
    }

    .btn-icon {
        padding: 6px 10px;
        font-size: 14px;
    }

    .stake-logo {
        font-size: 16px;
    }
}

/* Bounce animation for multiplier panels */
@keyframes bounce {
    20%, 80%, 100% {
        transform: translateY(0);
    }
    0% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 0.6s ease-in-out;
}



.amount-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--stake-text-primary);
    padding: 12px 16px;
    font-size: 16px;
    outline: none;
}

.currency-symbol {
    background-color: var(--stake-bg-primary);
    color: var(--stake-text-secondary);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border-left: 1px solid var(--stake-border);
}

.amount-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-amount {
    flex: 1;
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    color: var(--stake-text-secondary);
    padding: 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-amount:hover {
    background-color: var(--stake-bg-primary);
    color: var(--stake-text-primary);
}

.control-select,
.control-input {
    width: 100%;
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    color: var(--stake-text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.control-select:focus,
.control-input:focus {
    border-color: var(--stake-accent);
}

.btn-play {
    width: 100%;
    background-color: var(--stake-accent);
    border: none;
    color: #000;
    padding: 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.2s ease;
}

.btn-play:hover {
    background-color: var(--stake-accent-hover);
}

.btn-play:disabled {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-secondary);
}

.auto-controls {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--stake-border);
}

.plinko-game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
    min-height: 600px;
}

.plinko-game-area .plinko-board {
    flex: 1;
    background-color: var(--stake-bg-secondary);
    border: 2px solid var(--stake-border);
    border-radius: 12px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    min-height: 500px;
    width: 100%;
}

.plinko-game-area .plinko-board canvas {
    width: 100%;
    height: calc(100% - 80px);
    display: block;
}

.plinko-game-area .plinko-multipliers {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.plinko-game-area .multiplier-slot {
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--stake-text-primary);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 35px;
    transition: all 0.2s ease;
}

.plinko-game-area .multiplier-slot.hit {
    background-color: var(--stake-accent);
    color: #000;
    transform: scale(1.1);
}

.plinko-game-area .multiplier-slot.mega-multiplier {
    background-color: #ff6b6b;
    color: #fff;
}

.plinko-game-area .multiplier-slot.high-multiplier {
    background-color: #ffa726;
    color: #fff;
}

.plinko-game-area .multiplier-slot.medium-multiplier {
    background-color: #66bb6a;
    color: #fff;
}

.plinko-game-area .multiplier-slot.low-multiplier {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-secondary);
}

.plinko-bottom-section {
    background-color: var(--stake-bg-secondary);
    border-top: 1px solid var(--stake-border);
    padding: 16px 20px;
}

.plinko-bottom-section .game-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.plinko-bottom-section .stat-card {
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    border-radius: 8px;
    padding: 16px 20px;
    text-align: center;
    min-width: 140px;
}

.bottom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--stake-text-secondary);
    padding: 8px;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}


.stake-logo span {
    font-size: 18px;
    font-weight: 700;
    color: var(--stake-text-primary);
}

.btn-fairness {
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    color: var(--stake-text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-fairness:hover {
    background-color: var(--stake-bg-primary);
    border-color: var(--stake-accent);
}

/* Responsive Plinko Styles */
@media (max-width: 768px) {
    .plinko-game-layout {
        flex-direction: column;
        height: auto;
    }

    .plinko-controls {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--stake-border);
    }

    .plinko-board {
        height: 400px;
    }

    .game-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .bet-controls .row {
        gap: 12px;
    }

    .bet-controls .col-md-3,
    .bet-controls .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .multiplier-slot {
        min-width: 30px;
        font-size: 10px;
        padding: 6px 2px;
    }
}

@media (max-width: 576px) {
    .game-container {
        padding: 16px;
    }

    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .game-title {
        font-size: 20px;
    }

    .plinko-board {
        height: 350px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 16px;
    }
}

/* Chat Panel */
.stake-chat-panel {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background-color: var(--stake-bg-secondary);
    border-left: 1px solid var(--stake-border);
    z-index: 1002;
    transition: right var(--stake-layout-transition);
    display: flex;
    flex-direction: column;
}

.stake-chat-panel.open {
    right: 0;
}

.stake-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--stake-border);
}

.stake-chat-header h4 {
    margin: 0;
    color: var(--stake-text-primary);
    font-size: 16px;
    font-weight: 600;
}

.stake-chat-close {
    background: none;
    border: none;
    color: var(--stake-text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.stake-chat-close:hover {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
}

.stake-chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stake-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.stake-chat-message {
    margin-bottom: 12px;
    padding: 8px 12px;
    background-color: var(--stake-bg-tertiary);
    border-radius: 8px;
    font-size: 14px;
}

.stake-chat-user {
    color: var(--stake-accent);
    font-weight: 600;
    margin-right: 8px;
}

.stake-chat-text {
    color: var(--stake-text-primary);
}

.stake-chat-input {
    display: flex;
    padding: 16px;
    border-top: 1px solid var(--stake-border);
    gap: 8px;
}

.stake-chat-input input {
    flex: 1;
    padding: 10px 12px;
    background-color: var(--stake-bg-tertiary);
    border: 1px solid var(--stake-border);
    border-radius: 6px;
    color: var(--stake-text-primary);
    font-size: 14px;
}

.stake-chat-input input::placeholder {
    color: var(--stake-text-muted);
}

.stake-chat-input input:focus {
    outline: none;
    border-color: var(--stake-accent);
}

.stake-chat-send {
    padding: 10px 12px;
    background-color: var(--stake-accent);
    border: none;
    border-radius: 6px;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stake-chat-send:hover {
    background-color: var(--stake-accent-hover);
}

/* Responsive adjustments for chat */
@media (max-width: 768px) {
    .stake-chat-panel {
        width: 100%;
        right: -100%;
    }
}
}

.dark-theme .btn-outline-primary {
    border-color: var(--stake-accent);
    color: var(--stake-accent);
}

.dark-theme .btn-outline-primary:hover {
    background-color: var(--stake-accent);
    color: #000;
}

.dark-theme .modal-content {
    background-color: var(--stake-bg-secondary);
    border: 1px solid var(--stake-bg-tertiary);
}

.dark-theme .form-control {
    background-color: var(--stake-bg-tertiary);
    border-color: var(--stake-border);
    color: #ffffff;
}

.dark-theme .form-control:focus {
    background-color: var(--stake-bg-tertiary);
    border-color: var(--stake-accent);
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--stake-accent) 25%, transparent);
}

.dark-theme .form-select {
    background-color: var(--stake-bg-tertiary);
    border-color: var(--stake-border);
    color: #ffffff;
}

body {
    padding-top: 76px;
    margin-bottom: 60px;
}

/* Home page styles */
.hero-section {
    background: linear-gradient(135deg, var(--stake-bg-secondary) 0%, var(--stake-bg-tertiary) 100%);
    border-radius: 12px;
    margin: 20px 0;
}

.hero-buttons .btn {
    margin: 0 8px;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.game-stats .stat {
    font-size: 0.8rem;
    color: var(--stake-accent);
    font-weight: 500;
}

.game-stats .stat i {
    margin-right: 4px;
}

.feature-card {
    background-color: var(--stake-bg-secondary);
    border: 1px solid var(--stake-bg-tertiary);
    border-radius: 12px;
    padding: 32px 24px;
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--stake-border);
}

.feature-icon {
    font-size: 3rem;
    color: var(--stake-accent);
    margin-bottom: 20px;
}

.feature-card h4 {
    color: #ffffff;
    margin-bottom: 16px;
    font-weight: 600;
}

.feature-card p {
    color: var(--stake-text-secondary);
    line-height: 1.6;
}

.stats-section {
    background-color: var(--stake-bg-secondary);
    border-radius: 12px;
    margin: 40px 0;
}

.stat-item {
    padding: 20px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--stake-accent);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--stake-text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Admin Panel Styles */
.admin-card {
    background-color: var(--stake-bg-secondary);
    border: 1px solid var(--stake-bg-tertiary);
    border-radius: 12px;
    margin-bottom: 20px;
}

.admin-card .card-header {
    background-color: var(--stake-bg-tertiary);
    border-bottom: 1px solid var(--stake-border);
    border-radius: 12px 12px 0 0;
    padding: 16px 20px;
}

.admin-card .card-body {
    padding: 20px;
}

/* Custom Accordion Styling for Admin Settings */
.settings-accordion .accordion-item {
    background-color: var(--stake-bg-secondary);
    border: 1px solid var(--stake-border);
    border-radius: 8px;
    margin-bottom: 12px;
}

.settings-accordion .accordion-header {
    border-radius: 8px;
}

.settings-accordion .accordion-button {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-primary);
    border: none;
    border-radius: 8px;
    padding: 16px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.settings-accordion .accordion-button:not(.collapsed) {
    background-color: var(--stake-accent);
    color: var(--stake-bg-primary);
    box-shadow: none;
}

.settings-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--stake-accent) 25%, transparent);
    border-color: var(--stake-accent);
}

.settings-accordion .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.settings-accordion .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000000'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.settings-accordion .accordion-body {
    background-color: var(--stake-bg-secondary);
    color: var(--stake-text-primary);
    padding: 20px;
    border-top: 1px solid var(--stake-border);
}

.settings-accordion .badge {
    background-color: var(--stake-bg-primary);
    color: var(--stake-text-secondary);
}

.settings-accordion .accordion-button:not(.collapsed) .badge {
    background-color: color-mix(in srgb, var(--stake-bg-primary) 30%, transparent);
    color: var(--stake-bg-primary);
}

.stat-card {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-dark, #0056b3) 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    gap: 15px;
    overflow: clip;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.stat-card.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.stat-card.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #d39e00 100%);
    color: #fff;
}

.stat-card.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: 20px;
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-content p {
    font-size: 1rem;
    margin-bottom: 4px;
    opacity: 0.9;
}

.stat-content small {
    font-size: 0.875rem;
    opacity: 0.7;
}

.user-badge {
    background-color: var(--stake-accent);
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.game-badge {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-accent);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.top-player-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--stake-bg-tertiary);
}

.top-player-item:last-child {
    border-bottom: none;
}

.player-rank {
    width: 40px;
    text-align: center;
    font-size: 1.2rem;
}

.rank-number {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.player-info {
    flex: 1;
    margin-left: 12px;
}

.player-name {
    font-weight: 600;
    color: #ffffff;
}

.player-stats {
    display: flex;
    gap: 16px;
    margin-top: 4px;
}

.player-stats small {
    color: var(--stake-text-secondary);
    font-size: 0.75rem;
}

.player-actions {
    margin-left: 12px;
}

.new-bet-row {
    background-color: color-mix(in srgb, var(--stake-accent) 10%, transparent);
    animation: highlightBet 3s ease-out;
}

@keyframes highlightBet {
    0% { background-color: color-mix(in srgb, var(--stake-accent) 30%, transparent); }
    100% { background-color: transparent; }
}

/* Wallet Modal Styles */
#walletModal .modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 1rem);
    margin: 0.5rem auto;
    max-width: 600px;
    width: 95%;
}
#blockchainDetailsModal .modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 1rem);
    margin: 0.5rem auto;
    max-width: 600px;
    width: 95%;
}

#walletModal .modal-content {
    max-height: 700px;
    overflow: hidden;
}

.stake-wallet-tabs {
    display: flex;
    border-bottom: 1px solid var(--stake-border);
    margin-bottom: 24px;
}

.stake-wallet-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--stake-text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.stake-wallet-tab.active {
    color: var(--stake-text-primary);
    border-bottom-color: var(--stake-accent);
}

.stake-wallet-tab:hover {
    color: var(--stake-text-primary);
    background-color: var(--stake-bg-tertiary);
}

.stake-wallet-content {
    min-height: 300px;
}

.stake-wallet-balances {
    margin-bottom: 24px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 8px;
}

.stake-wallet-balances::-webkit-scrollbar {
    width: 6px;
}

.stake-wallet-balances::-webkit-scrollbar-track {
    background: var(--stake-bg-tertiary);
    border-radius: 3px;
}

.stake-wallet-balances::-webkit-scrollbar-thumb {
    background: var(--stake-accent);
    border-radius: 3px;
}

.stake-wallet-balances::-webkit-scrollbar-thumb:hover {
    background: var(--stake-accent);
}

.stake-balance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--stake-border);
}

.stake-balance-item:last-child {
    border-bottom: none;
}

.stake-balance-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stake-balance-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.crypto-icon {
    background-color: var(--stake-bg-tertiary);
    color: var(--stake-accent);
    border: 1px solid var(--stake-border);
}

.crypto-icon i {
    font-size: 16px;
}

.stake-balance-details {
    display: flex;
    flex-direction: column;
}

.stake-balance-name {
    color: var(--stake-text-muted);
    font-size: 14px;
    margin-bottom: 2px;
}

.stake-balance-amount {
    color: var(--stake-text-primary);
    font-size: 18px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.stake-wallet-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.stake-wallet-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

.stake-wallet-security {
    padding: 16px;
    background-color: var(--stake-bg-tertiary);
    border-radius: 8px;
    text-align: center;
}

.stake-wallet-security p {
    color: var(--stake-text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.stake-wallet-2fa-btn {
    padding: 8px 16px;
    font-size: 14px;
}

.stake-daily-bonus,
.stake-top-up {
    text-align: center;
    padding: 24px;
}

.stake-daily-bonus h6,
.stake-top-up h6 {
    color: var(--stake-text-primary);
    margin-bottom: 12px;
}

.stake-daily-bonus p,
.stake-top-up p {
    color: var(--stake-text-muted);
    margin-bottom: 20px;
}

.stake-top-up-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 300px;
    margin: 0 auto;
}

/* Admin Dashboard Styles */
.admin-dashboard {
    padding: 24px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--stake-border);
}

.admin-header h2 {
    color: var(--stake-text-primary);
    margin: 0;
    font-size: 24px;
}

.admin-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.admin-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background-color: var(--stake-bg-secondary);
    border: 1px solid var(--stake-border);
    border-radius: 8px;
    color: var(--stake-text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.admin-action-btn:hover {
    background-color: var(--stake-bg-tertiary);
    border-color: var(--stake-accent);
    color: var(--stake-text-primary);
}

.admin-action-btn i {
    font-size: 24px;
    color: var(--stake-accent);
}

.admin-action-btn span {
    font-size: 14px;
    font-weight: 500;
}

/* Admin Sub-pages */
.admin-page {
    padding: 24px;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--stake-border);
}

.admin-page-header h3 {
    color: var(--stake-text-primary);
    margin: 0;
    font-size: 20px;
}

.admin-page-content {
    color: var(--stake-text-primary);
}

/* Home page styles */
.stake-home:not(.stake-body) {
    padding: 48px 24px;
    text-align: center;
}

.stake-home:not(.stake-body) h2 {
    color: var(--stake-text-primary);
    margin-bottom: 16px;
}

.stake-home:not(.stake-body) p {
    color: var(--stake-text-muted);
    font-size: 16px;
}

/* Responsive admin styles */
@media (max-width: 768px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stake-wallet-actions {
        flex-direction: column;
    }

    .stake-top-up-options {
        max-width: 100%;
    }

    .admin-header,
    .admin-page-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .admin-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

    .stat-icon {
        margin-right: 0;
        margin-bottom: 12px;
    }

    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .admin-nav .btn {
        margin: 0;
        font-size: 0.875rem;
    }

@media (min-width: 769px) {
    .stake-body .stake-navbar {
        padding-inline-start: var(--stake-sidebar-width);
    }

    .stake-body:has(.stake-sidebar.collapsed) .stake-navbar {
        padding-inline-start: 60px;
    }

    .stake-body .stake-nav-container {
        width: min(var(--stake-content-width), calc(100% - var(--stake-content-gutter) * 2));
        margin-inline: auto;
        padding: 0;
        position: static;
        justify-content: space-between;
    }

    .stake-body .stake-nav-far-left {
        position: absolute;
        left: 10px;
    }

    .stake-body .stake-nav-center {
        position: absolute;
        left: calc(50% + var(--stake-sidebar-width) / 2);
        transform: translateX(-50%);
        transition: left var(--stake-layout-transition);
    }

    .stake-body:has(.stake-sidebar.collapsed) .stake-nav-center {
        left: calc(50% + 30px);
    }
}

@media (max-width: 1240px) {
    .stake-body .stake-nav-tabs {
        display: none;
    }
}

@media (max-width: 768px) {
    .stake-body {
        --stake-content-gutter: 16px;
    }

    .stake-body .stake-main.sidebar-collapsed {
        margin-left: 0;
    }

    .stake-body .stake-sidebar.collapsed {
        width: var(--stake-sidebar-width);
    }

    .stake-body .stake-sidebar.collapsed .stake-sidebar-item span,
    .stake-body .stake-sidebar.collapsed .stake-sidebar-header span {
        display: revert;
    }

    .stake-body .stake-sidebar.collapsed .stake-sidebar-item {
        justify-content: flex-start;
        padding-inline: 16px;
    }

    .stake-body .stake-nav-container {
        padding-inline: 8px;
    }

    .stake-body .stake-nav-far-left {
        margin-right: 5px;
    }

    .stake-body .stake-nav-left,
    .stake-body .stake-logo {
        min-width: 0;
    }

    .stake-body .stake-logo span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 14px;
    }

    .stake-body .stake-nav-center {
        flex: 0 0 auto;
        margin-inline: 8px auto;
    }

    .stake-body .stake-auth-buttons {
        gap: 6px;
    }

    .stake-body .stake-auth-buttons .stake-btn {
        padding-inline: 10px;
        white-space: nowrap;
    }

    .stake-body .stake-nav-far-right {
        gap: 2px;
    }

    .stake-body .stake-icon-btn {
        width: 30px;
    }

    .stake-body .stake-main.chat-open,
    .stake-body .stake-navbar.chat-open {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .stake-body {
        --stake-navbar-height: 88px;
    }

    .stake-body .stake-nav-container {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-rows: 48px 40px;
    }

    .stake-body .stake-nav-far-right {
        grid-column: 3;
        grid-row: 1;
    }

    .stake-body .stake-nav-center {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-inline: auto;
    }
}

/* Compact wallet menu: balance first, currency badge and code on the right. */
.stake-currency-menu { min-width:300px; padding:6px 0; border:0; border-radius:12px; background:var(--stake-bg-secondary); }
.stake-currency-menu .currency-item { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:8px 18px; color:var(--stake-text-primary); }
.stake-currency-menu .currency-details { display:flex; align-items:center; gap:6px; white-space:nowrap; color:var(--stake-text-primary); }
.stake-currency-menu .currency-balance { min-width:0; font-size:14px; font-weight:600; line-height:1.5; font-family:inherit; }
.currency-token { display:inline-grid; place-items:center; width:18px; height:18px; flex:0 0 18px; border-radius:50%; font:bold 14px/1 Arial,sans-serif; }
.currency-token.gc { color:#755800; background:#ffd000; }.currency-token.sc { color:#255a00; background:#78df00; }
.stake-currency-dropdown > .fa-chevron-down { transition:transform 160ms ease; }.stake-currency-dropdown[aria-expanded=true] > .fa-chevron-down { transform:rotate(180deg); }

/* Searchable wallet picker, shared by every page and color theme. */
.stake-body .stake-currency-menu { width:264px; min-width:0; max-width:calc(100vw - 24px); padding:8px 0 0; margin-top:10px!important; border:1px solid var(--stake-border); border-radius:12px; background:var(--stake-bg-secondary); box-shadow:0 12px 32px #0004; overflow:hidden; }
.currency-menu-search { display:flex; align-items:center; gap:8px; margin:0 10px 8px; padding:0 10px; height:36px; border:1px solid var(--stake-border); border-radius:8px; background:var(--stake-bg-inset); color:var(--stake-text-secondary); }
.currency-menu-search:focus-within { border-color:var(--stake-accent); box-shadow:0 0 0 1px var(--stake-accent); }
.currency-menu-search > i { flex:none; font-size:13px; }
.currency-menu-search input { width:100%; min-width:0; padding:0; border:0; outline:0; background:transparent; color:var(--stake-text-primary); font:inherit; font-size:12px; line-height:1.4; }
.currency-menu-search input::placeholder { color:var(--stake-text-secondary); opacity:1; }
.currency-menu-options { max-height:min(288px,50dvh); padding:0 0 6px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--stake-border) transparent; }
.currency-menu-options::-webkit-scrollbar { width:5px; }
.currency-menu-options::-webkit-scrollbar-thumb { border-radius:8px; background:var(--stake-border); }
.stake-body .stake-currency-menu .currency-item { width:100%; display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:31px; padding:6px 14px; color:var(--stake-text-primary); border:0; border-radius:0; background:transparent; text-align:left; }
.stake-body .stake-currency-menu .currency-item:hover,.stake-body .stake-currency-menu .currency-item:focus-visible { background:var(--stake-bg-tertiary); color:var(--stake-text-primary); }
.stake-body .stake-currency-menu .currency-item[aria-pressed=true] { background:var(--stake-bg-inset); }
.stake-body .stake-currency-menu .currency-balance { font-size:13px; font-weight:650; line-height:18px; font-variant-numeric:tabular-nums; }
.stake-body .stake-currency-menu .currency-details { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:650; line-height:18px; }
.currency-details img,.currency-details > i,.currency-icon-fallback { width:17px; height:17px; object-fit:contain; flex:none; }
.currency-icon-fallback { display:inline-grid; place-items:center; border-radius:50%; background:var(--stake-bg-tertiary); color:var(--stake-text-secondary); font-size:10px; font-weight:700; }
.stake-body .stake-currency-menu .currency-menu-settings { display:block; padding:11px 12px; border-top:1px solid var(--stake-border); text-align:center; color:var(--stake-text-primary); font-size:12px; font-weight:650; line-height:18px; }
.stake-body .stake-currency-menu .currency-menu-settings:hover,.stake-body .stake-currency-menu .currency-menu-settings:focus-visible { background:var(--stake-bg-tertiary); }
.currency-menu-empty { margin:4px 14px 12px; color:var(--stake-text-secondary); font-size:12px; }
.stake-currency-menu [hidden] { display:none!important; }
