/* ==================== متغیرها و پایه ==================== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
    --radius: 14px;
    --radius-sm: 10px;
    --font: 'Vazirmatn', Tahoma, system-ui, sans-serif;
    --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ==================== لودینگ اختصاصی ==================== */
#page-loader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}
#page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-cube {
    width: 60px; height: 60px;
    position: relative;
    transform-style: preserve-3d;
    animation: spinCube 2s infinite linear;
}
.loader-cube .face {
    position: absolute; width: 60px; height: 60px;
    border: 2px solid var(--primary);
    background: rgba(99,102,241,0.15);
}
.loader-cube .front  { transform: translateZ(30px); }
.loader-cube .back   { transform: rotateY(180deg) translateZ(30px); }
.loader-cube .left   { transform: rotateY(-90deg) translateZ(30px); }
.loader-cube .right  { transform: rotateY(90deg) translateZ(30px); }
.loader-cube .top    { transform: rotateX(90deg) translateZ(30px); }
.loader-cube .bottom { transform: rotateX(-90deg) translateZ(30px); }

@keyframes spinCube {
    0%   { transform: rotateX(0) rotateY(0); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}
.loader-text {
    margin-top: 24px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    letter-spacing: 2px;
}

/* ==================== ناوبری ==================== */
.navbar {
    background: var(--bg-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text);
}
.logo-icon { font-size: 1.6rem; }
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}
.nav-menu a {
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
}
.nav-menu a:hover { background: #f1f5f9; color: var(--primary); }
.nav-menu .btn-nav {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.nav-menu .btn-nav.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.nav-menu .btn-nav.btn-primary:hover { background: var(--primary-dark); }
.admin-link { color: var(--warning) !important; font-weight: 600; }
.user-menu { display: flex; align-items: center; gap: 0.6rem; margin-right: 0.5rem; }
.user-name { font-weight: 600; color: var(--primary); }
.btn-logout { color: var(--danger) !important; font-size: 0.9rem; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    width: 24px; height: 2.5px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* ==================== اصلی ==================== */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

/* فلش پیام‌ها */
.flash-container { margin-bottom: 1.25rem; }
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    font-weight: 500;
    animation: slideDown 0.35s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
.flash-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.flash-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.flash-close {
    background: none; border: none; font-size: 1.4rem;
    cursor: pointer; color: inherit; opacity: 0.7; line-height: 1;
}

/* دکمه‌ها */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.3rem;
    border-radius: 10px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-lg { padding: 0.85rem 1.8rem; font-size: 1.05rem; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ==================== هیرو ==================== */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    padding: 2.5rem 0 3.5rem;
}
.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.8rem;
}
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 1.8rem;
    max-width: 480px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.hero-visual { display: flex; justify-content: center; }
.floating-cube {
    width: 180px; height: 180px;
    position: relative;
    animation: float 4s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-18px) rotate(8deg); }
}
.cube-face {
    position: absolute; inset: 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    opacity: 0.85;
    box-shadow: 0 20px 40px rgba(99,102,241,0.3);
}
.cube-face.f2 { transform: rotate(15deg) scale(0.9); opacity: 0.5; }
.cube-face.f3 { transform: rotate(-12deg) scale(0.8); opacity: 0.3; }

