/* =========================================
   1. GLOBALNE ZMIENNE I RESET
   ========================================= */
:root {
    /* Paleta Dashboardu (Soczysta Zieleń) */
    --primary-color: #32cd32;
    --primary-dark: #228b22;
    /* Ciemniejszy dla efektu 3D */
    --primary-light: #90ee90;
    --bg-color: #f0fff4;
    --text-color: #2c3e50;
    --text-light: #5a6c7d;
    --border-color: #c8e6c9;
    --bg-alt: #e8f5e9;

    /* Zielony Cień (Glow) */
    --shadow: 0 4px 20px rgba(50, 205, 50, 0.25);
    --secondary-color: #20b2aa;
    --warning-color: #ffd93d;
    --gradient-primary: linear-gradient(135deg, #32cd32, #20b2aa);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Paleta Gier (Modern UI) */
    --game-accent: #4f46e5;
    --game-bg-option: #f8f9fa;
    --game-border: #e6e9f2;
    --game-success: #16a34a;
    /* Zielony sukces */
    --game-error: #dc2626;
    /* Czerwony błąd */

    /* Paleta Auth i Profilu */
    --auth-bg: #f1f5f9;
    --danger-color: #991b1b;
    --danger-bg: #fee2e2;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    /* Subtelny gradient w tle całej strony */
    background-image: radial-gradient(circle at 50% 0%, #e6ffec 0%, var(--bg-color) 70%);
}

/* Helpery */
a {
    text-decoration: none;
    color: inherit;
}

button:focus-visible {
    outline: 2px solid #4a90e2 !important;
}

/* =========================================
   2. HEADER & NAWIGACJA
   ========================================= */
.header {
    background: white;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.8rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-img {
    height: 50px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
}

.logo-bulga {
    color: #1e293b;
}

.logo-flow {
    color: var(--primary-color);
}

.nav-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-badge {
    background: white;
    border: 2px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: var(--text-light);
}

.coin-badge {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #b45309;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-light);
    transition: 0.2s;
}

.btn-icon:hover {
    background: var(--bg-alt);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* User Profile & Dropdown */
.user-profile {
    position: relative;
    cursor: pointer;
}

.user-menu {
    position: absolute;
    top: 120%;
    right: 0;
    background: white;
    width: 250px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    display: none;
    z-index: 100;
}

.user-menu.active {
    display: block;
}

.user-menu-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 16px 16px 0 0;
}

.user-menu-item {
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #475569;
    transition: 0.2s;
    text-decoration: none;
    cursor: pointer;
}

.user-menu-item:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.btn-logout-menu {
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 1rem;
    text-align: left;
}

.login-btn {
    font-weight: 800;
    font-size: 1.2rem;
    color: #475569;
    background-color: #f1f5f9;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.login-btn:hover {
    background-color: #e2e8f0;
    color: #2563eb;
}

/* =========================================
   3. DASHBOARD & POSTĘP
   ========================================= */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.welcome-section {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.welcome-section h1 {
    font-size: 2.5rem;
    margin: 1rem 0 0.5rem 0;
    color: #1e293b;
    font-weight: 800;
}

.welcome-section p {
    color: #64748b;
    font-size: 1.2rem;
}

/* --- MASKOTKA Z GLOWEM (ANIMACJE) --- */
.welcome-logo {
    display: inline-block;
    position: relative;
    z-index: 1;
}

.welcome-logo::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(50, 205, 50, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: -1;
    border-radius: 50%;
    animation: glowPulse 4s infinite ease-in-out;
}

.welcome-mascot {
    height: 160px;
    filter: drop-shadow(0 10px 15px rgba(50, 205, 50, 0.3));
    animation: mascotBounce 3s ease-in-out infinite;
}

.progress-overview {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.progress-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 2px solid #e2e8f0;
}

.progress-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.progress-card:nth-child(1) .progress-icon {
    background: #dbeafe;
    color: #2563eb;
}

.progress-card:nth-child(2) .progress-icon {
    background: #ffedd5;
    color: #ea580c;
}

.progress-card:nth-child(3) .progress-icon {
    background: #fce7f3;
    color: #db2777;
}

.level-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    margin: 0.5rem 0;
    overflow: hidden;
    position: relative;
}

.level-progress {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transition: width 0.5s ease-out;
    border-radius: 5px;
    width: 0%;
}

/* =========================================
   4. KARTY LEKCJI I GIER (ZIELONE PRZYCISKI)
   ========================================= */
.section-title {
    font-size: 1.5rem;
    color: #334155;
    margin-bottom: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.lesson-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.05);
}

.lesson-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(50, 205, 50, 0.2);
}

.lesson-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.lesson-card h3 {
    margin: 0.5rem 0 1rem 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 700;
}

/* ZIELONY PRZYCISK 3D */
.btn-start {
    display: block;
    width: 100%;
    padding: 0.9rem;
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.1s;
    border-bottom: 4px solid var(--primary-dark);
}

.btn-start:active {
    transform: translateY(2px);
    border-bottom-width: 0px;
    margin-top: 4px;
}

.btn-start:hover {
    filter: brightness(110%);
    box-shadow: 0 4px 15px rgba(50, 205, 50, 0.4);
}

/* =========================================
   5. EKRAN GRY (OGÓLNE)
   ========================================= */
.game-container {
    display: none;
    max-width: 900px;
    margin: 2rem auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    min-height: 600px;
    position: relative;
}

.game-container.active {
    display: block;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 1rem;
}

.game-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
}

