/* ===================================
   Qatar Seen Jeem - Main Styles
   Color Palette: Maroon, Gold, White
   =================================== */

:root {
    --primary-maroon: #a29a8a;
    --secondary-white: #F9F9F9;
    --accent-gold: #ffffff;
    --text-white: #FFFFFF;
    --dark-maroon: #5A1520;
    --light-maroon: #9A2E37;
    --shadow: rgba(122, 30, 39, 0.2);
    --success: #2ECC71;
    --danger: #E74C3C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-image: 
        linear-gradient(135deg, #af1540 0%, #7d193d 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-white);
    min-height: 100vh;
    direction: rtl;
    display: flex;
    flex-direction: column;
}

body.game-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-image: 
        linear-gradient(135deg, rgba(162, 154, 138, 0.85) 0%, rgba(90, 21, 32, 0.85) 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body.index-page {
    background-image: 
        linear-gradient(135deg, rgba(162, 154, 138, 0.85) 0%, rgba(90, 21, 32, 0.85) 100%);
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===================================
   Header Styles
   =================================== */

.main-header {
    background: linear-gradient(180deg, var(--dark-maroon) 0%, rgba(90, 21, 32, 0.95) 100%);
    padding: 35px 0;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 1px rgba(255, 255, 255, 0.1) inset,
        inset 0 1px 0px rgba(255, 255, 255, 0.1);
    position: relative;
}

.main-header .container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

.logo-container {
    flex-shrink: 0;
    position: relative;
}

.logo-circle {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F0F0 50%, #FFFFFF 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.8),
        0 10px 30px rgba(0, 0, 0, 0.4),
        inset 0 -2px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 8px rgba(255, 255, 255, 0.3);
    border: 4px solid var(--text-white);
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.logo-circle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 50%;
    pointer-events: none;
}

.logo-circle:hover {
    transform: scale(1.1);
    box-shadow: 
        0 0 50px rgba(255, 255, 255, 1),
        0 15px 40px rgba(0, 0, 0, 0.5),
        inset 0 -2px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 8px rgba(255, 255, 255, 0.4);
}

.logo-circle img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.logo-circle:hover img {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) brightness(1.1);
}

.logo-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-maroon);
    line-height: 1;
}

.logo-subtext {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-maroon);
}

.app-title {
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F0F0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    letter-spacing: 1px;
}

.main-nav {
    flex-shrink: 0;
    position: absolute;
    left: 20px;
}

.nav-btn {
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F0F0 100%);
    color: var(--dark-maroon);
    border: 2px solid transparent;
    padding: 12px 28px;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Cairo', sans-serif;
    box-shadow: 
        0 6px 20px rgba(255, 255, 255, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.nav-btn:hover {
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F0F0 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(255, 255, 255, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.nav-btn:hover::before {
    left: 100%;
}

/* ===================================
   Turn Indicator
   =================================== */

@keyframes flashIndicator {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.3);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.25) 100%);
    }
}

.turn-indicator {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    animation: flashIndicator 2s ease-in-out infinite;
}

.turn-indicator:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.turn-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}

.team-turn-name {
    color: var(--text-white);
    font-weight: 800;
    font-size: 16px;
}

/* ===================================
   User Profile Section
   =================================== */

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.user-profile-section {
    display: flex;
    align-items: center;
    gap: 15px;
    position: absolute;
    right: 20px;
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 8px 14px;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-profile-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Tier-based border colors for user profile card with flash animation */
@keyframes tierBorderFlash {
    0%, 100% {
        border-color: #808080;
        box-shadow: 0 0 10px rgba(128, 128, 128, 0.5);
    }
    50% {
        border-color: #808080;
        box-shadow: 0 0 20px rgba(128, 128, 128, 0.9);
    }
}

@keyframes tierBorderFlashBronze {
    0%, 100% {
        border-color: #CD7F32;
        box-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
    }
    50% {
        border-color: #CD7F32;
        box-shadow: 0 0 20px rgba(205, 127, 50, 0.9);
    }
}

@keyframes tierBorderFlashSilver {
    0%, 100% {
        border-color: #C0C0C0;
        box-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
    }
    50% {
        border-color: #C0C0C0;
        box-shadow: 0 0 20px rgba(192, 192, 192, 0.9);
    }
}

@keyframes tierBorderFlashGold {
    0%, 100% {
        border-color: #FFD700;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    50% {
        border-color: #FFD700;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
    }
}

@keyframes tierBorderFlashPlatinum {
    0%, 100% {
        border-color: #E5E4E2;
        box-shadow: 0 0 10px rgba(229, 228, 226, 0.5);
    }
    50% {
        border-color: #E5E4E2;
        box-shadow: 0 0 20px rgba(229, 228, 226, 0.9);
    }
}

@keyframes tierBorderFlashDiamond {
    0%, 100% {
        border-color: #B9F2FF;
        box-shadow: 0 0 10px rgba(185, 242, 255, 0.5);
    }
    50% {
        border-color: #B9F2FF;
        box-shadow: 0 0 20px rgba(185, 242, 255, 0.9);
    }
}

.user-profile-card.tier-unranked {
    animation: tierBorderFlash 2s infinite;
}

.user-profile-card.tier-bronze {
    animation: tierBorderFlashBronze 2s infinite;
}

.user-profile-card.tier-silver {
    animation: tierBorderFlashSilver 2s infinite;
}

.user-profile-card.tier-gold {
    animation: tierBorderFlashGold 2s infinite;
}

.user-profile-card.tier-platinum {
    animation: tierBorderFlashPlatinum 2s infinite;
}

.user-profile-card.tier-diamond {
    animation: tierBorderFlashDiamond 2s infinite;
}

.rank-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 20px;
    color: white;
    min-width: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.rank-badge:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.rank-badge.unranked {
    background: linear-gradient(135deg, #999999 0%, #666666 100%);
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #A0641E 100%);
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.rank-badge.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #808080 100%);
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.rank-badge.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.rank-badge.platinum {
    background: linear-gradient(135deg, #E5E4E2 0%, #9D9D9D 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(229, 228, 226, 0.4);
}

.rank-badge.diamond {
    background: linear-gradient(135deg, #B9F2FF 0%, #00CED1 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 206, 209, 0.4);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rank-tier-name {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.username {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.purchases-count {
    font-size: 11px;
    opacity: 0.8;
}

/* ===== RANK DETAILS MODAL ===== */
.rank-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rank-details-modal.show {
    opacity: 1;
}

.rank-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fb 100%);
    border-radius: 24px;
    padding: 0;
    max-width: 890px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35), 
                0 0 60px rgba(138, 21, 56, 0.1);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-x: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.rank-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(138, 21, 56, 0.1);
    border: 2px solid rgba(138, 21, 56, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #8A1538;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.rank-modal-close:hover {
    background: #8A1538;
    color: white;
    transform: rotate(90deg) scale(1.1);
    border-color: #8A1538;
}

.rank-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 35px 30px 25px;
    background: linear-gradient(135deg, #8A1538 0%, #5A0F29 100%);
    position: relative;
    overflow: hidden;
}

.rank-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    z-index: 1;
}

.rank-modal-icon {
    font-size: 60px;
    line-height: 1;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.2));
    z-index: 2;
}

.rank-modal-title {
    margin: 0;
    font-size: 32px;
    color: white;
    font-weight: 800;
    z-index: 2;
    letter-spacing: -0.5px;
}

.rank-modal-info {
    background: linear-gradient(135deg, rgba(138, 21, 56, 0.05) 0%, rgba(138, 21, 56, 0.02) 100%);
    padding: 20px 30px;
    border-bottom: 2px solid rgba(138, 21, 56, 0.1);
    text-align: center;
}

