/* ============================
   HOMEPAGE
============================ */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #1e1e1e;
    color: #e9e1e1
}

.top-bar {
    background: #2a2a2a;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #444;
}

.logo {
    font-size: 26px;
    font-weight: bold;
    color: #b381eb;
    text-decoration: none; 
    cursor: pointer; 
}

.logo:hover {
    filter: brightness(1.2);
}

.search-bar {
    width: 600px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #555;
    background: #3a3a3a;
    color: white;
}

.search-bar::placeholder {
    color: #bbbbbb;
}

.user-info {
    font-size: 14px;
    color: #d3a5ea;
}

.welcome {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.welcome h2 {
    font-size: 32px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 8px;
}

.welcome p {
    font-size: 20px;
    color: #bbbbbb;
    margin-bottom: 50px;
}

.navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
    margin-bottom: 65px;
}

.navigation .btn {
    display: inline-block;    
    padding: 22px 70px;
    border-radius: 12px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.navigation .library {
    background: #b097ec;     
}

.navigation .wishlist{
    background: #81a9e9;      
}

.navigation .reviews {
    background: #eb8f4e;       
}

.navigation .btn:hover {
    transform: translateY(-4px);
    filter: brightness(1.15);
}

.popular-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 15px 1px;
}

.popular-header h3 {
    font-size: 24px;
    color: rgb(255, 255, 255);
}

.popular-header .view-all {
    color: #9b7bff;
    text-decoration: none;
    font-weight: bold;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 0 25px 5px;
}

.game-card {
    background: #2b2b2b;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: transform 0.2s;
}

.game-card:hover {
    transform: translateY(-4px);
     box-shadow: 0 0 12px rgba(155, 123, 255, 0.4);
}

.game-card img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 8px;
}

.game-card p {
    margin-top: 10px;
    color: white;
    font-size: 16px;
    text-align: center;
    min-height: 22px;
}

.user-info a {
    color: #705aa3; /* bright purple */
    font-weight: bold;
    text-decoration: none;
}

.user-info a:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

/* ============================
   LIBRARY PAGE
============================ */

.library-page .top-bar {
    margin-bottom: 20px; /* smaller, clean spacing */
}

.library-page .library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    margin-bottom: 20px;
}

.library-page .nav-left {
    display: flex;
    gap: 12px;
}