.game-stats-inline {
    display: flex;
    gap: 15px;
    font-weight: 600;
    color: #64748b;
}

.game-area {
    text-align: center;
    padding: 1rem 0;
}

.big-word {
    font-size: 3rem;
    font-weight: 800;
    color: var(--game-accent);
    margin: 1rem 0 2rem 0;
    display: inline-block;
    padding: 1rem 2rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
}

/* Standardowe opcje (np. do Cyrylicy) */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.option-btn {
    background: white;
    border: 2px solid var(--game-border);
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom-width: 4px;
}

.option-btn:hover {
    border-color: var(--game-accent);
    transform: translateY(-2px);
    background: #f8fafc;
}

.option-btn:active {
    transform: translateY(2px);
    border-bottom-width: 0;
    margin-top: 4px;
}

.option-btn.correct {
    background: #dcfce7;
    border-color: var(--game-success);
    color: #166534;
}

.option-btn.incorrect {
    background: #fee2e2;
    border-color: var(--game-error);
    color: #991b1b;
    opacity: 0.7;
}

/* Komunikaty Feedback */
.feedback-msg {
    font-size: 1.2em;
    font-weight: bold;
    min-height: 30px;
    margin: 15px 0;
    text-align: center;
}

.feedback-msg.correct {
    color: var(--game-success);
}

.feedback-msg.incorrect {
    color: var(--game-error);
}

.btn-back {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-back:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.sentence-drop-zone {
    min-height: 80px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    gap: 0.5rem;
}

.word-bank {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.draggable-word {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    user-select: none;
    border-bottom: 3px solid #cbd5e1;
}

.draggable-word:active {
    transform: translateY(2px);
    border-bottom-width: 0;
}

.game-input {
    width: 100%;
    max-width: 500px;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    outline: none;
}

.game-input:focus {
    border-color: var(--game-accent);
}

/* =========================================
   5.1. STYLE GIER SZCZEGÓŁOWE (Łowca Słów)
   ========================================= */

/* Selektor kategorii */
.category-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.category-btn {
    background: #e9ecef;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #4b5563;
}

.category-btn:hover {
    background: #d1d5db;
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(50, 205, 50, 0.3);
}

/* Pasek postępu w grze */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 10px 0 20px 0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.5s ease;
    width: 0%;
}

/* Grid dla Łowcy Słów (Duże kafelki) */
.image-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 600px;
    margin: 30px auto;
}

