/* ====================== */
/*    GLOBAL STYLES       */
/* ====================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    color: white;
    overflow-x: hidden;
    position: relative;
}

/* Sahifalar uchun umumiy stil */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

.hidden {
    display: block;
}

/* Animatsiya effektlar */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================== */
/*   WELCOME SCREEN       */
/* ====================== */

#welcomeScreen h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.main-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.menu-btn {
    padding: 15px 40px;
    font-size: 1.3rem;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    min-width: 250px;
    backdrop-filter: blur(5px);
}

.menu-btn:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.3);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* ====================== */
/*     BACK BUTTON        */
/* ====================== */

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 100;
}

.back-btn:hover {
    background: rgba(0,0,0,0.5);
    transform: translateX(3px);
}

#settings .page-title {
    margin: 60px 0 30px;
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.settings-container {
    max-width: 500px;
    width: 90%;
    background: rgba(0,0,0,0.2);
    padding: 30px;
    border-radius: 20px;
    margin-top: 0px;
}

.setting-group {
    margin: 20px 0;
    text-align: left;
}

.setting-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #ffcc00;
}

.setting-group select {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0, 0, 0, 0.4); /* Yarim shaffof qora */
    backdrop-filter: blur(5px); /* Agar brauzer qo'llab-quvvatlasa */
    color: white;
    font-size: 1rem;
    appearance: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.save-btn {
    padding: 12px 30px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 500px;
    width: 90%;
    margin-top: 30px;
}

.stat-item {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}

.stat-item div:first-child {
    font-size: 0.9rem;
    opacity: 0.8;
}

.stat-item div:last-child {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffcc00;
}

/* ====================== */
/*     CONTACT PAGE       */
/* ====================== */

#contact .page-title {
    margin: 60px 0 30px;
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.contact-list {
    list-style: none;
    padding: 0;
    max-width: 400px;
    margin: 0 auto;
}

.contact-list li {
    margin: 15px 0;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.contact-list li:nth-child(1) { animation-delay: 0.1s; }
.contact-list li:nth-child(2) { animation-delay: 0.2s; }
.contact-list li:nth-child(3) { animation-delay: 0.3s; }
.contact-list li:nth-child(4) { animation-delay: 0.4s; }
.contact-list li:nth-child(5) { animation-delay: 0.5s; }

.contact-list a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    width: 100%;
    text-align: left;
}

.contact-list a:hover {
    background: rgba(255,255,255,0.25);
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.contact-list i {
    font-size: 1.5rem;
    min-width: 30px;
    text-align: center;
    color: #ffcc00;
}

/* ====================== */
/*      ABOUT PAGE        */
/* ====================== */

#about .page-title {
    margin: 40px 0 30px;
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.about-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.2s;
}

.about-content p {
    margin-bottom: 20px;
    text-align: left;
}

.about-content strong {
    color: #ffcc00;
    font-weight: 600;
}

/* ====================== */
/*      GAME SCREEN       */
/* ====================== */

#gameScreen {
    padding: 20px;
    max-width: 100%;
}

.computer-choice-container {
    margin: 40px 0;
    display: flex;
    justify-content: center;
}

.choice-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    transition: transform 0.6s ease;
    cursor: default;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255,255,255,0.2);
}

.choice-circle.spinning-3d {
    animation: spin3d 0.8s ease-in-out;
}

