/* ================= فونت‌ها ================= */
@font-face {
    font-family: 'Kalameh';
    src: url('../fonts/Kalameh-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Kalameh';
    src: url('../fonts/Kalameh-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kalameh', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* فاصله 70 پیکسلی از بالا برای جلوگیری از تداخل با دکمه‌های ایتا */
body {
    background-color: #F6F7F9;
    color: #1a1a1a;
    overflow-x: hidden;
    padding-top: 70px; 
}

/* ================= هدر ================= */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px 20px;
    background: rgba(246, 247, 249, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: sticky;
    top: 70px; /* چسبیدن دقیقاً زیر بخش دکمه‌های ایتا */
    z-index: 100;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s;
}

.icon-btn:active {
    transform: scale(0.9);
}

.orange-btn {
    background-color: #ff9800;
}

.yellow-btn {
    background-color: #ffffff;
    border: 2px solid #ffc107;
}

.yellow-btn svg path {
    fill: #ff9800;
}

.header-title h1 {
    font-size: 22px;
    font-weight: 900;
    color: #2D3436;
    letter-spacing: -0.5px;
}

/* ================= کادر بازی‌های مورد علاقه ================= */
.content-container {
    padding: 0 0 100px 0;
}

.favorite-section-wrapper {
    margin: 10px 20px 40px;
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    border-radius: 32px;
    padding: 24px 0 28px; 
    box-shadow: 0 20px 40px rgba(255, 152, 0, 0.25);
}

.favorite-section-wrapper .section-header {
    padding: 0 24px;
    margin-bottom: 20px;
}

.favorite-section-wrapper .section-title {
    color: #ffffff;
    font-size: 18px;
}

.favorite-section-wrapper .section-line {
    display: none;
}

.favorite-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 0 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.favorite-scroll::-webkit-scrollbar {
    display: none;
}

.favorite-scroll .game-card {
    min-width: 150px;
    width: 160px;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* ================= عناوین بخش‌ها ================= */
.section-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row-reverse;
    margin-bottom: 20px;
    padding: 0 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 900;
    color: #2D3436;
    margin-right: 12px;
    margin-left: 0;
}

.section-line {
    width: 6px;
    height: 22px;
    background-color: #ff9800;
    border-radius: 4px;
}

/* ================= کارت‌های بازی ================= */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0 24px;
}

.game-card {
    background-color: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

.clickable-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.game-card:active .clickable-area {
    transform: scale(0.96);
}

.game-icon-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 12px;
    background-color: #f1f2f6;
}

.game-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 38px;
    font-weight: bold;
    color: white;
}

.game-name {
    font-size: 16px;
    font-weight: 900;
    color: #2D3436;
    padding: 0 14px;
    text-align: right;
    margin-bottom: 2px;
}

.game-subtitle {
    font-size: 11px;
    color: #a4b0be;
    padding: 0 14px;
    text-align: right;
    display: block;
    margin-bottom: 14px;
}

/* ================= اکشن‌های کارت ================= */
.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 14px;
    width: 100%;
    margin-top: auto;
}

.start-btn {
    flex-grow: 1;
    padding: 10px 0;
    background-color: #ff9800;
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.start-btn:active {
    transform: scale(0.92);
}

.like-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 14px;
    border: 2px solid #f1f2f6;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding-top: 2px;
    transition: all 0.2s;
}

.like-btn.active {
    background-color: #fff0f2;
    border-color: #ff4757;
}

.like-btn:active svg {
    transform: scale(0.8);
}

/* ================= پاپ‌آپ‌ها ================= */
.modal-overlay {
    position: fixed;
    top: 70px; /* شروع از 70 پیکسل تا مزاحم دکمه‌های بستن ایتا نشود */
    left: 0;
    width: 100%;
    height: calc(100% - 70px); /* تنظیم ارتفاع دقیق */
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background-color: #ffffff;
    width: 100%;
    max-width: 500px;
    border-radius: 32px 32px 0 0;
    padding: 36px 24px 30px;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    background: #f1f2f6;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    color: #2D3436;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-body {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.modal-avatar {
    width: 90px;
    height: 90px;
    background-color: #ffc107;
    border-radius: 28px;
    margin-bottom: 20px;
}

.modal-body h2 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #2D3436;
    font-weight: 900;
}

.user-id {
    font-size: 15px;
    color: #a4b0be;
}

.game-details-image-container {
    width: 100%;
    height: 180px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 24px;
    background-color: #f1f2f6;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 60px;
}

.game-details-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-details-title {
    font-size: 24px !important;
    text-align: center;
}

.game-details-desc {
    font-size: 14px;
    color: #636e72;
    text-align: center;
    line-height: 1.8;
    margin-bottom: 24px;
    padding: 0 10px;
}

.game-mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.mode-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

.single-player-btn {
    background-color: #f1f2f6;
    color: #2D3436;
}

.multi-player-btn {
    background-color: #ff9800;
    color: #ffffff;
}

.loading-text {
    text-align: center;
    grid-column: span 2;
    color: #a4b0be;
    font-size: 16px;
    padding: 40px 0;
    font-weight: bold;
}