/* ==========================================================
   گردونه شانس ۱۰ برنده | استایل‌های مدرن و لوکس
   طراحی اختصاصی برای موبایل و وب‌ویوی اینستاگرام
   ========================================================== */

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-dark: #070a13;
    --bg-card: rgba(15, 23, 42, 0.78);
    --border-card: rgba(245, 158, 11, 0.22);
    --gold-1: #fbbf24;
    --gold-2: #f59e0b;
    --gold-3: #d97706;
    --gold-gradient: linear-gradient(135deg, #fde68a 0%, #fbbf24 40%, #d97706 100%);
    --purple-glow: rgba(168, 85, 247, 0.25);
    --gold-glow: rgba(245, 158, 11, 0.35);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Ambient glow orbs in background */
.ambient-glow {
    position: fixed;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}
.glow-top {
    top: -100px;
    right: -100px;
    background: radial-gradient(circle, #f59e0b 0%, #7c3aed 70%, transparent 100%);
}
.glow-bottom {
    bottom: -100px;
    left: -100px;
    background: radial-gradient(circle, #3b82f6 0%, #ec4899 70%, transparent 100%);
}

/* Dev / Preview Toolbar */
.preview-toolbar {
    position: sticky;
    top: 0;
    width: 100%;
    max-width: 520px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.78rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.preview-badge {
    color: var(--gold-1);
    font-weight: 700;
}
.preview-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #cbd5e1;
}
.preview-toolbar input[type="radio"] {
    accent-color: var(--gold-2);
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 480px;
    padding: 16px 16px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}
.campaign-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gold-1);
    margin-bottom: 12px;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--gold-1);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold-1);
    animation: pulse 1.8s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.main-title {
    font-size: 1.85rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}
.gold-gradient {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* Rule Alert Box */
.rule-alert {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(245, 158, 11, 0.12) 100%);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: right;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.alert-icon {
    font-size: 1.3rem;
    line-height: 1;
}
.alert-content {
    font-size: 0.8rem;
    color: #fca5a5;
    line-height: 1.5;
}
.alert-content strong {
    display: block;
    color: #fef08a;
    font-size: 0.84rem;
    margin-bottom: 2px;
}

/* Main Step Card */
.main-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* Step Views */
.step-view {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.step-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.step-header {
    text-align: center;
    margin-bottom: 20px;
}
.step-number {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold-2);
    background: rgba(245, 158, 11, 0.1);
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.step-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 4px;
}
.step-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.highlight-phone {
    color: var(--gold-1);
    font-weight: 700;
    direction: ltr;
    display: inline-block;
}

/* Form Styling */
.styled-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.25s ease;
}
.input-wrapper:focus-within {
    border-color: var(--gold-2);
    box-shadow: 0 0 15px var(--gold-glow);
}
.input-affix {
    padding: 12px 14px;
    color: var(--gold-2);
    font-weight: 700;
    font-size: 1rem;
    background: rgba(245, 158, 11, 0.08);
    border-left: 1px solid rgba(148, 163, 184, 0.15);
}
.ltr-input input {
    direction: ltr;
    text-align: left;
}
.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.95rem;
    padding: 12px 14px;
    font-weight: 500;
}
.input-wrapper input::placeholder {
    color: #64748b;
    font-size: 0.85rem;
}
.field-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--gold-gradient);
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    margin-top: 6px;
    width: 100%;
}
.btn-primary:active {
    transform: scale(0.98);
}
.btn-primary:hover {
    box-shadow: 0 6px 28px rgba(245, 158, 11, 0.6);
    filter: brightness(1.05);
}
.btn-icon {
    width: 18px;
    height: 18px;
    transform: rotate(180deg); /* for RTL */
}

/* OTP Inputs */
.otp-inputs-wrapper {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 10px 0;
}
.ltr-dir {
    direction: ltr;
}
.otp-box {
    width: 58px;
    height: 64px;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold-1);
    outline: none;
    transition: all 0.2s ease;
}
.otp-box:focus {
    border-color: var(--gold-2);
    box-shadow: 0 0 16px var(--gold-glow);
    background: rgba(245, 158, 11, 0.08);
    transform: translateY(-2px);
}
.otp-timer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.btn-link {
    background: none;
    border: none;
    color: var(--gold-1);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* Error Banner */
.error-banner {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    text-align: right;
}
.hidden {
    display: none !important;
}

/* STEP 3: WHEEL STAGE */
.user-greeting-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    margin-bottom: 16px;
}
.chance-badge {
    background: var(--gold-gradient);
    color: #0f172a;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: 999px;
}

.wheel-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10px 0;
}

.wheel-outer-ring {
    position: relative;
    width: 340px;
    height: 340px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 0 35px rgba(245, 158, 11, 0.35), inset 0 0 20px rgba(0, 0, 0, 0.8);
    border: 6px solid #d97706;
}

/* Flashing lights ring */
.wheel-lights {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
}

#wheelCanvas {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    z-index: 2;
    transition: transform 6s cubic-bezier(0.12, 0.8, 0.2, 1);
}

