@font-face {
    font-family: 'danab';
    src: url('fonts/db.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'danam';
    src: url('fonts/dm.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'danal';
    src: url('fonts/dl.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    direction: rtl;
}


body {
    background: #ffffff;
    color: #2c2c2c;
    font-family: 'danal';
}



a {
    text-decoration: none;
    color: inherit;
}

a:hover {
    color: #219b72;
    font-family: 'danam';
}

.top-menu {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-top: 2rem;
    margin-left: 2rem;
    margin-right: 2rem;

}

.top-menu-right-menu {
    display: flex;
    align-items: center;
    flex: 1;
}

.top-menu-right-menu a {
    margin-left: 16px;
}

.top-menu-logo {
    display: flex;
    justify-content: center;
    /* افقی */
    align-items: center;
    flex: 1;
}

.top-menu-left-menu {
    display: flex;
    align-items: center;
    justify-content: end;
    flex: 1;

}

.top-menu-left-menu a {
    margin-left: 16px;
}

#a-button-type-one {
    display: flex;
    align-items: center;
    text-align: center;
    background-color: #219b72;
    padding: 10px 20px;
    color: #ffffff;
    border-radius: 128px;
    margin-left: 0;
    margin-right: 8px;
}

#a-button-type-one:hover {
    display: flex;
    align-items: center;
    background-color: #1a5844;
    padding: 10px 20px;
    color: #ffffff;
    border-radius: 128px;
    text-align: center;
    margin-left: 0;
}

#my-team-span {
    margin-left: 16px;
    margin-right: 8px;
    font-family: 'danam';
}

#icon-a-game-button {
    margin-right: 16px;
}

.active-menu {

    background-color: #219b7222;
    padding: 8px;
    border-radius: 24px;
    font-family: 'danam';
    color: #219b72;
}

.img-a-icons {
    width: 24px;
    height: 17px;
}

.img-a-icons-pr {
    width: 24px;
    height: 24px;
}

.a-button-icon {
    display: flex;
}

#top-logo {
    width: 70px;
    height: 70px;
}

#a-special {
    margin-left: 0;
}

.mobile-menu {
    display: none;
}

.opened-mobile-menu {

    display: none;
}

.opened-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 60px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: right 0.3s ease;
    z-index: 1000;
}

.overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    transition: opacity 0.3s ease;
}


.container {
    display: flex;
    margin: 2rem;
}

.main-banner-right {
    display: flex;
    flex-direction: column;
    flex-grow: 4;
    margin-top: 7vh;
    padding: 0 20px;
}

.main-banner-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex-grow: 6;
    margin-top: 15vh;
    padding: 0 20px;
}

.main-banner-left-cwc {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.main-banner-left-cwc img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.main-banner-right-title {
    margin-top: 15vh;
    display: flex;
    flex-direction: column;
    font-family: 'danab';
}

.main-banner-right-details {
    margin-top: 6vh;
}

#h1-fantasy {
    color: #219b72;
}


.main-banner-right-buttons {
    display: flex;
    justify-content: end;
    margin-top: 8vh;
}

.green-button {
  padding: 10px 40px;
  background-color: #219b72;
  border-radius: 128px;
  color: #ffffff;
  font-family: 'danam';
  border: 3px solid #219b72;
  font-size: 1rem;
  white-space: nowrap;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.green-button:hover {
  background-color: #1a5844;
  border-color: #1a5844;
}

/* --------------------------- */

.white-button {
  padding: 10px 40px;
  background-color: #ffffff;
  border-radius: 128px;
  color: #219b72;
  font-family: 'danam';
  border: 3px solid #219b72;
  margin-left: 4px;
  font-size: 1rem;
  white-space: nowrap;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.white-button:hover {
  background-color: #1a5844;
  border-color: #1a5844;
  color: #ffffff;
}



input {
    padding: 12px 16px;
    font-size: 15px;
    border: 1.5px solid #ccc;
    border-radius: 122px;
    background-color: #fff;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
    direction: ltr;

    text-align: center;
}

h4 {
    font-family: 'danab';
}

input:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
    outline: none;

}

/* SATRT REGISTER */

.container-register {
    height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 8px;
}

.h2-title {
    font-family: 'danab';
}

#mobile-number-input {
    margin-bottom: 8px;
}

#firstName-input {
    margin-bottom: 8px;
}

#lastName-input {
    margin-bottom: 8px;
}

#teamName-input {
    margin-bottom: 8px;
}

.main-register-form-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 16px;
    text-align: center;
}

.main-register-form-form form {
    display: flex;
    flex-direction: column;
    margin-top: 3vh;
}


.main-register-form-details {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#a-linked {
    color: #219b72;
    font-family: 'danam';
}

.span-accepted-1 {
    position: absolute;
    bottom: 0;
    margin-bottom: 2vh;
}

.span-request:hover {
    font-family: 'danal';
}