.user-name-display {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

.user-name-display strong {
    color: #8A1538;
    font-weight: 800;
    display: block;
    font-size: 18px;
    margin-top: 5px;
}

.rank-points-display {
    font-size: 14px;
    color: #777;
    font-weight: 500;
    margin-top: 8px;
}

.rank-points-display strong {
    color: #8A1538;
    font-weight: 800;
    display: inline-block;
}

.rank-modal-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px;
    padding: 0;
}

.stat-item {
    background: linear-gradient(135deg, #ffffff 0%, #f5f6f8 100%);
    padding: 22px 18px;
    border-radius: 16px;
    text-align: center;
    border: 1.5px solid rgba(138, 21, 56, 0.08);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(138, 21, 56, 0.12);
    border-color: rgba(138, 21, 56, 0.15);
}

.stat-label {
    display: block;
    font-size: 11px;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, #8A1538 0%, #C41E3A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-section {
    padding: 25px 30px;
    background: linear-gradient(135deg, rgba(138, 21, 56, 0.02) 0%, rgba(138, 21, 56, 0.05) 100%);
    border-top: 2px solid rgba(138, 21, 56, 0.08);
    border-bottom: 2px solid rgba(138, 21, 56, 0.08);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.progress-percent {
    background: linear-gradient(135deg, #8A1538 0%, #C41E3A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    font-size: 16px;
}

.progress-bar {
    width: 100%;
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 0%, #e8e8e8 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8A1538 0%, #C41E3A 50%, #FF6B6B 100%);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(138, 21, 56, 0.4);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.next-tier-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    margin-bottom: 18px;
}

.next-tier-label {
    font-size: 14px;
    color: #555;
    font-weight: 600;
}

.next-tier-name {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #8A1538 0%, #C41E3A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rank-modal-benefits {
    background: white;
    padding: 30px;
    border-top: 2px solid rgba(138, 21, 56, 0.08);
}

.benefits-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.all-tier-icons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.tier-icon {
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(138, 21, 56, 0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tier-icon:hover {
    background: rgba(138, 21, 56, 0.15);
    transform: scale(1.1);
}

.rank-tier-selector {
    cursor: pointer;
}

.rank-tier-selector.tier-selected {
    background-color: rgba(212, 175, 55, 0.3);
    border: 2px solid #D4AF37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    transform: scale(1.2);
}

.rank-modal-benefits h3 {
    margin: 0;
    font-size: 16px;
    color: #2c2c2c;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.rank-modal-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.rank-modal-benefits li {
    padding: 12px;
    font-size: 13px;
    color: #555;
    border: 1px solid rgba(138, 21, 56, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-weight: 500;
    background: rgba(138, 21, 56, 0.02);
}

.rank-modal-benefits li:last-child {
    border: 1px solid rgba(138, 21, 56, 0.08);
}

.rank-modal-benefits li::before {
    content: '✓';
    color: #8A1538;
    font-weight: 900;
    margin-left: 8px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(138, 21, 56, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

/* All Ranks Modal */
.all-ranks-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.all-ranks-modal.show {
    opacity: 1;
}

.all-ranks-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.all-ranks-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.all-ranks-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 3px solid #8A1538;
    background: linear-gradient(135deg, rgba(138, 21, 56, 0.05) 0%, rgba(138, 21, 56, 0.02) 100%);
}

.all-ranks-modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: #2c2c2c;
    font-weight: 800;
}

.all-ranks-modal-close {
    background: rgba(138, 21, 56, 0.1);
    border: 2px solid rgba(138, 21, 56, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #8A1538;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.all-ranks-modal-close:hover {
    background: #8A1538;
    color: white;
    transform: rotate(90deg) scale(1.1);
}

/* Cards Container */
.all-ranks-cards-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Large Rank Cards */
.all-ranks-card {
    background: white;
    border: 2px solid rgba(138, 21, 56, 0.15);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: cardFadeIn 0.5s ease;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.all-ranks-card:hover {
    border-color: #8A1538;
    box-shadow: 0 10px 30px rgba(138, 21, 56, 0.2);
    transform: translateX(5px);
}

.all-ranks-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(138, 21, 56, 0.08) 0%, rgba(138, 21, 56, 0.03) 100%);
}

.all-ranks-card-icon {
    font-size: 50px;
    flex-shrink: 0;
}

.all-ranks-card-info h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #2c2c2c;
    font-weight: 800;
}

.rank-threshold {
    margin: 0;
    font-size: 12px;
    color: #8A1538;
    font-weight: 600;
}

.all-ranks-card-body {
    padding: 20px;
}

.all-ranks-benefits-title {
    font-size: 14px;
    font-weight: 800;
    color: #2c2c2c;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.all-ranks-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.all-ranks-benefits-list li {
    font-size: 13px;
    color: #555;
    padding: 8px 0;
    padding-right: 10px;
    border-right: 3px solid #D4AF37;
    text-align: right;
}

.all-ranks-benefits-list li::before {
    content: '';
}

/* Benefit Items - Active/Inactive States */
.benefit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.benefit-item.active {
    color: #2c2c2c;
    background-color: rgba(212, 175, 55, 0.1);
    border-right: 3px solid #D4AF37;
    font-weight: 500;
}

.benefit-item.inactive {
    color: #999;
    background-color: rgba(200, 200, 200, 0.08);
    border-right: 3px solid #ccc;
    opacity: 0.6;
}

.benefit-icon {
    font-weight: bold;
    min-width: 16px;
    text-align: center;
}

.benefit-item.active .benefit-icon {
    color: #D4AF37;
}

.benefit-item.inactive .benefit-icon {
    color: #aaa;
}

.benefit-text {
    flex: 1;
}

/* Clickable Rank Cards */
.rank-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.rank-clickable.selected {
    border-color: #D4AF37;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(138, 21, 56, 0.08) 100%);
    box-shadow: 0 10px 35px rgba(212, 175, 55, 0.2);
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .rank-modal-content {
        max-width: 95%;
    }

    .rank-modal-header {
        padding: 30px 25px 20px;
        gap: 15px;
    }

    .rank-modal-icon {
        font-size: 50px;
    }

    .rank-modal-title {
        font-size: 28px;
    }

    .rank-modal-stats {
        grid-template-columns: 1fr 1fr;
    }

    .progress-section {
        padding: 20px 25px;
    }

    .next-tier-label {
        font-size: 13px;
    }

    .next-tier-name {
        font-size: 19px;
    }
}

@media (max-width: 480px) {
    .rank-modal-content {
        border-radius: 20px;
        max-width: 100%;
    }

    .rank-modal-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
        top: 15px;
        right: 15px;
    }

    .rank-modal-header {
        flex-direction: column;
        gap: 12px;
        padding: 25px 20px 18px;
    }

    .rank-modal-header::before {
        width: 200px;
        height: 200px;
    }

    .rank-modal-icon {
        font-size: 45px;
    }

    .rank-modal-title {
        font-size: 24px;
    }

    .rank-modal-info {
        padding: 16px 20px;
    }

    .user-name-display {
        font-size: 13px;
    }

    .user-name-display strong {
        font-size: 15px;
        margin-top: 4px;
    }

    .rank-points-display {
        font-size: 13px;
        margin-top: 6px;
    }

    .rank-points-display strong {
        font-size: 14px;
    }

    .rank-modal-stats {
        grid-template-columns: 1fr 1fr;
        margin: 18px;
        gap: 12px;
    }

    .stat-item {
        padding: 16px 12px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: 22px;
    }

    .progress-section {
        padding: 18px 20px;
    }

    .next-tier-display {
        gap: 10px;
    }

    .next-tier-label {
        font-size: 13px;
    }

    .next-tier-name {
        font-size: 18px;
    }

    .progress-label {
        margin-bottom: 12px;
        font-size: 13px;
    }

    .progress-percent {
        font-size: 15px;
    }

    .progress-bar {
        height: 12px;
        margin-bottom: 10px;
    }

    .progress-info {
        font-size: 11px;
    }

    .rank-modal-benefits {
        padding: 18px 20px;
    }

    .benefits-header {
        gap: 12px;
        margin-bottom: 15px;
    }

    .all-tier-icons {
        gap: 6px;
    }

    .tier-icon {
        font-size: 20px;
        width: 32px;
        height: 32px;
    }

    .rank-modal-benefits h3 {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .rank-modal-benefits ul {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .rank-modal-benefits li {
        padding: 9px;
        font-size: 12px;
    }

    .rank-modal-benefits li::before {
        font-size: 12px;
        margin-left: 6px;
    }
}

.logout-btn {
    background: #E74C3C;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #C0392B;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.4);
}

@media (max-width: 768px) {
    .user-profile-section {
        gap: 10px;
    }

    .username {
        font-size: 14px;
    }

    .logout-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .user-profile-section {
        flex-direction: column;
        gap: 8px;
    }

    .username {
        font-size: 13px;
    }

    .logout-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* ===================================
   Main Content
   =================================== */

.main-content {
    padding: 40px 0;
    flex: 1;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color:gold
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Mode Selection
   =================================== */

.mode-selection {
    margin-bottom: 60px;
}

.mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.mode-btn {
    background: rgba(249, 249, 249, 0.5);
    color: #FFFFFF;
    border: 2px solid var(--dark-maroon);
    border-bottom: none;
    border-radius: 20px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-family: 'Cairo', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mode-btn:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px var(--shadow);
    border-color: var(--primary-maroon);
}

.mode-icon {
    font-size: 64px;
    margin-bottom: 20px;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.mode-icon img {
    position: absolute;
    width: 70%;
    height: 100%;
    object-fit: cover;
    top: 0;
    left: 30;
}

.mode-btn h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #FFFFFF;
    background-color: rgba(68, 35, 10, 0.56);
    padding: 8px 12px;
    border-radius: 6px;
}

.mode-btn p {
    font-size: 16px;
    color: #000000;
    background-color: rgba(199, 194, 189, 0.56);
    padding: 6px 10px;
    border-radius: 6px;
}

/* ===================================
   Categories Grid
   =================================== */

.categories-section {
    margin-top: 40px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.category-card {
    background: var(--secondary-white);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 4px 12px var(--shadow);
}

.category-card:hover {
    transform: translateY(-8px);
    border-color:gold
    box-shadow: 0 8px 20px var(--shadow);
}

.category-icon {
    font-size: 64px;
    margin-bottom: 15px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
}

.category-icon img {
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-maroon);
    margin-bottom: 8px;
}

.category-count {
    font-size: 14px;
    color: var(--dark-maroon);
    opacity: 0.8;
}

/* ===================================
   Game Page Styles
   =================================== */

.game-page {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--dark-maroon) 100%);
}

.score-bar {
    background: linear-gradient(180deg, rgba(90, 21, 32, 0.9) 0%, rgba(90, 21, 32, 0.8) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-top: 0.5rem;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 1px rgba(255, 255, 255, 0.1) inset,
        inset 0 1px 0px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: slideDownScore 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    width: 100%;
    box-sizing: border-box;
}

@keyframes slideDownScore {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.team-container {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    justify-content: center;
}

.team-1-container {
    flex-direction: row;
}

.team-2-container {
    flex-direction: row;
}

.team-score {
    text-align: center;
    flex: 0 1 auto;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 4px;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.team-1 {
    text-align: right;
}

.team-2 {
    text-align: left;
}

/* Score Adjustment Buttons */
.score-btn {
    background: linear-gradient(135deg, #A52A2A 0%, #800000 100%);
    color: #FFFFFF;
    border: 3px solid #FFFFFF;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.6),
        0 8px 25px rgba(128, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    z-index: 100;
    position: relative;
    outline: 2px solid #FFF;
    margin: 4px;
}

.score-btn:hover {
    transform: scale(1.12) translateY(-4px);
    box-shadow: 
        0 12px 35px rgba(128, 0, 0, 0.7),
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, #B83E3E 0%, #8B0000 100%);
}

.score-btn:active {
    transform: scale(0.92);
    box-shadow: 
        0 4px 15px rgba(231, 76, 60, 0.5),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.score-plus {
    background: linear-gradient(135deg, #A52A2A 0%, #800000 100%);
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.6),
        0 8px 25px rgba(128, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.score-plus:hover {
    box-shadow: 
        0 12px 35px rgba(128, 0, 0, 0.7),
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, #B83E3E 0%, #8B0000 100%);
}

.score-minus {
    background: linear-gradient(135deg, #A52A2A 0%, #800000 100%);
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.6),
        0 8px 25px rgba(128, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.score-minus:hover {
    box-shadow: 
        0 12px 35px rgba(128, 0, 0, 0.7),
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, #B83E3E 0%, #8B0000 100%);
}

.team-score::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
    animation: scoreShine 4s infinite;
}

@keyframes scoreShine {
    0% {
        transform: translateX(-100%) translateY(-100%);
    }
    100% {
        transform: translateX(100%) translateY(100%);
    }
}

@keyframes scoreFlash {
    0% {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
    }
    50% {
        background: linear-gradient(135deg, rgba(255, 255, 0, 0.4) 0%, rgba(255, 165, 0, 0.3) 100%);
        box-shadow: 0 0 30px rgba(255, 255, 0, 0.8), 0 8px 40px rgba(255, 165, 0, 0.4);
    }
    100% {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
    }
}

.score-flash {
    animation: scoreFlash 1s ease-in-out !important;
}

.team-score:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.4);
}

.team-score h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: gold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.score {
    font-size: 20px;
    font-weight: 800;
    color: gold;
    text-shadow: 
        3px 3px 10px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 255, 255, 0.3),
        -2px -2px 4px rgba(255, 255, 255, 0.2);
    display: block;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
    min-width: 90px;
    margin: 0;
    padding: 6px 12px;
    border: 3px solid gold;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.game-controls {
    display: flex;
    gap: 15px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #f0f0f0 100%);
    color: var(--dark-maroon);
    border: 2px solid transparent;
    padding: 14px 28px;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.control-btn:hover {
    background: linear-gradient(135deg, #f0f0f0 0%, var(--accent-gold) 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--dark-maroon);
}

.control-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ===================================
   Game Board
   =================================== */

.game-board {
    padding: 1.5rem 1rem 150px 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
}

.game-board .container {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-top: 60px;
}

.board-header {
    text-align: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.current-category {
    font-size: 2.2rem;
    font-weight: 900;
    color:gold
    text-shadow: 
        3px 3px 8px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.categories-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    flex: 1;
    justify-items: center;
    align-content: start;
    padding-right: 1rem;
    padding-bottom: 1rem;
}

/* Category Wrapper Layout */
.category-wrapper {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
}

/* Left Questions Container (Team 1) */
.questions-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    min-width: 120px;
    min-height: 300px;
}

/* Right Questions Container (Team 2) */
.questions-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    min-width: 120px;
    min-height: 300px;
}



/* Category Row Layout */
.category-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
    background-size: cover;
    background-position: center;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 28px;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex: 1;
    min-height: 300px;
    min-width: 300px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 3px rgba(255, 255, 255, 0.7) inset,
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 0 20px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.category-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
    pointer-events: none;
}

/* Hover animations disabled */

/* Questions positioning */
.questions-left,
.questions-right {
    position: relative;
    z-index: 2;
}

.question-tile-small {
    background: linear-gradient(135deg, #F5E6D3 0%, #E8DCC4 50%, #F5E6D3 100%);
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    padding: 0.8rem 1.2rem;
    margin: 0.5rem;
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--dark-maroon);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Cairo', sans-serif;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 3px rgba(255, 255, 255, 0.4),
        0 0 15px rgba(255, 255, 255, 0.3);
    min-width: 70px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.question-tile-small:hover:not(.answered) {
    transform: scale(1.2) translateY(-8px);
    box-shadow: 
        0 15px 50px rgba(255, 255, 255, 0.7),
        0 0 30px rgba(255, 255, 255, 0.5),
        inset 0 1px 3px rgba(255, 255, 255, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #F5E6D3 0%, #E8DCC4 50%, #F5E6D3 100%);
    border-color: var(--dark-maroon);
}

.question-tile-small.answered {
    background: linear-gradient(135deg, #7F8C8D 0%, #5A6C6D 100%);
    color: #ecf0f1;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border-color: rgba(127, 140, 141, 0.4);
}

/* Category Info in Center */
.category-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    justify-content: flex-start;
    flex: 1;
    text-align: center;
    width: 100%;
    overflow: hidden; /* Contain overflowing content */
    padding: 1.5rem 1rem;
    position: relative;
    z-index: 2;
}

.category-icon-inline {
    font-size: 5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 300px; /* Maximum height for icon container */
    overflow: hidden; /* Prevent overflow */
    position: relative;
    z-index: 2;
}

.category-icon-inline img {
    width: 280px;
    height: 280px;
    object-fit: contain;
    max-width: 100%; /* Ensure image doesn't exceed container */
    max-height: 100%;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.15));
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Icon hover animation disabled */

.category-name-inline {
    font-size: 1.5rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: -1px -1px 0 #000000, 1px -1px 0 #000000, -1px 1px 0 #000000, 1px 1px 0 #000000, 
                 -1px 0 0 #000000, 1px 0 0 #000000, 0 -1px 0 #000000, 0 1px 0 #000000;
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, #800020 0%, #640020 100%);
    padding: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: auto;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

/* Old styles - kept for backward compatibility */
.category-select-btn {
    background: var(--secondary-white);
    border: 3px solid gold;
    border-radius: 16px;
    padding: 25px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    text-align: center;
}

.category-select-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-maroon);
}

.category-select-btn .category-icon {
    font-size: 48px;
    margin-bottom: 10px;
    min-height: 48px;
}

.category-select-btn .category-icon img {
    max-width: 48px;
    max-height: 48px;
}

.category-select-btn .category-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-maroon);
}

.category-teams-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.team-badge {
    background: var(--primary-maroon);
    color:gold
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ===================================
   Questions Grid
   =================================== */

.questions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.question-tile {
    background:gold
    border: none;
    border-radius: 16px;
    padding: 40px 20px;
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-maroon);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.question-tile:hover:not(.answered) {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.5);
}

.question-tile.answered {
    background: #95A5A6;
    color: #7F8C8D;
    cursor: not-allowed;
    opacity: 0.5;
}

/* ===================================
   Modal Styles
   =================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeInBackdrop 0.3s ease;
}

@keyframes fadeInBackdrop {
    from {
        background-color: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }
    to {
        background-color: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
    }
}

.modal.active {
    display: flex;
}

/* Ensure game over modal appears on top of everything */
#gameOverModal {
    z-index: 2000 !important;
}

#gameOverModal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, var(--secondary-white) 0%, #f5f0ed 100%);
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 1px rgba(255, 255, 255, 0.5) inset;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUpModal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-maroon), var(--light-maroon));
    border-radius: 10px;
    transition: all 0.3s ease;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--light-maroon), var(--dark-maroon));
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--light-maroon) 100%);
    padding: 30px 40px;
    border-radius: 24px 24px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h3 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: 0.5px;
}

.modal-points {
    font-size: 36px;
    font-weight: 900;
    color:gold
    background: transparent;
    padding: 8px 16px;
    border-radius: 12px;
    display: inline-block;
    backdrop-filter: blur(10px);
}

/* Team Info in Modal Header */
.team-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    margin-left: 20px;
}

.team-indicator {
    font-size: 16px;
    font-weight: 700;
    color:gold
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.team-indicator:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.team-timer-badge {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-white);
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    white-space: nowrap;
    border: 2px solid gold;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.team-timer-badge:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.category-points-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.modal-body {
    padding: 40px;
    color: var(--primary-maroon);
}

/* Timer Styles */
.timer-container {
    text-align: center;
    margin-bottom: 35px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(242, 242, 242, 0.5) 0%, rgba(248, 244, 241, 0.5) 100%);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.timer-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-maroon);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.timer-display {
    font-size: 56px;
    font-weight: 900;
    color: var(--primary-maroon);
    background: linear-gradient(135deg, #FFFFFF 0%, #f5f0ed 100%);
    border: 3px solid gold;
    border-radius: 18px;
    padding: 20px 40px;
    display: inline-block;
    min-width: 140px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    letter-spacing: 1px;
}

.timer-display:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.timer-display.timer-warning {
    color: #E67E22;
    border-color: #E67E22;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    animation: pulseWarning 1s infinite;
}

.timer-display.timer-danger {
    color: #E74C3C;
    border-color: #E74C3C;
    background: linear-gradient(135deg, #ffe6e6 0%, #ffcccc 100%);
    animation: pulseDanger 0.5s infinite;
}

@keyframes pulseWarning {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(230, 126, 34, 0.2);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 12px 32px rgba(230, 126, 34, 0.4);
    }
}

@keyframes pulseDanger {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(231, 76, 60, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 12px 36px rgba(231, 76, 60, 0.5);
    }
}

.question-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-maroon);
    text-align: center;
    margin-bottom: 35px;
    line-height: 1.8;
    letter-spacing: 0.3px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(242, 242, 242, 0.3) 0%, rgba(248, 244, 241, 0.3) 100%);
    border-radius: 16px;
    border-left: 4px solid gold;
    backdrop-filter: blur(10px);
}