.image-option {
    border: 3px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    min-height: 80px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.image-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(50, 205, 50, 0.2);
}

.image-option.correct {
    border-color: var(--game-success);
    background: #dcfce7;
    color: #166534;
}

.image-option.incorrect {
    border-color: var(--game-error);
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 600px) {
    .image-options-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   6. AUTH
   ========================================= */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--auth-bg);
    padding: 20px;
}

.auth-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.auth-input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.auth-btn {
    width: 100%;
    padding: 0.8rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.auth-btn:hover {
    background: #2563eb;
}

.auth-btn-register {
    background: #10b981;
}

.auth-btn-register:hover {
    background: #059669;
}

.auth-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #64748b;
}

.error-msg {
    color: #dc2626;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* =========================================
   7. PROFIL
   ========================================= */
.profile-container {
    max-width: 600px;
    margin: 4rem auto;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.avatar-large {
    width: 80px;
    height: 80px;
    background-color: #e2e8f0;
    color: #475569;
    font-size: 2.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
}

.user-name-large {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.user-email-large {
    color: #64748b;
    margin-bottom: 2rem;
}

.join-date {
    color: #94a3b8;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-action {
    display: block;
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    font-family: inherit;
}

.btn-action-logout {
    background-color: #f1f5f9;
    color: #334155;
}

.btn-action-logout:hover {
    background-color: #e2e8f0;
}

.btn-action-delete {
    background-color: var(--danger-bg);
    color: var(--danger-color);
}

.btn-action-delete:hover {
    background-color: #fecaca;
}

.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: #3b82f6;
    font-weight: 600;
}

/* =========================================
   8. EKRANY POMOCNICZE (FULL SCREEN)
   ========================================= */
.full-screen-section {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.full-screen-section.active {
    display: block;
}

/* =========================================
   9. SKLEP, CZAT, STATYSTYKI
   ========================================= */

/* --- STATYSTYKI --- */
.stats-screen {
    min-height: 100vh;
    padding: 2rem;
    background: var(--bg-color);
}

.stats-container {
    max-width: 1000px;
    margin: 0 auto;
}

.stats-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-header h2 {
    font-size: 2rem;
    color: var(--text-color);
}

.stats-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

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

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

.stat-label {
    color: var(--text-light);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 10px;
}

.achievement-item.unlocked {
    background: linear-gradient(135deg, rgba(50, 205, 50, 0.1), rgba(32, 178, 170, 0.1));
    border: 1px solid var(--primary-color);
}

.achievement-icon {
    font-size: 2rem;
}

.achievement-item.unlocked .achievement-icon {
    color: var(--warning-color);
}

.achievement-item.locked .achievement-icon {
    color: var(--text-light);
    opacity: 0.5;
}

.achievement-icon.unlocked-icon {
    animation: achievementPulse 2s ease-in-out infinite;
}

/* --- SKLEP (SHOP) --- */
.shop-screen {
    min-height: 100vh;
    padding: 2rem;
    background: var(--bg-color);
}

.shop-container {
    max-width: 1200px;
    margin: 0 auto;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}

.shop-header h2 {
    font-size: 2rem;
    color: var(--text-color);
    flex: 1;
}

.shop-balance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #32cd32, #adff2f);
    border-radius: 25px;
    font-weight: 700;
    color: #064e3b;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(50, 205, 50, 0.3);
}

.shop-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.shop-section {
    background: white;
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.shop-section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shop-section-title i {
    color: var(--primary-color);
}

.exchange-container {
    max-width: 600px;
    margin: 0 auto;
}

.exchange-info {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.exchange-balance {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-color);
}

.balance-item i.fa-gem {
    color: #e74c3c;
}

.balance-item i.fa-coins {
    color: #ffd700;
}

.balance-item strong {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.exchange-rate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 8px;
    font-size: 1rem;
}

.exchange-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exchange-controls label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.exchange-input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.exchange-input-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1.1rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
}

.exchange-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(50, 205, 50, 0.1);
}

/* Ulepszony przycisk wymiany (pasuje do btn-start) */
.btn-exchange {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-bottom: 4px solid var(--primary-dark);
}

.btn-exchange:active {
    transform: translateY(2px);
    border-bottom-width: 0;
}

.btn-exchange:hover {
    filter: brightness(110%);
}

.exchange-preview {
    text-align: center;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 1.1rem;
}

.games-grid,
.coins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* --- CZAT (CHAT) --- */
.chat-screen {
    min-height: 100vh;
    padding: 2rem;
    background: var(--bg-color);
}

.chat-container {
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chat-header h2 {
    font-size: 2rem;
    color: var(--text-color);
    flex: 1;
}

.chat-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

.chat-players-list {
    background: white;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.chat-search {
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-alt);
}

.chat-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
}

.players-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.player-item {
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.player-item:hover {
    background: var(--bg-alt);
}

.player-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(50, 205, 50, 0.3);
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    flex-shrink: 0;
    border: 2px solid var(--primary-color);
}

.player-item.active .player-avatar {
    background: white;
    color: var(--primary-color);
    border: none;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
    margin-left: auto;
}

.player-status.offline {
    background: var(--text-light);
}

.chat-window {
    background: white;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    padding: 3rem;
}

.chat-empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: var(--primary-color);
}

