body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    color: #e0e0e0;
    position: relative;
}
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('imggame/0.jpg') center/cover;
    opacity: 0.1;
    z-index: -1;
    animation: starryGlow 10s ease-in-out infinite;
}
@keyframes starryGlow {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.15; }
}
.container {
    text-align: center;
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1s ease-in;
    box-sizing: border-box;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.logo {
    max-width: 150px;
    margin: 0 auto 30px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}
h1 {
    font-size: 2em;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}
p {
    font-size: 1em;
    color: #b0b0b0;
    margin: 10px 0 20px;
}
.cards-preview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-bottom: 20px;
    justify-items: center;
    align-content: center;
    padding: 20px;
    width: calc(100% - 40px);
    max-width: 1000px;
    box-sizing: border-box;
}
.card-preview {
    width: 180px;
    height: 270px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}
.card-preview img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    .card-preview {
        width: 60px;
        height: 90px;
    }
    .logo {
        max-width: 100px;
        margin-bottom: 20px;
    }
    h1 {
        font-size: 1.5em;
    }
    p {
        font-size: 0.9em;
    }
    .cards-preview {
        gap: 6px;
        padding: 0 10px;
    }
}
.btn {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s, border-color 0.3s;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 20px rgba(0, 240, 255, 0.3), 0 0 30px rgba(0, 240, 255, 0.1);
    animation: neonGlow 1.5s ease-in-out infinite alternate;
}
.btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.8), 0 0 30px rgba(0, 240, 255, 0.5), 0 0 45px rgba(0, 240, 255, 0.3);
    border-color: rgba(0, 240, 255, 0.8);
}
@keyframes neonGlow {
    from {
        box-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 20px rgba(0, 240, 255, 0.3), 0 0 30px rgba(0, 240, 255, 0.1);
    }
    to {
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.8), 0 0 30px rgba(0, 240, 255, 0.5), 0 0 45px rgba(0, 240, 255, 0.3);
    }
}
.game-screen, .result-screen, .retry-screen, .cooldown-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-in;
    padding: 20px;
    box-sizing: border-box;
}
.game-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 20px rgba(0, 240, 255, 0.3), 0 0 30px rgba(0, 240, 255, 0.1);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    animation: neonGlow 1.5s ease-in-out infinite alternate;
}
.card {
    width: 70px;
    height: 105px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.5s ease, box-shadow 0.3s ease;
    position: relative;
    transform-style: preserve-3d;
}
.card:hover {
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}
.card img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
}
.card .back {
    transform: rotateY(0deg);
}
.card .front {
    transform: rotateY(180deg);
}
.card.flipped {
    transform: rotateY(180deg);
}
@media (max-width: 768px) {
    .game-board {
        max-width: 100%;
        padding: 10px;
    }
    .card {
        width: 60px;
        height: 90px;
    }
}
.popup {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    width: 400px;
    min-height: 300px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 20px rgba(0, 240, 255, 0.3), 0 0 30px rgba(0, 240, 255, 0.1);
    backdrop-filter: blur(8px);
    color: #ffffff;
    animation: popIn 0.5s ease-out, neonGlow 1.5s ease-in-out infinite alternate;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}
@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.popup img {
    max-width: 150px;
    border-radius: 10px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}
.popup p {
    font-size: 1.2em;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 20px;
}
.popup .btn {
    margin: 8px;
}
.countdown {
    font-size: 1.5em;
    font-weight: 600;
    color: #ffffff;
    margin: 20px 0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}
.attempts {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.2em;
    font-weight: 600;
    color: #ffffff;
    background: rgba(0, 122, 255, 0.2);
    padding: 8px 16px;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}
.attempts:hover {
    transform: scale(1.05);
}
@media (max-width: 768px) {
    .attempts {
        font-size: 1em;
        padding: 6px 12px;
        top: 10px;
        right: 10px;
    }
    .countdown {
        font-size: 1.2em;
    }
    .popup {
        width: 90%;
        min-height: 250px;
    }
}