@keyframes spin3d {
    0% {
        transform: rotateY(0deg) rotateX(15deg);
    }
    50% {
        transform: rotateY(180deg) rotateX(-15deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(15deg);
    }
}

.user-choices {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.user-choice {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
}

.user-choice:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255,255,255,0.3);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.user-choice i {
    font-size: 2.5rem;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.user-choice:nth-child(1) i { color: #d32f2f; }    /* Tosh - qizil */
.user-choice:nth-child(2) i { color: #1976d2; }  /* Qog'oz - ko'k */
.user-choice:nth-child(3) i { color: #388e3c; }  /* Qaychi - yashil */

/* Scoreboard */
.scoreboard {
    display: flex;
    justify-content: space-around;
    margin: 50px 0 20px;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    width: 80%;
    max-width: 400px;
}

.score {
    text-align: center;
}

.score div:first-child {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 500;
}

.score div:last-child {
    font-size: 2rem;
    font-weight: bold;
    margin-top: 5px;
    color: #ffcc00;
}

/* ====================== */
/*        MODAL           */
/* ====================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-content {
    background: white;
    color: #333;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    width: 80%;
    max-width: 400px;
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

#modalMessage {
    font-size: 1.8rem;
    margin-bottom: 30px;
    font-weight: 600;
}

.modal-restart {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.modal-restart:hover {
    background: #e0e0e0;
    transform: rotate(180deg);
}

.modal-restart i {
    font-size: 1.8rem;
    color: #555;
}

/* Modal ranglari */
.modal-content.win {
    background: linear-gradient(135deg, #66bb6a, #43a047);
    color: white;
}

.modal-content.win .modal-restart {
    background: rgba(255,255,255,0.3);
}

.modal-content.win .modal-restart i {
    color: white;
}

.modal-content.lose {
    background: linear-gradient(135deg, #ef5350, #e53935);
    color: white;
}

.modal-content.tie {
    background: linear-gradient(135deg, #ffca28, #ffa000);
    color: #333;
}

/* ====================== */
/*     MOBIL UCHUN        */
/* ====================== */

@media (max-width: 768px) {

    body {
        font-size: 14px;
    }

    /* Welcome Screen */
    #welcomeScreen h1 {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }

    .menu-btn {
        font-size: 1.1rem;
        padding: 12px 25px;
        min-width: 200px;
        margin: 5px 0;
    }

    /* Orqaga tugmasi */
    .back-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    /* Dumaloq (computer choice) */
    .choice-circle {
        width: 120px;
        height: 120px;
        font-size: 3rem;
    }

    /* Foydalanuvchi tanlovlari */
    .user-choices {
        gap: 15px;
        margin: 30px 0;
    }

    .user-choice {
        width: 80px;
        height: 80px;
        font-size: 0.9rem;
        padding: 5px;
    }

    .user-choice i {
        font-size: 2rem;
    }

    /* Scoreboard */
    .scoreboard {
        flex-direction: row;
        gap: 15px;
        width: 90%;
        padding: 15px;
    }

    .score div:last-child {
        font-size: 1.8rem;
    }

    /* Modal oyna */
    .modal-content {
        padding: 30px 20px;
        width: 90%;
        max-width: 350px;
    }

    #modalMessage {
        font-size: 1.5rem;
    }

    .modal-restart {
        width: 50px;
        height: 50px;
    }

    .modal-restart i {
        font-size: 1.5rem;
    }

    /* Contact sahifasi */
    .contact-list a {
        font-size: 1rem;
        padding: 12px 15px;
    }

    .contact-list i {
        font-size: 1.3rem;
    }

    /* About sahifasi */
    .about-content {
        padding: 20px;
        font-size: 1rem;
        line-height: 1.6;
    }

    .page-title {
        font-size: 1.8rem;
        margin: 40px 0 20px;
    }
}

/* Kichik telefonlar (iPhone SE, Galaxy S5 va shunga o'xshash) */
@media (max-width: 480px) {

    #welcomeScreen h1 {
        font-size: 1.8rem;
    }

    .menu-btn {
        font-size: 1rem;
        padding: 10px 20px;
        min-width: 180px;
    }

    .choice-circle {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .user-choice {
        width: 70px;
        height: 70px;
    }

    .user-choice i {
        font-size: 1.8rem;
    }

    .scoreboard {
        width: 95%;
    }

    .score div:last-child {
        font-size: 1.6rem;
    }

    .modal-content {
        padding: 25px 15px;
        width: 95%;
    }

    #modalMessage {
        font-size: 1.4rem;
    }
}

/* ====================== */
/*      THEMES            */
/* ====================== */

body.dark {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #e0e0e0;
}

body.dark .menu-btn,
body.dark .user-choice,
body.dark .scoreboard,
body.dark .settings-container,
body.dark .stat-item,
body.dark .achievement,
body.dark .contact-list a,
body.dark .about-content,
body.dark .friends-container,
body.dark .achievements-container {
    background: rgba(255,255,255,0.05);
    color: #e0e0e0;
    border-color: rgba(255,255,255,0.1);
}

body.dark .menu-btn:hover,
body.dark .user-choice:hover,
body.dark .contact-list a:hover {
    background: rgba(255,255,255,0.1);
}

body.dark .setting-group label,
body.dark .score div:last-child,
body.dark .about-content strong,
body.dark .achievement strong {
    color: #ffd700;
}

body.dark .back-btn {
    background: rgba(0,0,0,0.5);
}

body.light {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    color: #333;
}

body.light .menu-btn,
body.light .user-choice,
body.light .scoreboard,
body.light .settings-container,
body.light .stat-item,
body.light .achievement,
body.light .contact-list a,
body.light .about-content,
body.light .friends-container,
body.light .achievements-container {
    background: rgba(0,0,0,0.05);
    color: #333;
    border-color: rgba(0,0,0,0.1);
}

body.light .menu-btn:hover,
body.light .user-choice:hover,
body.light .contact-list a:hover {
    background: rgba(0,0,0,0.1);
}

body.light .setting-group label,
body.light .score div:last-child,
body.light .about-content strong,
body.light .achievement strong {
    color: #ff6b35;
}

body.light .back-btn {
    background: rgba(0,0,0,0.1);
}

body.gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}