/*---------------- فونت وزیر ----------------*/
@font-face {
    font-family: 'Vazir';
    src: url('Vazir-Medium.woff2') format('woff2'),
        url('Vazir-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    animation: slideUp 0.8s ease;
    position: relative;
    z-index: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.header .emoji {
    font-size: 3rem;
    display: block;
    margin-top: -10px;
}

/* دکمه بازی با ربات */
.play-robot-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Vazir', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    margin: 15px 0;
    width: 100%;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.play-robot-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.play-robot-btn:active {
    transform: translateY(0px);
}

/* مودال */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 30px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    position: relative;
    animation: modalSlideIn 0.4s ease;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #764ba2;
    transition: transform 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    transform: rotate(90deg);
    background: rgba(118, 75, 162, 0.1);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #764ba2;
    font-size: 1.8rem;
}

.levels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.level-btn {
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    border: none;
    padding: 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.1rem;
    font-family: 'Vazir', sans-serif;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 15px #d1d1d1, -5px -5px 15px #ffffff;
}

.level-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.level-btn:active {
    transform: translateY(-2px);
}

.level-btn.avay { 
    border-bottom: 4px solid #4CAF50; 
}
.level-btn.mot { 
    border-bottom: 4px solid #FF9800; 
}
.level-btn.sakht { 
    border-bottom: 4px solid #f44336; 
}
.level-btn.namoton { 
    border-bottom: 4px solid #9C27B0; 
}

.level-btn .level-emoji {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}

.level-btn .level-name {
    font-weight: bold;
    font-size: 1.2rem;
}

.level-btn .level-desc {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

/* بخش بازی آنلاین */
.online-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #ddd;
}

.online-title {
    text-align: center;
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.online-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.online-btn {
    background: linear-gradient(145deg, #ffecd2, #fcb69f);
    border: none;
    padding: 15px 25px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Vazir', sans-serif;
    color: #333;
    transition: all 0.3s ease;
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.online-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.online-btn:hover::before {
    left: 100%;
}

.online-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(252, 182, 159, 0.4);
}

.online-btn:active {
    transform: translateY(0px);
}

.online-btn .btn-icon {
    font-size: 1.5rem;
}

.online-btn .btn-text {
    font-weight: bold;
}

.coming-soon {
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    color: #f44336;
    font-weight: bold;
}

/* صفحه بازی */
.game-screen {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    animation: slideUp 0.5s ease;
    position: relative;
    z-index: 1;
}

.game-screen.active {
    display: block;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.game-header h2 {
    color: #764ba2;
    font-size: 1.5rem;
}

.back-btn {
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    border: none;
    padding: 8px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Vazir', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 10px #d1d1d1, -3px -3px 10px #ffffff;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* امتیازات */
.scoreboard {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea22, #764ba222);
    border-radius: 20px;
}

.score-item {
    text-align: center;
}

.score-label {
    display: block;
    font-size: 1rem;
    color: #666;
    margin-bottom: 5px;
}

.score-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #764ba2;
    animation: scorePop 0.3s ease;
}

@keyframes scorePop {
    0% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.score-divider {
    font-size: 2rem;
    color: #764ba2;
    font-weight: bold;
}

/* دکمه‌های انتخاب */
.choices {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.choice-btn {
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    border: 3px solid transparent;
    padding: 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Vazir', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 15px #d1d1d1, -5px -5px 15px #ffffff;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.choice-btn:hover {
    transform: translateY(-5px);
    border-color: #764ba2;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.choice-btn:active {
    transform: translateY(-2px);
}

.choice-btn.selected {
    border-color: #4CAF50;
    background: linear-gradient(145deg, #e8f5e9, #f1f8e9);
}

.choice-btn .choice-emoji {
    font-size: 2.5rem;
    transition: transform 0.3s ease;
}

.choice-btn:hover .choice-emoji {
    transform: scale(1.2) rotate(-10deg);
}

.choice-btn .choice-name {
    font-weight: bold;
    color: #333;
}

/* منطقه نتیجه */
.result-area {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea08, #764ba208);
    border-radius: 20px;
}

.result-text {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    min-height: 40px;
    transition: all 0.3s ease;
}

.result-text.win {
    color: #4CAF50;
}

.result-text.lose {
    color: #f44336;
}

.result-text.draw {
    color: #FF9800;
}

/* دست‌ها */
.hands {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 20px 0;
}

.hand {
    width: 100px;
    height: 100px;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    border-radius: 20px;
    box-shadow: 5px 5px 15px #d1d1d1, -5px -5px 15px #ffffff;
    transition: all 0.5s ease;
    animation: handAppear 0.5s ease;
}

@keyframes handAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.player-hand {
    border: 3px solid #4CAF50;
}

.robot-hand {
    border: 3px solid #f44336;
}

.hand-vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: #764ba2;
    animation: vsPulse 1s infinite;
}

@keyframes vsPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* دکمه ریست */
.reset-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Vazir', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    width: 100%;
    margin-top: 10px;
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.reset-btn:active {
    transform: translateY(0px);
}

/* فوتر */
footer {
    margin-top: 30px;
    padding: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 700px;
}

footer p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.brand {
    color: #FFD700;
    font-weight: bold;
}

.made-by span {
    color: #FFD700;
    font-weight: bold;
}

/* انیمیشن برد/باخت */
@keyframes winAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes loseAnimation {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.win-animation {
    animation: winAnimation 0.5s ease;
}

.lose-animation {
    animation: loseAnimation 0.5s ease;
}

/* مدال و ستاره‌ها */
.stars {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
}

.star {
    font-size: 1.5rem;
    animation: starAppear 0.5s ease forwards;
    opacity: 0;
}

@keyframes starAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.star:nth-child(1) { animation-delay: 0.1s; }
.star:nth-child(2) { animation-delay: 0.2s; }
.star:nth-child(3) { animation-delay: 0.3s; }

/* responsive */
@media (max-width: 600px) {
    .game-container,
    .game-screen {
        padding: 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .levels {
        grid-template-columns: 1fr;
    }

    .online-buttons {
        flex-direction: column;
    }

    .choices {
        flex-direction: column;
        gap: 10px;
    }

    .hands {
        gap: 15px;
    }

    .hand {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }

    .score-value {
        font-size: 2rem;
    }
}

