* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
}

.game-wrapper {
    position: relative;
    width: 1000px;
    height: 650px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
    border: 2px solid rgba(255,215,0,0.4);
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
}

/* ========== منوی بازی ========== */
.game-menu {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 25;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(12px);
    padding: 6px 20px;
    border-radius: 60px;
    border: 1px solid rgba(255,215,0,0.4);
}

.game-menu button {
    background: rgba(255,255,255,0.08);
    border: none;
    padding: 8px 24px;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.25s;
    font-size: 14px;
}

.game-menu button.active {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a2e;
    box-shadow: 0 0 12px rgba(255,215,0,0.5);
}

.game-menu button:hover {
    transform: translateY(-2px);
    background: #FFD700;
    color: #1a1a2e;
}

/* ========== پنل امتیاز ========== */
.score-panel {
    position: absolute;
    top: 18px;
    left: 20px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(12px);
    padding: 6px 22px;
    border-radius: 60px;
    color: #FFD700;
    font-size: 24px;
    font-weight: bold;
    font-family: monospace;
    z-index: 15;
    border-left: 4px solid #FFD700;
    pointer-events: none;
}

/* ========== دکمه‌های سختی ========== */
.difficulty-buttons {
    position: absolute;
    top: 18px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 15;
}

.difficulty-buttons button {
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    border: none;
    padding: 5px 16px;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-size: 12px;
}

.difficulty-buttons button:hover {
    background: #FFD700;
    color: #1a1a2e;
    transform: scale(1.02);
}

/* ========== باکس گیم اور ========== */
.gameover-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.96);
    backdrop-filter: blur(20px);
    padding: 30px 50px;
    border-radius: 40px;
    text-align: center;
    z-index: 30;
    border: 2px solid #FFD700;
    display: none;
    min-width: 320px;
}

.gameover-box h2 {
    color: #ff6b6b;
    font-size: 34px;
    margin-bottom: 12px;
}

.gameover-box p {
    color: #FFD700;
    font-size: 26px;
    margin-bottom: 20px;
}

.gameover-box button {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    padding: 10px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.gameover-box button:hover {
    transform: scale(1.05);
}

/* ========== کانتینر حدس کلمه ========== */
.wordle-container {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(24px);
    border-radius: 32px;
    padding: 20px;
    text-align: center;
    border: 2px solid rgba(255,215,0,0.6);
    z-index: 25;
    display: none;
}

.wordle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.wordle-header h3 {
    color: #FFD700;
    font-size: 22px;
}

.wordle-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: 0.2s;
}

.wordle-close:hover {
    color: #FFD700;
    transform: scale(1.1);
}

.level-display {
    color: #FFD700;
    margin-bottom: 15px;
    font-size: 16px;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 15px auto;
    max-width: 280px;
}

.word-cell {
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 12px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    color: white;
}

