/**
 * Pixel Playground - Main Arcade Interface Styles
 * 
 * This stylesheet implements a responsive design system for the browser game arcade.
 * Key design principles:
 * - Mobile-first responsive design with CSS Grid
 * - Glassmorphism effects with backdrop-filter
 * - Smooth animations and transitions for enhanced UX
 * - Cross-browser compatibility for modern browsers
 */

/**
 * Global Reset and Base Styles
 * Ensures consistent rendering across all browsers
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/**
 * Body Base Styles
 * - Uses gradient background for visual appeal
 * - Sets minimum height to prevent layout issues on short content
 * - Establishes base typography with Arial fallback
 */
body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
}

.header {
    text-align: center;
    padding: 40px 20px 0px;
}

.title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.2);
    }

    to {
text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.4);
    }
}

.subtitle {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/**
 * Responsive CSS Grid Layout for Game Cards
 * 
 * Implementation Details:
 * - auto-fit: Automatically adjusts number of columns based on available space
 * - minmax(350px, 1fr): Minimum card width of 350px, expands to fill available space
 * - 30px gap: Provides consistent spacing between cards
 * - Responsive behavior: Automatically stacks cards on smaller screens
 * 
 * Breakpoint Behavior:
 * - Desktop (>1200px): Up to 3 columns
 * - Tablet (768px-1200px): 2 columns
 * - Mobile (<768px): 1 column (handled by media query below)
 * 
 * Requirements: 2.1, 2.2, 2.3 (Responsive UI)
 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

/**
 * Game Card Glassmorphism Design
 * 
 * Visual Design Elements:
 * - Semi-transparent background with backdrop blur for glassmorphism effect
 * - Rounded corners (20px) for modern appearance
 * - Subtle border with transparency for depth
 * - Smooth transitions for all interactive states
 * 
 * Accessibility Features:
 * - Cursor pointer indicates interactivity
 * - High contrast maintained for text readability
 * - Hover states provide clear visual feedback
 * 
 * Requirements: 2.5 (Accessibility), 8.4 (User Experience)
 */
.game-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

/**
 * Game Card Hover Effects
 * 
 * Interactive Animation Details:
 * - translateY(-10px): Lifts card to create floating effect
 * - Increased background opacity for better visibility
 * - Enhanced border opacity for stronger definition
 * - Box shadow creates depth and separation from background
 * 
 * Performance Considerations:
 * - Uses transform instead of changing position for better performance
 * - GPU-accelerated properties for smooth 60fps animations
 * 
 * Requirements: 7.1 (Performance), 8.4 (User Experience)
 */
.game-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.game-icon {
    font-size: 64px;
    margin-bottom: 20px;
    text-align: center;
}

.game-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.game-description {
    font-size: 16px;
    opacity: 0.8;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
}

.play-button {
    width: 100%;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.info-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin: 40px 0 0;
    backdrop-filter: blur(10px);
    text-align: center;
}

.footer {
    text-align: center;
    padding: 30px;
    opacity: 0.7;
    font-size: 14px;
}

/**
 * Leaderboard Component Styles
 * 
 * Provides consistent styling for the leaderboard display section
 * with responsive design and interactive elements.
 */
.leaderboard-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin: 40px 0;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.leaderboard-title {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: Arial, sans-serif;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.filter-btn:active {
    transform: translateY(0);
}

.filter-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.leaderboard-display {
    min-height: 300px;
    position: relative;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
opacity: 0;
transform: translateY(20px);
    }
    to {
opacity: 1;
transform: translateY(0);
    }
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-message {
    font-size: 18px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.retry-btn {
    background: #FF6B6B;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #FF5252;
    transform: scale(1.05);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.empty-message {
    font-size: 18px;
    opacity: 0.8;
    line-height: 1.5;
}

/* Scores Display */
.scores-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    overflow: hidden;
}

.scores-header {
    display: grid;
    grid-template-columns: 60px 1fr 120px 140px;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scores-list {
    max-height: 400px;
    overflow-y: auto;
}

.score-entry {
    display: grid;
    grid-template-columns: 60px 1fr 120px 140px;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
    align-items: center;
}

.score-entry:hover {
    background: rgba(255, 255, 255, 0.05);
}

.score-entry:last-child {
    border-bottom: none;
}

.score-entry:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.score-entry.highlight {
    background: rgba(255, 215, 0, 0.1);
    border-left: 4px solid #FFD700;
}

.rank {
    font-weight: bold;
    font-size: 18px;
    text-align: center;
}

.rank.top-3 {
    color: #FFD700;
}

.player-name {
    font-weight: 600;
    font-size: 16px;
}

.score-value {
    font-weight: bold;
    font-size: 16px;
    text-align: right;
    color: #4ECDC4;
}

.game-name {
    font-size: 14px;
    opacity: 0.8;
    text-align: center;
}

/* Enhanced Visual Effects */
.leaderboard-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.leaderboard-container:hover::before {
    opacity: 1;
}

.leaderboard-container {
    position: relative;
    overflow: hidden;
}

/* Smooth transitions for all interactive elements */
.filter-btn,
.score-entry,
.retry-btn,
.leaderboard-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulse animation for loading spinner */
.loading-spinner {
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
opacity: 1;
    }
    50% {
opacity: 0.7;
    }
}

/* Staggered animation for score entries */
.score-entry {
    opacity: 0;
    transform: translateY(20px);
}

.score-entry.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* Hover effects for interactive elements */
.scores-container:hover .score-entry:not(:hover) {
    opacity: 0.7;
}

.score-entry:hover {
    opacity: 1 !important;
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Focus styles for accessibility */
.filter-btn:focus,
.retry-btn:focus {
    outline: 2px solid #4ECDC4;
    outline-offset: 2px;
}

/* Loading state enhancements */
.loading-state p {
    margin-top: 10px;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Error state enhancements */
.error-state {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.retry-btn {
    position: relative;
    overflow: hidden;
}

.retry-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.retry-btn:hover::before {
    left: 100%;
}

/* Offline indicator styling */
.offline-indicator {
    color: #FF6B6B;
    font-weight: normal;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/**
 * Mobile Responsive Design Breakpoint
 * 
 * Responsive Design Strategy:
 * - 768px breakpoint aligns with common tablet/mobile boundary
 * - Single column layout ensures optimal mobile experience
 * - Reduced title font size maintains proportion on smaller screens
 * 
 * Mobile Optimization Features:
 * - Touch-friendly card sizes maintained (minimum 350px width)
 * - Adequate spacing preserved for finger navigation
 * - Typography scales appropriately for mobile readability
 * 
 * Cross-Device Compatibility:
 * - Works on phones, tablets, Chromebooks, and desktop browsers
 * - Maintains functionality across iOS Safari, Chrome Mobile, Firefox Mobile
 * 
 * Requirements: 2.1, 2.2, 2.3, 2.4 (Mobile Responsiveness)
 */
@media (max-width: 768px) {
    .title {
font-size: 36px;
    }

    .games-grid {
grid-template-columns: 1fr;
    }

    /* Mobile Leaderboard Styles */
    .leaderboard-container {
padding: 20px;
margin: 20px 0;
    }

    .leaderboard-title {
font-size: 24px;
margin-bottom: 20px;
    }

    .filter-controls {
gap: 8px;
    }

    .filter-btn {
padding: 8px 16px;
font-size: 12px;
min-height: 40px;
    }

    .scores-header {
grid-template-columns: 50px 1fr 80px;
gap: 10px;
padding: 12px 15px;
font-size: 12px;
    }

    .score-entry {
grid-template-columns: 50px 1fr 80px;
gap: 10px;
padding: 12px 15px;
    }

    .game-col,
    .game-name {
display: none;
    }

    .rank {
font-size: 16px;
    }

    .player-name {
font-size: 14px;
    }

    .score-value {
font-size: 14px;
    }

    .loading-state,
    .error-state,
    .empty-state {
padding: 30px 20px;
    }

    .empty-icon {
font-size: 48px;
    }

    .error-icon {
font-size: 36px;
    }

    /* Enhanced mobile touch interactions */
    .filter-btn {
-webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
touch-action: manipulation;
    }

    .score-entry:hover {
transform: none; /* Disable hover transform on mobile */
    }

    .scores-container:hover .score-entry:not(:hover) {
opacity: 1; /* Disable hover opacity changes on mobile */
    }

    /* Mobile-specific animations */
    .score-entry {
transition: background-color 0.2s ease;
    }

    .score-entry:active {
background: rgba(255, 255, 255, 0.1);
    }

    /* Improved mobile scrolling */
    .scores-list {
-webkit-overflow-scrolling: touch;
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    }

    .scores-list::-webkit-scrollbar {
width: 4px;
    }

    .scores-list::-webkit-scrollbar-track {
background: transparent;
    }

    .scores-list::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.3);
border-radius: 2px;
    }
}


/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .leaderboard-container {
border-width: 1px;
    }

    .filter-btn {
border-width: 1px;
    }

    .score-entry {
border-bottom-width: 0.5px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .leaderboard-container {
background: rgba(0, 0, 0, 0.3);
border-color: rgba(255, 255, 255, 0.1);
    }

    .scores-container {
background: rgba(0, 0, 0, 0.4);
    }

    .filter-btn {
background: rgba(0, 0, 0, 0.3);
border-color: rgba(255, 255, 255, 0.2);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .filter-btn,
    .score-entry,
    .retry-btn,
    .leaderboard-container,
    .loading-spinner {
transition: none;
animation: none;
    }

    .score-entry {
opacity: 1;
transform: none;
    }
}

body {
    font-family: Arial, sans-serif;
    font-weight: 400;
    font-size: 14px;
}
.wrapper {
    width: 960px;
    margin: 0 auto;
}


.container a {
    color: #454545;
}
.container table {
    font-size: 11px;
    margin-top: 20px;
}
.container table thead td {
    background-color: #f5f5f5;
    padding: 4px 10px;
}
.container table tbody td {
    padding: 4px 10px;
}
.container .box {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-top: 30px;
}
.container input {
    background-color: #f5f5f5;
    border: 0;
    padding: 5px 10px;
}
.container input[type="submit"] {
    background-color: #ccc;
    cursor: pointer;
}
.container input[type="submit"]:hover {
    background-color: #222;
    color: #fff;
}
.container button {
    background-color: #ccc;
    border: 0;
    padding: 5px 10px;
    cursor: pointer;
}
.container button:hover {
    background-color: #222;
    color: #fff;
}



/* navigation dropdown menu */
.navigation, .navigation-submenu {
    display: inline-block;
    list-style: none;
    /* btw this is necessary to remove most browsers's "hidden" default <ul> intent */
    margin: 0;
    padding: 0;
}
/* TODO */
.navigation {
}
.navigation.right {
    float: right;
}
.navigation li {
    float: left;
    margin-right: 5px;
}
.navigation .navigation-submenu {
    display: none;
}
.navigation li a {
    display: block;
    text-decoration: none;
    padding: 10px 15px;
    border: 2px solid #454545;
    background: #454545;
    color: #fff;
    float:none;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
}
.navigation li:hover .navigation-submenu {
    display: block;
    position: absolute;
    float: left;
}
.navigation li:hover li,
.navigation li:hover a {
    float: none;
}
.navigation li a:hover,
.navigation li:hover li a:hover {
    background: #fff;
    color: #454545;
}

.navigation > li.active a {
    background: #fff;
    color: #454545;
}
.navigation > li.active li a {
    background: #454545;
    color: #fff;
}

/* overview */
.overview-table img {
    width: 40px;
    height: 40px;
}

/* feedback boxes */
.feedback {
    padding: 30px;
    margin-bottom: 10px;
}
.feedback.success {
    color: #558f2d;
    background-color: #ddf2c0;
}
.feedback.error {
    color: #ff7272;
    background-color: #ffe5e5;
}
.feedback.info {
    color: #00529B;
    background-color: #BDE5F8;
}

.header_right_box {
    float: right;
}

/* login screen */
.login-page-box {
    display: table;
    width: 100%;
}
.login-page-box .table-wrapper {
    display: table-row;
}

.login-box {
    display: table-cell;
    margin: 0;
    color: #777;
    background-color: #f4f3f1;
    padding: 20px 50px 45px 50px;
    width: 49%;
    box-sizing: border-box;
    font-weight: 400;
    text-transform: uppercase;
}
.login-box h2 {
    color: #252525;
}
.login-box input[type="text"],
.login-box input[type="password"] {
    font-family: Arial, sans-serif;
    color: #252525;
    background-color: #ffffff;
    padding: 15px 20px;
    margin-bottom: 10px;
    display: block;
    width: 100%;
    box-sizing: border-box; /* modern way to say width:100% without padding */
    /*text-transform: uppercase;*/
}
.login-box input[type="submit"] {
    color: #777;
    background-color: transparent;
    border: 2px solid #777;
    padding: 15px 20px;
    margin-bottom: 10px;
    display: block;
    width: 100%;
    box-sizing: border-box; /* modern way to say width:100% without padding */
    text-transform: uppercase;
}
.login-box input[type="submit"]:hover {
    color: #fff;
    border-color: #252525;
    background-color: #252525;
}
.login-box .remember-me-label {
    display: block;
    margin-bottom: 10px;
}
.login-box .link-forgot-my-password {
    display: block;
    text-align: right;
}
.login-box .link-forgot-my-password a {
    color: #777;
    text-decoration: none;
}
.login-box .link-forgot-my-password a:hover {
    text-decoration: underline;
}
.login-box ::-webkit-input-placeholder { color: #777; opacity: 0.5; }
.login-box ::-moz-placeholder { color: #777; opacity: 0.5; }
.login-box :-ms-input-placeholder { color: #777; opacity: 0.5; }
.login-box input:-moz-placeholder { color: #777; opacity: 0.5; }

.register-box {
    display: table-cell;
    color: #fff;
    background-color: #252525;
    padding: 20px 50px 45px 50px;
    width: 49%;
    box-sizing: border-box;
    font-weight: 400;
    margin: 0;
    text-transform: uppercase;
}
.register-box h2 {
    color: #fff;
}
.register-box a {
    width: 100%;
    display: block;
    box-sizing: border-box; /* modern way to say width:100% without padding */
    background-color: transparent;
    border: 2px solid #fff;
    padding: 15px 20px;
    margin-bottom: 10px;
    text-decoration: none;
    text-align: center;
    color: #fff;
}
.register-box a:hover {
    background-color: #ffffff;
    color: #252525;
}

/* error page */
.red-text {
    color: red;
}
