* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #0b1633;
    color: #ffffff;
}

img {
    max-width: 100%;
    height: auto;
}

/* Header */
header {
    background: rgba(7, 16, 36, 0.95);
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 88px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

nav > a {
    display: flex;
    align-items: center;
}

.logo {
    max-width: 220px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    cursor: pointer;
    filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.35));
    transition: transform 0.25s ease, filter 0.25s ease;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    display: flex;
    align-items: center;
}

.nav-menu a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    padding: 10px 16px;
    border-radius: 999px;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.nav-menu a:hover {
    background: rgba(201, 7, 7, 0.12);
    color: #ffffff;
    transform: translateY(-1px);
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 100%;
    word-break: break-word;
}

.logout-link {
    color: #f87171 !important;
}

.logout-link:hover {
    background: rgba(248, 113, 113, 0.12) !important;
    color: #ffffff !important;
}

/* Main */
main {
    padding: 30px;
}

h2,
h3 {
    margin-bottom: 20px;
    color: #22c55e;
}

/* Search */
.search-form {
    display: flex;
    gap: 12px;
    margin: 20px 0 30px 0;
    flex-wrap: wrap;
    align-items: center;
}

.search-form input,
.search-form select,
.search-form button {
    padding: 12px 14px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
}

.search-form input {
    min-width: 220px;
    background: #ffffff;
    color: #111;
}

.search-form select {
    background: #ffffff;
    color: #111;
}

.search-form button {
    background: #00e676;
    color: #001b2e;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.search-form button:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

/* Cards */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.game-card {
    background: #1e293b;
    padding: 15px;
    border-radius: 10px;
    transition: 0.3s;
    width: 100%;
}

.game-card:hover {
    transform: scale(1.03);
}

.game-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.game-card h3 {
    margin: 10px 0;
}

.game-card a {
    display: inline-block;
    margin-top: 10px;
    color: #22c55e;
    text-decoration: none;
}

/* Detail page */
.game-detail {
    max-width: 800px;
    margin: auto;
    background: #1e293b;
    padding: 30px;
    border-radius: 10px;
}

.game-detail img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 40px auto;
    background: #1e293b;
    padding: 25px;
    border-radius: 10px;
}

.form-container h2,
.form-container h3 {
    margin-bottom: 20px;
}

.form-container label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-container input,
.form-container textarea {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    margin-bottom: 10px;
}

.form-container textarea {
    height: 100px;
    resize: vertical;
}

.form-container button {
    background: #22c55e;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
}

.form-container button:hover {
    background: #16a34a;
}

/* Messages */
.message {
    background: #0f172a;
    padding: 10px;
    border-left: 4px solid #38bdf8;
    margin-bottom: 15px;
}

.success-message {
    color: #00e676;
    font-weight: bold;
    margin-bottom: 15px;
}

.error-message {
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 15px;
}

/* Reviews */
.review {
    background: #1e293b;
    padding: 15px;
    border-radius: 8px;
    margin: 15px auto;
    max-width: 800px;
}

.review-item {
    background: #0b1830;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.review-item a,
.edit-btn {
    display: inline-block;
    margin-top: 10px;
    color: #38bdf8;
    text-decoration: none;
    font-weight: bold;
}

/* Account */
.account-page {
    margin-top: 30px;
}

.account-box {
    background: #10213a;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
}

.account-form input {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
}

.account-form button {
    width: fit-content;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    background: #00e676;
    color: #001b2e;
    font-weight: bold;
    cursor: pointer;
}

/* Buttons */
.game-actions form {
    margin-top: 15px;
}

.game-actions button,
button[name="add_favorite"] {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #00e676;
    color: #001b2e;
    font-weight: bold;
    cursor: pointer;
}

/* Footer */
footer {
    padding: 20px 30px;
    color: white;
}

/* Tablet */
@media (max-width: 992px) {
    nav {
        padding: 0 18px;
    }

    .logo {
        max-width: 180px;
    }

    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .game-card img {
        height: 260px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    main {
        padding: 20px 14px;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px;
        min-height: auto;
    }

    nav > a {
        margin-bottom: 6px;
    }

    .logo {
        max-width: 150px;
    }

    .nav-menu {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a,
    .nav-menu span,
    .welcome-badge {
        width: 100%;
        display: block;
        padding: 8px 0;
        border-radius: 0;
        text-align: left;
        background: transparent;
        border: none;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input,
    .search-form select,
    .search-form button {
        width: 100%;
        min-width: 0;
    }

    .game-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .game-card img {
        height: auto;
        max-height: 320px;
    }

    .game-detail,
    .form-container {
        padding: 18px;
    }

    .account-form {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    #main-nav {
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    #main-nav.nav-hidden {
        opacity: 0;
        transform: translateY(-20px);
        pointer-events: none;
    }
}

@media (max-width: 768px) {
    #main-header {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    #main-header.header-hidden {
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
    }
}

header {
    height: auto;
}