:root {
    --bg-dark: #040712; 
    --bg-card: #0b1021; 
    --bg-input: #121933;
    --accent-green: #10b981; 
    --accent-amber: #f59e0b; 
    --accent-red: #ef4444;
    --accent-blue: #2563eb; 
    --text-white: #f8fafc; 
    --text-muted: #64748b;
}

*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
}

body { 
    background-color: var(--bg-dark); 
    color: var(--text-white); 
    min-height: 100vh; 
    overflow-x: hidden; 
}

/* === СИСТЕМНЫЕ СЛОИ И ОВЕРЛЕИ === */
.system-overlay-layer { 
    position: fixed; 
    inset: 0; 
    background: radial-gradient(circle at center, #0a0f24 0%, #02040a 100%); 
    z-index: 999; 
    display: none; 
    justify-content: center; 
    align-items: center; 
    padding: 20px; 
}

.system-overlay-layer.active { 
    display: flex; 
}

#lockoutScreen { 
    z-index: 10000; 
    background: #03050d; 
}

.lock-card { 
    background: #090d1a; 
    border: 2px solid var(--accent-red); 
    padding: 40px; 
    border-radius: 24px; 
    max-width: 450px; 
    width: 100%; 
    text-align: center; 
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.2); 
}

.lock-icon { 
    font-size: 64px; 
    margin-bottom: 20px; 
    animation: pulseLock 2s infinite; 
}

.support-box { 
    background: rgba(239,68,68,0.1); 
    border: 1px dashed var(--accent-red); 
    color: #fca5a5; 
    padding: 15px; 
    border-radius: 12px; 
    margin-top: 25px; 
    font-weight: bold; 
}

@keyframes pulseLock { 
    0%, 100% { transform: scale(1); } 
    50% { transform: scale(1.05); } 
}

.gate-card { 
    background: var(--bg-card); 
    border: 1px solid #1e293b; 
    padding: 35px; 
    border-radius: 20px; 
    max-width: 440px; 
    width: 100%; 
    box-shadow: 0 25px 50px rgba(0,0,0,0.5); 
    text-align: center; 
    position: relative; 
    z-index: 10; 
}

.ai-pulse-logo { 
    font-size: 48px; 
    margin-bottom: 15px; 
    animation: aiPulse 2.5s infinite; 
}

@keyframes aiPulse { 
    0%, 100% { opacity: 0.6; } 
    50% { opacity: 1; } 
}

.terms-mini-list { 
    text-align: left; 
    background: rgba(0,0,0,0.2); 
    padding: 15px; 
    border-radius: 12px; 
    margin: 20px 0; 
}

.term-i { 
    font-size: 13px; 
    color: #94a3b8; 
    margin-bottom: 8px; 
}

.auth-blur-box { 
    background: rgba(11, 16, 33, 0.85); 
    backdrop-filter: blur(10px); 
    border-color: #334155; 
}

.matrix-loader { 
    margin-bottom: 25px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 12px; 
}

.spinner-core { 
    width: 60px; 
    height: 60px; 
    border: 3px solid rgba(37, 99, 235, 0.1); 
    border-top-color: var(--accent-blue); 
    border-bottom-color: var(--accent-green); 
    border-radius: 50%; 
    animation: spin 1.2s linear infinite; 
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

.loader-text { 
    font-family: monospace; 
    font-size: 11px; 
    letter-spacing: 2px; 
    color: var(--accent-blue); 
    font-weight: bold; 
}

.scan-line-effect { 
    position: absolute; 
    inset: 0; 
    pointer-events: none; 
    background: linear-gradient(rgba(16, 185, 129, 0) 95%, rgba(16, 185, 129, 0.15) 98%, rgba(16, 185, 129, 0) 100%); 
    background-size: 100% 40px; 
    animation: scanLineMove 6s linear infinite; 
}

@keyframes scanLineMove { 
    from { background-position: 0 0; } 
    to { background-position: 0 100vh; } 
}

/* === ШАПКА И ПАНЕЛЬ С СЕЛЕКТОРОМ ЯЗЫКОВ === */
.app-header { 
    background: #080d1c; 
    border-bottom: 1px solid #1e2a4a; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
}

.header-main-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 40px; 
    min-height: 70px; 
}

