body.connect-animal-page {
    background-color: #eef8ff; /* 使用柔和的天藍色背景 */
    font-family: 'M PLUS Rounded 1c', sans-serif;
    color: #333;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.page-header h1 {
    margin: 0;
    font-size: 1.5em;
    color: #2c3e50;
}

.connect-animal-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

#timer {
    color: #e74c3c; /* 紅色，突顯時間 */
}

#score {
    color: #2980b9; /* 藍色 */
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, 50px); /* 8x8 的網格，每個格子50px */
    grid-template-rows: repeat(8, 50px);
    gap: 5px;
    background-color: #ffffff;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative; /* 為了讓連接線的 canvas 能疊在上面 */
}

.tile {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px; /* 動物圖案的大小 */
    background-color: #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.tile.empty {
    background-color: transparent;
    cursor: default;
}

.tile:not(.empty):hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(41, 128, 185, 0.5);
}

.tile.selected {
    background-color: #95a5a6;
    border-color: #3498db;
    transform: scale(1.05);
}

.tile.matched {
    visibility: hidden; /* 消除後隱藏 */
    opacity: 0;
    transform: scale(0.5);
}

.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 2em;
    display: none; /* 預設隱藏 */
    z-index: 100;
}

#line-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* 讓 canvas 不會擋到滑鼠點擊 */
    z-index: 10;
}