.question-image {
    max-width: 450px;
    width: 100%;
    height: auto;
    margin: 30px auto;
    display: block;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    object-fit: contain;
    transition: all 0.3s ease;
    border: 2px solid rgba(0, 0, 0, 0.05);
}

.question-image:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.help-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.help-btn {
    background: var(--light-maroon);
    color: var(--text-white);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.help-btn:hover:not(:disabled) {
    background: var(--primary-maroon);
    transform: translateY(-2px);
}

.help-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.answer-btn {
    background: var(--secondary-white);
    border: 3px solid var(--primary-maroon);
    border-radius: 12px;
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-maroon);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    text-align: center;
}

.answer-btn:hover:not(:disabled) {
    background: var(--primary-maroon);
    color: var(--text-white);
    transform: translateY(-3px);
}

.answer-btn.correct {
    background: var(--success);
    color: var(--text-white);
    border-color: var(--success);
}

.answer-btn.wrong {
    background: var(--danger);
    color: var(--text-white);
    border-color: var(--danger);
}

.answer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.answer-btn.hidden {
    opacity: 0.3;
    pointer-events: none;
}

.modal-footer {
    padding: 30px 40px;
    border-top: 2px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.02) 100%);
    border-radius: 0 0 24px 24px;
    position: sticky;
    bottom: 0;
    z-index: 9;
}