.logo-neon { 
    font-size: 20px; 
    font-weight: 900; 
    color: #fff; 
    text-shadow: 0 0 10px rgba(37, 99, 235, 0.6); 
}

.live-sub-panel { 
    display: flex; 
    align-items: center; 
    gap: 25px; 
    background: rgba(0,0,0,0.2); 
    padding: 8px 20px; 
    border-radius: 10px; 
    border: 1px solid #141f3d; 
}

.lang-selector-wrapper {
    display: flex;
    align-items: center;
}

.lang-dropdown {
    background: #111a36;
    border: 1px solid #223263;
    color: var(--text-white);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.lang-dropdown:hover, .lang-dropdown:focus {
    border-color: var(--accent-blue);
}

.lang-dropdown option {
    background: #0b1021;
    color: var(--text-white);
}

.sub-info-block { 
    font-size: 14px; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.sub-lbl { 
    color: var(--text-muted); 
}

.white-text { 
    color: var(--text-white); 
    font-weight: bold; 
}

.logout-btn { 
    background: rgba(239, 68, 68, 0.1); 
    border: 1px solid rgba(239, 68, 68, 0.3); 
    color: #fca5a5; 
    padding: 6px 14px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 12px; 
    font-weight: bold; 
    transition: all 0.2s; 
}

.logout-btn:hover { 
    background: var(--accent-red); 
    color: white; 
}

/* === ВЕРСТКА НОВОГО КИБЕРСПОРТИВНОГО ДАШБОРДА === */
.main-app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-dashboard { 
    padding: 40px; 
    max-width: 1300px; 
    width: 100%;
    margin: 0 auto; 
    flex-grow: 1;
    display: flex; 
    flex-direction: column; 
}

.welcome-banner { 
    margin-bottom: 35px; 
}

.welcome-banner h1 { 
    font-size: 26px; 
    font-weight: 800; 
    margin-bottom: 6px; 
}

.welcome-banner p { 
    color: var(--text-muted); 
    font-size: 14px; 
}

/* Улучшенная сетка */
.slots-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); 
    gap: 30px; 
    margin-bottom: 40px; 
}

.slots-grid.hidden { 
    display: none; 
}

/* ПРЕМИУМ КАРТОЧКА СЛОТА С ЯРКОЙ ФОНОВОЙ ИКОНКОЙ */
.slot-card { 
    background: var(--bg-card); 
    border: 1px solid #1c2642; 
    border-radius: 20px; 
    position: relative;
    overflow: hidden; 
    cursor: pointer; 
    min-height: 220px;
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.3s, box-shadow 0.4s;
}

/* Технологичный фон для каждой карточки */
.slot-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(11, 16, 33, 0.90) 30%, rgba(4, 7, 18, 0.70) 100%);
    z-index: 2;
}

/* Позиционирование фоновой картинки-иконки */
.slot-background-holder {
    position: absolute;
    right: -20px;
    bottom: -10px;
    width: 200px;
    height: 200px;
    z-index: 1;
    opacity: 0.35; /* Сделали картинку ярче в обычном состоянии */
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s, filter 0.4s;
}

