﻿/* ==================== متغیرهای رنگ و استایل مدرن ==================== */
:root {
    /* پس زمینه‌های عمیق (Deep Space) */
    --bg-color: #05070d;
    --bg-secondary: #0b101e;
    /* افکت شیشه‌ای (Glassmorphism) */
    --glass-bg: rgba(26, 35, 50, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    /* رنگ‌های اصلی نئونی ملایم */
    --primary-blue: #00f0ff;
    --primary-blue-dark: #0088ff;
    --primary-purple: #8a2be2;
    --accent-gold: #fbbf24;
    --accent-green: #10b981;
    --accent-red: #ff3366;
    /* متن‌ها */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    /* رنگ‌های تخته شطرنج (لوکس) */
    --board-border: #1e293b;
    --white-cell: #cbd5e1;
    --black-cell: #334155;
    /* شعاع گوشه‌ها */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    /* ترنزیشن‌های نرم */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --move-from: #84cc16;
    --move-to: #a3e635;
    --bg-card: #1a2332;
    --bg-card-hover: #243044;
}

/* ==================== تنظیمات پایه ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/font/Vazir.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 15% 50%, rgba(138, 43, 226, 0.08), transparent 25%), radial-gradient(circle at 85% 30%, rgba(0, 240, 255, 0.08), transparent 25%);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 0; /* برای TMA بهتر است پدینگ بادی 0 باشد */
    user-select: none;
    overflow: hidden;
}
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
}
/* ==================== لابی ==================== */
#lobby-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    padding: 20px;
    padding-top: 60px;
}

.lobby-header {
    margin-bottom: 30px;
    text-align: center;
}

.logo-container {
    margin-bottom: 15px;
}

.logo-glow {
    display: inline-block;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glow-blue);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.7);
    }
}

.logo-glow img {
    height: 75px;
    object-fit: contain;
}

#lobby-screen h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(180deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.game-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* دکمه‌های اصلی */
.ButtonKind {
    display: grid;
    gap: 14px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 320px;
    justify-items: center;
}

.mainBtns {
    display: block;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

    .mainBtns::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
        transition: left 0.5s ease;
    }

    .mainBtns:hover::before {
        left: 100%;
    }

    .mainBtns:hover {
        transform: translateY(-3px);
    }

.btn-icon {
    font-size: 1.4rem;
}

.btn-text {
    flex: 1;
    text-align: center;
}




/* دکمه بازگشت */
.backtomainbtn {
    display: none;
    position: relative;
    top: 10px;
    padding: 10px 16px;
    font-size: 0.9rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: white;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

    .backtomainbtn:hover {
        background: var(--bg-card-hover);
        border-color: var(--primary-blue);
    }

/* بخش جستجو */
#lobby-status {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#lobby-status p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.cancel-search-btn {
    padding: 10px 25px;
    background: transparent;
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s;
}

    .cancel-search-btn:hover {
        background: var(--accent-red);
        color: white;
    }

/* بخش بازی خصوصی */
#private-game-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 320px;
    margin-top: 10px;
}

.private-game-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 24px;
}

.room-option {
    text-align: center;
}

    .room-option p {
        color: var(--text-secondary);
        margin-bottom: 14px;
        font-size: 0.9rem;
    }

.create-room-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(150deg, var(--accent-green), #059669);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
    justify-content: center;
    border-color: rgb(21, 80, 189);
}

    .create-room-btn:hover {
        transform: scale(1.02);
    }

#room-code-display {
    margin-top: 14px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-green);
    display: none;
    letter-spacing: 3px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-md);
    border: 1px solid var(--accent-green);
}

hr {
    width: 100%;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

#room-code-input {
    padding: 14px;
    font-size: 1.3rem;
    text-align: center;
    width: 100%;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 14px;
    text-transform: uppercase;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    font-family: monospace;
    letter-spacing: 6px;
    outline: none;
    transition: border-color 0.3s;
}

    #room-code-input:focus {
        border-color: var(--primary-blue);
    }

    #room-code-input::placeholder {
        letter-spacing: 2px;
        color: var(--text-muted);
    }

.join-room-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
    justify-content: center;
}

    .join-room-btn:hover {
        transform: scale(1.02);
    }

/* ==================== صفحه بازی ==================== */
#game-screen {
    display: flex;
    width: 100%;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

/* تایمر */
/* ==========================================
   تایمر حریف (بالا)
   ========================================== */
#opponent-timer-container {
    position: fixed;
    right: 15px;
    top: 60px;
    width: 70px;
    height: 45px;
    z-index: 15;
}

#opponent-timer-circle {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #a3a3a3;
    border: 3px solid #D4AF37;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3), 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* ==========================================
   تایمر شما (پایین)
   ========================================== */
#my-timer-container {
    position: fixed;
    right: 15px;
    bottom: 77px;
    width: 70px;
    height: 45px;
    z-index: 15;
}


#my-timer-circle {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #a3a3a3;
    border: 3px solid #D4AF37;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3), 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}



.timerActive {
    background: #ffffff !important;
}

