* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Apple Color System */
    --primary-bg: #FFFFFF;
    --secondary-bg: #F5F5F7;
    --tertiary-bg: #ECECF0;
    --text-primary: #1D1D1F;
    --text-secondary: #6F6F77;
    --border-color: #E5E5EA;
    --blue: #0071E3;
    --blue-hover: #0077ED;
    --light-gray: #A9A9B3;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 60px 20px 40px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

.game-icon {
    font-size: 48px;
}

.header h1 {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.header > p {
    width: 100%;
}

.subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 12px;
    text-align: center;
}

.badge {
    font-size: 20px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 12px;
    letter-spacing: 0;
    margin-left: auto;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

main {
    flex: 1;
    padding: 50px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Game Card */
.game-card {
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    border-color: var(--blue);
}

.game-card h1 {
    font-size: 0;
    margin: 0;
    padding: 0;
    line-height: 0;
    height: 0;
    visibility: hidden;
}

.game-card-link {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    display: block;
}

.game-card-link:hover {
    color: var(--blue);
}

.game-card-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-bottom: 75%;
    background: var(--secondary-bg);
    display: block;
    text-decoration: none;
}

.game-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-card-image img {
    transform: scale(1.05);
}

.game-card-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.game-card-info p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    background-color: var(--secondary-bg);
    color: var(--text-secondary);
}

.footer p {
    font-size: 13px;
    margin: 6px 0;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--blue);
}

.footer-links {
    font-size: 13px;
    margin: 8px 0 6px 0;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
}

.footer-link:hover {
    color: var(--blue);
}

.footer-separator {
    color: var(--border-color);
    margin: 0 10px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: var(--primary-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-body pre {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", monospace;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.contact-body {
    text-align: center;
}

.email-display {
    margin-top: 20px;
    padding: 16px;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--blue);
    word-break: break-all;
    font-family: monospace;
    user-select: all;
}

/* Responsive Design */
@media (max-width: 1024px) {
    main {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 25px;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 25px;
    }

    .header h1 {
        font-size: 36px;
    }

    .subtitle {
        font-size: 16px;
    }

    .badge {
        font-size: 16px;
        margin-top: 12px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header {
        padding: 40px 16px 30px;
    }

    .game-icon {
        font-size: 36px;
    }

    .header h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
    }

    .badge {
        font-size: 14px;
        margin-top: 10px;
        margin-left: 0;
        display: block;
        margin-top: 12px;
    }

    .header > p:last-child {
        text-align: center;
    }

    main {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    main {
        padding: 30px 0;
    }

    .modal-content {
        max-height: 90vh;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .modal-body pre {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .header {
        padding: 30px 12px 20px;
    }

    .logo {
        gap: 10px;
    }

    .game-icon {
        font-size: 32px;
    }

    .header h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 13px;
        margin-top: 8px;
    }

    .badge {
        font-size: 13px;
        margin-top: 8px;
        margin-left: 0;
        display: block;
    }

    main {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .game-card-info {
        padding: 14px;
    }

    .game-card-link {
        font-size: 14px;
    }

    .game-card-info p {
        font-size: 12px;
    }

    .footer p {
        font-size: 11px;
    }
}

/* Ultra Small Devices */
@media (max-width: 320px) {
    .header h1 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 12px;
    }

    .badge {
        font-size: 13px;
        margin-top: 6px;
        margin-left: 0;
        display: block;
    }

    main {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .game-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .game-card-info {
        padding: 12px;
    }

    .modal-content {
        max-height: 90vh;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body pre {
        font-size: 11px;
    }
}

/* Smooth Transitions */
@media (prefers-reduced-motion: reduce) {
    .game-card,
    .game-card-image img {
        transition: none;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-bg: #1D1D1F;
        --secondary-bg: #292930;
        --tertiary-bg: #424245;
        --text-primary: #FFFFFF;
        --text-secondary: #A9A9B3;
        --border-color: #424245;
        --blue: #0A84FF;
        --blue-hover: #3BA3FF;
    }
}
