@keyframes grain {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -10%);
    }

    20% {
        transform: translate(-15%, 5%);
    }

    30% {
        transform: translate(7%, -25%);
    }

    40% {
        transform: translate(-5%, 25%);
    }

    50% {
        transform: translate(-15%, 10%);
    }

    60% {
        transform: translate(15%, 0%);
    }

    70% {
        transform: translate(0%, 15%);
    }

    80% {
        transform: translate(3%, 35%);
    }

    90% {
        transform: translate(-10%, 10%);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grain {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200%;
    height: 200vh;
    background: transparent url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.05"/></svg>') repeat;
    background-size: 200px;
    animation: grain 8s steps(10) infinite;
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
}

.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    gap: 56px;
    position: relative;
    z-index: 1;
    background: transparent;
}

.landing-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInScale 1s ease-out;
}

.title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.landing-logo {
    height: clamp(56px, 9vw, 120px);
    width: auto;
    object-fit: contain;
    flex: 0 0 auto;
}

.landing-title {
    font-size: clamp(52px, 9vw, 96px);
    font-weight: 600;
    letter-spacing: -0.04em;
    margin-bottom: 12px;
    color: #ffffff;
    display: inline-block;
    background: linear-gradient(90deg,
            #ffffff 0%,
            #f5dcff 10%,
            #df8bff 20%,
            #cc5dff 30%,
            #b026ff 40%,
            #c13fff 50%,
            #b026ff 60%,
            #cc5dff 70%,
            #df8bff 80%,
            #f5dcff 90%,
            #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    animation: gradient-flow 6s linear infinite;
    will-change: background-position;
}

.landing-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    animation: fadeIn 1s ease-out 0.3s both;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 340px));
    justify-content: center;
    gap: 24px;
    width: 100%;
    max-width: 740px;
}

.game-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: var(--transition-premium);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.game-card:nth-child(1) {
    animation: slideUp 0.8s ease-out 0.4s both;
}

.game-card:nth-child(2) {
    animation: slideUp 0.8s ease-out 0.5s both;
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.game-card:hover .card-glow {
    opacity: 0.15;
}

.fortnite-card {
    --glow-color: #b026ff;
}

.fortnite-card:hover {
    border-color: rgba(176, 38, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(176, 38, 255, 0.1);
    transform: translateY(-4px) scale(1.02);
}

.arc-card {
    --glow-color: #de8bff;
}

.arc-card:hover {
    border-color: rgba(222, 139, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(222, 139, 255, 0.1);
    transform: translateY(-4px) scale(1.02);
}

.game-card-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

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

.game-name {
    font-size: 24px;
    font-weight: 500;
    margin: 0;
    letter-spacing: -0.02em;
}

.arrow-icon {
    opacity: 0.4;
    transition: all 0.3s ease;
}

.game-card:hover .arrow-icon {
    opacity: 1;
    transform: translateX(4px);
}

.game-desc {
    font-size: 14px;
    color: #444;
    margin: 8px 0 0 0;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.card-status {
    height: 20px;
}

.badge {
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: inline-block;
    animation: fadeIn 0.6s ease-out both;
}

.badge.updated {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge.outdated {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.landing-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.footer-icons {
    display: flex;
    gap: 12px;
}

.footer-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #666;
    transition: all 0.2s ease;
}

.footer-icon-link:hover {
    color: #fff;
    transform: scale(1.1);
}

.footer-note {
    font-size: 13px;
    color: #3a3a3a;
}

@media (max-width: 740px) {
    .landing-container {
        gap: 36px;
        padding: 28px 16px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        max-width: 380px;
        gap: 16px;
    }

    .game-card-content {
        padding: 24px 20px;
    }

    .game-name {
        font-size: 22px;
    }

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

    .card-glow {
        display: none;
    }
}

@media (max-width: 480px) {
    .landing-container {
        gap: 28px;
        padding: 20px 14px;
    }

    .landing-logo {
        height: clamp(44px, 12vw, 80px);
    }

    .title-row {
        flex-direction: column;
        gap: 8px;
    }

    .landing-title {
        font-size: clamp(36px, 14vw, 56px);
        margin-bottom: 4px;
    }

    .landing-subtitle {
        font-size: 13px;
    }

    .games-grid {
        max-width: 100%;
        gap: 14px;
    }

    .game-card-content {
        padding: 20px 16px;
    }

    .game-name {
        font-size: 20px;
    }

    .game-header {
        flex-wrap: wrap;
    }

    .arrow-icon {
        display: none;
    }

    .footer-icon-link {
        width: 44px;
        height: 44px;
    }

    .footer-note {
        font-size: 12px;
    }
}

@media (max-width: 375px) {
    .landing-container {
        gap: 24px;
        padding: 16px 12px;
    }

    .landing-logo {
        height: clamp(40px, 15vw, 60px);
    }

    .landing-title {
        font-size: clamp(32px, 16vw, 48px);
    }

    .landing-subtitle {
        font-size: 12px;
    }

    .game-card-content {
        padding: 18px 14px;
    }

    .game-name {
        font-size: 18px;
    }

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

.header-viewer {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.header-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-back:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin: 0;
}

.header-badge {
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.header-search {
    margin-left: auto;
}

.header-search-input {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    width: 320px;
    transition: all 0.2s;
}

.header-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.header-search-input:focus {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.code-viewer {
    flex: 1;
    overflow: auto;
    padding: 32px;
}

.code-loading {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
    font-size: 15px;
}

.code-content {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #e2e8f0;
    margin: 0;
    background: var(--bg-secondary);
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stats-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 32px;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.stats-bar span {
    font-weight: 500;
}

@media (max-width: 768px) {
    .header-bar {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-search {
        margin-left: 0;
        width: 100%;
        order: 3;
    }

    .header-search-input {
        width: 100%;
    }

    .header-back {
        width: 40px;
        height: 40px;
    }

    .header-title {
        font-size: 16px;
        flex: 1;
    }

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

    .code-viewer {
        padding: 16px;
    }

    .code-content {
        padding: 16px;
        font-size: 12px;
        border-radius: 8px;
    }

    .stats-bar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
        font-size: 12px;
    }

    .stats-bar span:first-child {
        width: 100%;
    }
}