/* ==========================================
   متن تایمر
   ========================================== */
#opponent-timer-text,
#my-timer-text {
    width: auto;
    height: auto;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-weight: bold;
    font-size: 1.4rem;
    position: relative;
    z-index: 1;
    box-shadow: none;
    border: none;
    padding: 0 8px;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
}

/* ==========================================
   نوار پیشرفت (فقط این یکی)
   ========================================== */
#my-timer-circle::after,
#opponent-timer-circle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: var(--progress, 100%);
    height: 4px;
    background: var(--timer-color, #D4AF37);
    transition: width 1s linear, background 0.3s ease;
    box-shadow: 0 0 6px var(--timer-color, rgba(212, 175, 55, 0.5));
    z-index: 2;
}

/* ==========================================
   حالت فوری (زمان کم)
   ========================================== */
#opponent-timer-text.urgent,
#my-timer-text.urgent {
    animation: pulseTimer 0.5s ease-in-out infinite;
    color: #c0392b;
}

@keyframes pulseTimer {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

/* ==========================================
   انیمیشن تغییر عدد
   ========================================== */
#opponent-timer-text span,
#my-timer-text span {
    display: inline-block;
    transition: transform 0.2s ease;
}

#opponent-timer-text.flip span,
#my-timer-text.flip span {
    animation: flipNumber 0.3s ease;
}

@keyframes flipNumber {
    0% {
        transform: rotateX(0deg);
        opacity: 1;
    }

    50% {
        transform: rotateX(90deg);
        opacity: 0;
    }

    100% {
        transform: rotateX(0deg);
        opacity: 1;
    }
}

/* منوی کشویی */
.game-menu-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
}

.menu-toggle-btn {
    font-family: inherit;
    padding: 10px 16px;
    font-size: 0.9rem;
    background-color: var(--bg-card);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    position: fixed;
    top: 10px;
    right: 10px;
}

    .menu-toggle-btn:hover {
        background-color: var(--bg-card-hover);
    }

.game-menu-dropdown {
    position: fixed;
    top: 57px;
    right: 0;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 160px;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: 0.9rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-family: inherit;
    text-align: right;
    width: 100%;
    transition: background 0.2s;
}

    .menu-item:hover {
        background: rgba(255, 255, 255, 0.1);
    }

.draw-offer-btn:hover {
    background: rgba(16, 185, 129, 0.2);
}

.exit-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* پروفایل حریف */
.OppProfile {
    position: fixed;
    top: 15px;
    left: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    z-index: 10;
}

#opponent-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

#opponent-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

#opponent-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--primary-blue);
    object-fit: cover;
}

/* پروفایل من */
.MyProfile {
    position: fixed;
    bottom: 12px;
    left: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    z-index: 10;
}

#my-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--accent-green);
    object-fit: cover;
}

#my-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

#my-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}
/* مهره‌های کپچر شده - بازطراحی شده */
.captured-pieces {
    position: absolute;
    display: flex;
    flex-direction: row;
    border-radius: var(--radius-md);
    z-index: 5;
    background: rgba(255, 255, 255, 0.09);
    padding: 4px 8px;
    gap: 2px;
    width: fit-content;
    min-height: 26px;
    margin: 4px 0;
    align-items: center;
}

#captured-by-opponent {
    width: 90%;
    justify-self: left;
    top: -80px;
    left: -15px;
    right: 0;
    justify-content: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#captured-by-me {
    width: 90%;
    justify-self: left;
    bottom: -80px;
    left: -15px;
    right: 0;
    justify-content: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.captured-pieces-container {
    display: flex;
    flex-wrap: wrap; 
    align-items: center;
    width: 100%;
    max-height: 48px; 
    overflow: hidden;
    padding-right: 10px;
}
.captured-black-box {
    background: rgba(255, 255, 255, 0.16) !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
/* گروه‌بندی مهره‌ها بر اساس نوع */
.captured-group {
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 0 4px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

    .captured-group:last-child {
        border-right: none;
    }

.captured-piece {
    font-size: 1.2rem;
    line-height: 1;
}

    .captured-piece img {
        width: 18px;
        height: 18px;
        object-fit: contain;
    }

/* تخته شطرنج - اصلاح شده */
.outer-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 570px;
    margin-top: 50px;
    margin-bottom: 50px;
}

/* فضای خالی برای مهره‌های کپچر */
#board-container {
    margin-top: 35px; /* فضا برای مهره‌های حریف */
    margin-bottom: 35px; /* فضا برای مهره‌های من */
}

.middle-row {
    display: flex;
    padding-right: 8px;
}

#chessboard {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 95vmin;
    height: 95vmin;
    max-width: 450px;
    max-height: 450px;
    border: 3px solid var(--board-border);
    box-shadow: var(--shadow-lg);
    background-color: var(--board-border);
    border-radius: var(--radius-md);
    position: relative;
}

.rad-up-right {
    border-radius: 0 10px 0 0;
}

.rad-up-left {
    border-radius: 10px 0 0 0;
}

.rad-down-left {
    border-radius: 0 0 0 10px;
}

