* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: Arial, sans-serif;

    background: #0c0c0c;
    color: #ffffff;

    direction: rtl;
}


/* HEADER */

.topbar {
    border-bottom: 1px solid #252525;
    background: #101010;
}

.header-content {
    max-width: 700px;
    height: 65px;

    margin: auto;
    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 900;
    font-size: 24px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-button {
    width: 40px;
    height: 40px;

    padding: 0;

    border: 1px solid #303030;
    border-radius: 10px;

    background: #181818;
    color: white;

    cursor: pointer;
}


/* GAME */

.game-container {
    width: 100%;
    max-width: 650px;

    margin: auto;
    padding: 45px 20px 80px;
}

.game-header {
    text-align: center;
    margin-bottom: 35px;
}

.game-header h1 {
    margin: 0;

    font-size: 30px;
    font-weight: 800;
}

.challenge {
    margin-top: 10px;
    color: #8f8f8f;
}

.challenge span {
    color: #ffffff;
    font-weight: bold;
}


/* SEARCH */

.search-section {
    margin-bottom: 25px;
}

.search-area {
    display: flex;
    gap: 10px;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

#playerInput {
    width: 100%;
    height: 52px;

    padding: 0 17px;

    border: 1px solid #333;
    border-radius: 12px;

    outline: none;

    background: #171717;
    color: white;

    font-size: 16px;
}

#playerInput:focus {
    border-color: #666;
}

#playerInput::placeholder {
    color: #777;
}

.guess-button {
    min-width: 100px;
    height: 52px;

    border: none;
    border-radius: 12px;

    background: #ffffff;
    color: #111111;

    font-size: 15px;
    font-weight: 800;

    cursor: pointer;
}


/* SUGGESTIONS */

.suggestions {
    display: none;

    position: absolute;

    top: 58px;
    right: 0;
    left: 0;

    z-index: 100;

    overflow: hidden;

    border: 1px solid #333;
    border-radius: 12px;

    background: #181818;

    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.suggestion-item {
    padding: 13px 16px;

    text-align: right;

    border-bottom: 1px solid #292929;

    cursor: pointer;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #252525;
}

.suggestion-name {
    display: block;
    font-weight: 700;
}

.suggestion-club {
    display: block;

    margin-top: 4px;

    color: #888;
    font-size: 12px;
}


/* ATTEMPTS */

.attempts-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 18px;

    color: #888;
    font-size: 14px;
}

.attempts-bar strong {
    color: white;
    direction: ltr;
    unicode-bidi: isolate;
}


/* RESULTS */

#result {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guess-result {
    margin: 0;
}

.guess-result h3 {
    margin: 0 0 8px;

    font-size: 14px;
    font-weight: 700;

    color: #aaa;
}

.comparison {
    display: grid;

    grid-template-columns: repeat(6, 1fr);

    gap: 6px;
}

.info-box {
    min-height: 83px;

    padding: 8px 4px;

    border-radius: 10px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    gap: 5px;
}

.info-box .label {
    font-size: 10px;
    opacity: 0.7;
}

.info-box strong {
    font-size: 12px;
}

.correct {
    background: #238636;
}

.wrong {
    background: #9e2a2a;
}


/* SHARE */

.share-button {
    display: block;

    width: 100%;
    height: 52px;

    margin: 30px auto 0;

    border: none;
    border-radius: 12px;

    background: #ffffff;
    color: #111;

    font-size: 16px;
    font-weight: 800;

    cursor: pointer;
}


/* FOOTER */

footer {
    padding: 30px 20px;

    text-align: center;

    color: #555;
    font-size: 12px;
}


/* MOBILE */

@media (max-width: 600px) {

    .game-container {
        padding-top: 35px;
    }

    .game-header h1 {
        font-size: 25px;
    }

    .comparison {
        grid-template-columns: repeat(3, 1fr);
    }

    .info-box {
        min-height: 75px;
    }

}


@media (max-width: 400px) {

    .search-area {
        flex-direction: column;
    }

    .guess-button {
        width: 100%;
    }

}

.arrow {
    display: block;
    width: 0;
    height: 0;
    margin-top: 3px;
}

.arrow.up {
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid white;
}

.arrow.down {
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid white;
}

.end-card {
    margin-top: 30px;
    padding: 28px;

    border: 1px solid #292929;
    border-radius: 16px;

    background: #141414;

    text-align: center;
}

.end-icon {
    margin-bottom: 8px;
    font-size: 32px;
}

.end-card h2 {
    margin: 0;
    font-size: 24px;
}

.end-card > p {
    margin: 8px 0 22px;
    color: #888;
}

.answer-card {
    padding: 16px;

    border: 1px solid #292929;
    border-radius: 12px;

    background: #0d0d0d;
}

.answer-card span {
    display: block;

    margin-bottom: 5px;

    color: #777;
    font-size: 12px;
}

.answer-card strong {
    font-size: 19px;
}

.next-challenge {
    margin-top: 22px;
}

.next-challenge span {
    display: block;

    margin-bottom: 6px;

    color: #777;
    font-size: 12px;
}

.next-challenge strong {
    direction: ltr;
    unicode-bidi: isolate;

    display: inline-block;

    font-size: 21px;
    letter-spacing: 2px;
}

/* ========================================
   نافذة الإحصائيات
======================================== */

.stats-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;

    align-items: center;
    justify-content: center;

    padding: 20px;
}

.stats-modal.show {
    display: flex;
}

.stats-box {
    position: relative;

    width: 100%;
    max-width: 430px;

    background: #161616;
    border: 1px solid #2b2b2b;
    border-radius: 18px;

    padding: 30px 20px 25px;

    text-align: center;
}

.stats-box h2 {
    margin: 0 0 25px;
    font-size: 22px;
    color: white;
}

.close-stats {
    position: absolute;
    top: 12px;
    left: 15px;

    border: none;
    background: transparent;

    color: #aaa;
    font-size: 28px;

    cursor: pointer;
}

.close-stats:hover {
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 6px;
}

.stat-item strong {
    font-size: 26px;
    color: white;
}

.stat-item span {
    font-size: 12px;
    color: #999;
}

/* للجوال */
@media (max-width: 500px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}