* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: #fff;
    min-height: 100vh;
    background-attachment: fixed; /* FIXED: Keep gradient fixed on scroll */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative; /* FIXED: Added for proper positioning */
}

/* Loading Overlay - FIXED: Ensure it covers everything */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#loading-overlay.loaded {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(253, 187, 45, 0.3);
    border-top: 4px solid #fdbb2d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #fdbb2d;
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(to right, #fdbb2d, #b21f1f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; /* FIXED: Added standard property */
}

nav ul {
    display: flex;
    list-style: none;
    gap: 15px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 5px;
    display: block;
}

nav a:hover, 
nav a.active {
    color: #fdbb2d;
    background: rgba(253, 187, 45, 0.1);
    transform: translateY(-2px);
}

/* FIXED: Mobile menu styles */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle[aria-expanded="true"] {
    color: #fdbb2d;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    nav {
        display: none;
        width: 100%;
        margin-top: 15px;
    }
    
    nav.active {
        display: block;
    }
    
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
}

.hero {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 30px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 20px;
    color: #f8f8f8;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(to right, #fdbb2d, #b21f1f);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.games-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, #fdbb2d, #b21f1f);
    border-radius: 2px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.game-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transform: translateY(0);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

.game-image {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.game-card:hover .game-image img {
    transform: scale(1.05);
}

/* FIXED: Added fallback for .game-image i when no image */
.game-image i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
}

.game-content {
    padding: 15px;
}

.game-content h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #fff;
}

.game-content p {
    color: #e0e0e0;
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    min-height: 60px; /* Changed from fixed height to min-height */
    overflow: hidden;
}

.game-button {
    display: block;
    background: linear-gradient(to right, #1a2a6c, #b21f1f);
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}

.game-button:hover {
    background: linear-gradient(to right, #b21f1f, #1a2a6c);
    transform: translateY(-2px);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
    animation: fadeIn 1s ease;
}

.feature-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.2rem;
    color: #fdbb2d;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: #fff;
}

.feature-card p {
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Navigation Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* All Games Page */
.search-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto 25px;
}

#game-search {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 1rem;
    transition: box-shadow 0.3s;
}

#game-search:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(253, 187, 45, 0.3);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.category-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 600;
}

.category-btn:hover, 
.category-btn.active {
    background: linear-gradient(to right, #fdbb2d, #b21f1f);
    transform: translateY(-2px);
}

/* Leaderboards */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th, 
.leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th {
    background: rgba(253, 187, 45, 0.2);
    font-weight: 600;
    color: #fdbb2d;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.highlight-row {
    background: rgba(253, 187, 45, 0.15) !important;
    font-weight: 600;
}

/* Table Container for Responsive Tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 10px;
}

/* Leaderboards Section */
.leaderboards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.leaderboard-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-card h3 {
    margin-bottom: 15px;
    color: #fdbb2d;
    text-align: center;
}

/* Game Select in Leaderboard */
#game-select {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 15px;
    color: #333;
    cursor: pointer;
}

#game-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(253, 187, 45, 0.3);
}

/* Your Leaderboard Section */
.your-scores {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.score-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s;
}

.score-card:hover {
    transform: translateY(-5px);
}

.score-card h4 {
    margin-bottom: 10px;
    color: #fdbb2d;
    font-size: 1.1rem;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
}

.total-score {
    background: rgba(253, 187, 45, 0.2);
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
}

/* Login/Signup Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f);
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close {
    color: #fff;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #fdbb2d;
    transform: scale(1.1);
}

.form-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: #fdbb2d;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #fff;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    color: #333;
    transition: box-shadow 0.3s;
}

.form-group input:focus, 
.form-group select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(253, 187, 45, 0.3);
}

.phone-prefix {
    display: flex;
    align-items: center;
}

.phone-prefix span {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px;
    border-radius: 6px 0 0 6px;
    font-weight: bold;
    color: #333;
    border-right: 1px solid #ddd;
}

.phone-prefix input {
    border-radius: 0 6px 6px 0 !important;
    flex: 1;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(to right, #fdbb2d, #b21f1f);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    min-height: 48px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(253, 187, 45, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn .btn-text {
    display: inline-block;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .loading-spinner-btn {
    display: inline-block !important;
}

.loading-spinner-btn {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.form-footer p {
    color: #e0e0e0;
    font-size: 0.95rem;
}

.form-footer a {
    color: #fdbb2d;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
}

.form-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Profile Page */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(to right, #fdbb2d, #b21f1f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 200px;
}

.profile-info h3 {
    margin-bottom: 5px;
    font-size: 1.8rem;
    color: #fff;
}

.profile-info p {
    color: #e0e0e0;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.profile-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-card h3 {
    margin-bottom: 15px;
    color: #fdbb2d;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.3rem;
}

.balance-display {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
    color: #fff;
}

.deposit-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.deposit-form input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 1rem;
}

