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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: url('background.png') center/cover no-repeat fixed;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.launcher-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 1;
    margin: auto 0;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    padding: 20px;
}

.app-card-container {
    perspective: 1000px;
    height: 280px;
}

.app-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.app-card-container.flipped .app-card-inner {
    transform: rotateY(180deg);
}

.app-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, rgba(138, 73, 244, 0.15), rgba(26, 10, 46, 0.9));
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.app-card-front {
    transform: rotateY(0deg);
}

.app-card-back {
    transform: rotateY(180deg);
    justify-content: center;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(145deg, #8a49f4, #ff47a1, #00d9ff);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.app-card > * {
    position: relative;
    z-index: 1;
}

.app-card-front:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(138, 73, 244, 0.6),
        0 0 80px rgba(138, 73, 244, 0.3);
}

.app-card-front:hover::before {
    opacity: 1;
}

.app-card-container:not(.flipped) .app-card-front:hover {
    transform: translateY(-8px) scale(1.02);
}

.app-card-container.flipped .app-card-back {
    pointer-events: auto;
}

.app-card-container:not(.flipped) .app-card-back {
    pointer-events: none;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ff47a1 0%, #8a49f4 50%, #00d9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #ffffff;
    font-weight: bold;
    box-shadow:
        0 8px 24px rgba(138, 73, 244, 0.6),
        0 0 40px rgba(255, 71, 161, 0.4);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow:
            0 8px 24px rgba(138, 73, 244, 0.6),
            0 0 40px rgba(255, 71, 161, 0.4);
    }
    50% {
        box-shadow:
            0 8px 32px rgba(138, 73, 244, 0.8),
            0 0 60px rgba(255, 71, 161, 0.6);
    }
}

.app-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff 0%, #d4c5f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-description {
    font-size: 14px;
    color: #c9b3ff;
    line-height: 1.4;
    text-shadow: 0 0 10px rgba(201, 179, 255, 0.3);
}

.app-back-image {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    background: linear-gradient(135deg, #ff47a1 0%, #8a49f4 50%, #00d9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    margin-bottom: 20px;
    box-shadow:
        0 8px 24px rgba(138, 73, 244, 0.6),
        0 0 40px rgba(255, 71, 161, 0.4);
}

.play-button {
    padding: 12px 32px;
    background: linear-gradient(135deg, #ff47a1 0%, #8a49f4 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(138, 73, 244, 0.4);
    position: relative;
    z-index: 10;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(138, 73, 244, 0.6);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
    }

    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
        padding: 10px;
    }

    .app-card-container {
        height: 240px;
    }

    .app-card {
        padding: 20px;
    }

    .app-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .app-back-image {
        width: 80px;
        height: 80px;
        font-size: 40px;
        margin-bottom: 15px;
    }

    .play-button {
        padding: 10px 24px;
        font-size: 14px;
    }
}