.chat-messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-messages-header {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-alt);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-color);
}

/* Dymki wiadomości */
.message {
    display: flex;
    gap: 0.75rem;
    max-width: 70%;
    animation: messageSlide 0.3s ease;
}

.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.received {
    align-self: flex-start;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--bg-alt);
    border: 1px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.message.sent .message-avatar {
    background: var(--primary-color);
    color: white;
}

.message-content {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.sent .message-content {
    /* Zielony gradient dla wysłanych wiadomości */
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.message-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 0.25rem;
}

.chat-input-container {
    padding: 1rem 1.5rem;
    border-top: 2px solid var(--border-color);
    background: white;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.chat-input-container input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    background: var(--bg-alt);
    color: var(--text-color);
    outline: none;
    transition: var(--transition);
}

.chat-input-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(50, 205, 50, 0.1);
}

.btn-send-message {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-send-message:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(50, 205, 50, 0.3);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }

    .chat-players-list {
        display: none;
    }

    .chat-players-list.active {
        display: flex;
    }
}

/* --- RANKING (LEADERBOARD) --- */
.leaderboard-screen {
    min-height: 100vh;
    padding: 2rem;
    background: var(--bg-color);
}

.leaderboard-container {
    max-width: 1000px;
    margin: 0 auto;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.leaderboard-header h2 {
    font-size: 2rem;
    color: var(--text-color);
}

.leaderboard-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.leaderboard-tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.leaderboard-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.leaderboard-tab:hover {
    color: var(--primary-color);
}

.leaderboard-content {
    background: white;
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: 10px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.leaderboard-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
    border-color: var(--border-color);
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, rgba(50, 205, 50, 0.1), rgba(32, 178, 170, 0.1));
    border: 2px solid var(--primary-color);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.leaderboard-stats {
    display: flex;
    gap: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.leaderboard-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.user-position {
    margin-top: 2rem;
}


/* =========================================
   10. ANIMACJE I EFEKTY
   ========================================= */

/* Kontener dla logo i dymku */
.logo-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Stylizacja dymku z literką */
.logo-speech-bubble {
    position: absolute;
    top: -5px;
    right: -10px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: bubbleFloat 3s ease-in-out infinite;
    z-index: 10;
}

/* Wersja dymku dla dużego logo */
.welcome-speech-bubble {
    position: absolute;
    top: 10px;
    right: -20px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    animation: bubbleFloat 3s ease-in-out infinite;
    z-index: 10;
}

.cyrillic-letter {
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-color);
}

.cyrillic-welcome {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
}

@keyframes bubbleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes mascotBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.5;
    }
}

@keyframes achievementPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}