/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior-y: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.language-selector {
    padding: 10px 16px;
    border: 2px solid #667eea;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 35px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.language-selector:hover, .language-selector:focus {
    border-color: #764ba2;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Main Content */
main {
    padding: 40px 0;
}

.hero {
    text-align: center;
    color: white;
    margin-bottom: 50px;
}

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

.hero p {
    font-size: 18px;
    opacity: 0.95;
}

/* Games Grid - Vertical Layout */
.games-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.game-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Featured Card - Center Highlight */
.game-card.featured {
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    padding: 50px 40px;
    transform: scale(1.08);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
    border: 3px solid #667eea;
    z-index: 10;
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.game-card.featured .game-icon {
    font-size: 80px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

.game-card.featured .game-title {
    font-size: 26px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-card.featured .game-desc {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}

.game-card.featured .play-btn {
    padding: 16px 40px;
    font-size: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.game-card:hover::before, .game-card:active::before {
    transform: scaleX(1);
}

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

.game-card.featured:hover {
    transform: scale(1.12);
    box-shadow: 0 25px 70px rgba(102, 126, 234, 0.5);
}

.game-card:active {
    transform: translateY(-5px) scale(0.98);
}

.game-card.featured:active {
    transform: scale(1.08);
}

/* Active state for clicked game */
.game-card.active {
    transform: scale(1.15);
    box-shadow: 0 30px 80px rgba(102, 126, 234, 0.6);
    border: 4px solid #667eea;
    z-index: 100;
}

.game-card.featured.active {
    transform: scale(1.2);
    box-shadow: 0 35px 90px rgba(102, 126, 234, 0.7);
    border: 5px solid #764ba2;
}

.game-card.active .game-icon-img {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.5);
}

/* Animation for active state */
@keyframes activePulse {
    0%, 100% {
        box-shadow: 0 30px 80px rgba(102, 126, 234, 0.6);
    }
    50% {
        box-shadow: 0 35px 90px rgba(102, 126, 234, 0.8);
    }
}

.game-card.active {
    animation: activePulse 2s ease-in-out infinite;
}

/* Touch feedback for mobile */
@media (hover: none) {
    .game-card {
        transition: all 0.2s ease;
    }

    .game-card:active {
        transform: scale(0.95);
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    }
}

.game-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

/* Game Icon Image Styles */
.game-icon-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    background: white;
    padding: 10px;
}

.game-card.featured .game-icon-img {
    width: 160px;
    height: 160px;
    margin-bottom: 20px;
    border-radius: 25px;
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
    padding: 15px;
}

.game-card:hover .game-icon-img {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.game-card.featured:hover .game-icon-img {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.5);
}

.game-title {
    font-size: 22px;
    margin-bottom: 10px;
    color: #333;
}

.game-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Game Stats */
.game-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    padding: 8px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.stat-icon {
    font-size: 16px;
    line-height: 1;
}

.stat-value {
    font-size: 14px;
    font-weight: bold;
    color: #667eea;
    line-height: 1;
}

.stat-label {
    font-size: 11px;
    color: #999;
    margin-left: 2px;
    line-height: 1;
}

/* Featured game stats */
.game-card.featured .game-stats {
    gap: 25px;
    margin-bottom: 25px;
}

.game-card.featured .stat-item {
    background: linear-gradient(135deg, #fff 0%, #f0f2ff 100%);
    padding: 10px 16px;
    border-radius: 22px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.15);
}

.game-card.featured .stat-icon {
    font-size: 18px;
}

.game-card.featured .stat-value {
    font-size: 16px;
}

.game-card.featured .stat-label {
    font-size: 12px;
}

/* Rating stars */
.rating {
    color: #ffd700;
    text-shadow: 0 1px 2px rgba(255, 215, 0, 0.3);
}

/* Likes */
.likes {
    color: #ff6b6b;
}

.play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    min-height: 48px; /* Mobile touch target size */
    min-width: 120px;
}

.play-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.play-btn:hover::after {
    width: 300px;
    height: 300px;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.play-btn:active {
    transform: scale(0.98);
}

/* Touch feedback for mobile */
@media (hover: none) {
    .play-btn {
        transition: all 0.2s ease;
    }

    .play-btn:active {
        transform: scale(0.95);
        box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    }
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

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

.game-frame-container {
    width: 100%;
    height: 100%;
}

.game-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Ad Container */
.ad-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin: 30px auto;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.ad-container div[id^='div-gpt-ad'] {
    margin: 0 auto;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

footer p {
    opacity: 0.8;
    margin-bottom: 10px;
}

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

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 13px;
    opacity: 0.8;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 5px;
}

.footer-links a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.domain-info {
    font-size: 12px;
    opacity: 0.6;
    margin-top: 15px;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    header {
        padding: 15px 0;
    }

    .hero {
        margin-bottom: 30px;
        padding: 20px 0;
    }

    .hero h2 {
        font-size: 28px;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .hero p {
        font-size: 15px;
        padding: 0 10px;
        line-height: 1.6;
    }

    .games-grid {
        max-width: 100%;
        gap: 15px;
        padding: 10px 0;
    }

    .game-card {
        padding: 25px 20px;
        border-radius: 15px;
    }

    .game-card.featured {
        padding: 35px 25px;
        transform: scale(1.02);
    }

    .game-icon {
        font-size: 56px;
        margin-bottom: 12px;
    }

    .game-icon-img {
        width: 90px;
        height: 90px;
        padding: 8px;
    }

    .game-card.featured .game-icon-img {
        width: 120px;
        height: 120px;
        padding: 12px;
    }

    .game-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .game-desc {
        font-size: 13px;
        margin-bottom: 15px;
        padding: 0 5px;
    }

    .game-stats {
        gap: 12px;
        margin-bottom: 15px;
    }

    .stat-item {
        padding: 6px 10px;
    }

    .stat-icon {
        font-size: 14px;
    }

    .stat-value {
        font-size: 12px;
    }

    .stat-label {
        font-size: 10px;
    }

    .play-btn {
        padding: 12px 28px;
        font-size: 15px;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .close {
        top: 15px;
        right: 20px;
        font-size: 36px;
    }

    .logo {
        font-size: 22px;
    }

    /* Active state for mobile */
    .game-card.active {
        transform: scale(1.05);
    }

    .game-card.featured.active {
        transform: scale(1.08);
    }

    .language-selector {
        padding: 8px 28px 8px 14px;
        font-size: 13px;
    }

    main {
        padding: 30px 0;
    }

    footer {
        padding: 20px 0;
        font-size: 13px;
    }

    .footer-links {
        gap: 10px;
        margin: 15px 0;
    }

    .footer-links a {
        font-size: 11px;
        padding: 4px 8px;
    }

    .domain-info {
        font-size: 11px;
    }

    .featured-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 24px;
    }

    .hero p {
        font-size: 14px;
    }

    .game-card {
        padding: 20px 15px;
    }

    .game-card.featured {
        padding: 30px 20px;
        transform: scale(1.01);
    }

    .game-icon {
        font-size: 48px;
    }

    .game-card.featured .game-icon {
        font-size: 60px;
    }

    .game-icon-img {
        width: 70px;
        height: 70px;
        padding: 6px;
    }

    .game-card.featured .game-icon-img {
        width: 90px;
        height: 90px;
        padding: 8px;
    }

    .game-title {
        font-size: 16px;
    }

    .game-desc {
        font-size: 12px;
    }

    .game-stats {
        gap: 8px;
        margin-bottom: 12px;
    }

    .stat-item {
        padding: 5px 8px;
    }

    .stat-icon {
        font-size: 12px;
    }

    .stat-value {
        font-size: 11px;
    }

    .stat-label {
        font-size: 9px;
    }

    .play-btn {
        padding: 11px 24px;
        font-size: 14px;
    }

    .logo {
        font-size: 18px;
    }

    .language-selector {
        padding: 7px 24px 7px 12px;
        font-size: 12px;
    }

    .close {
        top: 10px;
        right: 15px;
        font-size: 32px;
    }
}

/* PC Large Screen Optimizations */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .games-grid {
        max-width: 700px;
    }

    .hero h2 {
        font-size: 48px;
    }

    .hero p {
        font-size: 20px;
    }

    .game-card.featured {
        transform: scale(1.1);
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .games-grid {
        max-width: 650px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .games-grid {
        max-width: 600px;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .games-grid {
        max-width: 550px;
    }

    .game-card.featured {
        transform: scale(1.05);
    }
}

/* Tablet specific optimizations */
@media (min-width: 481px) and (max-width: 768px) {
    .games-grid {
        max-width: 500px;
    }
}

/* Touch device specific styles */
@media (hover: none) and (pointer: coarse) {
    .game-card:hover {
        transform: none;
    }

    .play-btn:hover {
        transform: none;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .game-icon {
        image-rendering: -webkit-optimize-contrast;
    }

    .game-icon-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support for system preference */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed in the future */
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