/* ===================================
   Result Modal
   =================================== */

.result-content {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #FFFFFF 0%, #f5f0ed 100%);
}

.result-icon {
    font-size: 100px;
    margin-bottom: 25px;
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.result-content h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-maroon);
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    animation: slideDown 0.6s ease 0.2s both;
}

.result-content p {
    font-size: 18px;
    color: var(--dark-maroon);
    margin-bottom: 35px;
    font-weight: 600;
    letter-spacing: 0.3px;
    animation: slideDown 0.6s ease 0.3s both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Answer Modal
   =================================== */

.answer-content {
    text-align: center;
    padding: 50px 40px;
    background: linear-gradient(135deg, #FFFFFF 0%, #f5f0ed 100%);
}

.correct-answer-text {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-white);
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--light-maroon) 100%);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.correct-answer-text:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.team-selection-label {
    font-size: 18px;
    color: var(--primary-maroon);
    margin-bottom: 25px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* ===================================
   Buttons
   =================================== */

.btn-primary {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--light-maroon) 100%);
    color: var(--text-white);
    border: none;
    padding: 14px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Cairo', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, var(--light-maroon) 0%, var(--dark-maroon) 100%);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-maroon);
    border: 2px solid var(--primary-maroon);
    padding: 14px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Cairo', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--light-maroon) 100%);
    color: var(--text-white);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--light-maroon);
}