/* Center Pointer Arrow */
.wheel-pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}
.pointer-triangle {
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 28px solid #ef4444;
    position: relative;
}
.pointer-triangle::after {
    content: '';
    position: absolute;
    top: -28px;
    left: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 18px solid #f87171;
}

/* Center Spin Button */
.center-spin-btn {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #fde68a 0%, #f59e0b 60%, #b45309 100%);
    border: 4px solid #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 8;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.8);
    transition: all 0.2s ease;
}
.center-spin-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7), 0 0 35px rgba(245, 158, 11, 1);
}
.center-spin-btn:active {
    transform: scale(0.95);
}
.center-spin-btn:disabled {
    filter: grayscale(0.8) opacity(0.7);
    cursor: not-allowed;
    transform: none;
}
.spin-text {
    font-size: 0.85rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.1;
}
.spin-sub {
    font-size: 0.62rem;
    font-weight: 800;
    color: #78350f;
    letter-spacing: 1px;
}

.wheel-instruction {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 16px;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 10, 19, 0.88);
    backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    padding: 28px 22px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
    from { transform: translateY(30px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.winner-card {
    border: 2px solid var(--gold-2);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.35);
}
.loser-card {
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.modal-icon-badge {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: -50px auto 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    border: 3px solid #0f172a;
}
.win-badge {
    background: var(--gold-gradient);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.7);
}
.lose-badge {
    background: linear-gradient(135deg, #64748b 0%, #334155 100%);
    box-shadow: 0 0 20px rgba(100, 116, 139, 0.4);
}

.modal-title {
    font-size: 1.45rem;
    font-weight: 900;
    margin-bottom: 6px;
}
.win-title {
    color: var(--gold-1);
}
.lose-title {
    color: #e2e8f0;
}
.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Prize Box */
.prize-display-box {
    background: rgba(245, 158, 11, 0.12);
    border: 1.5px dashed var(--gold-2);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 16px;
}
.prize-tag {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.prize-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

/* Tracking Code Box */
.tracking-box {
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.tracking-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.tracking-code-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.tracking-code-row code {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gold-1);
    letter-spacing: 2px;
}
.btn-copy {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--gold-2);
    color: var(--gold-1);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
}
.copy-alert {
    color: var(--success);
    font-size: 0.72rem;
    display: block;
    margin-top: 4px;
}

.winner-instructions {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.inst-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.4;
}
.inst-num {
    background: rgba(245, 158, 11, 0.2);
    color: var(--gold-1);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.btn-modal-action {
    width: 100%;
    background: var(--gold-gradient);
    color: #0f172a;
    font-weight: 800;
    padding: 12px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Loser Consolation Box */
.consolation-box {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(59, 130, 246, 0.12) 100%);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: right;
    margin-bottom: 18px;
}
.consolation-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fde047;
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.consolation-text {
    font-size: 0.8rem;
    color: #e2e8f0;
    line-height: 1.6;
}
.btn-instagram {
    text-decoration: none;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(220, 39, 67, 0.4);
}
.insta-icon {
    width: 20px;
    height: 20px;
}
.btn-subtle {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 6px;
}

/* Confetti Canvas */
.confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.72rem;
    color: #64748b;
}
.footer-links {
    margin-top: 4px;
    color: #475569;
}

/* ==========================================================
   PRE-RULE MODAL & CAMPAIGN STATUS STYLES
   ========================================================== */

.rule-modal-card {
    border: 2px solid rgba(245, 158, 11, 0.7);
    box-shadow: 0 0 50px rgba(245, 158, 11, 0.35);
}
.warning-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
}
.rule-title {
    color: #f59e0b;
    font-size: 1.35rem;
    font-weight: 900;
}
.rule-box-content {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 16px 0 20px;
    text-align: right;
    line-height: 1.7;
}
.rule-main-text {
    font-size: 0.95rem;
    color: #f8fafc;
    margin-bottom: 12px;
}
.rule-sub-alert {
    background: rgba(239, 68, 68, 0.15);
    border-right: 3px solid #ef4444;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #fca5a5;
    line-height: 1.6;
}
.rule-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.btn-confirm-rule {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    font-size: 0.98rem;
    padding: 14px;
}
.btn-go-instagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(245, 158, 11, 0.5);
    color: #fde68a;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-go-instagram:hover {
    background: rgba(245, 158, 11, 0.15);
    color: #fff;
    border-color: #f59e0b;
}

/* Campaign Status Card (Paused / Completed) */
.campaign-status-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-lg);
    padding: 36px 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: 8px 0;
    animation: fadeIn 0.4s ease;
}
.status-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}
.status-title {
    font-size: 1.45rem;
    font-weight: 900;
    color: #f59e0b;
    margin-bottom: 8px;
}
.status-desc {
    font-size: 0.92rem;
    color: #cbd5e1;
    line-height: 1.7;
    margin-bottom: 22px;
}
.status-action-row {
    display: flex;
    justify-content: center;
}

