/* =====================================================================
   بازی آمیرزا - استایل اختصاصی (سازگار با تم روشن و تیره)
   از متغیرهای رنگی سراسری سایت (--bg-white, --card-bg, --border-color,
   --text-accent, --text-light, --title, --body-color) استفاده می‌شود
   تا در هر دو تم ظاهر یکسان و خوانا داشته باشد.
   ===================================================================== */

.amz-root {
    --amz-gold: #d9a441;
    --amz-gold-dark: #a9722a;
    --amz-tea: #7a9e6b;
    --amz-success: #2e9e5b;
    --amz-danger: #e0475b;
    --amz-info: #4098d7;
    color: var(--body-color);
}

/* ---------- عمومی: کارت / پنل ---------- */
.amz-card {
    background: var(--card-bg, var(--bg-white));
    border: 1px solid var(--border-color, rgba(0,0,0,.08));
    border-radius: var(--border-radius, 10px);
    padding: 16px;
    box-shadow: 0 4px 18px rgba(0,0,0,.06);
}

.theme-dark .amz-card {
    box-shadow: 0 4px 18px rgba(0,0,0,.25);
}

.amz-section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--title);
    background: linear-gradient(90deg, rgba(217,164,65,.18), transparent);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid rgba(217,164,65,.35);
}

/* ---------- هدر / هیرو ---------- */
.amz-hero {
    position: relative;
    border-radius: var(--border-radius-md, 15px);
    padding: 28px 18px;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, #2c1a08 0%, #6b4a1c 55%, #d9a441 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.amz-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.15), transparent 45%),
                radial-gradient(circle at 85% 80%, rgba(255,255,255,.12), transparent 40%);
    pointer-events: none;
}

.amz-hero h1 {
    position: relative;
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.amz-hero p {
    position: relative;
    margin: 8px 0 0;
    color: rgba(255,255,255,.9);
    font-size: .95rem;
}

/* ---------- کارت انتخاب مد بازی ---------- */
.amz-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 576px) {
    .amz-mode-grid {
        grid-template-columns: 1fr;
    }
}

.amz-mode-card {
    display: block;
    text-decoration: none;
    border-radius: var(--border-radius, 10px);
    padding: 18px 14px;
    text-align: center;
    background: var(--card-bg, var(--bg-white));
    border: 1px solid var(--border-color, rgba(0,0,0,.08));
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    color: var(--body-color) !important;
}

.amz-mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(217,164,65,.25);
    border-color: var(--amz-gold);
}

.amz-mode-card .amz-mode-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.6rem;
    color: #fff;
    background: linear-gradient(135deg, var(--amz-gold), var(--amz-gold-dark));
}

.amz-mode-card.amz-mode-solo .amz-mode-icon {
    background: linear-gradient(135deg, #4098d7, #2c5f92);
}

.amz-mode-card .amz-mode-title {
    font-weight: 700;
    font-size: 1.05rem;
    display: block;
}

.amz-mode-card .amz-mode-desc {
    display: block;
    margin-top: 4px;
    font-size: .82rem;
    color: var(--text-light);
}

.amz-mode-card .amz-mode-badge {
    display: inline-block;
    margin-top: 10px;
    font-size: .72rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--amz-gold);
    color: #fff;
    font-weight: 700;
}

.amz-mode-card.amz-mode-solo .amz-mode-badge {
    background: var(--amz-info);
}

/* ---------- کد بازی ---------- */
.amz-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--amz-gold), var(--amz-gold-dark));
    color: #fff !important;
}

/* ---------- حروف کاربر (کشیدنی) ---------- */
.amz-tiles-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px;
}

.amz-tile {
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 10px;
    background: var(--card-bg, var(--bg-white));
    color: var(--title);
    border: 1px solid var(--border-color, rgba(0,0,0,.15));
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    user-select: none;
    transition: transform .12s ease, box-shadow .12s ease;
}

.amz-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(217,164,65,.3);
    border-color: var(--amz-gold);
}

.amz-tile.amz-drag-over-top {
    border-top: 3px solid var(--amz-gold);
}

.amz-tile.amz-drag-over-bottom {
    border-bottom: 3px solid var(--amz-gold);
}

/* ---------- سکه ها ---------- */
.amz-coin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(224,71,91,.12);
    color: var(--amz-danger);
    border: 1px solid rgba(224,71,91,.35);
}

.amz-coin-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.amz-coin-actions a {
    display: inline-block;
    min-width: 30px;
    text-align: center;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--amz-gold);
    color: #fff !important;
    font-weight: 700;
    font-size: .8rem;
    text-decoration: none;
}

.amz-coin-actions a:hover {
    background: var(--amz-gold-dark);
}

/* ---------- کلمه ثبت شده ---------- */
.amz-word-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 30px;
    background: var(--bg-light);
    border: 1px dashed var(--border-color, rgba(0,0,0,.2));
    font-size: 1.15rem;
    font-weight: 700;
}