.word-cell.correct { background: #4caf50; box-shadow: 0 0 8px #4caf50; }
.word-cell.wrong-place { background: #ffc107; color: #1a1a2e; box-shadow: 0 0 5px #ffc107; }
.word-cell.wrong { background: #3a3a3a; }

.word-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.word-input {
    padding: 10px 14px;
    font-size: 16px;
    text-align: center;
    border-radius: 40px;
    border: none;
    width: 140px;
    background: rgba(255,255,255,0.15);
    color: white;
}

.word-input:focus {
    outline: none;
    background: rgba(255,255,255,0.25);
}

.word-guess-btn, .hint-btn {
    padding: 10px 18px;
    background: #FFD700;
    border: none;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.hint-btn {
    background: #4ecdc4;
    color: #1a1a2e;
}

.word-guess-btn:hover, .hint-btn:hover {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.word-message {
    color: white;
    margin-top: 10px;
    font-size: 13px;
}

/* ========== سوالات متداول ========== */
.faq-container {
    position: absolute;
    bottom: 70px;
    right: 15px;
    width: 260px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    z-index: 20;
    border: 1px solid rgba(255,215,0,0.3);
    overflow: hidden;
}

.faq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0,0,0,0.5);
    color: #FFD700;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

.faq-toggle {
    background: none;
    border: none;
    color: #FFD700;
    font-size: 16px;
    cursor: pointer;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-content.open {
    max-height: 300px;
}

.faq-item {
    padding: 10px 15px;
    border-top: 1px solid rgba(255,215,0,0.2);
}

.faq-question {
    color: #FFD700;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 5px;
}

.faq-answer {
    color: #ccc;
    font-size: 11px;
    line-height: 1.4;
}

.faq-link {
    color: #FFD700;
    text-decoration: none;
}

.faq-link:hover {
    text-decoration: underline;
}

/* ========== به زودی فعال میشود ========== */
.coming-soon {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 180px;
    height: 60px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    z-index: 20;
}

.coming-soon-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.2);
}

.coming-soon-text {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    padding: 5px;
}

.coming-soon-text span {
    font-size: 9px;
    color: #aaa;
    margin-top: 3px;
}

/* ========== پیام موقت آفرین ========== */
.congrats-toast {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a2e;
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 20px;
    z-index: 35;
    white-space: nowrap;
    transition: bottom 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.congrats-toast.show {
    bottom: 100px;
}

/* ========== فوتر ========== */
.game-footer {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(12px);
    padding: 6px 20px;
    border-radius: 50px;
    display: flex;
    gap: 12px;
    z-index: 15;
    font-size: 12px;
    white-space: nowrap;
    flex-wrap: wrap;
    justify-content: center;
}

.game-footer a, .privacy-link {
    color: white;
    text-decoration: none;
    transition: 0.2s;
}

.game-footer a:hover, .privacy-link:hover {
    color: #FFD700;
}

.footer-sep {
    color: rgba(255,255,255,0.3);
}

.copyright {
    color: #aaa;
    font-size: 11px;
}

/* ========== ریسپانسیو ========== */
@media (max-width: 900px) {
    .game-wrapper {
        width: 95vw;
        height: 65vh;
        transform: scale(0.98);
    }
    
    .faq-container {
        width: 220px;
        bottom: 65px;
    }
    
    .coming-soon {
        width: 150px;
        height: 55px;
    }
    
    .coming-soon-text {
        font-size: 9px;
    }
    
    .game-footer {
        font-size: 9px;
        gap: 8px;
        padding: 4px 12px;
    }
    
    .wordle-container {
        width: 90%;
        max-width: 380px;
    }
}
/* دکمه تغییر زبان */
.lang-switch {
    background: rgba(255,215,0,0.2);
    border: 1px solid rgba(255,215,0,0.5);
    border-radius: 30px;
    padding: 2px 8px;
    color: #FFD700;
    font-size: 10px;
    cursor: pointer;
    margin-left: 8px;
    transition: 0.2s;
}

.lang-switch:hover {
    background: rgba(255,215,0,0.4);
}

/* ورود و ثبت نام فیک */
.fake-login {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.fake-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 30px;
    padding: 5px 10px;
    color: white;
    font-size: 10px;
    text-align: center;
}

.fake-login-btn {
    background: rgba(255,215,0,0.2);
    border: 1px solid rgba(255,215,0,0.5);
    border-radius: 30px;
    padding: 4px;
    color: #FFD700;
    font-size: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.fake-login-btn:hover {
    background: rgba(255,215,0,0.4);
}

.fake-note {
    font-size: 8px;
    color: #aaa;
    text-align: center;
    margin-top: 4px;
}

.faq-section-title {
    color: #FFD700;
    font-size: 12px;
    font-weight: bold;
    padding: 8px 12px 4px 12px;
    border-top: 1px solid rgba(255,215,0,0.2);
    margin-top: 5px;
}

/* تنظیمات زبان */
.faq-lang {
    transition: all 0.2s;
}
/* ========== تنظیم مجدد موقعیت بخش FAQ ========== */
.faq-container {
    position: absolute;
    bottom: 80px; /* بالاتر از فوتر */
    right: 15px;
    width: 280px;
    max-height: 350px; /* حداکثر ارتفاع */
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    z-index: 25; /* بالاتر از بقیه */
    border: 1px solid rgba(255,215,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

/* محتوای قابل اسکرول */
.faq-content {
    max-height: 0;
    overflow-y: auto; /* اسکرول عمودی */
    transition: max-height 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: #FFD700 #333;
}

.faq-content.open {
    max-height: 280px; /* فضای کافی برای محتوا */
}

/* استایل اسکرول بار برای مرورگرهای Webkit */
.faq-content::-webkit-scrollbar {
    width: 5px;
}

.faq-content::-webkit-scrollbar-track {
    background: #333;
    border-radius: 10px;
}

.faq-content::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 10px;
}

/* هدر بخش FAQ */
.faq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0,0,0,0.7);
    color: #FFD700;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,215,0,0.2);
}

/* دکمه تغییر زبان */
.lang-switch {
    background: rgba(255,215,0,0.2);
    border: 1px solid rgba(255,215,0,0.5);
    border-radius: 30px;
    padding: 2px 8px;
    color: #FFD700;
    font-size: 9px;
    cursor: pointer;
    margin-left: 8px;
    transition: 0.2s;
}

.lang-switch:hover {
    background: rgba(255,215,0,0.4);
}

/* اطمینان از اینکه دکمه‌های سختی بالاتر از FAQ هستن */
.difficulty-buttons {
    position: absolute;
    top: 18px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 30; /* بالاتر از FAQ */
}

/* باکس "به زودی" پایین سمت چپ */
.coming-soon {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 170px;
    height: 55px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    z-index: 20;
}

/* فوتر در پایین */
.game-footer {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(12px);
    padding: 5px 18px;
    border-radius: 50px;
    display: flex;
    gap: 12px;
    z-index: 20;
    font-size: 11px;
    white-space: nowrap;
}