#toast-container {
    position: fixed;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toast {
    background-color: #ef4444;
    color: #fff;
    padding: 12px 24px;
    margin-bottom: 12px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-family: 'danam';
    animation: fadeInOut 3s ease forwards;
    min-width: 240px;
    text-align: center;
}


.toast.success {
    background-color: #22c55e;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    90% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.span-request {
    pointer-events: none;
}

/* END REGISTEER */


/* IMPORTANT */
/* START GAME */
.down-menu {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background-color: #f5f5f5;
    color: rgb(0, 0, 0);
    text-align: center;
    padding: 10px 4px;
    z-index: 998;
    border-radius: 50px;
}

.down-menu-item {
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 24px;
    font-family: 'danal';
    border: solid #2c2c2c7a 1px;
    color: #2c2c2c;
    opacity: 0.5;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.down-menu-item:hover {
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 24px;
    font-family: 'danal';
    border: solid #2c2c2c 1px;
    color: #2c2c2cd4;
    opacity: 0.8;
}

.down-menu-item-lock {
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 24px;
    font-family: 'danal';
    border: solid #2c2c2c7a 1px;
    color: #2c2c2c;
    opacity: 0.1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}


.down-menu-item-exit {
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 24px;
    font-family: 'danal';
    border: solid rgba(219, 79, 79, 0.755) 1px;
    color: #ef4444;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.7;
}

.down-menu-item-exit:hover {
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 24px;
    font-family: 'danal';
    border: solid rgb(219, 79, 79) 1px;
    opacity: 1;
}



.active-down-menu-item {
    background-color: #219b72;
    color: #ffffff;
    border-radius: 24px;
    margin-right: 8px;
    padding: 2px 8px;
    font-family: 'danal';
    border: solid #219b72 1px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.down-menu-icon {
    width: 20px;
}

.a-down-menu {
    display: flex;
    flex-direction: row;
}



.fantasy-myteam-container {
    margin-top: 2rem;
    margin-left: 2rem;
    margin-right: 2rem;
}

.myteam-top-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.myteam-game-info {
    display: flex;
    flex-direction: row;
    justify-content: center;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    gap: 10px;
    padding: 10px;
    scroll-behavior: smooth;
    margin-top: 5vh;
}

.myteam-game-info-details {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
}

.play-sec-details span {
    padding: 4px;
    border: solid 1px #d8d8d8;
    border-radius: 32px;
    margin-right: 8px;
}

.play-sec-details {
    display: flex;
    justify-content: end;
    margin: 8px;
}

.myteam-game-info-details {
    margin-top: 16px;
}

.error-span {
    color: #ef4444;
}



.b-active {
    background-color: #219b72;
    margin: 4px;
    border-radius: 32px;
    padding: 16px;
    color: #fff;
}

.b-off {
    margin: 4px;
    border-radius: 32px;
    padding: 16px;
    opacity: 0.4;
}








#team-formation {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* فاصله بین ردیف‌ها */
    padding: 10px;
    background-color: #ffffff;
    min-height: 1000px;
}

.position-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    /* فاصله بین بازیکن‌ها */
}

.player-slot {
    width: 80px;
    min-height: 120px;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 12px;
    text-align: center;
    padding: 8px;
    position: relative;
    transition: transform 0.2s ease;
}

.player-slot:hover {
    transform: scale(1.05);
}

.player-slot.empty {
    opacity: 0.5;
}

.img-player {
    width: 100%;
    height: auto;
    margin-bottom: 5px;
}

.player-name,
.player-value,
.player-score,
.player-position {
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.player-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    cursor: pointer;
    width: 32px;
    height: 32px;
}

.remove-icon {
    width: 24px;
    height: 24px;
}

.plus-icon {
    width: 16px;
    height: 16px;
}

.player-add {
    cursor: pointer;
    margin-top: 5px;
}


/* START GAME */
/* IMPORTANT */

#dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 999;
}

#player-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 600px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-family: 'danam';
}

#player-dialog::-webkit-scrollbar {
    width: 6px;
}

#player-dialog::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}


.player-card {
    width: 210px;
    background: #fafafa;
    border-radius: 10px;
    padding: 16px;
    margin: 8px;
    text-align: center;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.player-card:hover {
    background-color: #f0f0f0;
}


.player-card p {
    margin: 6px 0;
    font-size: 14px;
    color: #333;
}

.player-card img {
    width: 64px;
    height: 64px;
    margin: 12px 0;
    border-radius: 6px;
}


.add-player-btn {
    margin-top: 10px;
    background-color: #219b72;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    font-family: 'danam', sans-serif;
    transition: background-color 0.2s ease;
}

.add-player-btn:hover {
    background-color: #1a5844;
}


.dialog-player-card {
    width: 100px;
    padding: 10px;
    border-radius: 8px;
    background: #f9f9f9;
    border: 1px solid #ccc;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dialog-player-card:hover {
    background-color: #e9e9e9;
}

.dialog-player-card img {
    width: 80%;
    margin-bottom: 6px;
    border-radius: 4px;
}

.dialog-player-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
}

