/* ==========================================================
   کامپوننت‌های مشترک رابط کاربری بازی
   ========================================================== */

/* ---------- دکمه‌های بازی (بزرگ، سه‌بعدی، مناسب کودک) ---------- */
.game-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    font-family: var(--font-main);
    font-weight: 900;
    font-size: 18px;
    color: #fff;
    border-radius: var(--radius-full);
    background: var(--color-fox);
    box-shadow: 0 5px 0 var(--color-fox-dark), var(--shadow-soft);
    transition: transform .08s ease, box-shadow .08s ease;
    min-height: 56px;
}
.game-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--color-fox-dark);
}
.game-btn.secondary { background: var(--color-forest); box-shadow: 0 5px 0 var(--color-forest-dark), var(--shadow-soft); }
.game-btn.secondary:active { box-shadow: 0 1px 0 var(--color-forest-dark); }
.game-btn.sun { background: var(--color-sun); color: var(--color-plum); box-shadow: 0 5px 0 #E0A93E, var(--shadow-soft); }
.game-btn.sun:active { box-shadow: 0 1px 0 #E0A93E; }
.game-btn.ghost {
    background: rgba(255,255,255,0.6);
    color: var(--color-plum);
    box-shadow: 0 3px 0 rgba(74,59,107,0.15);
}
.game-btn:disabled { opacity: .5; pointer-events: none; }
.game-btn.full { width: 100%; }
.game-btn.small { padding: 10px 18px; font-size: 14px; min-height: 40px; }

.icon-btn {
    width: 48px; height: 48px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.75);
    box-shadow: var(--shadow-soft);
    font-size: 22px;
    transition: transform .1s;
}
.icon-btn:active { transform: scale(.9); }

/* ---------- کارت شیشه‌ای (Glass Morphism) ---------- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 28px 24px;
}

.solid-card {
    background: var(--color-cream);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px 22px;
}

/* ---------- برچسب امتیاز (سکه/الماس/ستاره/قلب) ---------- */
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.85);
    border-radius: var(--radius-full);
    padding: 6px 14px 6px 10px;
    font-weight: 900;
    font-size: 14px;
    box-shadow: var(--shadow-soft);
    color: var(--color-plum);
}
.stat-pill .stat-icon { font-size: 18px; }

/* ---------- فیلد فرم ---------- */
.form-field { text-align: right; margin-bottom: 14px; }
.form-field label {
    display: block; font-size: 13px; font-weight: 700;
    margin-bottom: 6px; color: var(--color-plum-soft);
}
.form-field input {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(74,59,107,0.12);
    font-family: inherit;
    font-size: 15px;
    background: rgba(255,255,255,0.8);
    outline: none;
    transition: border-color .15s;
}
.form-field input:focus { border-color: var(--color-fox); background: #fff; }
.form-hint { font-size: 11.5px; color: var(--color-plum-soft); margin-top: 4px; }

.alert-box {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 14px;
    display: none;
    align-items: center;
    gap: 8px;
}
.alert-box.show { display: flex; }
.alert-box.error { background: rgba(232,97,93,0.12); color: #C23F3B; }
.alert-box.success { background: rgba(76,175,109,0.12); color: #2F8B4E; }
.alert-box.info { background: rgba(110,198,232,0.15); color: #2C7CA3; }

/* ---------- حباب گفتگوی شخصیت ---------- */
.speech-bubble {
    position: relative;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    max-width: 260px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--color-plum);
    box-shadow: var(--shadow-soft);
}
.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    border-width: 12px 10px 0 10px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.mascot-wrap {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}
.mascot-avatar { width: 84px; height: 84px; flex-shrink: 0; }

/* ---------- مودال ---------- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(74,59,107,0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: var(--z-modal);
    padding: 20px;
}
.modal-box {
    background: var(--color-cream);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    max-width: 400px;
    width: 100%;
    padding: 28px 24px;
    text-align: center;
}

/* ---------- تب سوییچ (ورود / ثبت‌نام) ---------- */
.switch-tabs {
    display: flex;
    background: rgba(74,59,107,0.08);
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: 22px;
}
.switch-tabs button {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 14px;
    color: var(--color-plum-soft);
    transition: all .2s;
}
.switch-tabs button.active {
    background: var(--color-fox);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

/* ---------- Toast ---------- */
.game-toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--color-plum);
    color: #fff;
    padding: 14px 24px;
    border-radius: var(--radius-full);
    font-weight: 800; font-size: 14px;
    box-shadow: var(--shadow-card);
    z-index: var(--z-toast);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
    display: flex; align-items: center; gap: 8px;
}
.game-toast.show { transform: translateX(-50%) translateY(0); }
.game-toast.error { background: #C23F3B; }
.game-toast.success { background: var(--color-forest-dark); }

/* ---------- لودر اولیه ---------- */
.loader-wrap {
    position: fixed; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: linear-gradient(180deg, var(--color-sky) 0%, var(--color-sky-deep) 100%);
    z-index: 999;
    gap: 18px;
}
.loader-ring {
    width: 64px; height: 64px;
    border-radius: 50%;
    border: 6px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    animation: spin-slow 1s linear infinite;
}
.loader-text { color: #fff; font-weight: 800; font-size: 15px; }
