/* ============================================================
   Дурак Онлайн — Основные стили (Премиум тёмная тема)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #12122a;
    --bg-card: #1a1a3e;
    --bg-card-hover: #222255;
    --border-color: #2a2a5a;
    --border-glow: #00d4ff;

    --text-primary: #ffffff;
    --text-secondary: #b0b0d0;
    --text-muted: #6a6a8a;

    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-gold: #ffd700;
    --accent-green: #2ecc71;
    --accent-red: #ff4757;
    --accent-orange: #ff9f43;

    --glow-blue: 0 0 20px rgba(0, 212, 255, 0.3);
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
    --glow-green: 0 0 20px rgba(46, 204, 113, 0.3);
    --glow-red: 0 0 20px rgba(255, 71, 87, 0.3);

    --gradient-primary: linear-gradient(135deg, #00d4ff, #7c3aed);
    --gradient-gold: linear-gradient(135deg, #ffd700, #ff9f43);
    --gradient-green: linear-gradient(135deg, #2ecc71, #27ae60);
    --gradient-dark: linear-gradient(145deg, #1a1a2e, #16213e);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a { color: var(--accent-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: #33ddff; }

/* ---- Кнопки ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}
.btn:hover::before { left: 100%; }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--glow-blue);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.btn-gold {
    background: var(--gradient-gold);
    color: #1a1a2e;
    box-shadow: var(--glow-gold);
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.btn-green {
    background: var(--gradient-green);
    color: #fff;
    box-shadow: var(--glow-green);
}

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}
.btn-outline:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.btn-lg { padding: 18px 48px; font-size: 18px; border-radius: var(--radius-lg); }
.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-block { width: 100%; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ---- Формы ---- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ---- Карточки ---- */
.card {
    background: var(--gradient-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--shadow-md);
}

/* ---- Модальные окна ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover { background: rgba(255,255,255,0.2); }

/* ---- Toast уведомления ---- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    min-width: 300px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.4s ease-out;
    box-shadow: var(--shadow-lg);
}

.toast.toast-win {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, #1a1a2e, #2a2a1a);
}

.toast-icon { font-size: 24px; flex-shrink: 0; }
.toast-text { font-size: 14px; color: var(--text-secondary); }
.toast-text strong { color: var(--accent-gold); }

.toast.leaving { animation: toastOut 0.3s ease-in forwards; }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
    to { transform: translateX(100%); opacity: 0; }
}

/* ---- Онлайн-плашка ---- */
.online-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 20px;
    font-size: 13px;
    color: var(--accent-green);
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
}

/* ---- Chips badge ---- */
.chips-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,159,67,0.15));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    font-weight: 600;
    color: var(--accent-gold);
}

.chips-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffe066, #ffb300 60%, #e69500);
    border: 2px solid #c77800;
    box-shadow: 0 0 6px rgba(255, 179, 0, 0.5), inset 0 -2px 3px rgba(0,0,0,0.25);
    position: relative;
    vertical-align: middle;
    flex-shrink: 0;
    font-size: 0;
    line-height: 0;
}
.chips-icon::after {
    content: '₽';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 800;
    color: #8b5e00;
    line-height: 1;
}

/* ---- Chip animation ---- */
.chip-float {
    position: fixed;
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    pointer-events: none;
    z-index: 9999;
    animation: chipFloat 1.5s ease-out forwards;
}

@keyframes chipFloat {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(1.5); }
}

/* ---- Навигация ---- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 0;
    background: rgba(10, 10, 20, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 8px 0;
    background: rgba(10, 10, 20, 0.95);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    flex-shrink: 0;
}

.nav-logo-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
}

.nav-logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .navbar { padding: 6px 0; }
    .nav-inner { padding: 0 10px; gap: 8px; }
    .nav-logo-text { display: none; }
    .nav-logo-icon { font-size: 22px; }
    .nav-actions { gap: 6px; }
    .nav-actions .btn-sm { padding: 6px 10px; font-size: 11px; }
    .online-badge { padding: 4px 8px; font-size: 11px; gap: 4px; }
    .online-badge .online-dot { width: 6px; height: 6px; }
    .chips-badge { padding: 4px 8px; font-size: 11px; gap: 3px; }
    .chips-icon { width: 14px; height: 14px; border-width: 1.5px; }
    .chips-icon::after { font-size: 8px; }
}

/* ---- Контейнер ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Утилиты ---- */
.show-mobile { display: none; }
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: inline !important; }
}
@media (max-width: 480px) {
    .hide-mobile-sm { display: none !important; }
}

.text-center { text-align: center; }
.text-gold { color: var(--accent-gold); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-blue { color: var(--accent-primary); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ---- Скроллбар ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #3a3a6a; }

/* ---- Адаптивность ---- */
@media (max-width: 768px) {
    .btn-lg { padding: 14px 32px; font-size: 16px; }
    .container { padding: 0 16px; }
    .modal { padding: 24px; width: 95%; }
    .toast-container { top: 10px; right: 10px; left: 10px; }
    .toast { min-width: auto; max-width: 100%; padding: 12px 16px; font-size: 13px; }
    .toast-icon { font-size: 20px; }
    .toast-text { font-size: 13px; }
}

/* ---- Загрузка ---- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    z-index: 10000;
}