.btn-secondary:active {
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: var(--text-white);
    border: none;
    padding: 14px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Cairo', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.2);
}

.btn-danger:hover {
    background: #C0392B;
    transform: translateY(-2px);
}

/* ===================================
   Settings Page
   =================================== */

.settings-page {
    background: var(--secondary-white);
    min-height: 100vh;
}

.settings-section {
    background: var(--text-white);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.settings-section .section-title {
    color: var(--primary-maroon);
    text-align: right;
    margin-bottom: 0;
}

.info-section {
    background: linear-gradient(135deg, #f8f4f1 0%, #faf7f5 100%);
    border-right: 4px solid var(--gold);
}

.info-content {
    text-align: right;
    line-height: 1.8;
}

.info-content p {
    color: #333;
    font-size: 15px;
    margin-bottom: 12px;
}

.info-content ul {
    list-style: none;
    padding-right: 20px;
    margin: 15px 0;
}

.info-content li {
    color: #444;
    font-size: 15px;
    margin-bottom: 10px;
    padding-right: 15px;
    position: relative;
}

.info-content li:before {
    content: "✓";
    position: absolute;
    right: 0;
    color: var(--primary-maroon);
    font-weight: bold;
}

.toggle-chevron {
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.3s ease;
    color: var(--primary-maroon);
}

.section-header:hover {
    opacity: 0.8;
}

.info-section .section-header {
    user-select: none;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.category-item {
    background: var(--secondary-white);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid var(--primary-maroon);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-width: 250px;
    position: relative;
    overflow: hidden;
}

/* Overlay for text readability over background images */
.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    z-index: 1;
}

.category-item > * {
    position: relative;
    z-index: 2;
}

.category-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.category-item .category-icon {
    font-size: 100px;
    min-width: 120px;
    max-width: 120px;
    min-height: 120px;
    max-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-item .category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-details h3 {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 5px;
    text-shadow: 
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0px -1px 0 #fff,
        0px 1px 0 #fff,
        -1px 0px 0 #fff,
        1px 0px 0 #fff;
}

.category-details p {
    font-size: 14px;
    color: #000000;
    text-shadow: 
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0px -1px 0 #fff,
        0px 1px 0 #fff,
        -1px 0px 0 #fff,
        1px 0px 0 #fff;
}

.question-summary {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
}

.summary-item {
    color: #555;
    background: rgba(122, 30, 39, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
    border-left: 3px solid var(--primary-maroon);
    text-shadow: 
        -0.5px -0.5px 0 #fff,
        0.5px -0.5px 0 #fff,
        -0.5px 0.5px 0 #fff,
        0.5px 0.5px 0 #fff;
}

.summary-total {
    color: var(--primary-maroon);
    background: rgba(255, 193, 7, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    border-left: 3px solid gold;
    font-weight: 700;
    text-shadow: 
        -0.5px -0.5px 0 #fff,
        0.5px -0.5px 0 #fff,
        -0.5px 0.5px 0 #fff,
        0.5px 0.5px 0 #fff;
}

/* Approval Button in Actions */
.approval-btn {
    background:gold
    color: var(--primary-maroon);
}

.approval-btn.pending {
    background: #FFE4B5;
    color: #FF8C00;
    border-color: #FF8C00 !important;
}

.approval-btn.pending:hover {
    background: #FF8C00;
    color: #fff;
}

.approval-btn.approved {
    background: #C8E6C9;
    color: #27AE60;
    border-color: #27AE60 !important;
}

.approval-btn.approved:hover {
    background: #27AE60;
    color: #fff;
}

.category-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    width: 100%;
    justify-content: center;
}

.action-btn {
    background:gold
    color: var(--primary-maroon);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.action-btn:hover {
    background: var(--primary-maroon);
    color: var(--text-white);
}

.action-btn.delete {
    background: var(--danger);
    color: var(--text-white);
}

.action-btn.delete:hover {
    background: #C0392B;
}

.data-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ===================================
   Form Styles
   =================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-maroon);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--primary-maroon);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color:gold
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    font-family: 'Cairo', sans-serif;
    line-height: 1.5;
    color: #333;
}

.question-field {
    background: var(--secondary-white);
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E0E0E0;
}

.question-header label {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-maroon);
    margin: 0;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group-half {
    flex: 1;
}

.form-group-half label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-maroon);
    margin-bottom: 8px;
}

.question-field label {
    font-size: 14px;
    margin-bottom: 5px;
}

.question-field input,
.question-field select,
.question-field textarea {
    margin-bottom: 10px;
}

.question-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--primary-maroon);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    resize: vertical;
    min-height: 80px;
}

.question-field textarea:focus {
    outline: none;
    border-color:gold
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.remove-question-btn {
    background: var(--danger);
    color: var(--text-white);
    border: none;
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.remove-question-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Questions Tabs Styles */
/* Modal Summary */
.modal-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(122, 30, 39, 0.05));
    border-radius: 8px;
    border-left: 4px solid var(--primary-maroon);
}

.modal-summary-item {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-maroon);
    background: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    border-radius: 6px;
    border-bottom: 2px solid gold;
}

.modal-summary-total {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: var(--primary-maroon);
    padding: 6px 12px;
    border-radius: 6px;
    margin-left: auto;
}

.questions-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 3px solid #E0E0E0;
    flex-wrap: wrap;
}

.tab-btn {
    background: #F0F0F0;
    border: 2px solid #E0E0E0;
    border-bottom: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-maroon);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
    background: #E8E8E8;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--light-maroon);
    color: var(--text-white);
    border-color: var(--light-maroon);
    box-shadow: 0 -2px 8px rgba(154, 46, 55, 0.2);
}

.questions-tab-content {
    display: none;
    padding: 15px 0;
}

.questions-tab-content.active {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icon Upload Styles */
.icon-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 2px dashed #ccc;
}

.icon-preview {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    overflow: hidden;
    flex-shrink: 0;
}

.icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.icon-preview .preview-placeholder {
    font-size: 80px;
}

.icon-upload-controls {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex: 1;
    width: 100%;
}

.icon-upload-controls button {
    flex: 1;
}

.form-hint {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.tooltip-icon {
    cursor: help;
    margin-right: 5px;
    color: #7A1E27;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tooltip-icon:hover {
    opacity: 1;
}

/* ===================================
   Modal Styles
   =================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.modal-content {
    background-color: var(--dark-maroon);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    width: 90%;
    animation: slideDown 0.3s ease;
}

.modal-header {
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #5A1520;
    padding-bottom: 15px;
}

.modal-header h2 {
    color: #FFFFFF;
    font-size: 24px;
    font-weight: 700;
}

.modal-body {
    margin-bottom: 20px;
}

.team-input-group {
    margin-bottom: 15px;
}

.team-input-group label {
    display: block;
    color: #FFFFFF;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
}

.team-name-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #FFFFFF;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    background-color: #FFFFFF;
    color: #000;
    direction: rtl;
    transition: border-color 0.3s ease;
}

.team-name-input:focus {
    outline: none;
    border-color: #FFFFFF;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* ===================================
   Team Names Modal Styling
   =================================== */

.team-names-modal {
    width: 100%;
    max-width: 700px;
}

.team-names-body {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    direction: rtl;
}

.team-input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.team-section-1 {
    order: 2;
}

.team-section-2 {
    order: 1;
}

.team-label {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--light-maroon);
    text-align: right;
    letter-spacing: 0.5px;
}

