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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4a148c 0%, #1a0933 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Анимация падающих монеток */
.coins-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.coin {
    position: absolute;
    font-size: 24px;
    opacity: 0.3;
    animation: fall linear infinite;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg);
    }
}

@keyframes swing {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(30px);
    }
}

.container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Navigation */
.navbar {
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #9c27b0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #9c27b0;
    text-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
    cursor: default;
    user-select: none;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.site-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(156, 39, 176, 0.5));
    transition: filter 0.3s ease;
}

.site-logo:hover {
    filter: drop-shadow(0 0 15px rgba(156, 39, 176, 0.8));
}

.navbar-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-btn, .logout-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

#adminPanelBtn {
    background: rgba(100, 150, 200, 0.2);
    border: 1px solid #64b5f6;
    color: #64b5f6;
    margin-left: auto;
}

#adminPanelBtn:hover {
    background: #64b5f6;
    color: #fff;
}

#adminPanelBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(100, 150, 200, 0.1);
    color: #999;
}

.nav-btn:hover, .logout-btn:hover {
    background: #9c27b0;
    color: #fff;
    transform: translateY(-2px);
}

.nav-btn.active {
    background: #9c27b0;
    color: #fff;
}

.logout-btn {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.logout-btn:hover {
    background: #f44336;
    color: #fff;
}

/* Pages */
.page {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-box {
    background: rgba(30, 10, 50, 0.95);
    border: 2px solid #9c27b0;
    border-radius: 8px;
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(156, 39, 176, 0.3);
}

.login-box h1 {
    text-align: center;
    color: #9c27b0;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
}

.login-subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #b0b0b0;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #9c27b0;
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #ba68c8;
    background: rgba(156, 39, 176, 0.1);
    box-shadow: 0 0 10px rgba(156, 39, 176, 0.3);
}

.btn-primary {
    width: 100%;
    padding: 0.8rem;
    background: #9c27b0;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: #7b1fa2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    padding: 0.8rem;
    background: rgba(100, 150, 200, 0.2);
    color: #64b5f6;
    border: 1px solid #64b5f6;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #64b5f6;
    color: #fff;
}

.btn-danger {
    background: #f44336;
    color: #fff;
}

.btn-danger:hover {
    background: #da190b;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

.error-message {
    color: #f44336;
    margin-top: 1rem;
    text-align: center;
    padding: 0.5rem;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #9c27b0;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.success-message.show {
    display: block;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
    }
    to {
        transform: translateX(0);
    }
}

/* Dashboard */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard h2 {
    margin-bottom: 2rem;
    color: #9c27b0;
    font-size: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(30, 10, 50, 0.7);
    border: 2px solid #9c27b0;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(156, 39, 176, 0.2);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    color: #9c27b0;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(156, 39, 176, 0.3);
}

/* Actions */
.actions-section {
    margin: 2rem 0;
}

.actions-section h3 {
    margin-bottom: 1rem;
    color: #9c27b0;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.action-btn {
    padding: 1rem;
    background: rgba(156, 39, 176, 0.2);
    border: 2px solid #9c27b0;
    color: #9c27b0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #9c27b0;
    color: #fff;
    transform: scale(1.05);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(30, 10, 50, 0.95);
    border: 2px solid #9c27b0;
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-large {
    max-width: 500px;
}

.modal-content h3 {
    color: #9c27b0;
    margin-bottom: 1.5rem;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: #9c27b0;
}

/* Tables */
.transactions-section, .history-section {
    margin-top: 2rem;
}

.transactions-section h3, .history-section h2 {
    color: #9c27b0;
    margin-bottom: 1rem;
}

.transactions-table, .players-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(30, 10, 50, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.transactions-table th, .players-table th {
    background: rgba(156, 39, 176, 0.2);
    padding: 1rem;
    text-align: left;
    color: #9c27b0;
    font-weight: 600;
    border-bottom: 2px solid #9c27b0;
}

.transactions-table td, .players-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(156, 39, 176, 0.1);
    color: #e0e0e0;
}

.transactions-table tr:hover, .players-table tr:hover {
    background: rgba(156, 39, 176, 0.05);
}

.transactions-table .empty, .players-table .empty {
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Settings */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.settings-container h2 {
    color: #9c27b0;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-align: center;
}

.settings-section {
    background: rgba(30, 10, 50, 0.7);
    padding: 1.5rem;
    border: 2px solid #9c27b0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(156, 39, 176, 0.3);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #b0b0b0;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="color"],
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #9c27b0;
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="color"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #ba68c8;
    background: rgba(156, 39, 176, 0.1);
    box-shadow: 0 0 10px rgba(156, 39, 176, 0.3);
}

.form-group input[type="color"] {
    height: 45px;
    cursor: pointer;
    padding: 0.4rem;
}

.form-group small {
    display: block;
    margin-top: 0.4rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-group label input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-links {
        width: 100%;
        justify-content: space-around;
        flex-wrap: wrap;
    }

    #adminPanelBtn {
        margin-left: auto;
        order: -1;
    }

    .stats-grid, .stats-grid-admin {
        grid-template-columns: 1fr;
    }

    .page {
        padding: 1rem;
    }

    .login-box {
        padding: 2rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .admin-tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
    }

    .filter-group {
        flex-direction: column;
    }

    .filter-group select, .filter-group input {
        min-width: 100%;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .action-btn {
        width: 100%;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-bar input {
        width: 100%;
    }

    .search-bar button {
        width: 100%;
    }
}