:root {
    --primary: #007AFF;
    --bg-color: #f5f5f7;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(255, 255, 255, 0.4);
    --text-color: #1d1d1f;
    --secondary-text: #86868b;
    --border-radius: 12px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
}

/* Bubble Background */
.bubble-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.08);
    animation: float 15s infinite ease-in-out alternate;
    filter: blur(40px);
}
.bubble-1 { width: 400px; height: 400px; top: -100px; left: -100px; }
.bubble-2 { width: 500px; height: 500px; bottom: -150px; right: -100px; animation-delay: -2s; background: rgba(52, 199, 89, 0.08); }
.bubble-3 { width: 300px; height: 300px; bottom: 20%; left: 20%; animation-delay: -5s; background: rgba(255, 59, 48, 0.05); }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -50px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
}

.game-box {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
}

.game-box h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 20px;
    margin-top: 0;
}

.info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.stats {
    display: flex;
    gap: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-text);
}

.stats strong {
    color: var(--text-color);
    font-weight: 800;
}

.best-time {
    color: #ff9500;
}

.best-time strong {
    color: #ff9500;
}

.btn {
    background-color: var(--text-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.btn:hover {
    background-color: #000;
    transform: scale(1.05);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    perspective: 1000px;
}

.card {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.card-front {
    background-color: var(--primary);
    background-image: radial-gradient(circle at top right, #3395ff, var(--primary));
}

.card-front::after {
    content: '?';
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 800;
}

.card-back {
    background-color: #fff;
    transform: rotateY(180deg);
    font-size: 2.5rem;
    border: 2px solid #e5e5ea;
}

.card.matched .card-back {
    background-color: #f0fdf4;
    border-color: #34c759;
}

/* Info container styling */
.info-container {
    width: 100%;
    max-width: 800px;
    background: #fff;
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    margin-bottom: 40px;
    text-align: left;
}

.info-container h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid #f2f2f7;
    padding-bottom: 10px;
}

.info-container h2:first-child {
    margin-top: 0;
}

.info-container ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.info-container li {
    margin-bottom: 15px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #444;
    position: relative;
    padding-left: 25px;
}

.info-container li::before {
    content: '★';
    position: absolute;
    left: 0;
    color: var(--primary);
}

@media (max-width: 480px) {
    .info-bar {
        justify-content: center;
    }
    
    .stats {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    .game-box {
        padding: 20px 15px;
    }

    .grid-container {
        gap: 8px;
    }
    
    .card-front::after {
        font-size: 1.5rem;
    }
    
    .card-back {
        font-size: 2rem;
    }
}