.slot-icon-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Цветовое неоновое свечение граней при ховере */
.slot-card.theme-aviator:hover { border-color: #ef4444; box-shadow: 0 15px 45px rgba(239, 68, 68, 0.25); }
.slot-card.theme-chicken:hover { border-color: #f59e0b; box-shadow: 0 15px 45px rgba(245, 158, 11, 0.25); }
.slot-card.theme-tappy:hover { border-color: #3b82f6; box-shadow: 0 15px 45px rgba(59, 130, 246, 0.25); }

/* Эффекты при наведении на карточку */
.slot-card:hover {
    transform: translateY(-6px);
}

.slot-card:hover .slot-background-holder {
    opacity: 0.70; /* Картинка становится значительно ярче и четче при наведении */
    transform: scale(1.15) rotate(-5deg);
    filter: drop-shadow(0 0 25px rgba(255,255,255,0.2));
}

/* Контентная часть (поверх фона) */
.slot-body { 
    padding: 25px 25px 15px 25px; 
    position: relative;
    z-index: 3; 
    flex-grow: 1; 
}

.slot-body h3 { 
    font-size: 21px; 
    font-weight: 800;
    margin-bottom: 10px; 
    letter-spacing: 0.5px;
    color: var(--text-white);
}

.slot-body p { 
    font-size: 13.5px; 
    color: #cbd5e1; /* Сделали текст немного светлее для лучшей читаемости */
    line-height: 1.6; 
    max-width: 80%; 
}

.slot-online-status {
    margin-top: 15px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
}

.slot-online-status strong {
    color: #38bdf8;
}

/* Нижняя плашка карточки */
.slot-footer { 
    background: rgba(4, 7, 18, 0.6); 
    padding: 15px 25px; 
    position: relative;
    z-index: 3;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.badge { 
    font-size: 11px; 
    font-weight: 700; 
    padding: 4px 10px; 
    border-radius: 20px; 
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.25); }

.btn-go { 
    font-size: 13px; 
    font-weight: 700; 
    color: var(--text-white); 
    background: rgba(255,255,255,0.08);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    transition: all 0.3s ease;
}

.slot-card:hover .btn-go {
    background: var(--text-white);
    color: var(--bg-dark);
    border-color: var(--text-white);
    box-shadow: 0 4px 15px rgba(255,255,255,0.3);
}

/* === ВСЁ ОСТАЛЬНОЕ (ФРЕЙМ, ФУТЕР, КНОПКИ) === */
.slot-viewer-wrapper { 
    display: none; 
    background: var(--bg-card); 
    border: 1px solid #1c2642; 
    border-radius: 20px; 
    overflow: hidden; 
    margin-bottom: 40px; 
}

.slot-viewer-wrapper.active { 
    display: block; 
}

.viewer-header { 
    background: #0f1630; 
    padding: 15px 25px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #1c2642; 
}

.back-to-hub-btn { 
    background: #1e294b; 
    border: none; 
    color: white; 
    padding: 8px 16px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 13px; 
}

.btn { 
    width: 100%; 
    padding: 14px; 
    border: none; 
    border-radius: 12px; 
    font-weight: 700; 
    font-size: 14px; 
    cursor: pointer; 
    margin-top: 10px; 
    text-transform: uppercase; 
}

.btn-green { background: var(--accent-green); color: white; }
.btn-amber { background: var(--accent-amber); color: #000; }
.btn-blue { background: var(--accent-blue); color: white; }

input { 
    width: 100%; 
    padding: 14px; 
    background: var(--bg-input); 
    border: 1px solid #2e3d70; 
    border-radius: 12px; 
    color: white; 
    font-size: 14px; 
    margin-bottom: 15px; 
    outline: none; 
    text-align: center; 
}

.green-text { color: var(--accent-green) !important; }
.amber-text { color: var(--accent-amber) !important; }

.app-cyber-footer { 
    margin-top: auto; 
    border-top: 1px solid #1c2642; 
    background: #060917; 
    margin-left: -40px; 
    margin-right: -40px; 
    padding: 0 40px 25px 40px; 
}

.footer-grid { 
    display: grid; 
    grid-template-columns: 2fr 1fr; 
    gap: 40px; 
    padding-top: 25px; 
}

.footer-about h4, .footer-status-box h4 { 
    font-size: 12px; 
    letter-spacing: 2px; 
    color: #3b82f6; 
    margin-bottom: 12px; 
    font-weight: 800; 
}

.footer-about p { 
    font-size: 13px; 
    color: var(--text-muted); 
    line-height: 1.6; 
}

.footer-status-box { 
    background: rgba(0,0,0,0.2); 
    padding: 15px; 
    border-radius: 12px; 
    border: 1px solid #121930; 
    font-size: 13px; 
}

.status-line { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 8px; 
    border-bottom: 1px dashed #1c2642; 
    padding-bottom: 6px; 
}

.status-line:last-child { 
    margin-bottom: 0; 
    border: none; 
    padding-bottom: 0; 
}

.status-line span { color: var(--text-muted); }

.footer-bottom-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-top: 1px solid #121930; 
    padding-top: 20px; 
    font-size: 12px; 
    color: #475569; 
}

.admin-call-btn { 
    background: none; 
    border: none; 
    color: #334155; 
    font-size: 12px; 
    cursor: pointer; 
    text-decoration: underline; 
}

.ticker-wrap { 
    width: 100%; 
    overflow: hidden; 
    background: #02040a; 
    border-bottom: 1px solid #111827; 
    padding: 10px 0; 
}

.ticker { 
    display: inline-block; 
    white-space: nowrap; 
    padding-left: 100%; 
    animation: tickerMove 25s linear infinite; 
}

.ticker-item { 
    display: inline-block; 
    padding: 0 30px; 
    font-family: monospace; 
    font-size: 11px; 
    color: #38bdf8; 
}

@keyframes tickerMove { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }

.notification-container { 
    position: fixed; 
    top: 20px; 
    right: 20px; 
    z-index: 99999; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    max-width: 360px; 
    width: 100%; 
}

.push-toast { 
    background: #0d1530; 
    border-left: 4px solid var(--accent-blue); 
    padding: 16px 20px; 
    border-radius: 8px; 
    color: white; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 
    font-size: 14px; 
    line-height: 1.4; 
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; 
}

.push-toast.system-welcome { border-left-color: var(--accent-green); }
.push-toast.broadcast { border-left-color: var(--accent-amber); }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.push-toast.fade-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

.admin-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); z-index: 2000; display: none; justify-content: center; align-items: center; padding: 20px; }
.admin-modal.active { display: flex; }
.admin-modal-content { background: #0c1226; border: 1px solid #2a3a6e; width: 100%; max-width: 600px; border-radius: 20px; padding: 25px; max-height: 90vh; overflow-y: auto; }
.admin-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #1c2642; padding-bottom: 15px; }
.admin-close-btn { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.admin-table-wrapper { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.admin-table th, .admin-table td { padding: 12px; border-bottom: 1px solid #1c2642; }

/* === RTL СТИЛИ ДЛЯ АРАБСКОЙ ЛОКАЛИЗАЦИИ === */
.rtl-lang { 
    direction: rtl; 
    text-align: right; 
}
.rtl-lang .live-sub-panel, .rtl-lang .sub-info-block { 
    flex-direction: row-reverse; 
}
.rtl-lang .slot-footer { 
    flex-direction: row-reverse; 
}
.rtl-lang .slot-background-holder {
    right: auto;
    left: -20px;
}
.rtl-lang .slot-body p {
    max-width: 80%;
    margin-right: 0;
    margin-left: auto;
}
.rtl-lang .back-to-hub-btn {
    order: 2;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
    .header-main-row { padding: 15px 20px; flex-direction: column; gap: 15px; text-align: center; }
    .live-sub-panel { flex-direction: column; gap: 10px; width: 100%; justify-content: center; }
    .slots-grid { grid-template-columns: 1fr; }
    .slot-background-holder { width: 150px; height: 150px; right: -10px; bottom: -10px; opacity: 0.50; }
    .slot-card:hover .slot-background-holder { opacity: 0.85; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .app-cyber-footer { margin-left: -20px; margin-right: -20px; padding: 0 20px 25px 20px; }
    .footer-bottom-bar { flex-direction: column; gap: 15px; text-align: center; }
}