* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 16px;
}

.game-info {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.info-item {
    text-align: center;
}

.label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.value {
    color: #333;
    font-size: 20px;
    font-weight: 700;
    margin-left: 5px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: scale(1.05);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card.matched {
    opacity: 0.6;
    cursor: default;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
}

.card-back {
    background: white;
    font-size: 40px;
    transform: rotateY(180deg);
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #ff9800;
    color: white;
}

.btn-secondary:hover {
    background: #e68900;
}

.game-rules {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.game-rules h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 10px;
}

.game-rules ul {
    color: #555;
    font-size: 14px;
    margin-left: 20px;
}

.game-rules li {
    margin-bottom: 5px;
}

.disclaimer-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.privacy-box {
    background: #e7f3ff;
    border: 1px solid #2196F3;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.disclaimer-box .small-text {
    color: #856404;
    font-size: 12px;
    line-height: 1.5;
}

.privacy-box .small-text {
    color: #0d47a1;
    font-size: 12px;
    line-height: 1.5;
}

footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.copyright {
    color: #666;
    font-size: 14px;
}

/* 彈窗樣式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 20px;
}

.modal-stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 16px;
    color: #555;
    line-height: 2;
}

/* 響應式設計 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px 15px;
        border-radius: 15px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 14px;
    }

    .game-info {
        padding: 12px;
        margin-bottom: 15px;
    }

    .label {
        font-size: 12px;
    }

    .value {
        font-size: 16px;
    }

    .game-board {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 15px;
    }

    .card-front {
        font-size: 20px;
    }

    .card-back {
        font-size: 28px;
    }

    .controls {
        gap: 10px;
        margin-bottom: 15px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .game-rules {
        padding: 15px;
        margin-bottom: 15px;
    }

    .game-rules h3 {
        font-size: 16px;
    }

    .game-rules ul {
        font-size: 13px;
    }

    .disclaimer-box,
    .privacy-box {
        padding: 12px;
        margin-bottom: 12px;
    }
}