.dialog-player-price {
    font-size: 12px;
    color: #555;
}

.player-card {
    width: 210px;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 16px;
    margin: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.player-card:hover {
    background-color: #f0f0f0;
}

.player-card img {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    object-fit: contain;
}

.player-card p {
    margin: 0;
    font-size: 14px;
    color: #333;
    width: 100%;
    text-align: center;
}

.add-player-btn {
    margin-top: auto;
    background-color: #219b72;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    font-family: 'danam', sans-serif;
    transition: background-color 0.2s ease;
    align-self: stretch;
}

.add-player-btn:hover {
    background-color: #1a5844;
}

#xxx {
    margin-bottom: 100px;
}

.bench-section {
    margin-top: 30px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 12px;
}

.position-row.BENCH {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.player-slot.bench {
    width: 90px;
    max-height: 200px;
    text-align: center;
    background: #ececec;
    border-radius: 10px;
    padding: 5px;
    margin-right: 4px;
}

.bench-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    min-height: 300px;
}

.captain-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    background-color: #ffd700;
    color: #000;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);

    display: flex;
    justify-content: center;
    align-items: center;

    line-height: 1;
    text-align: center;
    font-family: sans-serif;
    /* مطمئن میشیم فونت درست رندر میشه */
    z-index: 10;
}


/* هایلایت بازیکنان قابل تعویض */
.highlight-swap {
    border: 2px solid #219b72;
    box-shadow: 0 0 10px #219b72;
    cursor: pointer;
    transform: scale(1.05);
    transition: all 0.2s ease-in-out;
}

.play-sec {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 64px;
    margin-top: 16px;
}


.play-sec span {
    padding: 6px;
    border-radius: 50px;
    border: solid 1px #ccc;
    margin-top: 8px;
    margin-bottom: 8px;
    margin-right: 6px;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-height: 80vh;
    overflow-y: auto;
    width: 80vw;
    max-width: 500px;

    display: flex;
    flex-direction: column;
    align-items: center;
    /* ✅ وسط‌چین افقی محتوا */
    gap: 16px;
    /* فاصله بین آیتم‌ها مثل عنوان و بازیکن‌ها */
    text-align: center;
    /* ✅ برای وسط‌چین کردن متن‌ها */
}


.matches-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.match-card {
    background-color: #f8f8f8;
    color: rgb(98, 98, 98);
    border-radius: 10px;
    padding: 1rem;
    width: 420px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.teams-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.team-name {
    margin-top: 0.5rem;
    font-size: 14px;
    text-align: center;
}

.prediction-inputs {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.prediction-inputs input {
    width: 50px;
    text-align: center;
}

.btn-increase,
.btn-decrease {
    background: none;
    border: 1px solid #fff;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 4px;
    cursor: pointer;
}

.match-datetime,
.result,
.user-score {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 13px;

}

.user-score {
    border: 1px #b8b8b8 solid;
    border-radius: 18px;
    padding: 8px;
    margin-top: 32px;
    align-self: center;
}

.btn-s,
.details-btn {
    background-color: #219b72;
    border: none;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'danal';
}



@media (max-width: 768px) {


    .top-menu {
        display: none;
    }

    .mobile-menu {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 1rem;
    }

    .mobile-menu-logo img {
        width: 50px;
        height: 50px;
    }

    .mobile-menu-buttons {
        display: flex;
        flex-direction: row;

    }

    .mobile-menu-button-myteam {
        display: flex;
        flex-direction: row;
    }

    .mobile-menu-button-myteam a {
        display: flex;
        background-color: #219b72;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 16px;
        margin-right: 4px;
    }

    .game-icon {
        width: 25px;
        height: 18px;
    }

    .game-icon-pr {
        width: 25px;
        height: 25px;
    }

    .mobile-menu-icon {
        display: flex;
        background-color: #dddddd;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 16px;
        margin-right: 4px;
    }


    .mobile-menu-icon img {
        width: 25px;
        height: 25px;
    }

    #mobile-menu-icon-close {
        display: none;
    }

    /* END MENU */

    .container {
        display: flex;
        margin: 4px;
        align-items: center;
        justify-content: center;
    }

    .main-banner-right-title {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-top: 10vh;
    }

    .main-banner-left {
        display: none;
    }

    .main-banner-right-details {
        display: flex;
        flex-direction: column;
        margin-top: 2vh;
        justify-content: center;
        align-items: center;
    }

    .main-banner-right-buttons {
        align-items: center;
        justify-content: center;
        flex-direction: row;
        margin-top: 7vh;
    }


    .fantasy-myteam-container {
        margin-top: 1rem;
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .myteam-game-info {
        display: flex;
        justify-content: start;
        margin-top: 5vh;
    }



}