body {
    margin: 0;
    padding: 0;
    background-color: #1a1a2e;
    color: #e94560;
    font-family: '微軟正黑體', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    user-select: none;
    overflow: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #16213e;
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.header {
    display: flex;
    justify-content: space-between;
    width: 420px;
    align-items: center;
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
    font-size: 32px;
}

.score-board {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    background: #0f3460;
    padding: 10px 20px;
    border-radius: 8px;
}

.instructions {
    background: rgba(233, 69, 96, 0.1);
    color: #e94560;
    border-left: 4px solid #e94560;
    padding: 10px 15px;
    margin-bottom: 20px;
    width: 390px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

.instructions h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.instructions small {
    color: #a0a0a0;
    font-size: 12px;
}

#grid {
    width: 416px; 
    height: 416px;
    display: flex;
    flex-wrap: wrap;
    background-color: #0f3460;
    border-radius: 10px;
    padding: 8px;
    gap: 2px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    box-sizing: border-box;
}

.candy {
    width: 48px;
    height: 48px;
    box-sizing: border-box;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.2), 0 3px 5px rgba(0,0,0,0.3);
}

.candy:hover {
    transform: scale(1.05);
}

.candy.selected {
    transform: scale(1.15);
    box-shadow: 0 0 15px #e94560, inset 0 0 10px rgba(255,255,255,0.5);
    z-index: 10;
    border: 2px solid white;
}