.amz-word-box.is-hidden {
    color: var(--text-light);
    letter-spacing: 3px;
}

.amz-word-box.is-revealed {
    color: var(--amz-info);
}

.amz-word-box.is-missing {
    color: var(--amz-danger);
}

/* ---------- کارت های چای / قند ---------- */
.amz-cardgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .amz-cardgrid {
        grid-template-columns: 1fr;
    }
}

.amz-flipcard {
    position: relative;
    border-radius: var(--border-radius, 10px);
    padding: 14px 12px;
    background: var(--card-bg, var(--bg-white));
    border: 1px dashed var(--amz-gold);
    text-align: center;
    transition: box-shadow .18s ease;
}

.amz-flipcard:hover {
    box-shadow: 0 8px 20px rgba(217,164,65,.25);
}

.amz-flipcard .amz-flipcard-ribbon {
    position: absolute;
    top: -9px;
    right: 10px;
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    color: #fff;
}

.amz-flipcard.amz-chay .amz-flipcard-ribbon {
    background: var(--amz-tea);
}

.amz-flipcard.amz-ghand .amz-flipcard-ribbon {
    background: var(--amz-gold);
}

.amz-flipcard h6 {
    margin: 6px 0 6px;
    font-weight: 700;
    color: var(--title);
}

.amz-flipcard span {
    font-size: .82rem;
    color: var(--text-accent);
    line-height: 1.6;
}

/* ---------- لیست بازی ها ---------- */
.amz-list-item {
    background: var(--card-bg, var(--bg-white));
    border: 1px solid var(--border-color, rgba(0,0,0,.08));
    border-radius: var(--border-radius, 10px);
    padding: 14px;
    margin-bottom: 12px;
}

/* =====================================================================
   مد تک نفره
   ===================================================================== */

.amz-solo-stage {
    position: relative;
    border-radius: var(--border-radius-md, 15px);
    padding: 18px;
    background: var(--card-bg, var(--bg-white));
    border: 1px solid var(--border-color, rgba(0,0,0,.08));
}

.amz-solo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.amz-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: .95rem;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--bg-light);
    color: var(--title);
}

.amz-stat .fa, .amz-stat i {
    font-size: .9rem;
}

.amz-stat.amz-stat-score { color: var(--amz-gold-dark); }
.theme-dark .amz-stat.amz-stat-score { color: var(--amz-gold); }
.amz-stat.amz-stat-streak { color: #e0722c; }
.amz-stat.amz-stat-best { color: var(--amz-info); }

.amz-lives {
    display: inline-flex;
    gap: 4px;
    font-size: 1.1rem;
    color: var(--amz-danger);
}

.amz-lives i.amz-life-lost {
    color: var(--border-color);
    opacity: .5;
}

/* تایمر */
.amz-timerbar {
    position: relative;
    height: 10px;
    border-radius: 20px;
    background: var(--bg-light);
    overflow: hidden;
    margin-bottom: 16px;
}

.amz-timerbar-fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--amz-tea), var(--amz-gold));
    transition: width 1s linear, background .3s ease;
}

.amz-timerbar-fill.is-low {
    background: linear-gradient(90deg, #e0722c, var(--amz-danger));
    animation: amz-pulse .6s ease-in-out infinite;
}

@keyframes amz-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}

/* حروف قابل کلیک */
.amz-solo-tiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 18px 0;
    min-height: 60px;
}

.amz-solo-tile {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    border-radius: 12px;
    background: linear-gradient(160deg, var(--amz-gold), var(--amz-gold-dark));
    color: #fff;
    box-shadow: 0 4px 10px rgba(217,164,65,.35);
    cursor: pointer;
    user-select: none;
    transition: transform .12s ease, opacity .12s ease;
}

.amz-solo-tile:active {
    transform: scale(.92);
}

.amz-solo-tile.is-used {
    opacity: .25;
    pointer-events: none;
    transform: scale(.9);
}

/* جایگاه پاسخ */
.amz-answer-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    min-height: 54px;
}

.amz-answer-slot {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
    border-radius: 10px;
    border: 2px dashed var(--border-color, rgba(0,0,0,.25));
    color: var(--title);
    background: var(--bg-light);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.amz-answer-slot.is-filled {
    border-style: solid;
    border-color: var(--amz-tea);
    background: rgba(122,158,107,.12);
}

.amz-answer-slot.is-hint {
    border-color: var(--amz-info);
    color: var(--amz-info);
}

/* انیمیشن های بازخورد */
.amz-shake {
    animation: amz-shake .45s ease;
}

@keyframes amz-shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-8px); }
    40%, 60% { transform: translateX(8px); }
}

.amz-pop {
    animation: amz-pop .4s ease;
}