.library-page .btn.library { background: #b097ec; }
.library-page .btn.wishlist { background: #81a9e9; }
.library-page .btn.reviews { background: #eb8f4e; }


.library-page .sort-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.library-page .sort-right label {
    font-size: 14px;
    color: #ccc;
}

.library-page #sort-select {
    background: #755da4;     
    color: white;            
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}

.library-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px;
    padding: 0 25px 40px;
}

.library-item {
    background: #2b2b2b;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.library-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 12px rgba(155, 123, 255, 0.4);
}

.library-item img {
    width: 100%;
    height: 270px;
    object-fit: cover;
    border-radius: 6px;
}

.library-item h3 {
    margin: 12px auto 10px auto;
    font-size: 20px;
    color: rgb(190, 120, 230);
    text-align: center;
    width: 100%;
    min-height: 48px;  
    display: flex;
    align-items: center;
    justify-content: center;
}


.library-item select {
    padding: 6px 12px;
    background: #755da4;
    color: white;
    border: none;
    border-radius: 6px;
    width: 130px;       
    font-size: 14px;
    cursor: pointer;
}

.bottom-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 12px;       
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.remove-btn:hover {
    background: #ff6b5c;
}

/* ============================
  WISHLIST
============================ */
.wishlist-page .top-bar {
    margin-bottom: 20px;
}

.wishlist-page .btn.library { background: #b097ec; }
.wishlist-page .btn.wishlist { background: #81a9e9; }
.wishlist-page .btn.reviews { background: #eb8f4e; }

.wishlist-page .library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    margin-bottom: 20px;
}

#wishlist-sort {
    background: #755da4;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}

.wishlist-page .sort-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wishlist-page .sort-right label {
    font-size: 14px;
    color: #ccc;
}

.wishlist-page .nav-left {
    display: flex;
    gap: 12px;
}

.nav-left .btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    text-decoration: none;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.nav-left .btn:hover {
    transform: translateY(-4px);
    filter: brightness(1.15);
}

.nav-left .btn.active {
    filter: brightness(1.35);
    box-shadow: 0 0 10px rgba(122, 60, 255, 0.6);
    transform: scale(1.05);
}

/* ============================
   LOGIN
============================ */
.auth-page {
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: auto;
    justify-content: flex-start; 
    padding-top: 40px; 
    color: white;
}

.site-title {
    font-size: 48px;
    font-weight: 700;
    color: #b097ec;
    margin-top: -10px;
    margin-bottom: 60px;   
    text-align: center;
}

.auth-page  .auth-container {
    background: #2a2a2a;
    width: 90%;
    max-width: 420px;
    padding: 30px 25px;  
    border-radius: 12px;       
    box-shadow: 0 0 25px rgba(155, 123, 255, 0.25);
    transform: none; 
}

.auth-title {
    text-align: center;
    font-size: 40px;
    margin-top: 0;          
    margin-bottom: 30px;   
    color: #ddd;
}

.auth-container label {
    font-size: 18px;
    color: #ccc;
    margin-bottom: 8px;
    display: block;
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    box-sizing: border-box;
    margin-bottom: 25px;    
    border-radius: 8px;
    border: 1px solid #555;
    background: #3a3a3a;
    color: white;
    font-size: 16px;
}

.auth-btn {
    width: 50%;
    padding: 10px;
    margin: 20px auto 0;    
    background: #b097ec;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 22px;
    cursor: pointer;
    color: white;
    display: block;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.auth-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.15);
}

.auth-switch {
    text-align: center;
    margin-top: 25px;
    font-size: 16px;
}

.auth-switch a {
    color: #9b7bff;
    text-decoration: none;
    font-weight: bold;
}

/* ============================
   REGISTER
============================ */
.register-page .auth-container {
    width: 500px;
    padding: 28px 32px;
}

.register-page .auth-title {
    font-size: 34px;
    margin-bottom: 20px;
}

.register-page .auth-container label {
    font-size: 16px;
    margin-bottom: 6px;
}

.register-page .auth-input {
    padding: 10px 12px;
    font-size: 15px;
    margin-bottom: 16px;
}

.register-page .auth-btn {
    padding: 10px;
    font-size: 18px;
    margin-top: 18px;
}

/* ============================
   SEARCH
============================ */
.search-title {
    color: #ddd;
    font-size: 28px;
    margin: 30px 0 20px 40px;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 90%;
    margin-left: 80px;
    margin-bottom: 70px;
}

.search-item {
    display: flex;
    background: #2a2a2a;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(155, 123, 255, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(155, 123, 255, 0.25);
}

.search-item img {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
}

.search-item .info h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.search-item .info h3 a {
    color: #b097ec;
    text-decoration: none;
}

.search-item .info h3 a:hover {
    text-decoration: underline;
}

.search-item .type {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 6px;
}

.search-item .platforms {
    color: #ccc;
    font-size: 14px;
}

/* ============================
   MY REVIEWS PAGE
   ============================ */
.reviews-page .reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    margin: 20px 0 20px; 
    flex-direction: row;  
}

.reviews-page .nav-left {
    display: flex;
    gap: 12px;
}

.reviews-page .nav-left .btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    text-decoration: none;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.reviews-page .btn.library { background: #b097ec; }
.reviews-page .btn.wishlist { background: #81a9e9; }
.reviews-page .btn.reviews { background: #eb8f4e; }

.reviews-page .btn.active {
    filter: brightness(1.35);
    box-shadow: 0 0 10px rgba(122, 60, 255, 0.6);
    transform: scale(1.05);
}

.reviews-page .sort-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    width: auto;
    margin: 0;
}

.reviews-page .sort-right label {
    font-size: 14px;
    color: #ccc;
}

.reviews-page #review-sort {
    background: #755da4;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}

.my-reviews-list {
    width: 80%;
    margin-left: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.my-review-item {
    display: flex;
    background: #2a2a2a;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(155, 123, 255, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.my-review-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(155, 123, 255, 0.25);
}

.review-cover {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
}

.review-info h3 {
    margin: 0 0 8px;
    color: #b097ec;
    font-size: 20px;
}

.stars {
    color: gold;
    font-size: 18px;
    margin-bottom: 8px;
}

.review-text {
    color: #ccc;
    font-size: 15px;
}

.review-info h3 a {
    color: #b097ec;     
    text-decoration: none;
    font-weight: inherit;
}

.review-info h3 a:hover {
    text-decoration: underline;
}

/* ============================
   GAME PAGE 
   ============================ */
.game-header {
    display: flex;
    gap: 30px;
    background: #2a2a2a;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(155, 123, 255, 0.15);
    border: 1px solid rgba(255,255,255,0.05);
    margin-left: 40px;
    margin-right: 40px;
}

.game-cover {
    width: 240px;
    height: 350px;
    object-fit: cover;
    border-radius: 10px;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-info h2 {
    margin: 0;
    color: #eee;
    font-size: 34px;
    font-weight: 700;
}

.game-info p {
    color: #ccc;
    margin: 0;
    font-size: 20px;
}

.add-btn {
    align-self: center;
    margin-top: 20px;
    padding: 14px 22px;
    background: #6d4aff;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 0 12px rgba(155, 123, 255, 0.3);
    transition: 0.2s ease;
    width: 80%;
    max-width: 300px; 
}

.add-btn:hover {
    background: #8366ff;
    box-shadow: 0 0 18px rgba(155, 123, 255, 0.45);
}

.add-btn.remove {
    background: #e74c3c;
}

.add-btn.remove:hover {
    background: #ff6b5c;
}

.status {
    margin-top: 10px;
    font-size: 18px;
    color: #ccc;
    font-weight: 500;
    text-align: center;
}

.top-right-links {
    position: absolute;
    top: 20px;
    right: 40px;
}

.jump-link {
    color: #b097ec;
    text-decoration: none;
    font-size: 18px;
}

.jump-link:hover {
    text-decoration: underline;
}

.stars {
    color: gold;
    font-size: 20px;
    letter-spacing: 2px;
}

.back-link {
    display: inline-block;
    margin: 20px 0 20px 40px;
    color: #b097ec;
    text-decoration: none;
    font-size: 18px;
}

.back-link:hover {
    text-decoration: underline;
}

/* ============================
   TRAILERS SECTION
   ============================ */
.game-trailers {
    margin-left: 40px;
}

.trailers-container {
    margin-top: 10px;
    display: flex;
    justify-content: center; 
    gap: 20px;                
    margin-left: 40px;         
    margin-right: 40px;
}

/* ============================
   USER REVIEWS
   ============================ */
.reviews-section {
    margin-left: 40px; 
    margin-right: 40px;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.reviews-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.write-review-btn {
    background: #6d4aff;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.write-review-btn:hover {
    background: #8366ff;
}

.game-reviews-list {
    max-width: 8000px;
    margin-left: 40px;  
    margin-right: 40px;
}

.review {
    background: #2f2f2f;
    padding: 8px 14px 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.08);
}

.review-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review h4 {
    margin: 0;
    color: #eee;
    font-size: 18px;
}

.review-text {
    margin-top: 4px;
    color: #ccc;
    font-size: 16px;
    line-height: 1.35;
}

.reviews-controls select {
    background: #3a3a3a;
    color: white;
    border: 1px solid #555;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}

/* ============================
   GAME PAGE — REVIEW POPUP
   ============================ */
.review-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.review-modal.active {
    display: flex;
}

.review-content {
    background: #2a2a2a;
    width: 520px;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 0 25px rgba(155, 123, 255, 0.4);
}

.review-title {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    color: white;
}

.popup-review-top {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}

.popup-cover {
    width: 150px;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
}

.popup-game-name {
    color: #b097ec;
    font-size: 20px;
    margin: 0;
}

.popup-label {
    display: block;
    margin-top: 10px;
    margin-bottom: 6px;
    color: #ddd;
    font-size: 16px;
}

.popup-textarea {
    width: 95%;
    height: 110px;
    background: #3a3a3a;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px;
    color: white;
    resize: none;
    font-size: 15px;
}

.popup-stars {
    font-size: 24px;
    color: gold;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0px;
}

.popup-stars span {
    padding: 3px;
}

.popup-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.cancel-btn,
.submit-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

.cancel-btn {
    background: #444;
    color: white;
}

.submit-btn {
    background: #b097ec;
    color: white;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.rating-row .popup-label {
    margin: 0;
}

/* --------------------------------
   MOBILE LAYOUT
---------------------------------*/
@media (max-width: 1100px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
        gap: 4px;
    }

    .search-wrapper {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        padding: 0 10px;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .search-bar {
        width: min(500px, 80vw);
    }

    .user-info {
        width: 100%;
        text-align: left;
        margin-top: 4px;
        padding-left: 10px;
        font-size: 14px;
    }

    .nav-left {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        width: 100%;
        flex-wrap: nowrap;
        margin-top: 10px;
    }

    /* ==========================================
       MOBILE — LIBRARY PAGE
    ========================================== */
    .library-header {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .library-page .nav-left .btn,
    .wishlist-page .nav-left .btn {
        padding: 10px 15px;
        font-size: 13px;
        white-space: nowrap;
        width: auto;
    }

    .sort-right {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 10px;
    }

    #sort-select {
        width: 60%;
        max-width: 200px;
    }

    .library-cover {
        width: 100%;
        max-width: 180px;
        aspect-ratio: 3 / 4;
        object-fit: cover;
        border-radius: 8px;
    }

    .library-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        padding: 15px;
    }

    .bottom-row {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .bottom-row select,
    .bottom-row .remove-btn {
        width: 100%;
    }

    /* ==========================================
       MOBILE — REVIEWS PAGE
    ========================================== */
    .reviews-page .reviews-header {
        flex-direction: column;
        align-items: center;
        gap: 9px;
        margin: 15px 20px;
    }

    .reviews-page .nav-left {
        justify-content: center;
    }

    .reviews-page .nav-left .btn {
        padding: 10px 15px;
        font-size: 13px;
    }

    .reviews-page .sort-right {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 10px;
        margin-bottom: 6px;
        align-items: center;
        gap: 6px;
    }

    /* ==========================================
       MOBILE — AUTH PAGES (LOGIN + REGISTER)
    ========================================== */
    .auth-container {
        width: 90%;
        max-width: 420px;
        padding: 30px 25px;
    }

    .site-title {
        font-size: 36px;
        margin-bottom: 40px;
    }

    .auth-title {
        font-size: 30px;
        margin-bottom: 20px;
    }

    /* ==========================================
       MOBILE — SEARCH PAGE
    ========================================== */
    .search-results {
        margin-left: 20px;
        width: 95%;
    }

 /* ==========================================
   MOBILE — GLOBAL SECTION WRAPPER
========================================== */
.section {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 12px;
}

/* ==========================================
   MOBILE — GLOBAL SECTION WRAPPER FIX
========================================== */
@media (max-width: 768px) {
    .section:has(.game-page) {
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
}

/* ==========================================
   MOBILE — GAME PAGE
========================================== */
@media (max-width: 768px) {

    /* GAME PAGE LEFT SHIFT */
    .game-page {
        padding-left: 4px;
    }

    /* TOP LINKS */
    .game-top-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding-left: 0;
        margin-left: 0;
    }

    .game-top-links a:first-child {
        align-self: flex-start;
        margin-left: 0;
    }

    /* FIX TOP LINKS ON MOBILE */
.back-link {
    margin: 10px 0 0 8px !important;  /* small left padding */
    display: block;
}

.top-right-links {
    position: static !important;      /* remove absolute positioning */
    width: 100%;
    padding: 0 8px;
    margin-top: 4px;
    box-sizing: border-box;
    display: block;                   /* force new row */
}

.top-right-links a {
    display: block;
    text-align: right;
    margin-bottom: 10px;
}


    /* GAME HEADER */
    .game-header {
        display: flex;
        flex-direction: column;
        align-items: center;

        background: #2a2a2a;
        border-radius: 12px;
        box-shadow: 0 0 15px rgba(155, 123, 255, 0.15);
        border: 1px solid rgba(255,255,255,0.05);

        width: calc(100% - 8px);
        margin: 10px 0;
        padding: 12px;
        gap: 12px;
    }

    /* COVER */
    .game-header img,
    .game-cover {
        width: 180px;
        height: 270px;
        object-fit: cover;
        border-radius: 8px;
    }

    /* GAME INFO */
    .game-info {
        width: 100%;
        padding-left: 0;
        text-align: left;
    }

    .game-info h2 {
        font-size: 17px;
        margin-bottom: 6px;
    }

    .game-info p {
        font-size: 13px;
        margin: 0 0 4px 0;
    }

    /* BUTTON + STATUS */
    .add-btn,
    .remove-btn,
    .status {
        width: 180px;
        align-self: center;
    }

    .game-trailers {
        padding-left: 8px;   /* gentle push from left */
        margin-left: 0;
    }

    .trailers-container {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-left: 8px;   /* same spacing as title */
        margin-left: 0;
        align-items: flex-start;
    }

    .trailers-container video {
        width: 320px !important;      /* bigger than before */
        height: calc(320px * 9 / 16); /* keeps 16:9 */
        max-width: none !important;
        margin-left: 0 !important;
        object-fit: cover;
    }

    /* REVIEW SECTION — full width + left aligned */
    .reviews-section {
        width: 100%;
        padding: 0 8px;
        margin: 0;
        box-sizing: border-box;
    }

    /* HEADER — User Reviews ABOVE controls */
    .reviews-section .reviews-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
        margin: 0 0 10px 0;
        padding: 0;
    }

    .reviews-section .reviews-header h3 {
        margin: 0;
        padding: 0;
        text-align: left;
        width: 100%;
    }

    /* SORT + WRITE REVIEW — same row */
    .reviews-section .reviews-controls {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between; /* dropdown left, button right */
        width: 100%;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    /* Tighten label + dropdown spacing */
    .reviews-controls label {
        margin: 0 4px 0 0;
        padding: 0;
    }

    .reviews-controls select {
        font-size: 14px;
        margin: 0;
        padding: 2px 4px;
    }

    .write-review-btn {
        font-size: 14px;
        padding: 6px 10px;
        white-space: nowrap;
    }

    /* REVIEWS LIST — aligned perfectly under title */
    .reviews-section .game-reviews-list {
        width: 100%;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
        box-sizing: border-box;
    }

    /* REVIEW CARD — full width, no overflow */
    .reviews-section .review {
        width: 100%;
        padding: 10px;
        background: #2a2a2a;
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.05);
        box-sizing: border-box;
        overflow: hidden; /* prevents stars from spilling */
    }

    /* Username + stars row */
    .review-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 6px;
        overflow-wrap: anywhere; /* prevents pushing stars out */
    }

    .review-text {
        margin: 0;
        text-align: left;
        overflow-wrap: anywhere;
    }
}

    /* ==========================================
       MOBILE — HOMEPAGE
    ========================================== */
    .top-bar {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 12px;
    }

    .logo {
        font-size: 26px;
    }

    .search-bar {
        width: 90%;
        max-width: 400px;
    }

    .user-info {
        font-size: 14px;
        text-align: center;
    }

    .navigation {
        display: flex;
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
        padding: 0 12px;
    }

    .navigation .btn {
        padding: 12px 18px;
        font-size: 16px;
        white-space: nowrap;
    }

    .popular {
        padding: 0 10px;
    }

    .popular-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-left: 2px;
    }

    .popular-header h3 {
        font-size: 20px;
    }

    .view-all {
        font-size: 14px;
        white-space: nowrap;
    }

    .game-card img {
        width: 100%;
        height: auto;
        max-height: 300px;
        object-fit: contain;
    }

    .homepage .game-card {
    transform: scale(0.92);
    transform-origin: top center;
    }
}

/* Small phones — 1 per row */
@media (max-width: 480px) {
    .popular-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .game-card img {
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
    }
}

/* Medium phones — 2 per row */
@media (min-width: 480px) and (max-width: 700px) {
    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .game-card img {
        max-width: 220px;
    }
}

/* Large phones / small tablets — 3 per row */
@media (min-width: 700px) and (max-width: 950px) {
    .popular-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .game-card img {
        max-width: 200px;
    }
}

/* Tablets — 4 per row */
@media (min-width: 950px) and (max-width: 1200px) {
    .popular-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }

    .game-card img {
        max-width: 180px;
    }
}

/* Desktop — 5 per row */
@media (min-width: 1200px) {
    .popular-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }

    .game-card img {
        max-width: 170px;
    }
}

