/* ========================================
   🎰 CasinoLena Style (Replica)
   ======================================== */

:root {
    --base-hue: 333; /* Розово-красный оттенок как в оригинале */
    
    --hsl-b1: var(--base-hue), 10%, 40%;
    --hsl-b2: var(--base-hue), 10%, 30%;
    --hsl-b3: var(--base-hue), 10%, 25%;
    --hsl-b4: var(--base-hue), 10%, 20%;
    --hsl-b5: var(--base-hue), 10%, 15%;
    --hsl-b6: var(--base-hue), 10%, 10%;
    
    --hsl-c1: var(--base-hue), 40%, 100%;
    --hsl-c2: var(--base-hue), 40%, 90%;
    --hsl-l1: var(--base-hue), 40%, 80%;
    --hsl-l2: var(--base-hue), 40%, 75%;
    --hsl-h1: var(--base-hue), 100%, 70%;
    --hsl-f1: var(--base-hue), 10%, 60%;
    
    --font-default: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --font-content: "Inter", sans-serif;
}

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

html, body {
    overflow-x: hidden;
    height: 100%;
}

body {
    margin: 0;
    background-color: hsl(var(--hsl-b6));
    color: hsl(var(--hsl-c1));
    font-family: var(--font-default);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: hsl(var(--hsl-l2));
    text-decoration: none;
    transition: color 80ms linear;
}
a:hover { color: #fff; text-decoration: none; }

/* ─── Container ───────────────────────── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* ── Header (Sticky & Blur) ──────────── */
#siteHeader {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    background-color: hsl(var(--hsl-b5));
    border-bottom: 2px solid hsl(var(--hsl-b4));
    transition: all 0.2s;
}
#siteHeader.scrolled {
    background-color: rgba(20, 10, 15, 0.95);
    backdrop-filter: blur(8px);
    padding: 10px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 20px;
    font-weight: 700;
    color: hsl(var(--hsl-c1));
    text-transform: lowercase;
    letter-spacing: 1px;
}
.site-logo span { color: hsl(var(--hsl-h1)); }

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}
.nav-links > a {
    font-size: 15px;
    font-weight: 600;
    text-transform: lowercase;
    color: hsl(var(--hsl-f1));
}
.nav-links > a:hover, .nav-links > a.active { 
    color: #fff; 
    text-shadow: 0 0 8px hsl(var(--hsl-h1));
}

/* User Menu in Header */
.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: hsl(var(--hsl-b3));
    border: 2px solid hsl(var(--hsl-b2));
    object-fit: cover;
}
.btn-logout-header {
    font-size: 12px;
    color: hsl(var(--hsl-f1));
    cursor: pointer;
}
.btn-logout-header:hover { color: #fff; }

/* ─── Profile Banner ──────────────────── */
.profile-banner {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, hsl(var(--hsl-b3)), hsl(var(--hsl-b5)));
    border-radius: 8px;
    margin-bottom: -40px; /* Overlap with identity */
    position: relative;
    z-index: 1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ─── Profile Identity ────────────────── */
.profile-identity {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
    padding: 0 12px;
}
.profile-avatar-large {
    width: 100px; height: 100px;
    border-radius: 50%;
    background-color: hsl(var(--hsl-b3));
    border: 4px solid hsl(var(--hsl-b6));
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    overflow: hidden;
    flex-shrink: 0;
}
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; }

.user-info { padding-bottom: 10px; }
.user-info .username {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: hsl(var(--hsl-c1));
    line-height: 1.1;
}
.user-info .user-rank {
    color: hsl(var(--hsl-h1));
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
    display: block;
}
.user-info .user-joined {
    font-size: 12px;
    color: hsl(var(--hsl-f1));
    margin-top: 2px;
}

/* ─── Stats Grid ──────────────────────── */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-box {
    background-color: hsl(var(--hsl-b4));
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-align: center;
    border: 1px solid hsl(var(--hsl-b3));
    transition: transform 0.2s, border-color 0.2s;
}
.stat-box:hover {
    transform: translateY(-2px);
    border-color: hsl(var(--hsl-l2));
}
.stat-label {
    font-size: 11px;
    color: hsl(var(--hsl-f1));
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: hsl(var(--hsl-c1));
}

/* ─── Content Sections (Cards) ────────── */
.content-section {
    background-color: hsl(var(--hsl-b4));
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid hsl(var(--hsl-b3));
}
.content-section h2 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: hsl(var(--hsl-c1));
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid hsl(var(--hsl-b3));
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Tables ──────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 2px solid hsl(var(--hsl-b2));
    color: hsl(var(--hsl-f1));
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid hsl(var(--hsl-b3));
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: hsl(var(--hsl-b3)); }