.rad-down-right {
    border-radius: 0 0 10px 0;
}

.numberingRow {
    display: grid;
    grid-template-rows: repeat(8, 1fr);
    max-height: 450px;
}

    .numberingRow p {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        margin: 0;
        color: var(--text-muted);
        font-size: 0.8rem;
    }

.horizontalNumbers {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    width: 88vmin;
    max-width: 450px;
    height: 24px;
}

    .horizontalNumbers p {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        color: var(--text-muted);
        font-size: 0.8rem;
    }

/* خانه‌های شطرنج */
.cell {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 9vmin;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    padding: 4px;
}

@media (min-width: 500px) {
    .cell {
        font-size: 2.8rem;
    }
}

.white-cell {
    background-color: var(--white-cell);
    color: black;
}

.black-cell {
    background-color: var(--black-cell);
    color: black;
}

.selected {
    background-color: var(--selected) !important;
}

.last-move-from {
    background-color: var(--move-from) !important;
}

.last-move-to {
    background-color: var(--move-to) !important;
}

.valid-move::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
}

.capture-move {
    background-color: rgba(231, 76, 60, 0.5) !important;
}

.check {
    background-color: var(--accent-red) !important;
}

/* ==================== صفحه رفرال ==================== */
#referral-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 6px 20px 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

    #referral-screen:not(.hidden) {
        display: flex;
    }

.referral-container {
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.referral-header {
    text-align: center;
    margin-bottom: 10px;
}

.gift-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--accent-gold), #d97706);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: var(--shadow-glow-gold);
}

.referral-header h1 {
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: 6px;
}

.referral-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.referral-code-section {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 20px;
}

.referral-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.referral-link-box {
    margin-bottom: 14px;
}

.referral-link-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 4px;
}

#referral-link-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 0.85rem;
    padding: 10px;
    outline: none;
}

.copy-btn {
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--accent-green), #059669);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: inherit;
}

    .copy-btn:hover {
        transform: scale(1.05);
    }

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    color: white;
    transition: all 0.3s;
    font-family: inherit;
}

    .share-btn.bale {
        background: linear-gradient(180deg, #0e8439, #16a34a);
    }

    .share-btn:hover {
        transform: translateY(-2px);
    }

/* آمار رفرال */
.referral-stats {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 20px;
}

    .referral-stats h2 {
        color: white;
        font-size: 1.1rem;
        margin-bottom: 16px;
        text-align: center;
    }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

    .stat-card.gold {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
        border-color: var(--accent-gold);
    }

.stat-icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.stat-card.gold .stat-value {
    color: var(--accent-gold);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* لیست رفرال‌ها */
.referrals-list-section {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 20px;
}

    .referrals-list-section h2 {
        color: white;
        font-size: 1.1rem;
        margin-bottom: 14px;
        text-align: center;
    }

.referrals-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 180px;
    overflow-y: auto;
}

.empty-list {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-style: italic;
}

.referral-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #075ad8;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    transition: all 0.25s ease;
    cursor: pointer;
}

    /* Hover Effect */
    .referral-user-item:hover {
        background: #f8f9ff;
        border-color: #6366f1;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
        transform: translateY(-1px);
    }

/* ─── Avatar ─── */
.referral-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    transition: border-color 0.25s;
    flex-shrink: 0;
}

.referral-user-item:hover .referral-avatar {
    border-color: #6366f1;
}

/* ─── Info ─── */
.referral-user-info {
    flex: 1;
    min-width: 0; /* جلوگیری از سرریز */
}

.referral-user-name {
    font-size: 15px;
    font-weight: 600;
    color: #dfdfdf;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.referral-user-status {
    font-size: 12px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .referral-user-status.active {
        color: #22c55e;
    }

    .referral-user-status.inactive {
        color: black;
    }

/* ─── Duel Button ─── */
.duel-btn {
    padding: 8px 14px;
    background: #3c2aff;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

    .duel-btn:hover:not([disabled]) {
        background: #4f46e5;
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    }

    .duel-btn:active:not([disabled]) {
        transform: scale(0.97);
    }

    /* Disabled State */
    .duel-btn[disabled],
    .duel-btn:disabled {
        background: #e5e7eb;
        color: #9ca3af;
        cursor: not-allowed;
        box-shadow: none;
    }

/* Badge جلوی وضعیت (اختیاری) */
.referral-user-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
}

.referral-user-status.active::before {
    background: #22c55e;
}

.referral-user-status.inactive::before {
    background: #ef4444;
}

/* ==================== صفحه تورنمنت ==================== */
#tournamentContain {
    display: block;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 60px 0px 0px;
}



.tournament-header {
    text-align: center;
    margin-bottom: 20px;
}

.trophy-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--primary-purple), #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

#tournamentContain h1 {
    font-size: 1.4rem;
    color: var(--primary-purple);
}

.tournament-container {
    display: flex;
    overflow-x: auto;
    padding: 20px 10px;
    gap: 30px;
    min-height: 350px;
    width: 100%;
}

/* دکمه‌های پایین صفحه */
.buttons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 20px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 10px;
}