.team-emoji-selector {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.team-emoji-input {
    width: 60px;
    height: 50px;
    font-size: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Arial', sans-serif;
}

.team-emoji-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.emoji-presets {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
}

.emoji-presets:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Emoji Scroll Carousel */
.emoji-scroll-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: flex-end;
}

.emoji-scroll-btn {
    width: 40px;
    height: 40px;
    background: var(--light-maroon);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 1.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(154, 46, 55, 0.3);
}

.emoji-scroll-btn:hover {
    background: #7A1E27;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(154, 46, 55, 0.5);
}

.emoji-scroll-btn:active {
    transform: scale(0.95);
}

.emoji-scroll-list {
    display: flex;
    gap: 0.6rem;
    overflow-x: hidden;
    scroll-behavior: smooth;
    width: 200px;
    justify-content: flex-end;
}

.emoji-item {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    flex-shrink: 0;
}

.emoji-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* ===================================
   Footer
   =================================== */

.main-footer {
    background: var(--dark-maroon);
    padding: 20px;
    text-align: center;
    color: var(--text-white);
    font-size: 14px;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1200px) {
    .logo-circle {
        width: 80px;
        height: 80px;
    }
    
    .app-title {
        font-size: 32px;
    }
    .categories-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.3rem;
    }
    
    .category-row {
        min-height: 450px;
        padding: 2.5rem;
    }
    
    .question-tile-small {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        min-width: 75px;
    }
    
    .category-icon-inline {
        max-height: 260px;
    }
    
    .category-icon-inline img {
        width: 240px;
        height: 240px;
    }
    
    .category-name-inline {
        font-size: 1.4rem;
        padding: 14px 22px;
        margin: 0;
        width: 100%;
    }
}