.tx-amount.pos { color: #4ade80; font-weight: 600; }
.tx-amount.neg { color: #f87171; font-weight: 600; }

/* ─── Login Page ──────────────────────── */
.login-wrapper {
    max-width: 500px;
    margin: 40px auto;
}
.login-card {
    background: hsl(var(--hsl-b4));
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid hsl(var(--hsl-b3));
    text-align: center;
}
.login-card h1 { font-size: 24px; margin-bottom: 10px; color: hsl(var(--hsl-c1)); }
.login-card p { color: hsl(var(--hsl-f1)); margin-bottom: 24px; }

.btn-telegram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #2AABEE;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s;
    width: 100%;
    border: none;
    cursor: pointer;
}
.btn-telegram:hover { background: #229ED9; color: white; }

/* ─── Level Progress ──────────────────── */
.level-bar-container {
    background: hsl(var(--hsl-b6));
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 8px;
    width: 100%;
}
.level-bar {
    height: 100%;
    background: linear-gradient(90deg, hsl(var(--hsl-h1)), #ff6b9c);
    width: 0%; /* Dynamic */
    transition: width 0.5s;
}

/* ─── Responsive ──────────────────────── */
@media (max-width: 768px) {
    .profile-identity { flex-direction: column; align-items: center; text-align: center; margin-top: -60px; }
    .profile-stats-grid { grid-template-columns: 1fr 1fr; }
    .nav-links { display: none; /* Add mobile menu logic if needed */ }
}
/* ========================================
   🔧 Fixes & UI Improvements
   ======================================== */

.btn-logout {
    background: transparent;
    border: 1px solid hsl(var(--hsl-b2));
    color: hsl(var(--hsl-f1));
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.btn-logout:hover {
    border-color: hsl(var(--hsl-h1));
    color: #fff;
    background: hsl(var(--hsl-b3));
    box-shadow: 0 0 8px hsla(var(--hsl-h1), 0.3);
}

.btn-login {
    background: hsl(var(--hsl-b3));
    border: 1px solid hsl(var(--hsl-b2));
    color: hsl(var(--hsl-c2));
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-login:hover {
    background: hsl(var(--hsl-h1));
    border-color: hsl(var(--hsl-h1));
    color: #fff;
}

/* ─── Progress Bar Row ──────────────────────────────── */
.level-progress-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: hsl(var(--hsl-b4));
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    border: 1px solid hsl(var(--hsl-b3));
}

.level-label {
    font-weight: 700;
    font-size: 15px;
    color: hsl(var(--hsl-c1));
    min-width: 70px;
}

.level-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.level-bar-container {
    width: 100%;
    height: 14px; /* Более толстая и видимая */
    background: hsl(var(--hsl-b6));
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
    position: relative;
}

.level-bar {
    height: 100%;
    background: linear-gradient(90deg, hsl(var(--hsl-h1)), #ff9cbf);
    border-radius: 7px;
    box-shadow: 0 0 12px hsla(var(--hsl-h1), 0.8);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.level-xp-text {
    font-size: 12px;
    color: hsl(var(--hsl-f1));
    font-weight: 500;
    text-align: right;
}

/* ─── Profile Identity Tweaks ───────────────────────── */
.profile-identity {
    margin-bottom: 16px; /* Уменьшен отступ, так как прогресс вынесен отдельно */
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 899px) {
    .level-progress-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .level-xp-text { text-align: left; }
    .header-inner { flex-wrap: wrap; gap: 10px; }
}




/* Кнопки и инпуты для настроек */
.btn-secondary {
    background: hsl(var(--hsl-b3));
    color: hsl(var(--hsl-c2));
    border: 1px solid hsl(var(--hsl-b2));
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background: hsl(var(--hsl-b2));
    color: #fff;
}

.btn-primary {
    background: hsl(var(--hsl-h1));
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s;
}
.btn-primary:hover {
    opacity: 0.9;
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="text"] {
    width: 100%;
    background: hsl(var(--hsl-b6));
    border: 1px solid hsl(var(--hsl-b3));
    color: hsl(var(--hsl-c1));
    padding: 10px 12px;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}
input[type="text"]:focus {
    border-color: hsl(var(--hsl-h1));
}

.btn-danger {
    background: transparent;
    color: #f87171;
    border: 1px solid #f87171;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-danger:hover {
    background: #f87171;
    color: white;
}
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
    color: #f87171;
}

.btn-disabled {
    background: hsl(var(--hsl-b6));
    color: hsl(var(--hsl-f1));
    border: 1px solid hsl(var(--hsl-b3));
    padding: 8px 16px;
    border-radius: 4px;
    cursor: not-allowed;
    font-size: 13px;
    opacity: 0.5;
}