.btn {
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: bold;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-waiting {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.8;
    flex-direction: column;
    padding: 12px 20px;
}

    .btn-waiting .timer-text {
        font-size: 0.75rem;
        margin-top: 4px;
        color: #718096;
    }

    .btn-waiting .timer-value {
        font-size: 1.1rem;
        font-weight: bold;
        color: var(--text-primary);
        font-family: monospace;
    }

/* ==================== صفحه رنکینگ ==================== */
#ranking-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 60px 15px 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

    #ranking-screen:not(.hidden) {
        display: flex;
    }

.ranking-header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

    .ranking-header h1 {
        font-size: 1.4rem;
        color: var(--accent-gold);
        margin-bottom: 16px;
    }

.ranking-filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.3s;
}

    .filter-btn:hover {
        border-color: var(--primary-blue);
        color: white;
    }

    .filter-btn.active {
        background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
        border-color: var(--primary-blue);
        color: white;
    }

.ranking-container {
    width: 100%;
    max-width: 450px;
    max-height: 55vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 14px;
    overflow-x: hidden;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    transition: all 0.3s;
}

    .ranking-item:hover {
        background: rgba(0, 0, 0, 0.3);
        transform: scale(1.01);
    }

    .ranking-item.top-1 {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.25));
        border: 1px solid var(--accent-gold);
    }

    .ranking-item.top-2 {
        background: linear-gradient(135deg, rgba(156, 163, 175, 0.25), rgba(107, 114, 128, 0.25));
        border: 1px solid #9ca3af;
    }

    .ranking-item.top-3 {
        background: linear-gradient(135deg, rgba(205, 97, 51, 0.25), rgba(160, 64, 0, 0.25));
        border: 1px solid #cd6133;
    }

    .ranking-item.my-rank {
        border: 2px solid var(--accent-green);
        background: rgba(16, 185, 129, 0.1);
    }

.rank-position {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-left: 12px;
    flex-shrink: 0;
}

.top-1 .rank-position {
    color: var(--accent-gold);
    font-size: 1.2rem;
}

.top-2 .rank-position {
    color: #9ca3af;
}

.top-3 .rank-position {
    color: #cd6133;
}

.player-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.player-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-score {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-gold);
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.my-ranking-card {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin-top: 18px;
    padding: 18px;
    background: var(--bg-card);
    border: 2px solid var(--accent-green);
    border-radius: var(--radius-xl);
}

.my-rank-info,
.my-score-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rank-label,
.score-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.rank-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-green);
}

.score-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-gold);
}

/* ==================== چت ==================== */
#chat-container {
    position: fixed;
    bottom: 18px;
    right: 18px;
    width: 300px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 100;
    font-family: inherit;
    overflow: hidden;
    transition: all 0.3s ease;
}

    #chat-container.hidden {
        display: none;
    }

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary-purple), #7c3aed);
    cursor: pointer;
    font-weight: 600;
}



.chat-messages {
    height: 200px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.my-message {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary-purple), #7c3aed);
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-message.opponent-message {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
}

.chat-input-container {
    display: flex;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    gap: 8px;
}

#chat-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

    #chat-input::placeholder {
        color: var(--text-muted);
    }

.chat-send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-purple), #7c3aed);
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    .chat-send-btn:hover {
        transform: scale(1.1);
    }

#chat-container.collapsed .chat-messages,
#chat-container.collapsed .chat-input-container {
    display: none;
}

#chat-container.collapsed {
    width: 130px;
    border-radius: var(--radius-lg);
}

/* ==================== صفحه انتظار ==================== */
.waiting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.waiting-modal {
    background: var(--bg-card);
    border: 2px solid var(--primary-blue);
    border-radius: var(--radius-xl);
    padding: 35px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: var(--shadow-glow-blue);
}

.waiting-animation {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.chess-piece {
    font-size: 2.2rem;
    animation: bounce 1s infinite;
}

    .chess-piece:nth-child(2) {
        animation-delay: 0.2s;
    }

    .chess-piece:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.waiting-title {
    color: var(--primary-blue);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.waiting-message {
    color: var(--text-muted);
    margin-bottom: 18px;
}

.waiting-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.timer-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.timer-value {
    color: var(--primary-cyan);
    font-size: 1.2rem;
    font-weight: bold;
    font-family: monospace;
}

.waiting-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    color: var(--accent-gold);
    font-size: 0.85rem;
    margin-bottom: 18px;
}

.btn-cancel-wait {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--accent-red), #dc2626);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s;
}

    .btn-cancel-wait:hover {
        transform: scale(1.05);
    }

/* ==================== مودال ارتقا ==================== */
#promotion-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-xl);
    text-align: center;
    color: white;
    width: 100%;
    max-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .modal-content h3 {
        margin-bottom: 18px;
        color: var(--primary-blue);
    }