@media (max-width: 900px) {
    .logo-circle {
        width: 75px;
        height: 75px;
    }
    
    .app-title {
        font-size: 28px;
    }
    
    .categories-selector {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .category-row {
        min-height: 400px;
        padding: 2.2rem;
    }
    
    .question-tile-small {
        padding: 1rem 1.4rem;
        font-size: 1rem;
        min-width: 70px;
    }
    
    .category-icon-inline {
        max-height: 220px;
    }
    
    .category-icon-inline img {
        width: 200px;
        height: 200px;
    }
    
    .category-name-inline {
        font-size: 1.2rem;
        padding: 13px 20px;
        margin: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .logo-circle {
        width: 70px;
        height: 70px;
    }
    
    .app-title {
        font-size: 26px;
    }
    
    /* Game Page Responsive */
    .game-board {
        padding: 1.5rem;
    }
    
    .categories-selector {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-wrapper {
        flex-direction: column;
    }
    
    .category-row {
        min-height: 320px;
        padding: 1.8rem;
        gap: 1rem;
        width: 100%;
        flex: none;
    }
    
    .questions-left,
    .questions-right {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Hover animations disabled */

    /* Team Names Modal Responsive */
    .team-names-body {
        flex-direction: column;
        gap: 1.2rem;
    }

    .team-section-1,
    .team-section-2 {
        order: initial;
    }

    .team-label {
        font-size: 1.2rem;
    }

    .team-emoji-selector {
        justify-content: center;
    }

    .team-emoji-input {
        width: 55px;
        height: 45px;
        font-size: 1.8rem;
    }

    .emoji-presets {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }
    
    .emoji-scroll-container {
        justify-content: center;
    }
    
    .emoji-scroll-btn {
        width: 38px;
        height: 38px;
        font-size: 1.6rem;
    }
    
    .emoji-scroll-list {
        width: 180px;
    }
    
    .emoji-item {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }

    .question-tile-small {
        padding: 0.95rem 1.3rem;
        font-size: 0.95rem;
        min-width: 65px;
    }
    
    .category-icon-inline {
        max-height: 200px;
    }
    
    .category-icon-inline img {
        width: 170px;
        height: 170px;
    }
    
    .category-name-inline {
        font-size: 1.1rem;
        padding: 11px 18px;
        margin: 0;
        width: 100%;
    }

    .control-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Modal Responsive */
    .modal-content {
        width: 95%;
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 20px;
    }

    .modal-header {
        padding: 20px 25px;
        flex-direction: column;
        gap: 15px;
    }

    .modal-header h3 {
        font-size: 22px;
    }

    .modal-body {
        padding: 25px;
    }

    .modal-footer {
        padding: 20px 25px;
        gap: 10px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 12px 24px;
        font-size: 15px;
        flex: 1;
        min-width: 100px;
    }

    .timer-display {
        font-size: 42px;
        padding: 15px 30px;
        min-width: 120px;
    }

    .question-text {
        font-size: 20px;
        padding: 18px;
    }

    .correct-answer-text {
        font-size: 24px;
        padding: 20px;
    }

    .timer-container {
        padding: 20px;
        margin-bottom: 25px;
    }

    .settings-group {
        padding: 18px;
        margin-bottom: 20px;
    }

    .settings-label {
        font-size: 15px;
    }

    .preset-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .team-indicator,
    .team-timer-badge {
        font-size: 14px;
        padding: 8px 12px;
    }

    .app-title {
        font-size: 24px;
    }

    .logo-circle {
        width: 60px;
        height: 60px;
    }

    .logo-text {
        font-size: 14px;
    }

    .score-bar {
        flex-direction: column;
        gap: 12px;
        padding: 18px 20px;
        margin-top: 1.5rem;
    }

    .team-score {
        padding: 10px;
        border-radius: 12px;
    }

    .team-score h3 {
        font-size: 14px;
    }

    .score {
        font-size: 42px;
    }

    .questions-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .question-tile {
        padding: 20px 10px;
        font-size: 24px;
    }

    .answers-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .mode-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo-circle {
        width: 60px;
        height: 60px;
        animation: none; /* Disable floating animation on small screens */
    }
    
    .app-title {
        font-size: 22px;
    }
    
    /* Team Names Modal Mobile */
    .team-names-body {
        gap: 1rem;
    }

    .team-input-section {
        padding: 1.2rem;
        gap: 0.8rem;
    }

    .team-label {
        font-size: 1rem;
    }

    .team-emoji-input {
        width: 50px;
        height: 42px;
        font-size: 1.6rem;
    }

    .emoji-presets {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    .emoji-scroll-container {
        justify-content: center;
    }
    
    .emoji-scroll-btn {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }
    
    .emoji-scroll-list {
        width: 160px;
    }
    
    .emoji-item {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .team-name-input {
        font-size: 14px;
        padding: 10px;
    }
    
    /* Extra small game page adjustments */
    .game-board {
        padding: 1rem;
    }
    
    .categories-selector {
        gap: 0.8rem;
    }
    
    .category-wrapper {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .category-row {
        min-height: 240px;
        padding: 1.3rem;
        gap: 0.9rem;
        width: 100%;
        flex: none;
    }

    /* Hover animations disabled */

    .questions-left,
    .questions-right {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .question-tile-small {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
        min-width: 55px;
        border-radius: 12px;
    }
    
    .category-icon-inline {
        max-height: 160px;
    }
    
    .category-icon-inline img {
        width: 140px;
        height: 140px;
    }
    
    .category-name-inline {
        font-size: 1rem;
        padding: 9px 15px;
        margin: 0;
        width: 100%;
    }

    .control-btn {
        padding: 10px 16px;
        font-size: 12px;
        letter-spacing: 0.2px;
    }

    /* Extra small modal adjustments */
    .modal {
        background: rgba(0, 0, 0, 0.75);
    }

    .modal-content {
        width: 98%;
        max-height: 98vh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 15px 18px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-body {
        padding: 18px;
    }

    .modal-footer {
        padding: 15px 18px;
        flex-direction: column-reverse;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }

    .timer-display {
        font-size: 36px;
        padding: 12px 24px;
        min-width: 100px;
    }

    .timer-label {
        font-size: 12px;
    }

    .question-text {
        font-size: 18px;
        padding: 15px;
        margin-bottom: 25px;
    }

    .correct-answer-text {
        font-size: 20px;
        padding: 15px;
    }

    .team-selection-label {
        font-size: 16px;
    }

    .timer-container {
        padding: 15px;
        margin-bottom: 20px;
    }

    .settings-content {
        max-width: 100%;
    }

    .settings-group {
        padding: 15px;
        margin-bottom: 15px;
    }

    .settings-label {
        font-size: 14px;
    }

    .timer-controls {
        gap: 8px;
        padding: 10px;
    }

    .timer-btn {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .timer-input {
        width: 90px;
        padding: 10px;
        font-size: 22px;
    }

    .preset-btn {
        padding: 8px 14px;
        font-size: 13px;
        min-width: 60px;
    }

    .team-indicator,
    .team-timer-badge {
        font-size: 12px;
        padding: 6px 10px;
    }

    .result-content {
        padding: 40px 25px;
    }

    .result-icon {
        font-size: 80px;
        margin-bottom: 15px;
    }

    .result-content h2 {
        font-size: 28px;
    }

    .result-content p {
        font-size: 16px;
    }
}

/* ===================================
   Animations
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.category-card,
.mode-btn,
.question-tile {
    animation: fadeIn 0.5s ease;
}

.score {
    animation: pulse 2s infinite;
}

/* ===================================
   Settings Modal Styles
   =================================== */

.settings-content {
    max-width: 600px;
    width: 95%;
    max-height: 85vh;
}

.settings-group {
    margin-bottom: 35px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(242, 242, 242, 0.4) 0%, rgba(248, 244, 241, 0.4) 100%);
    border-radius: 16px;
    border-left: 4px solid gold;
    backdrop-filter: blur(10px);
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-maroon);
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-label .icon {
    font-size: 26px;
}

.timer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.timer-btn {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--light-maroon) 100%);
    color: var(--text-white);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.timer-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.timer-btn:active {
    transform: scale(0.95);
}

.timer-input {
    width: 110px;
    padding: 14px;
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    border: 3px solid gold;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    color: var(--primary-maroon);
    background: linear-gradient(135deg, #FFFFFF 0%, #f5f0ed 100%);
    transition: all 0.3s ease;
}

.timer-input:focus {
    outline: none;
    border-color: var(--primary-maroon);
    box-shadow: 0 0 16px rgba(128, 0, 32, 0.25);
    transform: scale(1.05);
}

.timer-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary-maroon);
    border: 2px solid gold;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Cairo', sans-serif;
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-btn:hover {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--light-maroon) 100%);
    color: var(--text-white);
    border-color: var(--light-maroon);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.preset-btn:active {
    transform: translateY(0);
}

/* ===================================
   Game Over Modal Styles
   =================================== */


@keyframes gameOverSlideIn {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.game-over-title {
    font-size: 3.5rem;
    color:gold
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    margin: 0 0 1rem 0;
    animation: titlePulse 1s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.game-over-body {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.final-scores {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 2rem;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.team-final-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.team-final-score h3 {
    font-size: 2rem;
    color:gold
    margin: 0;
}

.final-score-value {
    font-size: 4.5rem;
    font-weight: 800;
    color:gold
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    animation: scoreCountUp 1s ease-out 0.5s backwards;
}

@keyframes scoreCountUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vs-divider {
    font-size: 3rem;
    font-weight: 800;
    color:gold
    opacity: 0.7;
    animation: dividerFade 1s ease-in-out infinite;
}

@keyframes dividerFade {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.winner-announcement {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color:gold
    padding: 2rem;
    background: rgba(46, 204, 113, 0.15);
    border-radius: 10px;
    border: 2px solid rgba(46, 204, 113, 0.3);
    animation: winnerGlow 1.5s ease-in-out infinite;
}

@keyframes winnerGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(46, 204, 113, 0.6);
    }
}

.winner-announcement.tie {
    background: rgba(243, 156, 18, 0.15);
    border-color: rgba(243, 156, 18, 0.3);
}

.winner-announcement.tie {
    animation: tieGlow 1.5s ease-in-out infinite;
}

@keyframes tieGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(243, 156, 18, 0.6);
    }
}

/* Game Over Modal Buttons */
.game-over-content .modal-footer {
    padding: 3rem 2rem;
}

.game-over-content .btn-secondary {
    padding: 18px 50px;
    font-size: 1.2rem;
    font-weight: 700;
    min-height: 60px;
}

/* ===================================
   Confetti Animation
   =================================== */

.celebration-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: 15px;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background:gold
    animation: confettiFall 3s ease-in infinite;
    opacity: 0.8;
    border-radius: 50%;
}

.confetti:nth-child(1) {
    left: 10%;
    background: #FFD700;
    animation-delay: 0s;
}

.confetti:nth-child(2) {
    left: 20%;
    background: #FF69B4;
    animation-delay: 0.2s;
}

.confetti:nth-child(3) {
    left: 30%;
    background: #00BFFF;
    animation-delay: 0.4s;
}

.confetti:nth-child(4) {
    left: 40%;
    background: #32CD32;
    animation-delay: 0.6s;
}

.confetti:nth-child(5) {
    left: 50%;
    background: #FF6347;
    animation-delay: 0.8s;
}

.confetti:nth-child(6) {
    left: 60%;
    background: #9370DB;
    animation-delay: 1s;
}

.confetti:nth-child(7) {
    left: 70%;
    background: #FFB6C1;
    animation-delay: 1.2s;
}

.confetti:nth-child(8) {
    left: 80%;
    background: #87CEEB;
    animation-delay: 1.4s;
}

.confetti:nth-child(9) {
    left: 90%;
    background: #FFD700;
    animation-delay: 1.6s;
}

.confetti:nth-child(10) {
    left: 95%;
    background: #FF69B4;
    animation-delay: 1.8s;
}

@keyframes confettiFall {
    0% {
        top: -10px;
        opacity: 1;
        transform: translateX(0) rotateZ(0deg);
    }
    100% {
        top: 100%;
        opacity: 0;
        transform: translateX(100px) rotateZ(360deg);
    }
}

/* Game Over Modal Responsive */
@media (max-width: 768px) {
    .game-over-content {
        max-width: 90%;
    }
    
    .game-over-title {
        font-size: 2rem;
    }
    
    .game-over-body {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .final-scores {
        flex-direction: row;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .team-final-score {
        padding: 1rem;
    }
    
    .final-score-value {
        font-size: 2.5rem;
    }
    
    .vs-divider {
        font-size: 1.5rem;
    }
    
    .winner-announcement {
        font-size: 1.2rem;
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .game-over-title {
        font-size: 1.5rem;
    }
    
    .game-over-body {
        padding: 1rem;
        gap: 1rem;
    }
    
    .final-scores {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .team-final-score {
        padding: 0.8rem;
    }
    
    .team-final-score h3 {
        font-size: 1rem;
    }
    
    .final-score-value {
        font-size: 2rem;
    }
    
    .vs-divider {
        font-size: 1.2rem;
        transform: rotate(90deg);
    }
    
    .winner-announcement {
        font-size: 1rem;
        padding: 0.6rem;
    }
    
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
}

/* ===================================
   Game Board Background
   =================================== */

.game-board {
    background-image: url('gameimage/Sealine.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ===================================
   Mobile Optimization - Touch-Friendly
   =================================== */

@media (max-width: 1024px) {
    /* Ensure buttons are at least 44px for touch targets */
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .nav-btn,
    button {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 16px;
    }

    /* Improve spacing between interactive elements */
    .button-group {
        gap: 8px;
    }

    /* Better modal sizing */
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Improve header on tablets */
    .main-header {
        padding: 20px 0;
    }

    .logo-circle {
        width: 70px;
        height: 70px;
    }

    .app-title {
        font-size: 28px;
    }
}

@media (max-width: 600px) {
    /* Extra small phone optimizations */
    
    /* Root font size adjustment for better scaling */
    html {
        font-size: 14px;
    }

    body {
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    /* Ensure all interactive elements meet minimum touch size */
    button, a, input[type="button"], input[type="submit"], 
    input[type="reset"], input[type="checkbox"], input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-width: auto;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
        margin-bottom: 8px;
    }

    /* Header optimization */
    .main-header {
        padding: 15px 0;
    }

    .main-header .container {
        gap: 10px;
        flex-wrap: wrap;
    }

    .app-title {
        font-size: 20px;
        position: relative;
        width: 100%;
        margin: 10px 0 0 0;
    }

    .main-nav {
        position: static;
        width: 100%;
        order: 3;
    }

    .main-nav button {
        font-size: 12px;
        padding: 8px 12px;
        width: 100%;
    }

    .user-profile-section {
        position: static;
        order: 2;
    }

    .logo-circle {
        width: 60px;
        height: 60px;
        border: 3px solid var(--text-white);
    }

    .turn-indicator {
        position: static;
        display: inline-flex;
        font-size: 14px;
        padding: 8px 12px;
    }

    /* Container padding */
    .container {
        padding: 0 12px;
    }

    /* Game board optimizations */
    .game-board {
        padding: 12px;
    }

    .categories-selector {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .category-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .category-row {
        min-height: auto;
        padding: 16px 12px;
        gap: 10px;
        width: 100%;
        flex: none;
    }

    .questions-left,
    .questions-right {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .question-tile {
        padding: 16px 8px;
        font-size: 20px;
        min-height: 44px;
    }

    .question-tile-small {
        padding: 10px 6px;
        min-width: 44px;
        min-height: 44px;
        font-size: 0.85rem;
    }

    /* Modal optimizations */
    .modal-content {
        width: 95vw;
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 16px 16px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px;
        max-height: 60vh;
        overflow-y: auto;
    }

    .modal-footer {
        padding: 12px 16px;
        gap: 8px;
        flex-direction: column;
    }

    .modal-footer .btn-primary,
    .modal-footer .btn-secondary,
    .modal-footer .btn-danger {
        width: 100%;
    }

    /* Timer display */
    .timer-display {
        font-size: 36px;
        padding: 12px 20px;
        min-width: 100px;
    }

    .question-text {
        font-size: 18px;
        padding: 14px;
    }

    .correct-answer-text {
        font-size: 20px;
        padding: 16px;
    }

    /* Score display */
    .score-bar {
        flex-direction: column;
        gap: 10px;
        padding: 14px 16px;
        margin-top: 1.2rem;
    }

    .team-score {
        padding: 10px;
    }

    .team-score h3 {
        font-size: 13px;
    }

    .score {
        font-size: 36px;
    }

    /* Input fields */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    textarea,
    select {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
    }

    /* Prevent zoom on input focus */
    input:focus,
    textarea:focus,
    select:focus {
        font-size: 16px;
    }

    /* Text sizing */
    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 16px;
    }

    p {
        font-size: 14px;
    }

    /* Improve readability */
    body {
        line-height: 1.6;
    }

    /* Image optimization */
    img {
        max-width: 100%;
        height: auto;
    }

    /* List optimization */
    ul, ol {
        margin-left: 16px;
    }

    li {
        margin-bottom: 8px;
    }

    /* Remove hover effects on touch devices */
    @media (hover: none) {
        .btn-primary:hover,
        .btn-secondary:hover,
        .nav-btn:hover,
        button:hover {
            transform: none;
        }
    }
}

@media (max-width: 360px) {
    /* Extra small devices (phone in portrait) */
    
    .app-title {
        font-size: 18px;
    }

    .logo-circle {
        width: 50px;
        height: 50px;
        border: 2px solid var(--text-white);
    }

    .nav-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .question-tile {
        font-size: 18px;
        padding: 12px 6px;
    }

    .category-wrapper {
        flex-direction: column;
        gap: 0.6rem;
    }

    .questions-left,
    .questions-right {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .question-tile-small {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        min-width: 44px;
        min-height: 44px;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .timer-display {
        font-size: 32px;
    }

    .turn-indicator {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Landscape orientation optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .main-header {
        padding: 8px 0;
    }

    .logo-circle {
        width: 50px;
        height: 50px;
    }

    .app-title {
        font-size: 18px;
    }

    .game-board {
        padding: 8px;
    }

    .category-wrapper {
        flex-direction: row;
        gap: 0.5rem;
        align-items: stretch;
    }

    .category-row {
        min-height: auto;
        padding: 10px 8px;
        gap: 8px;
        flex: 1;
    }

    .questions-left,
    .questions-right {
        flex-direction: column;
        gap: 0.4rem;
        flex: 0 0 auto;
    }

    .question-tile-small {
        padding: 0.6rem 0.8rem;
        font-size: 0.75rem;
        min-width: 40px;
    }

    .modal-content {
        max-height: 85vh;
    }

    .modal-body {
        max-height: 50vh;
    }
}

/* ===================================
   Game Settings - Dual Time System
   =================================== */

.game-settings-container {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

/* Collapsible Section */
.collapsible-section {
    margin-bottom: 30px;
}

.collapsible-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: rgba(162, 154, 138, 0.15);
    border: 2px solid rgba(162, 154, 138, 0.3);
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-maroon);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    text-align: right;
}

.collapsible-header:hover {
    background: rgba(162, 154, 138, 0.25);
    border-color: rgba(162, 154, 138, 0.5);
    transform: translateX(-5px);
}

.collapse-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 16px;
}

.collapsible-header.active .collapse-arrow {
    transform: rotate(-180deg);
}

.collapsible-content {
    background: rgba(162, 154, 138, 0.08);
    border: 1px solid rgba(162, 154, 138, 0.2);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 20px;
    margin-top: -2px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.system-explanation {
    color: var(--primary-maroon);
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
}

/* Time Controls Wrapper */
.time-controls-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.time-control-group {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.time-control-group:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.time-label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 15px;
    text-align: right;
}

/* Time Input Container */
.time-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px;
}

.time-btn-decrement,
.time-btn-increment {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--light-maroon) 100%);
    color: var(--text-white);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

.time-btn-decrement:hover,
.time-btn-increment:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.time-btn-decrement:active,
.time-btn-increment:active {
    transform: scale(0.95);
}

.time-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.time-input:focus {
    outline: none;
    border-color:gold
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

/* Preset Buttons */
.time-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.preset-btn.active {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--light-maroon) 100%);
    border-color: var(--primary-maroon);
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(162, 154, 138, 0.5);
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.settings-actions .btn-primary,
.settings-actions .btn-secondary {
    min-width: 150px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .game-settings-container {
        padding: 20px;
    }

    .time-controls-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .time-control-group {
        padding: 15px;
    }

    .time-presets {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .preset-btn {
        padding: 10px 6px;
        font-size: 12px;
    }

    .time-btn-decrement,
    .time-btn-increment {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 20px;
    }

    .time-input {
        font-size: 20px;
    }

    .collapsible-header {
        font-size: 16px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .game-settings-container {
        padding: 15px;
    }

    .time-controls-wrapper {
        gap: 15px;
    }

    .time-control-group {
        padding: 12px;
    }

    .time-label {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .time-presets {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .preset-btn {
        padding: 8px 4px;
        font-size: 11px;
    }

    .time-btn-decrement,
    .time-btn-increment {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 18px;
    }

    .time-input {
        font-size: 18px;
        padding: 8px 10px;
    }

    .time-input-container {
        gap: 8px;
        padding: 6px;
    }

    .settings-actions {
        flex-direction: column;
        gap: 10px;
    }

    .settings-actions .btn-primary,
    .settings-actions .btn-secondary {
        width: 100%;
        min-width: auto;
    }

    .collapsible-header {
        font-size: 14px;
        padding: 10px 12px;
        gap: 8px;
    }

    .system-explanation {
        font-size: 13px;
    }
}
