/* ===== Mobile First – سبک حماسی ===== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Readex+Pro:wght@400;600;700&display=swap');

:root {
    --bg-dark: #0d0d0f;
    --bg-card: #16161a;
    --accent-red: #c41e3a;
    --accent-red-dim: #8b1528;
    --accent-gold: #c9a227;
    --accent-gold-dim: #8a7019;
    --text-primary: #f0e6e0;
    --text-muted: #9a8f88;
    --border: rgba(196, 30, 58, 0.35);
    --shadow-glow: 0 0 30px rgba(196, 30, 58, 0.2);
    --radius: 12px;
    /* نقش‌ها */
    --role-liberal: #2563eb;
    --role-liberal-dim: #1d4ed8;
    --role-fascist: #722f37;
    --role-fascist-dim: #5a252b;
    --role-hitler: #722f37;
    --role-communist: #6b4423;
    --role-communist-dim: #52341a;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Readex Pro', 'Amiri', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% 0%, rgba(196, 30, 58, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(201, 162, 39, 0.08) 0%, transparent 50%);
}

/* صفحات – فقط یکی فعال */
.screen {
    display: none;
    width: 100%;
    max-width: 22rem;
}
.screen.screen-active {
    display: block;
}
.screen .page {
    max-width: none;
}

/* صفحه خالی */
.empty-content {
    text-align: center;
}
.empty-content .btn-play {
    min-width: 14rem;
}

/* صفحه نقش */
.role-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem;
    box-shadow: var(--shadow-glow);
}
.role-content .field {
    margin-bottom: 1.25rem;
}
.role-display {
    padding: 1.25rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    border: 2px solid transparent;
}
.role-display.role-liberal {
    background: rgba(37, 99, 235, 0.25);
    border-color: var(--role-liberal);
    color: #93c5fd;
}
.role-display.role-fascist,
.role-display.role-hitler {
    background: rgba(114, 47, 55, 0.35);
    border-color: var(--role-fascist);
    color: #e8b4b8;
}
.role-display.role-communist {
    background: rgba(107, 68, 35, 0.35);
    border-color: var(--role-communist);
    color: #d4a574;
}
.role-display .role-unknown,
.modal-role-result.role-unknown {
    color: var(--text-muted);
}

/* صفحه راهبر بازی */
.screen-title {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}
.game-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.game-actions .btn-play {
    width: 100%;
}
.btn-secondary {
    background: linear-gradient(180deg, #374151 0%, #1f2937 100%);
    box-shadow: 0 4px 0 #1f2937, 0 6px 20px rgba(0, 0, 0, 0.4);
}
.btn-secondary:hover {
    box-shadow: 0 5px 0 #1f2937, 0 8px 24px rgba(55, 65, 81, 0.35);
}
.btn-secondary:active {
    box-shadow: 0 2px 0 #1f2937, 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* مودال */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal.modal-open {
    opacity: 1;
    visibility: visible;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}
.modal-box {
    position: relative;
    width: 100%;
    max-width: 22rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.modal-box .field {
    margin-bottom: 1rem;
}
.modal-box .btn-play {
    width: 100%;
    margin-top: 0.5rem;
}
.modal-role-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}
.modal-role-result.role-liberal {
    background: rgba(37, 99, 235, 0.25);
    border: 2px solid var(--role-liberal);
    color: #93c5fd;
}
.modal-role-result.role-fascist,
.modal-role-result.role-hitler {
    background: rgba(114, 47, 55, 0.35);
    border: 2px solid var(--role-fascist);
    color: #e8b4b8;
}
.modal-role-result.role-communist {
    background: rgba(107, 68, 35, 0.35);
    border: 2px solid var(--role-communist);
    color: #d4a574;
}
.hidden {
    display: none !important;
}

.page {
    width: 100%;
    max-width: 22rem;
}

/* تایتل */
.title {
    font-family: 'Amiri', serif;
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-shadow:
        0 0 20px rgba(196, 30, 58, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.02em;
}

/* فرم */
.setup-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem;
    box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.field {
    margin-bottom: 1.25rem;
}

.field:last-of-type {
    margin-bottom: 1.5rem;
}

.field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.field input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: 8px;
    -webkit-appearance: none;
    appearance: none;
}

.field input:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.25);
}

.field input::placeholder {
    color: var(--text-muted);
}

/* دکمه بازی */
.btn-play {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--bg-dark);
    background: linear-gradient(180deg, var(--accent-gold) 0%, var(--accent-gold-dim) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow:
        0 4px 0 var(--accent-gold-dim),
        0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-play:hover {
    transform: translateY(-1px);
    box-shadow:
        0 5px 0 var(--accent-gold-dim),
        0 8px 24px rgba(201, 162, 39, 0.35);
}

.btn-play:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 var(--accent-gold-dim),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

/* تبلت و بالاتر */
@media (min-width: 480px) {
    .page {
        max-width: 26rem;
    }

    .setup-form {
        padding: 2rem 1.5rem;
    }

    .title {
        margin-bottom: 2.5rem;
    }
}

@media (min-width: 768px) {
    body {
        padding: 2rem;
    }

    .page {
        max-width: 28rem;
    }

    .title {
        font-size: 2.5rem;
        margin-bottom: 2.75rem;
    }

    .setup-form {
        padding: 2.25rem 2rem;
        border-radius: 16px;
    }

    .btn-play {
        padding: 1.15rem 1.5rem;
        font-size: 1.2rem;
    }
}