.promotion-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.promo-piece {
    cursor: pointer;
    padding: 2px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

    .promo-piece:hover {
        background: rgba(59, 130, 246, 0.2);
        border-color: var(--primary-blue);
        transform: scale(1.1);
    }

/* ==================== مودال پایان بازی ==================== */
#game-over-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.GameOver {
    position: relative;
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-xl);
    text-align: center;
    color: white;
    width: 90%;
    max-width: 380px;
    border: 2px solid var(--primary-blue);
    box-shadow: var(--shadow-glow-blue);
    animation: modalPop 0.3s ease;
}
.game-over-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#game-over-title {
    margin-top: 0;
    color: var(--primary-blue);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

#game-over-message {
    font-size: 1.1rem;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.NewGameBtn {
    flex: 1;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .NewGameBtn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
    }
.NewGameBtn.review-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

    .NewGameBtn.review-btn:hover {
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5);
    }
.xBtn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    color: white;
    background: var(--accent-red);
    text-align: center;
    border-radius: 50%;
    padding: 0;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
}

    .xBtn:hover {
        transform: scale(1.1);
    }

/* ==================== مودال خطا ==================== */
#Error-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.errorMod {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-xl);
    text-align: center;
    color: white;
    width: 90%;
    max-width: 380px;
    border: 2px solid var(--accent-red);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

#Error-title {
    margin-top: 0;
    color: var(--accent-red);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

#Error-message {
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

#Error-ancor {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: var(--radius-md);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
}

    #Error-ancor:hover {
        transform: scale(1.05);
    }

/* ==================== مودال تأیید ==================== */
#custom-confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.customCon {
    background: var(--bg-card);
    padding: 26px;
    border-radius: var(--radius-xl);
    text-align: center;
    width: 85%;
    max-width: 320px;
    border: 2px solid var(--primary-cyan);
    animation: modalPop 0.3s ease;
}

.hEx {
    margin-top: 0;
    color: var(--primary-cyan);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.SureLeave {
    color: var(--text-secondary);
    margin-bottom: 22px;
    font-size: 0.95rem;
}

.sureDiv {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.SureBtn {
    flex: 1;
    padding: 12px;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s;
}

.SureWightBg {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

    .SureWightBg:hover {
        background: rgba(255, 255, 255, 0.25);
    }

.SureRedBg {
    background: linear-gradient(135deg, var(--accent-red), #dc2626);
}

    .SureRedBg:hover {
        transform: scale(1.05);
    }

/* ==================== مودال‌های دوئل ==================== */
.duel-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

    .duel-modal:not(.hidden) {
        display: flex;
    }

.duel-modal-content {
    background: var(--bg-card);
    padding: 26px;
    border-radius: var(--radius-xl);
    text-align: center;
    color: white;
    width: 90%;
    max-width: 340px;
    border: 2px solid var(--accent-pink);
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.4);
    animation: modalPop 0.3s ease;
}

.duel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}

.duel-icon {
    font-size: 1.8rem;
}

.duel-header h3 {
    margin: 0;
    color: var(--accent-pink);
    font-size: 1.2rem;
}

.duel-modal-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.duel-user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 18px;
}

    .duel-user-info img {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        border: 2px solid var(--accent-pink);
        object-fit: cover;
    }

    .duel-user-info span {
        font-weight: 600;
        font-size: 1rem;
    }

.duel-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.duel-accept-btn,
.duel-decline-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s;
}

.duel-accept-btn {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
}

    .duel-accept-btn:hover {
        transform: scale(1.05);
    }

.duel-decline-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

    .duel-decline-btn:hover {
        background: var(--accent-red);
    }

.duel-cancel-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-red), #dc2626);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    margin-top: 14px;
    transition: transform 0.2s;
}

    .duel-cancel-btn:hover {
        transform: scale(1.05);
    }

.duel-spinner {
    width: 40px;
    height: 40px;
    margin: 18px auto;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==================== پیشنهاد تساوی ==================== */
.draw-received-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    padding: 22px;
    border-radius: var(--radius-xl);
    text-align: center;
    color: white;
    z-index: 100;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
    animation: pulse-glow 1.5s infinite;
    min-width: 280px;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(245, 158, 11, 0.6);
    }
}

.draw-received-toast.hidden {
    display: none;
}

.draw-received-toast h4 {
    margin: 0 0 10px 0;
    color: var(--accent-gold);
    font-size: 1.1rem;
}

.draw-received-toast p {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.draw-received-toast .buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.draw-accept-btn,
.draw-decline-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s;
}

.draw-accept-btn {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
}

    .draw-accept-btn:hover {
        transform: scale(1.05);
    }

.draw-decline-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

    .draw-decline-btn:hover {
        background: var(--accent-red);
    }

/* ==================== Toast ==================== */
#toast {
    visibility: hidden;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--accent-green);
    color: white;
    text-align: center;
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    position: fixed;
    z-index: 300;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%) translateY(20px);
    font-size: 0.95rem;
    opacity: 0;
    transition: all 0.4s ease;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

    #toast.show {
        visibility: visible;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

/* ==================== Utility Classes ==================== */
.hidden {
    display: none !important;
}

