/* Modern Design System - Consistent with Portfolio */
:root {
    --primary: #0B7A75;
    --primary-dark: #19535F;
    --accent: #D7C9AA;
    --accent-gold: #fbbf24;
    --text-primary: #F0F3F5;
    --text-secondary: rgba(240, 243, 245, 0.7);
    --bg-dark: #0a1929;
    --bg-darker: #05101a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-darker);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
    height: auto;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated gradient background */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0a1929 0%, #0d2a32 25%, #05101a 50%, #0a1929 75%, #0d2a32 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    will-change: background-position;
    transform: translateZ(0);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Floating orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
    will-change: transform;
    transform: translateZ(0);
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-gold);
    bottom: -200px;
    right: -200px;
    animation-delay: 5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 50%;
    right: -150px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    position: relative;
    opacity: 0;
    transform: translate3d(0, 10px, 0);
    transition: opacity 0.3s ease;
    overflow-x: hidden;
    will-change: opacity;
}

.screen.active {
    display: block;
    opacity: 1;
    transform: translate3d(0, 0, 0);
    animation: screenFadeIn 0.4s ease-out;
    will-change: auto;
}

/* Games hub screen should allow vertical scrolling and natural height */
#games-hub.screen {
    overflow-y: visible;
    height: auto;
    min-height: 100vh;
    transform: none;
}

#games-hub.screen.active {
    display: block;
    transform: none;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Splash Screen */
#splash-screen {
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    background: var(--bg-darker);
}

.splash-content {
    text-align: center;
    animation: fadeIn 1s ease-in;
}

.splash-logo {
    height: 100vh;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 10px 30px rgba(11, 122, 117, 0.5));
    animation: fadeIn 1s ease-in, logoGlow 2s ease-in-out infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 10px 30px rgba(11, 122, 117, 0.5));
    }
    50% {
        filter: drop-shadow(0 15px 40px rgba(11, 122, 117, 0.8));
    }
}

/* Navigation */
.hub-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 40px;
    backdrop-filter: blur(20px);
    background: rgba(10, 25, 41, 0.8);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-wrapper {
    display: inline-block;
    padding: 5px 20px;
    text-decoration: none;
    cursor: pointer;
    margin: -5px 0;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent-gold), var(--primary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0px;
    display: inline-block;
    transform-style: preserve-3d;
    pointer-events: none;
}

.logo-wrapper:hover .logo {
    background-position: 100% 50%;
    letter-spacing: 2px;
    transform: rotateX(360deg) scale(1.08);
    filter: drop-shadow(0 4px 12px rgba(11, 122, 117, 0.4));
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* Games Hub Content */
#games-hub {
    position: relative;
    padding-top: 80px;
    overflow-x: hidden;
    min-height: 100vh;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.hub-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(30px, 5vw, 60px) clamp(15px, 3vw, 20px);
    width: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.hub-header {
    text-align: center;
    margin-bottom: clamp(30px, 5vw, 60px);
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-label {
    display: inline-block;
    padding: 6px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: 13px;
    color: var(--accent-gold);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.hub-title {
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 900;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 50%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hub-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

/* Game Cards */
.game-card {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(215, 201, 170, 0.06), rgba(251, 191, 36, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: clamp(16px, 2vw, 20px);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.1);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent-gold), var(--primary));
    background-size: 200% 100%;
    transform: scaleX(0);
    transition: transform 0.4s ease;
    z-index: 1;
}

.game-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(11, 122, 117, 0.2), rgba(251, 191, 36, 0.3));
    border-radius: clamp(16px, 2vw, 20px);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 24px 64px rgba(251, 191, 36, 0.3), 0 8px 32px rgba(11, 122, 117, 0.2);
}

.game-card:hover::before {
    transform: scaleX(1);
    animation: shimmer 2s ease infinite;
}

.game-card:hover::after {
    opacity: 1;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.game-card-image {
    height: 240px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(215, 201, 170, 0.12), rgba(11, 122, 117, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    width: 100%;
    flex-shrink: 0;
}

.game-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(251, 191, 36, 0.2) 0%, transparent 70%);
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.game-card:hover .game-card-image::before {
    opacity: 0.9;
}

.game-card-image img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: transform 0.4s ease;
    z-index: 1;
    position: relative;
}

.game-card:hover .game-card-image img {
    transform: scale(1.1);
    filter: drop-shadow(0 12px 24px rgba(251, 191, 36, 0.4)) drop-shadow(0 8px 16px rgba(11, 122, 117, 0.3));
}

.game-card-image img.solitaire-logo {
    width: 180px;
    height: 180px;
}

.game-card-image img.wanderer-logo {
    width: 176px;
    height: 176px;
}

.city-icon {
    font-size: 90px;
    transition: transform 0.4s ease;
}

.game-card:hover .city-icon {
    transform: scale(1.2);
}

