* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1b2838;
    --secondary-color: #2a475e;
    --accent-color: #66c0f4;
    --dark-color: #171a21;
    --light-color: #c6d4df;
    --white: #ffffff;
    --success-color: #a4d007;
    --danger-color: #ff4d4d;
    --warning-color: #ffaa00;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--primary-color);
    color: var(--light-color);
    line-height: 1.6;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s;
}

a:hover {
    color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--dark-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--light-color);
    letter-spacing: 2px;
}

.logo span {
    color: var(--accent-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: var(--light-color);
    font-size: 14px;
    text-transform: uppercase;
}

nav a:hover, nav a.active {
    color: var(--accent-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.balance {
    color: var(--success-color);
    font-weight: bold;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(to bottom, #a4d007 5%, #536904 95%);
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #b8e60a 5%, #6c8605 95%);
}

.btn-secondary {
    background: linear-gradient(to bottom, #47bfff 5%, #1a9fff 95%);
    color: var(--white);
}

.btn-secondary:hover {
    background: linear-gradient(to bottom, #66c0f4 5%, #2a475e 95%);
}

.btn-danger {
    background: linear-gradient(to bottom, #ff4d4d 5%, #cc0000 95%);
    color: var(--white);
}

.btn-large {
    padding: 12px 30px;
    font-size: 16px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--white);
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--light-color);
}

/* Game Cards */
.games-section {
    padding: 40px 0;
}

.section-title {
    font-size: 32px;
    color: var(--white);
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.game-card {
    background: var(--secondary-color);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.game-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--dark-color);
}

.game-info {
    padding: 15px;
}

.game-title {
    font-size: 18px;
    color: var(--white);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-genre {
    font-size: 12px;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.game-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.original-price {
    text-decoration: line-through;
    color: #888;
    font-size: 14px;
}

.discount-price {
    color: var(--white);
    font-weight: bold;
    font-size: 18px;
}

.discount-tag {
    background: var(--success-color);
    color: var(--white);
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: bold;
}

/* Forms */
.auth-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 40px;
    background: var(--secondary-color);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--white);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--light-color);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: var(--dark-color);
    border: 1px solid #316282;
    border-radius: 2px;
    color: var(--white);
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.auth-container .btn {
    width: 100%;
    margin-top: 10px;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

/* Cart */
.cart-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--secondary-color);
    margin-bottom: 15px;
    border-radius: 4px;
}

.cart-item-image {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 20px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 16px;
    color: var(--white);
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 18px;
    font-weight: bold;
}

.cart-item-remove {
    padding: 5px 15px;
    background: var(--danger-color);
    color: var(--white);
    border: none;
    border-radius: 2px;
    cursor: pointer;
}

.cart-summary {
    background: var(--secondary-color);
    padding: 30px;
    margin-top: 30px;
    text-align: right;
}

.cart-total {
    font-size: 24px;
    color: var(--white);
    margin-bottom: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--secondary-color);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 4px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
}

.game-detail-cover {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.game-detail-content {
    padding: 30px;
}

.game-detail-title {
    font-size: 32px;
    color: var(--white);
    margin-bottom: 15px;
}

.game-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
}

.game-detail-description {
    color: var(--light-color);
    margin-bottom: 30px;
    line-height: 1.8;
}

.game-detail-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Admin Dashboard */
.admin-dashboard {
    display: flex;
    min-height: calc(100vh - 70px);
}

.admin-sidebar {
    width: 250px;
    background: var(--dark-color);
    padding: 20px;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li {
    margin-bottom: 10px;
}

.admin-sidebar a {
    display: block;
    padding: 10px 15px;
    color: var(--light-color);
    border-radius: 4px;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--secondary-color);
    color: var(--white);
}

.admin-content {
    flex: 1;
    padding: 30px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #316282;
}

.admin-table th {
    background: var(--dark-color);
    color: var(--white);
}

.admin-table tr:hover {
    background: rgba(102, 192, 244, 0.1);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 15px;
    background: var(--secondary-color);
    color: var(--light-color);
    border: none;
    border-radius: 2px;
    cursor: pointer;
}

.pagination button:hover,
.pagination button.active {
    background: var(--accent-color);
    color: var(--white);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 4px;
    color: var(--white);
    font-weight: bold;
    z-index: 3000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
footer {
    background: var(--dark-color);
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--light-color);
}

footer p {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-dashboard {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
    }
}