.deposit-btn {
    padding: 10px 20px;
    background: linear-gradient(to right, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
    white-space: nowrap;
}

.deposit-btn:hover {
    transform: translateY(-2px);
}

.game-score {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

.game-score:last-child {
    border-bottom: none;
}

.game-score .score {
    font-weight: bold;
    color: #fdbb2d;
}

/* University Filter Buttons */
.university-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.university-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 600;
}

.university-btn:hover, 
.university-btn.active {
    background: linear-gradient(to right, #fdbb2d, #b21f1f);
    transform: translateY(-2px);
}

/* Logout button */
#logout-button {
    background: linear-gradient(to right, #e74c3c, #c0392b);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    align-self: center;
}

#logout-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* Error states */
.error {
    border-color: #e74c3c !important;
    background-color: rgba(231, 76, 60, 0.1) !important;
}

.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
    min-height: 20px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced modal accessibility */
.modal[aria-hidden="true"] {
    display: none;
}

.modal[aria-hidden="false"] {
    display: block;
}

/* Skip to main content link */
a.sr-only:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    padding: 10px;
    background: #fdbb2d;
    color: #000;
    z-index: 10000;
    clip: auto;
}

footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
    padding: 5px;
}

.footer-links a:hover {
    color: #fdbb2d;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.social-icons a {
    color: white;
    font-size: 1.3rem;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.social-icons a:hover {
    color: #fdbb2d;
    background: rgba(253, 187, 45, 0.2);
    transform: translateY(-3px);
}

.copyright p {
    color: #aaa;
    font-size: 0.9rem;
}

/* ── Login badge on game cards ─────────────────────────────────────────────── */
.login-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.72);
    color: #fdbb2d;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    pointer-events: none;
    white-space: nowrap;
}
.game-image { position: relative; }

/* ── Leaderboard filters ───────────────────────────────────────────────────── */
.leaderboard-filters {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-group label {
    font-weight: 600;
    color: #fdbb2d;
    font-size: 0.95rem;
}

/* ── Categories section ────────────────────────────────────────────────────── */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.category-card {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s;
}
.category-card:hover { transform: translateY(-6px); }
.category-card i { font-size: 2.4rem; color: #fdbb2d; margin-bottom: 12px; }
.category-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.category-card p { font-size: 0.88rem; color: #ddd; margin-bottom: 14px; }

/* ── Notification toast ────────────────────────────────────────────────────── */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1a2a6c;
    color: #fff;
    padding: 14px 22px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 99999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-left: 4px solid #fdbb2d;
    max-width: 320px;
    word-break: break-word;
    animation: slideInRight 0.3s ease;
}
.notification-toast.success { border-left-color: #2ecc71; }
.notification-toast.error   { border-left-color: #e74c3c; }
@keyframes slideInRight {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ── Responsive Design ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .leaderboards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Header + nav */
    header {
        padding: 14px 0;
        margin-bottom: 16px;
        gap: 10px;
    }
    .logo h1 { font-size: 1.6rem; }
    .mobile-menu-toggle { display: block; }

    nav { display: none; width: 100%; }
    nav.active { display: block; }
    nav ul {
        flex-direction: column;
        gap: 4px;
        background: rgba(0,0,0,0.4);
        border-radius: 10px;
        padding: 10px;
    }
    nav a { padding: 10px 14px; font-size: 0.95rem; }

    /* Hero */
    .hero { padding: 24px 0; }
    .hero h2 { font-size: 1.9rem; }

    /* Games grid – 2 cols on tablet */
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    /* Modals */
    .modal-content {
        padding: 20px;
        margin: 6% auto;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Profile */
    .deposit-form { flex-direction: column; }
    .deposit-btn { width: 100%; }
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .profile-info { text-align: center; }
    #logout-button { width: 100%; margin-top: 10px; }

    /* Leaderboard */
    .leaderboard-table th,
    .leaderboard-table td { padding: 8px 6px; font-size: 0.82rem; }

    /* Score cards */
    .total-score {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .container { padding: 12px; }

    /* 1-column games on phone */
    .games-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Buttons */
    .category-filters, .university-filters { gap: 6px; }
    .category-btn, .university-btn { padding: 6px 10px; font-size: 0.78rem; }

    /* Footer */
    .footer-links { flex-direction: column; gap: 8px; align-items: center; }

    /* Score cards */
    .your-scores { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }

    /* Text */
    .hero h2 { font-size: 1.5rem; }
    .section-title { font-size: 1.35rem; }
    .form-title { font-size: 1.4rem; }

    /* Notification on mobile */
    .notification-toast {
        right: 10px;
        left: 10px;
        top: 10px;
        max-width: 100%;
    }

    /* Game cards on very small screens */
    .game-image { height: 130px; }
    .game-content { padding: 10px; }
    .game-content h3 { font-size: 1rem; }
    .game-content p { font-size: 0.82rem; min-height: 0; }
}

/* Accessibility improvements */
:focus {
    outline: 2px solid #fdbb2d;
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #fdbb2d, #b21f1f);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #b21f1f, #fdbb2d);
}