/* ویژگی‌ها */
.section-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.8rem;
    color: var(--text);
}
.features { padding: 2rem 0; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.6rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 2.2rem; margin-bottom: 0.7rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

/* پیش‌نمایش روبیک‌ها */
.cubes-preview { padding: 2.5rem 0; }
.cubes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.cube-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1rem;
    text-align: center;
    transition: all var(--transition);
    color: var(--text);
    position: relative;
}
.cube-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow); }
.cube-card.locked { opacity: 0.7; }
.cube-preview-icon {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.lock-badge {
    display: block;
    font-size: 0.75rem;
    color: var(--warning);
    margin-top: 0.4rem;
}
.guest-note {
    text-align: center;
    margin-top: 1.2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* تورنمنت و جداول */
.tournament-list, .tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}
.tournament-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.3rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform var(--transition);
    color: var(--text);
}
.tournament-card:hover { transform: translateY(-3px); }
.tournament-card.faded { opacity: 0.75; }
.t-badge {
    display: inline-block;
    background: #e0e7ff;
    color: var(--primary-dark);
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.t-status.active { color: var(--success); font-weight: 600; font-size: 0.85rem; }
.t-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.t-meta { font-size: 0.85rem; color: var(--text-muted); margin: 0.6rem 0; display: flex; flex-wrap: wrap; gap: 0.8rem; }

.table-responsive { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.leader-table, .admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}
.leader-table th, .admin-table th {
    background: #f1f5f9;
    padding: 0.85rem 1rem;
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.leader-table td, .admin-table td {
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
}
.leader-table tr:hover, .admin-table tr:hover { background: #f8fafc; }
.highlight-row { background: #eef2ff !important; }
.time-cell { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ==================== صفحات احراز هویت ==================== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 1rem 0;
}
.auth-card {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 2.2rem 2rem;
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border);
}
.auth-header { text-align: center; margin-bottom: 1.8rem; }
.auth-icon { font-size: 2.8rem; margin-bottom: 0.6rem; }
.auth-header h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.auth-header p { color: var(--text-muted); font-size: 0.95rem; }

.form-group { margin-bottom: 1.15rem; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
}
.required { color: var(--danger); }
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: var(--font);
    font-size: 1rem;
    background: #fff;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-error { display: block; color: var(--danger); font-size: 0.85rem; margin-top: 0.3rem; }
.code-input {
    text-align: center;
    font-size: 1.6rem !important;
    letter-spacing: 10px;
    font-weight: 700;
}
.auth-footer {
    text-align: center;
    margin-top: 1.4rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.demo-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
    opacity: 0.8;
}

/* ==================== صفحه روبیک ==================== */
.cube-page { padding-bottom: 2rem; }
.cube-header { margin-bottom: 1.5rem; }
.cube-header h1 { font-size: 1.6rem; margin-bottom: 0.8rem; }
.cube-type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.type-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1.5px solid transparent;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
}
.type-btn:hover { background: #e0e7ff; }
.type-btn.active { background: var(--primary); color: white; }
.type-btn.locked { opacity: 0.6; }
.mini-lock { font-size: 0.75rem; }

.locked-overlay {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem;
}
.locked-box {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.lock-icon { font-size: 3.5rem; margin-bottom: 0.8rem; }
.locked-actions { display: flex; gap: 0.8rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }

.cube-workspace {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.cube-main {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.scramble-display {
    margin-top: 0.8rem;
    padding: 0.7rem 1rem;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 0.95rem;
    word-break: break-all;
}
.scramble-label { font-weight: 600; color: var(--text-muted); margin-left: 0.4rem; }

.cube-controls {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.3rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.timer-box {
    text-align: center;
    margin-bottom: 1.2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border-radius: 12px;
}
.timer-display {
    font-size: 2.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    letter-spacing: 2px;
}
.timer-status { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.2rem; }

.control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}
.control-buttons .btn { width: 100%; }

.move-buttons { margin-bottom: 1.2rem; }
.moves-title { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.move-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
}
.move-btn {
    padding: 0.45rem 0;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}
.move-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

.save-section { margin-top: 0.5rem; }
.save-hint, .guest-hint { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }

/* ==================== صفحات عمومی ==================== */
.page-header { margin-bottom: 1.8rem; }
.page-header h1 { font-size: 1.7rem; margin-bottom: 0.3rem; }
.page-header p { color: var(--text-muted); }
.back-link { display: inline-block; margin-bottom: 0.6rem; font-size: 0.95rem; color: var(--text-muted); }
.back-link:hover { color: var(--primary); }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.filter-btn {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background: #f1f5f9;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
}
.filter-btn.active { background: var(--primary); color: white; }

.alert {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.2rem;
}
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

.empty-state {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

.scramble-box {
    background: #f1f5f9;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    word-break: break-all;
}
.scramble-box code { font-size: 1.05rem; font-weight: 600; color: var(--primary-dark); }

.participate-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}
.your-time { font-size: 1.1rem; }
.hint { font-size: 0.9rem; color: var(--text-muted); }

/* تیکت‌ها */
.tickets-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
}
.ticket-form-card, .my-tickets {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.ticket-item {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.8rem;
}
.ticket-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.status-badge {
    font-size: 0.8rem;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    background: #f1f5f9;
}
.status-open .status-badge { background: #fef3c7; color: #92400e; }
.status-answered .status-badge { background: #d1fae5; color: #065f46; }
.status-closed .status-badge { background: #e2e8f0; color: #475569; }
.admin-reply {
    background: #f0fdf4;
    padding: 0.7rem;
    border-radius: 8px;
    margin-top: 0.6rem;
    border-right: 3px solid var(--success);
}
.ticket-date { font-size: 0.8rem; color: var(--text-muted); }

/* اعلان‌ها */
.notif-list { display: flex; flex-direction: column; gap: 0.8rem; }
.notif-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.3rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.notif-item.unread { border-right: 4px solid var(--primary); }
.notif-title { font-weight: 700; margin-bottom: 0.3rem; }
.notif-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==================== پنل ادمین ==================== */
.admin-page { }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.8rem;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.3rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}
.stat-label { font-size: 0.9rem; color: var(--text-muted); }
.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 2rem;
}
.admin-sections {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
}
.admin-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.3rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.admin-section h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.admin-form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.badge {
    background: var(--warning);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}
.status-active { color: var(--success); font-weight: 600; }
.ticket-mini-list { list-style: none; }
.ticket-mini-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}
.ticket-mini-list li span { font-size: 0.85rem; color: var(--text-muted); }
.ticket-detail-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.ticket-body {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}
.previous-reply {
    background: #f0fdf4;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.notif-admin-list { list-style: none; }
.notif-admin-list li {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.7rem;
    border: 1px solid var(--border);
}

/* ==================== فوتر ==================== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 2rem 1.25rem;
    margin-top: auto;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
}
.footer-brand { font-weight: 700; }
.footer-brand p { font-weight: 400; font-size: 0.9rem; color: var(--text-muted); margin-top: 0.2rem; }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 0.95rem; }
.footer-links a:hover { color: var(--primary); }
.footer-copy { font-size: 0.85rem; color: var(--text-muted); }

/* ==================== ریسپانسیو ==================== */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; text-align: center; }
    .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .hero-visual { order: -1; }
    .cube-workspace { grid-template-columns: 1fr; }
    .tickets-layout { grid-template-columns: 1fr; }
    .admin-sections { grid-template-columns: 1fr; }
    .move-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 60px);
        background: var(--bg-card);
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        box-shadow: -5px 0 30px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 999;
        gap: 0.3rem;
    }
    .nav-menu.open { right: 0; }
    .nav-menu li { width: 100%; }
    .nav-menu a { display: block; padding: 0.7rem 1rem; }
    .user-menu { flex-direction: column; align-items: flex-start; }
    .control-buttons { grid-template-columns: 1fr; }
    .timer-display { font-size: 2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .main-content { padding: 1rem 0.8rem 2rem; }
    .auth-card { padding: 1.6rem 1.2rem; }
    .hero-title { font-size: 1.9rem; }
    .feature-card { padding: 1.2rem; }
    .cubes-grid { grid-template-columns: repeat(2, 1fr); }
}

/* انیمیشن‌های پایه برای data-anime */
[data-anime] { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-anime].anime-in { opacity: 1; transform: translateY(0); }
[data-anime="fade-left"] { transform: translateX(30px); }
[data-anime="fade-left"].anime-in { transform: translateX(0); }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }
.text-center { text-align: center; }

/* ==================== OTP ۶ خانه‌ای ==================== */
.otp-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.5rem 0;
    direction: ltr;
}
.otp-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    transition: all 0.2s;
    font-family: var(--font);
}
.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
    transform: scale(1.05);
}
.auth-icon-svg { margin-bottom: 0.8rem; }