@keyframes amz-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.amz-flash-correct {
    box-shadow: 0 0 0 3px var(--amz-success) inset !important;
}

.amz-flash-wrong {
    box-shadow: 0 0 0 3px var(--amz-danger) inset !important;
}

/* دکمه های اکشن سولو */
.amz-solo-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.amz-btn-solo {
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    color: #fff;
    transition: transform .12s ease, opacity .12s ease;
}

.amz-btn-solo:hover {
    transform: translateY(-2px);
}

.amz-btn-solo:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.amz-btn-submit { background: linear-gradient(135deg, var(--amz-success), #1f7a44); }
.amz-btn-hint { background: linear-gradient(135deg, var(--amz-info), #2c5f92); }
.amz-btn-clear { background: linear-gradient(135deg, #8a8a8a, #5c5c5c); }
.amz-btn-start { background: linear-gradient(135deg, var(--amz-gold), var(--amz-gold-dark)); }

/* صفحه شروع / پایان */
.amz-solo-intro, .amz-solo-gameover {
    text-align: center;
    padding: 20px 10px;
}

.amz-solo-intro .amz-mode-icon,
.amz-solo-gameover .amz-mode-icon {
    width: 74px;
    height: 74px;
    font-size: 2.1rem;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--amz-gold), var(--amz-gold-dark));
    box-shadow: 0 8px 20px rgba(217,164,65,.35);
}

.amz-solo-gameover .amz-mode-icon {
    background: linear-gradient(135deg, var(--amz-danger), #a22e3d);
    box-shadow: 0 8px 20px rgba(224,71,91,.35);
}

.amz-solo-intro h3, .amz-solo-gameover h3 {
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--title);
}

.amz-solo-intro p, .amz-solo-gameover p {
    color: var(--text-accent);
    margin-bottom: 16px;
}

.amz-solo-stats-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.amz-solo-stats-row .amz-stat {
    font-size: 1rem;
    padding: 8px 16px;
}

.amz-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--card-bg, var(--bg-white));
    color: var(--title);
    border: 1px solid var(--border-color);
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 2000;
}

.amz-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.amz-toast.is-success { border-color: var(--amz-success); color: var(--amz-success); }
.amz-toast.is-danger { border-color: var(--amz-danger); color: var(--amz-danger); }

/* =====================================================================
   فروشگاه امتیاز راهنمایی
   ===================================================================== */

.amz-stat-hint { color: var(--amz-info); }

.amz-shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.amz-wallet-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: .85rem;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(217,164,65,.15);
    color: var(--amz-gold-dark);
    border: 1px solid rgba(217,164,65,.35);
}

.theme-dark .amz-wallet-badge { color: var(--amz-gold); }

.amz-shop-desc {
    color: var(--text-accent);
    font-size: .88rem;
}

.amz-shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 576px) {
    .amz-shop-grid {
        grid-template-columns: 1fr;
    }
}

.amz-shop-pack {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 12px;
    border-radius: var(--border-radius, 10px);
    background: var(--bg-light);
    border: 1px solid var(--border-color, rgba(0,0,0,.1));
    text-align: center;
}

.amz-shop-pack.is-popular {
    border-color: var(--amz-gold);
    box-shadow: 0 6px 18px rgba(217,164,65,.25);
}

.amz-shop-pack-badge {
    position: absolute;
    top: -10px;
    background: var(--amz-gold);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 20px;
}

.amz-shop-pack-count {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--title);
}

.amz-shop-pack-label {
    font-size: .78rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.amz-btn-buy {
    border: none;
    border-radius: 30px;
    padding: 8px 14px;
    font-weight: 700;
    font-size: .82rem;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--amz-tea), #4c7a3f);
    transition: transform .12s ease, opacity .12s ease;
    width: 100%;
}

.amz-btn-buy:hover {
    transform: translateY(-2px);
}

.amz-btn-buy:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

/* =====================================================================
   جدول رتبه‌بندی برترین بازیکنان
   ===================================================================== */

.amz-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.amz-leaderboard-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm, 8px);
    background: var(--bg-light);
    border: 1px solid var(--border-color, rgba(0,0,0,.08));
}

.amz-leaderboard-row.is-top {
    border-color: var(--amz-gold);
    background: rgba(217,164,65,.1);
}

.amz-leaderboard-rank {
    font-weight: 800;
    color: var(--amz-gold-dark);
    min-width: 28px;
}

.theme-dark .amz-leaderboard-rank { color: var(--amz-gold); }

.amz-leaderboard-name {
    font-weight: 700;
    color: var(--title);
    flex: 1;
    min-width: 80px;
}

.amz-leaderboard-guesses {
    font-size: .82rem;
    color: var(--text-accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.amz-leaderboard-score {
    font-weight: 700;
    color: var(--amz-info);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
