:root {
    --gameboy-dark-blue: #012d5a;
    --pink-color: #e11764;
    --grid-line-color: rgba(255, 255, 255, 0.05);
    --frame-color: #012d5a; 
    --screen-color: #012d5a;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--gameboy-dark-blue);
    color: white;
    font-family: 'Courier New', monospace;
    overflow-x: hidden;
    min-height: 150vh;
    cursor: url('cursor.png'), auto;
}

/* --- Gameboy Grid Effect --- */
#game-screen {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-top: 120px;
    box-sizing: border-box;
    background-image: 
        linear-gradient(to right, var(--grid-line-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line-color) 1px, transparent 1px);
    background-size: 10px 10px;
    display: flex;
    justify-content: center;
}

/* --- Header & Logo --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 5px 15px;
    z-index: 1000;
    box-sizing: border-box;
}

.logo {
    width: 120px;
    height: auto;
    margin-right:50px;
}

.game-title {
    font-size: 1em;
    color: white;
    text-shadow: 2px 2px var(--pink-color);
}

/* --- Typewriter Effect --- */
#typewriter-container {
    position: fixed;
    top: 60px;
    width: 100%;
    text-align: center;
    font-size: 1em;
    color: var(--pink-color);
    z-index: 999;
}

.cursor {
    border-right: .15em solid white;
    opacity: 0;
}

.cursor.hidden {
    display: none;
}

/* --- Game Boy Frame Styles --- */
.game-frame-container {
    padding-top: 50px;
}

.gameboy-frame {
    width: 450px;
    height: 400px;
    background-color: var(--frame-color);
    border: 10px solid #012d5a;
    border-radius: 20px;
    box-shadow: 
        inset 0 0 15px rgba(0, 17, 56, 0.201), 
        0 10px 20px rgb(0, 37, 79);
    position: relative;
}

.gameboy-screen {
    width: 90%;
    height: 80%;
    margin: 5% auto;
    background-color: var(--screen-color);
    border: 5px solid #030051;
    box-shadow: inset 0 0 10px rgba(0, 23, 94, 0.9);
    position: relative;
    overflow: hidden;
}

/* --- Mouse Trail Effect (修正：確保 ID 對應且定位正確) --- */
#mouse-trail {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: opacity 0.3s ease;
    will-change: transform; /* 提升渲染性能 */
}

#trail-icon {
    font-size: 14px;
    color: #00d4ff;
}

/* --- Interactive Piling Area --- */
#piling-area {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

.snow-piece {
    position: absolute;
    width: 20px;
    height: 20px;
    opacity: 0;
    /* transition 包含 transform，確保旋轉時有平滑動畫 */
    transition: opacity 0.5s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-image 0.3s ease;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 原始狀態/雪花狀態：使用原本的雲朵圖 */
.snow-piece.cloud-original {
    background-image: url('snow_cloud.png');
}

/* 轉換為 Logo 圖片狀態 */
.snow-piece.logo-shape {
    background-image: url('snow_cloud_n.png') !important;
    background-color: transparent;
}




/* --- Background Digit Snowing --- */
.snow-digit {
    position: absolute;
    top: -5%;
    color: white;
    font-size: 10px;
    opacity: 0.8;
    user-select: none;
    animation: snowing linear infinite;
    z-index: 1;
}

@keyframes snowing {
    0% { transform: translateY(0) translateX(0); opacity: 0.8; }
    100% { transform: translateY(200vh) translateX(50px); opacity: 0.2; }
}

/* --- Santa Footer --- */
#santa-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.santa-graphic {
    width: 120px;
    height: auto;
    filter: drop-shadow(2px 2px 0 var(--gameboy-dark-blue));
    animation: santaBounce 3s infinite ease-in-out;
}

.santa-speech {
    background: white;
    color: var(--gameboy-dark-blue);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 4px 4px 0 var(--pink-color);
    white-space: nowrap;
}

.santa-speech::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

@keyframes santaBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}