/* ==================== Podium لیدربورد ==================== */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.8rem;
    margin: 2rem 0 2.5rem;
    min-height: 220px;
}
.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 110px;
    position: relative;
}
.podium-rank {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}
.podium-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.3rem;
    color: white;
    margin-bottom: 0.4rem;
}
.podium-name { font-weight: 700; font-size: 0.9rem; text-align: center; }
.podium-time { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.podium-bar {
    width: 100%;
    border-radius: 10px 10px 0 0;
}
.gold-bar { height: 100px; background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.silver-bar { height: 70px; background: linear-gradient(180deg, #e2e8f0, #94a3b8); }
.bronze-bar { height: 50px; background: linear-gradient(180deg, #fdba74, #c2410c); }
.podium-place.gold .podium-avatar { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 4px 15px rgba(251,191,36,0.4); }
.podium-place.silver .podium-avatar { background: linear-gradient(135deg, #94a3b8, #64748b); }
.podium-place.bronze .podium-avatar { background: linear-gradient(135deg, #fdba74, #c2410c); }
.podium-crown { margin-bottom: -8px; animation: bounce 2s infinite; }
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.85rem;
    color: white;
}
.gold-medal { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.silver-medal { background: linear-gradient(135deg, #94a3b8, #64748b); }
.bronze-medal { background: linear-gradient(135deg, #fdba74, #c2410c); }
.rank-gold { background: #fffbeb !important; }
.rank-silver { background: #f8fafc !important; }
.rank-bronze { background: #fff7ed !important; }

/* ==================== اعلان صفحه اصلی ==================== */
.home-notifications { margin: 1.5rem 0; }
.notif-banner {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius);
    padding: 1rem 1.3rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    box-shadow: var(--shadow);
}
.notif-banner-icon { color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.notif-banner-list { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.notif-banner-item { font-size: 0.95rem; }
.notif-banner-item strong { color: var(--primary-dark); margin-left: 0.4rem; }
.notif-banner-item span { color: var(--text-muted); }

/* ==================== آیکون‌های SVG ==================== */
.icon-inline {
    width: 1.3em; height: 1.3em;
    vertical-align: -0.25em;
    margin-left: 0.3rem;
    display: inline-block;
}
.mini-lock-svg { vertical-align: middle; margin-right: 2px; opacity: 0.7; }
.cube-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
}
.anti-cheat-note {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.85;
}
.btn svg { vertical-align: middle; margin-left: 0.3rem; }

/* ==================== ادمین موبایل ==================== */
@media (max-width: 768px) {
    .admin-sections { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-nav { flex-direction: column; }
    .admin-nav .btn { width: 100%; }
    .admin-table { font-size: 0.85rem; }
    .admin-table th, .admin-table td { padding: 0.5rem 0.6rem; }
    .podium { gap: 0.4rem; }
    .podium-place { width: 90px; }
    .podium-avatar { width: 42px; height: 42px; font-size: 1.1rem; }
    .gold-bar { height: 80px; }
    .silver-bar { height: 55px; }
    .bronze-bar { height: 40px; }
    .otp-input { width: 42px; height: 50px; font-size: 1.4rem; }
}

/* انیمیشن‌های بیشتر */
.feature-card, .cube-card, .tournament-card, .stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover, .cube-card:hover, .tournament-card:hover {
    transform: translateY(-5px) scale(1.01);
}
.btn {
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    opacity: 0;
    transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.timer-box {
    animation: pulse-border 3s infinite;
}
@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.15); }
    50% { box-shadow: 0 0 0 6px rgba(99,102,241,0.08); }
}
.type-btn {
    transition: all 0.25s ease;
}
.type-btn:hover { transform: scale(1.05); }
.type-btn.active { transform: scale(1.05); box-shadow: 0 4px 12px rgba(99,102,241,0.3); }

/* جلوگیری از انتخاب متن */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
input, textarea, .otp-input, .form-control {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* لوگو متحرک */
.animated-logo {
    display: inline-flex;
    align-items: center;
}
.logo-cube-svg {
    animation: logoSpin 6s ease-in-out infinite;
    transform-origin: center;
}
@keyframes logoSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(8deg) scale(1.08); }
    50% { transform: rotate(0deg) scale(1); }
    75% { transform: rotate(-8deg) scale(1.08); }
}
.svg-check { color: #10b981; font-weight: 800; }
.svg-cross { color: #ef4444; font-weight: 800; }
.svg-wait { color: #f59e0b; }
.svg-admin { 
    background: #f59e0b; color: white; 
    font-size: 0.7rem; padding: 0.1rem 0.35rem; 
    border-radius: 4px; font-weight: 700;
}
.feature-icon svg { display: block; margin: 0 auto 0.5rem; }

/* بج به زودی */
.soon-badge {
    display: block;
    font-size: 0.65rem;
    color: #ef4444;
    font-weight: 700;
    margin-top: 2px;
}
.soon-text { color: #64748b; }
.soon-text strong { color: #ef4444; }

/* راهنمای حل */
.solve-guide {
    margin-top: 2.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.solve-guide h2 {
    font-size: 1.25rem;
    margin-bottom: 1.2rem;
    text-align: center;
}
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.guide-step {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 0.8rem;
    background: #f8fafc;
    border-radius: 10px;
    transition: transform 0.2s;
}
.guide-step:hover { transform: translateX(-4px); }
.step-num {
    flex-shrink: 0;
    width: 32px; height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.9rem;
}
.guide-step strong { display: block; margin-bottom: 0.2rem; }
.guide-step p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }
.guide-note {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* امکانات وسط‌چین */
.features-grid .feature-card {
    text-align: center;
}
.features-grid .feature-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.7rem;
}
.features-grid .feature-card h3,
.features-grid .feature-card p {
    text-align: center;
}

/* منوی موبایل وسط‌چین برای ورود/ثبت‌نام */
@media (max-width: 768px) {
    .nav-menu .btn-nav {
        text-align: center;
        display: block;
        width: 100%;
    }
    .nav-menu li {
        text-align: center;
    }
    .nav-menu a {
        text-align: center;
        justify-content: center;
    }
    .user-menu {
        align-items: center;
        width: 100%;
    }
}

/* انیمیشن صفحات احراز هویت */
.auth-card {
    animation: authEntrance 0.6s ease-out;
}
@keyframes authEntrance {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-form .form-group {
    animation: fadeSlide 0.5s ease-out both;
}
.auth-form .form-group:nth-child(1) { animation-delay: 0.1s; }
.auth-form .form-group:nth-child(2) { animation-delay: 0.18s; }
.auth-form .form-group:nth-child(3) { animation-delay: 0.26s; }
.auth-form .form-group:nth-child(4) { animation-delay: 0.34s; }
.auth-form .form-group:nth-child(5) { animation-delay: 0.42s; }
@keyframes fadeSlide {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.auth-form .btn {
    animation: fadeSlide 0.5s ease-out 0.45s both;
}
.otp-container {
    animation: fadeSlide 0.5s ease-out 0.2s both;
}
.otp-input {
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.otp-input:focus {
    transform: scale(1.12);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
}
.auth-header {
    animation: fadeSlide 0.5s ease-out both;
}
.auth-icon-svg svg {
    animation: iconPop 0.6s ease-out;
}
@keyframes iconPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.type-btn.disabled-soon {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    background: #f1f5f9;
    color: #94a3b8;
}
.type-btn.disabled-soon .soon-badge {
    color: #ef4444;
}

/* قوانین */
.terms-page { max-width: 800px; margin: 0 auto; }
.terms-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem 1.8rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.terms-section { margin-bottom: 1.6rem; }
.terms-section h2 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 0.6rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}
.terms-section ul {
    padding-right: 1.2rem;
    margin: 0;
}
.terms-section li {
    margin-bottom: 0.45rem;
    color: var(--text);
    line-height: 1.75;
    font-size: 0.95rem;
}
.terms-updated {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

/* تیک قوانین در ثبت‌نام */
.terms-check { margin-top: 0.5rem; }
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.5;
}
.terms-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: pointer;
}
.checkbox-label a {
    color: var(--primary);
    text-decoration: underline;
}

.notif-admin-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.notif-admin-body { flex: 1; }
.notif-admin-item .btn-danger {
    flex-shrink: 0;
    white-space: nowrap;
}

.row-banned { background: #fef2f2 !important; }
.row-cheat { background: #fff7ed !important; }
.ban-badge {
    display: inline-block;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 700;
}
.ban-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-bottom: 0.35rem;
}
.ban-form .form-control-sm {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    min-width: 90px;
}
.actions-cell { min-width: 220px; }
.form-control-sm { max-width: 140px; }

/* تبلیغات دسکتاپ */
.desktop-only { display: none; }
@media (min-width: 992px) {
    .desktop-only { display: block; }
}
.ad-slot {
    overflow: hidden;
}
/* تبلیغ صفحه اصلی — هم‌اندازه کارت امکانات، بدون پس‌زمینه سفید */
.ad-slot-home.feature-card {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    min-height: 150px;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    height: 100%;
    display: flex !important;
    align-items: stretch;
    justify-content: center;
}
.ad-slot-home:hover {
    transform: none !important;
    box-shadow: none !important;
}
.ad-slot-home .ad-placeholder {
    width: 100%;
    max-width: 300px;
    min-height: 150px;
    height: 150px;
    border: 2px dashed #94a3b8;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: transparent;
    color: #64748b;
    text-align: center;
    padding: 1rem;
}
.ad-slot-home .ad-link {
    display: flex;
    width: 100%;
    max-width: 300px;
    height: 150px;
    min-height: 150px;
    align-items: center;
    justify-content: center;
}
.ad-slot-home .ad-image {
    width: 100%;
    max-width: 300px;
    height: 150px;
    min-height: 150px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.ad-slot-cube {
    margin-top: 1.2rem;
    min-height: 200px;
}
.ad-placeholder {
    width: 100%;
    min-height: 140px;
    border: 2px dashed #94a3b8;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    padding: 1rem;
}
.ad-slot-cube .ad-placeholder { min-height: 180px; }
.ad-label { font-weight: 700; font-size: 0.95rem; color: #475569; }
.ad-size { font-size: 0.9rem; font-weight: 600; color: #6366f1; font-variant-numeric: tabular-nums; }
.ad-hint { font-size: 0.75rem; opacity: 0.8; }
.ad-link { display: block; width: 100%; height: 100%; }
.ad-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}
@media (max-width: 991px) {
    .ad-slot, .desktop-only { display: none !important; }
}

/* اعلان‌های رنگی صفحه اصلی — متن کامل */
.notif-banner-list-full {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.notif-card {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    border: 1px solid transparent;
    box-shadow: var(--shadow);
}
.notif-card-icon { flex-shrink: 0; margin-top: 2px; }
.notif-card-body { flex: 1; min-width: 0; }
.notif-card-title {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.35rem;
}
.notif-card-msg {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.notif-color-blue {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-color: #c7d2fe;
    color: #3730a3;
}
.notif-color-blue .notif-card-icon { color: #4f46e5; }
.notif-color-blue .notif-card-msg { color: #4338ca; }

.notif-color-green {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #a7f3d0;
    color: #065f46;
}
.notif-color-green .notif-card-icon { color: #059669; }
.notif-color-green .notif-card-msg { color: #047857; }

.notif-color-yellow {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
    color: #92400e;
}
.notif-color-yellow .notif-card-icon { color: #d97706; }
.notif-color-yellow .notif-card-msg { color: #b45309; }

.notif-color-red {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fecaca;
    color: #991b1b;
}
.notif-color-red .notif-card-icon { color: #dc2626; }
.notif-color-red .notif-card-msg { color: #b91c1c; }

.notif-color-purple {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-color: #ddd6fe;
    color: #5b21b6;
}
.notif-color-purple .notif-card-icon { color: #7c3aed; }
.notif-color-purple .notif-card-msg { color: #6d28d9; }

.notif-color-pink {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
    border-color: #fbcfe8;
    color: #9d174d;
}
.notif-color-pink .notif-card-icon { color: #db2777; }
.notif-color-pink .notif-card-msg { color: #be185d; }

.notif-color-teal {
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    border-color: #99f6e4;
    color: #115e59;
}
.notif-color-teal .notif-card-icon { color: #0d9488; }
.notif-color-teal .notif-card-msg { color: #0f766e; }

/* انتخاب رنگ در پنل */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.color-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.9rem;
}
.swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid rgba(0,0,0,0.1);
    display: inline-block;
}
.swatch-blue { background: #6366f1; }
.swatch-green { background: #10b981; }
.swatch-yellow { background: #f59e0b; }
.swatch-red { background: #ef4444; }
.swatch-purple { background: #8b5cf6; }
.swatch-pink { background: #ec4899; }
.swatch-teal { background: #14b8a6; }

/* قفل کامل هنگام Debug / Inspect */
#debug-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: rgba(15, 23, 42, 0.97);
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    user-select: none;
}
.debug-lock-box {
    text-align: center;
    color: #f8fafc;
    padding: 2rem;
    max-width: 420px;
}
.debug-lock-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}
.debug-lock-box h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #f87171;
    margin-bottom: 1rem;
    text-transform: lowercase;
}
.debug-lock-box p {
    color: #cbd5e1;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}
.debug-lock-hint {
    margin-top: 1.2rem !important;
    color: #94a3b8 !important;
    font-size: 0.9rem;
}
html.debug-locked,
html.debug-locked body {
    overflow: hidden !important;
}
html.debug-locked body > *:not(#debug-lock-overlay) {
    filter: blur(8px);
    pointer-events: none !important;
}

/* کلمات کلیدی سئو در فوتر */
.seo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    justify-content: center;
    padding: 1rem 0 0.25rem;
    font-size: 0.75rem;
    color: #94a3b8;
    opacity: 0.85;
}
.seo-tags span {
    white-space: nowrap;
}
.seo-tags span::before {
    content: "#";
    opacity: 0.6;
}

.seo-lead {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}


/* SPA transitions */
#app-main.spa-loading {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
#app-main.spa-enter {
    animation: spaFadeIn 0.35s ease;
}
@keyframes spaFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.recaptcha-wrap {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
    transform: scale(0.95);
    transform-origin: center;
}


.forgot-link {
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }


/* دکمه‌های دانلود هدر */
.nav-dl-item { list-style: none; }
.btn-dl {
    position: relative;
    display: inline-flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    color: #fff !important;
    overflow: hidden;
    text-decoration: none !important;
    border: none !important;
    background: transparent;
    white-space: nowrap;
}
.btn-dl span { position: relative; z-index: 1; }
.btn-dl svg {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    /* در RTL آیکون سمت راست متن (بعد از متن در flex با dir rtl می‌شود راست) */
    order: 2;
}
.btn-dl span { order: 1; }
.btn-dl-blue {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-dl-blue:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
    color: #fff !important;
    transform: translateY(-1px);
}
.btn-dl-green {
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}
.btn-dl-green:hover {
    background: linear-gradient(135deg, #15803d, #16a34a) !important;
    color: #fff !important;
    transform: translateY(-1px);
}
/* نور عبوری هر ۶ ثانیه */
.btn-dl::after {
    content: '';
    position: absolute;
    top: 0;
    right: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.45),
        transparent
    );
    transform: skewX(-20deg);
    animation: dlShine 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}
.btn-dl-green::after {
    animation-delay: 0.8s;
}
@keyframes dlShine {
    0%, 70% { right: -60%; opacity: 0; }
    75% { opacity: 1; }
    90% { right: 120%; opacity: 1; }
    100% { right: 120%; opacity: 0; }
}

@media (max-width: 992px) {
    .btn-dl {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1rem !important;
        font-size: 0.9rem !important;
        margin: 0.25rem 0;
    }
    .nav-dl-item {
        width: 100%;
        padding: 0 0.5rem;
    }
}

/* ورودی خانه‌ای ۷ تایی */
.char-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  direction: ltr;
  margin: 0.5rem 0 0.25rem;
  flex-wrap: nowrap;
}
.char-boxes input.char-box {
  width: 40px;
  height: 46px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  caret-color: #6366f1;
  text-transform: none;
  padding: 0;
}
.char-boxes input.char-box:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.char-boxes.password-boxes input.char-box {
  -webkit-text-security: disc;
  font-family: text-security-disc, sans-serif;
}
@media (max-width: 400px) {
  .char-boxes input.char-box {
    width: 34px;
    height: 40px;
    font-size: 1rem;
  }
  .char-boxes { gap: 5px; }
}

/* انیمیشن ورود کاراکتر */
.char-boxes input.char-box {
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.char-boxes input.char-box.char-pop {
  animation: charPop 0.28s ease;
}
@keyframes charPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.char-boxes input.char-box.char-filled {
  border-color: #6366f1;
  background: #eef2ff;
}

.email-split {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  direction: ltr;
  width: 100%;
}
.email-split .email-local {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
}
.email-split .email-at {
  font-weight: 700;
  color: #64748b;
  flex: 0 0 auto;
}
.email-split .email-domain {
  flex: 0 0 auto;
  width: auto;
  max-width: 42%;
  min-width: 110px;
}
@media (max-width: 480px) {
  .email-split { flex-wrap: nowrap; gap: 4px; }
  .email-split .email-domain {
    max-width: 40%;
    min-width: 100px;
    font-size: 0.85rem;
    padding-left: 6px;
    padding-right: 6px;
  }
  .email-split .email-local {
    font-size: 0.9rem;
    padding-left: 8px;
    padding-right: 8px;
  }
}

.email-split {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  direction: ltr;
  width: 100%;
}
.email-split .email-local {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
}
.email-split .email-at {
  font-weight: 700;
  color: #64748b;
  flex: 0 0 auto;
}
.email-split .email-domain {
  flex: 0 0 auto;
  width: auto;
  max-width: 42%;
  min-width: 110px;
}
@media (max-width: 480px) {
  .email-split { flex-wrap: nowrap; gap: 4px; }
  .email-split .email-domain {
    max-width: 40%;
    min-width: 100px;
    font-size: 0.85rem;
    padding-left: 6px;
    padding-right: 6px;
  }
  .email-split .email-local {
    font-size: 0.9rem;
    padding-left: 8px;
    padding-right: 8px;
  }
}
