:root {
    --primary: #ff4d4d;
    --primary-alt: #e63946;
    --secondary: #22c55e;
    --accent: #facc15;
    --bg-light: #ffffff;
    --bg-alt: #f8fafc;
    --bg-card: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-white: #ffffff;
    --radius-lg: 1.5rem;
    --radius-md: 0.75rem;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(255, 77, 77, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

header {
    padding: 2.5rem 0;
    background: var(--bg-light);
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.logo-text {
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    color: var(--text-dark);
    text-transform: uppercase;
}

.logo-text .thin {
    font-weight: 300;
}

.logo-text .bold {
    font-weight: 900;
    color: var(--primary);
    margin: 0 0.2rem;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Background elements */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(255, 77, 77, 0.03) 0%, transparent 70%);
    z-index: -1;
    animation: float 20s infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.03) 0%, transparent 70%);
    z-index: -1;
    animation: float 25s infinite alternate-reverse;
}

/* Hero Section */
.hero {
    padding: 4rem 0 6rem;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
    color: var(--text-dark);
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 3rem;
    padding: 2rem 0;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-premium);
}

.game-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.game-icon {
    width: 140px;
    height: 140px;
    border-radius: 2.5rem;
    margin-bottom: 2rem;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease;
}

.game-card:hover .game-icon {
    transform: rotate(5deg) scale(1.1);
}

.game-card h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.game-card p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

.card-actions {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
}

.btn-play-modal {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-play-modal:hover {
    background: var(--primary-alt);
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.btn-details {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    padding: 0.8rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.btn-details:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-white);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #000;
    width: 100%;
    max-width: 500px;
    height: 100%;
    max-height: 850px;
    border-radius: 3rem;
    position: relative;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 77, 77, 0.2);
    border: 8px solid #1e293b;
    overflow: hidden;
}

.modal-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    color: black;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 800;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 1001;
    border: none;
}

.modal-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--primary);
    color: white;
}

.portrait-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Download Buttons */
.download-section {
    padding: 4rem 0;
    text-align: center;
}

.download-link-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 2rem;
    border-radius: 1.5rem;
    color: var(--text-white);
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.download-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.download-btn .btn-text {
    text-align: left;
}

.download-btn .btn-text span {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.download-btn .btn-text b {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Footer */
footer {
    padding: 6rem 0;
    text-align: center;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }

    .modal-overlay {
        padding: 0;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}