/* ==================== ریسپانسیو ==================== */
@media (max-width: 480px) {
    #lobby-screen h1 {
        font-size: 1.5rem;
    }

    .mainBtns {
        padding: 14px 18px;
        font-size: 0.95rem;
    }

    .btn-icon {
        font-size: 1.2rem;
    }

    #chessboard {
        width: 90vw;
        height: 90vw;
        max-width: 360px;
        max-height: 360px;
    }

    .cell {
        font-size: 2rem;
    }

    .numberingRow,
    .horizontalNumbers {
        max-width: 358px;
    }

        .numberingRow p,
        .horizontalNumbers p {
            width: 20px;
            font-size: 0.7rem;
        }



    #opponent-avatar,
    #my-avatar {
        width: 36px;
        height: 36px;
    }

    #opponent-name,
    #my-name {
        font-size: 0.8rem;
    }

    #timer-text {
        width: 37px;
        height: 37px;
        font-size: 0.9rem;
    }

    #chat-container {
        width: calc(100% - 30px);
        right: 15px;
        left: 15px;
    }

    .GameOver,
    .errorMod,
    .customCon,
    .duel-modal-content {
        padding: 22px;
    }

    .stats-grid {
        gap: 8px;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-value {
        font-size: 1.3rem;
    }
}

/* اسکرول بار سفارشی */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary-purple);
    }

/* فوکوس روی اینپوت‌ها */
input:focus,
button:focus {
    outline: none;
}

    input:focus::placeholder {
        color: transparent;
    }

/* ترنزیشن نرم */
/** {
    transition-property: background, background-color, border, border-color, box-shadow, transform, opacity;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}*/


/* هر ستون (راند) */
.round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 160px;
    position: relative;
    flex-shrink: 0;
    padding-top: 35px;
}

.round-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: #aaa;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* مسابقه */
.match {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    margin: 10px 0;
    background: linear-gradient(145deg, #2a2a4a, #1a1a2e);
    border: 1px solid #3a3a5a;
    border-radius: 6px;
    padding: 6px;
    position: relative;
    width: 100%;
    transition: all 0.3s ease;
}

/* تیم */
.team {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border: 2px solid #4a5568;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

    .team:hover {
        border-color: #00d9ff;
        box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
        transform: scale(1.02);
    }

    .team.me {
        background: linear-gradient(135deg, #d4b503 0%, #f59e0b 100%);
        filter: drop-shadow(0px 1px 3px yellow);
    }

    .team.winner {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
        border-color: #10b981;
    }

    .team.score {
        min-width: 30px;
        border-right: 3px solid #00d9ff;
    }

/* خطوط اتصال - با استفاده از pseudo-elements */
.match::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    width: 25px;
    height: 2px;
    background: #4a5568;
}

.round:not(:last-child) .match::after {
    display: block;
}

.round:last-child .match::after {
    display: none;
}

/* اتصال عمودی بین مسابقات */
.match-connector {
    position: absolute;
    left: calc(100% + 25px);
    width: 2px;
    background: #4a5568;
    transform: translateX(-50%);
}

/* راند اول - بدون اتصال سمت چپ */
.round:first-child .match::before {
    display: none;
}

/* تنظیم ارتفاع خطوط عمودی */
.round:nth-child(1) .match-connector {
    display: none;
}

.round:nth-child(2) .match-connector {
    top: calc(50% - 40px);
    height: 80px;
}

    .round:nth-child(2) .match-connector:nth-child(odd) {
        top: calc(50% - 60px);
        height: 120px;
    }

.round:nth-child(3) .match-connector {
    top: calc(50% - 100px);
    height: 200px;
}

.round:nth-child(4) .match-connector {
    top: calc(-200%);
    height: calc(500%);
}


/* استایل قهرمان */
.champion {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #fbbf24;
    font-size: 16px;
    font-weight: bold;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    }

    to {
        box-shadow: 0 0 25px rgba(245, 158, 11, 0.8);
    }
}

/* تنظیمات ریسپانسیو */
@media (max-width: 768px) {
    body {
        padding: 10px 5px;
        /*min-width: 110vh;*/
    }

    .tournament-container {
        padding: 10px 5px;
    }

    .round {
        min-width: 140px;
    }

    .team {
        padding: 8px 10px;
        font-size: 11px;
    }

    .match::after {
        width: 15px;
    }

    .match-connector {
        left: calc(100% + 15px);
    }
}

@media (max-width: 480px) {
    .round {
        min-width: 120px;
    }

    .team {
        padding: 6px 8px;
        font-size: 10px;
    }

    h1 {
        font-size: 18px;
        padding-top: 20px;
    }
}

/* کانتینر قهرمان */
.champion-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 150px;
}

.trophy-icon {
    font-size: 40px;
    margin-bottom: 10px;
}
/* ===== دکمه‌های پایین صفحه ===== */


.btn {
    padding: 15px 35px;
    font-size: 15px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    align-items: center;
    gap: 10px;
}