.game-card-content {
    padding: 28px;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.game-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.game-description {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.6;
    flex: 1;
}

.game-badge {
    display: inline-block;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trivia-badge {
    background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
    border: none;
    color: #0d2a32;
}

.sports-badge {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border: none;
    color: #ffffff;
}

.puzzle-badge {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    border: none;
    color: #ffffff;
}

.wip-badge {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.2));
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: var(--accent-gold);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.strategy-badge {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    color: #0d2a32;
}

.adventure-badge {
    background: linear-gradient(135deg, #F44336, #D32F2F);
    border: none;
    color: #ffffff;
}

/* Game Card Overlay */
.game-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(11, 122, 117, 0.95), rgba(25, 83, 95, 0.95));
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    border-radius: 20px;
}

.game-card:hover .game-card-overlay {
    opacity: 1;
}

.play-icon {
    font-size: clamp(36px, 5vw, 48px);
    color: white;
    margin-bottom: 12px;
    animation: playPulse 1.5s ease-in-out infinite;
}

@keyframes playPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

.play-text {
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 800;
    color: white;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Footer */
.hub-footer {
    text-align: center;
    padding: clamp(20px, 3vw, 30px) 20px;
    color: var(--text-secondary);
    font-size: clamp(12px, 1.8vw, 14px);
    margin-top: auto;
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
/* Very large desktops */
@media (min-width: 1400px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 40px;
        padding: 0;
    }
}

/* Large tablets and small desktops */
@media (min-width: 1024px) and (max-width: 1399px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }
}

/* Medium tablets */
@media (min-width: 768px) and (max-width: 1023px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
    
    .hub-content {
        padding: 50px 30px;
    }
    
    .hub-header {
        margin-bottom: 50px;
    }
    
    .game-card-image {
        height: 200px;
    }
    
    .game-card-image img {
        width: 140px;
        height: 140px;
    }
    
    .game-card-image img.solitaire-logo {
        width: 160px;
        height: 160px;
    }
    
    .game-card-image img.wanderer-logo {
        width: 154px;
        height: 154px;
    }
    
    .city-icon {
        font-size: 80px;
    }
    
    .game-card-content {
        padding: 24px;
    }
    
    .game-title {
        font-size: 22px;
    }
    
    .game-description {
        font-size: 14px;
    }
}

/* Small tablets and large phones */
@media (max-width: 767px) {
    .hub-nav {
        padding: 15px 20px;
    }

    .logo {
        font-size: 24px;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-link {
        font-size: 14px;
    }

    #games-hub {
        padding-top: 70px;
    }

    .hub-content {
        padding: 40px 15px;
    }

    .hub-header {
        margin-bottom: 40px;
    }

    .hub-title {
        font-size: clamp(32px, 8vw, 48px);
    }

    .hub-subtitle {
        font-size: clamp(14px, 3vw, 18px);
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 0;
    }

    .game-card-image {
        height: 200px;
    }
    
    .game-card-image img {
        width: 140px;
        height: 140px;
    }
    
    .game-card-image img.solitaire-logo {
        width: 160px;
        height: 160px;
    }
    
    .game-card-image img.wanderer-logo {
        width: 154px;
        height: 154px;
    }
    
    .city-icon {
        font-size: 80px;
    }

    .game-card-content {
        padding: 24px;
    }
    
    .game-title {
        font-size: 22px;
    }
    
    .game-description {
        font-size: 14px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .hub-nav {
        padding: 15px 20px;
    }

    .logo {
        font-size: 24px;
    }

    .nav-link {
        font-size: 14px;
    }

    .hub-content {
        padding: 30px 12px;
    }

    .hub-header {
        margin-bottom: 30px;
    }

    .section-label {
        font-size: 11px;
        padding: 5px 12px;
    }

    .hub-title {
        font-size: 28px;
        margin-bottom: 12px;
    }

    .hub-subtitle {
        font-size: 13px;
    }

    .games-grid {
        gap: 20px;
        padding: 0;
    }

    .game-card-image {
        height: 180px;
    }

    .game-card-image img {
        width: 120px;
        height: 120px;
    }

    .game-card-image img.solitaire-logo {
        width: 140px;
        height: 140px;
    }
    
    .game-card-image img.wanderer-logo {
        width: 132px;
        height: 132px;
    }

    .city-icon {
        font-size: 70px;
    }

    .game-card-content {
        padding: 20px;
    }

    .game-title {
        font-size: 20px;
    }

    .game-description {
        font-size: 13px;
    }

    .game-badge {
        font-size: 11px;
        padding: 6px 14px;
    }

    .play-icon {
        font-size: 40px;
    }

    .play-text {
        font-size: 16px;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .hub-title {
        font-size: 24px;
    }

    .game-card-image {
        height: 160px;
    }

    .game-card-image img {
        width: 100px;
        height: 100px;
    }
    
    .game-card-image img.solitaire-logo {
        width: 120px;
        height: 120px;
    }
    
    .game-card-image img.wanderer-logo {
        width: 110px;
        height: 110px;
    }
    
    .city-icon {
        font-size: 60px;
    }
}

/* Prevent text selection */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
