* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    min-height: 100vh;
    /* 紫色渐变背景图(base64) */
    background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MDAiIGhlaWdodD0iNjAwIj48cmVjdCB3aWR0aD0iODAwIiBoZWlnaHQ9IjYwMCIgZmlsbD0iIzMwMTU1OCIvPjxjaXJjbGUgY3g9IjIwMCIgY3k9IjE1MCIgcj0iMTIwIiBmaWxsPSIjNDIyNzc2IiBvcGFjaXR5PSIwLjMiLz48Y2lyY2xlIGN4PSI2MDAiIGN5PSI0MDAiIHI9IjE1MCIgZmlsbD0iIzUyMzg4OCIgb3BhY2l0eT0iMC4yIi8+PGNpcmNsZSBjeD0iNDAwIiBjeT0iMjgwIiByPSIxODAiIGZpbGw9IiM2MzQ5OTMiIG9wYWNpdHk9IjAuMjUiLz48L3N2Zz4=");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    width: 100%;
    max-width: 700px;
    background: rgba(48, 21, 88, 0.85);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 0 30px #7b43cc;
}

.game-header {
    text-align: center;
    margin-bottom: 16px;
    color: #f0e6ff;
}

.game-header h1 {
    font-size: clamp(1.4rem,4vw,2rem);
    margin-bottom:8px;
}

.score-panel {
    display: flex;
    justify-content: space-around;
    font-size: clamp(1rem,2.5vw,1.2rem);
    margin-bottom:16px;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(8,1fr);
    gap: 4px;
    width: 100%;
    aspect-ratio: 1/1;
}

.tile {
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.2rem,4vw,1.8rem);
    cursor: pointer;
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(220,190,255,0.25);
    transition: transform 0.15s ease;
    user-select: none;
}

.tile.selected {
    transform: scale(1.12);
    border-color:#e2c8ff;
    box-shadow:0 0 12px #d8b8ff;
}

.tile.matched {
    animation: vanish 0.35s forwards;
}

@keyframes vanish {
    0% {opacity:1;transform:scale(1)}
    100% {opacity:0;transform:scale(0.2)}
}

.game-footer {
    margin-top: 18px;
    text-align:center;
}

#restartBtn {
    padding:10px 24px;
    font-size:1rem;
    border:none;
    border-radius:10px;
    background:#9d65e0;
    color:white;
    cursor:pointer;
    transition:0.2s;
}
#restartBtn:hover{
    background:#b480ee;
}

/* 手机适配 */
@media (max-width:480px){
    .game-container{
        padding:12px;
    }
    #game-board{
        gap:3px;
    }
}