/* دکمه خاکستری - غیرفعال */
.btn-waiting {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #a0aec0;
    cursor: not-allowed;
    opacity: 0.8;
    flex-direction: column;
    padding: 12px 25px;
}

    .btn-waiting .timer-text {
        font-size: 11px;
        margin-top: 5px;
        color: #718096;
    }

    .btn-waiting .timer-value {
        font-size: 18px;
        font-weight: bold;
        color: #e2e8f0;
        font-family: monospace;
    }

/* تنظیمات ریسپانسیو */
@media (max-width: 768px) {


    .tournament-container {
        padding: 10px 5px;
    }

    .round {
        min-width: 140px;
    }

    .team {
        padding: 8px 10px;
        font-size: 11px;
    }

    .match::after {
        width: 15px;
    }

    .match-connector {
        left: calc(100% + 15px);
    }
}

@media (max-width: 480px) {
    .round {
        min-width: 120px;
    }

    .team {
        padding: 6px 8px;
        font-size: 10px;
    }

    h1 {
        font-size: 18px;
    }

    .btn {
        min-width: 200px;
        padding: 12px 25px;
        font-size: 13px;
    }

    .buttons-container {
        gap: 15px;
        padding: 20px 15px;
    }
}

#tournamentContain {
    flex-direction: column;
    align-items: center;
}



/* دکمه‌ها در حالت پر - پایین صفحه */
.buttons-container.bottom {
    position: relative;
    margin-top: auto;
    width: 100%;
}


/* استایل دکمه */
.neon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(0,210,255,0.12), rgba(58,123,213,0.12));
    color: #eafcff;
    padding: 12px 36px;
    font-size: 18px;
    font-weight: 800;
    font-family: inherit;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    transition: transform 180ms ease, box-shadow 220ms ease, filter 220ms ease;
    box-shadow: 0 6px 26px rgba(0,190,255,0.08), inset 0 0 8px rgba(255,255,255,0.02);
}

/* subtle animated glow layer */
.neon-button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 60% at 20% 30%, rgba(0,210,255,0.16), transparent 30%),
                radial-gradient(50% 50% at 80% 70%, rgba(58,123,213,0.10), transparent 30%);
    filter: blur(14px);
    opacity: 0.55;
    transform: scale(1.05);
    transition: opacity 260ms ease, transform 260ms ease, filter 260ms ease;
    pointer-events: none;
}

/* animated sheen */
.neon-button::before {
    content: '';
    position: absolute;
    left: -60%;
    top: -40%;
    width: 220%;
    height: 200%;
    background: linear-gradient(120deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02), rgba(255,255,255,0.06));
    transform: translateX(-30%);
    opacity: 0.0;
    transition: transform 800ms cubic-bezier(.2,.9,.3,1), opacity 420ms ease;
    pointer-events: none;
}

.neon-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,180,255,0.16), inset 0 0 18px rgba(255,255,255,0.02);
}

.neon-button:hover::after { opacity: 0.9; filter: blur(18px); transform: scale(1.08); }
.neon-button:hover::before { transform: translateX(10%); opacity: 0.12; }

.neon-button:active { transform: translateY(-1px) scale(0.98); }

/* keyboard focus for accessibility */
.neon-button:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0,210,255,0.12), 0 10px 30px rgba(0,180,255,0.12);
}

/* disabled state */
.neon-button[disabled],
.neon-button.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

/* small modifier */
.neon-button.small { padding: 8px 18px; font-size: 14px; letter-spacing: 1px; }

.chat-badge {
    position: absolute;
    top: 8px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.5);
    z-index: 1001;
}

    .chat-badge.pulse {
        animation: pulse-animation 1s infinite;
    }

@keyframes pulse-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.5);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 2px 15px rgba(231, 76, 60, 0.8);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.5);
    }
}

/* ============================================ */
/* ✅ استایل برای مسابقات فعال (حاشیه طلایی) */
/* ============================================ */
.match.active-match {
    border: 2px solid #FFD700; /* حاشیه طلایی */
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); /* افکت درخشش */
    animation: pulse-gold 2s infinite; /* انیمیشن ضربان */
    position: relative;
}

/* انیمیشن درخشش */
@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
}

/* نشانگر وضعیت */
.match-status-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 10;
}

/* افکت hover */
.match.active-match:hover {
    border-color: #FFA500;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
    transform: scale(1.02);
    transition: all 0.3s ease;
}



/* ============================================ */
/* ✅ استایل‌های صفحه تماشاگر */
/* ============================================ */

#spectator-screen {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px;
    direction: rtl;
}

.spectator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

    .back-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }

.spectator-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.spectator-info-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

    .spectator-info-box span {
        color: white;
        font-size: 14px;
    }

.spectator-notice {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

    .spectator-notice p {
        color: #ffc107;
        margin: 0;
    }

/* مودال پایان بازی تماشاگر */
#spectator-game-over-modal .modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #667eea;
}

#spectator-game-over-modal h3 {
    color: white;
}

#spectator-game-over-modal p {
    color: #aaa;
}


/* کل تخته را 180 درجه بچرخان */
.flipLabels .numberingRow p:nth-child(1) {
    order: 8;
}

.flipLabels .numberingRow p:nth-child(2) {
    order: 7;
}

.flipLabels .numberingRow p:nth-child(3) {
    order: 6;
}

.flipLabels .numberingRow p:nth-child(4) {
    order: 5;
}

.flipLabels .numberingRow p:nth-child(5) {
    order: 4;
}

.flipLabels .numberingRow p:nth-child(6) {
    order: 3;
}

.flipLabels .numberingRow p:nth-child(7) {
    order: 2;
}

.flipLabels .numberingRow p:nth-child(8) {
    order: 1;
}

.flipLabels .horizontalNumbers p:nth-child(1) {
    order: 8;
}

.flipLabels .horizontalNumbers p:nth-child(2) {
    order: 7;
}

.flipLabels .horizontalNumbers p:nth-child(3) {
    order: 6;
}

.flipLabels .horizontalNumbers p:nth-child(4) {
    order: 5;
}

.flipLabels .horizontalNumbers p:nth-child(5) {
    order: 4;
}

.flipLabels .horizontalNumbers p:nth-child(6) {
    order: 3;
}

.flipLabels .horizontalNumbers p:nth-child(7) {
    order: 2;
}

.flipLabels .horizontalNumbers p:nth-child(8) {
    order: 1;
}

#Modes {
    font-family: inherit;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
    direction: rtl;
}

.analysis-stats-container {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}

.stats-grid {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    text-align: center;
}

.stat-box {
    flex: 1;
    padding: 5px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
}

    .stat-box small {
        font-size: 10px;
        font-weight: normal;
        opacity: 0.8;
    }

    .stat-box.accuracy {
        background: linear-gradient(45deg, #11998e, #38ef7d);
    }

    .stat-box.best {
        background: #2ecc71;
    }

    .stat-box.inacc {
        background: #f39c12;
    }

    .stat-box.mistake {
        background: #e67e22;
    }

    .stat-box.blunder {
        background: #e74c3c;
    }

/* استایل نوار ارزیابی */
.eval-bar-wrapper {
    width: 20px;
    background-color: #333;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.eval-bar-fill {
    width: 100%;
    height: 50%;
    background-color: #eee;
    transition: height 0.5s ease;
}

.eval-score-text {
    position: absolute;
    width: 100%;
    text-align: center;
    color: #888;
    font-size: 10px;
    font-weight: bold;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    mix-blend-mode: difference;
    color: white;
}

.reportBtn {
    font-family: inherit;
    padding: 10px 16px;
    font-size: 0.9rem;
    background-color: var(--bg-card);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    position: absolute;
    right: -75px;
    width:70px;
}

.btn-danger {
    background: #c0392b !important;
    color: white !important;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    font-family: inherit;
}

    

    .btn-danger:active {
        transform: scale(0.95);
    }

.btn-leave {
    background: #6c757d !important;
    color: white;
}

.card-action.btn-danger {
    background: #e74c3c !important;
    color: white;
}

.modal-overlay.active {
    display: flex;
}
#pending-requests-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

    #pending-requests-modal.active {
        display: flex !important;
    }
.acceptJoin {
    font-family: 'Vazirmatn';
    background: rgb(0 255 22);
    color: #00d2ff;
    border: 1px solid rgba(0, 210, 255, 0.3);
}
#recent-games-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 150;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake-animation {
    animation: shake 0.4s ease-in-out;
    border: 1px solid #ff4444 !important;
}

.ranking-table td {
    font-size: 0.9rem;
}

.match-card {
    transition: transform 0.2s;
    cursor: default;
}

    .match-card.active-match {
        border-color: #e74c3c !important;
        cursor: pointer;
    }

        .match-card.active-match:hover {
            transform: scale(1.02);
            background: #34384b;
        }

.pulse-icon {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}
.match-card.show-accuracy .accuracy-label {
    display: block !important;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.active-timer {
    background-color: white !important;
    color: black !important; /* رنگ متن سیاه تا روی پس‌زمینه سفید خوانا باشد */
    border: 2px solid #fbbf24; /* یک حاشیه طلایی هم برای زیبایی بیشتر (اختیاری) */
    transition: background-color 0.3s ease, color 0.3s ease;
}


.analysis-modal-content {
    width: 95%;
    max-width: 900px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    background: #1e2130;
    border: 1px solid #3d425b;
    border-radius: 12px;
    overflow: hidden;
}

.analysis-layout {
    display: flex;
    flex-direction: row;
    padding: 15px;
    gap: 20px;
    overflow-y: auto;
    height: 100%;
}

.analysis-board-section {
    flex: 1.5;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
}

.analysis-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (max-width: 768px) {
    .analysis-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .analysis-layout {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }

    .analysis-board-section {
        flex: none;
        width: 100%;
        align-items: center;
    }

    #analysis-board-container {
        width: calc(100vw - 50px) !important; /* فضا برای نوار سمت چپ */
        max-width: 450px;
    }

    .analysis-info-section {
        flex: 1;
        overflow-y: auto;
    }
}

.lobby-dashboard-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;


}
    .lobby-dashboard-btn button {
        margin: 0;
        padding: 10px;
        border-radius: 50%;
        width: 45px;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
    }