:root {
    --bg-color: #2c3e50;
    --console-body: #f0e6d2;
    --screen-bg: #9ea792;
    --pixel-color: #2d3329;
    --btn-color: #e74c3c;
    --btn-shadow: #c0392b;
}

* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }

body {
    background: var(--bg-color);
    font-family: 'Press Start 2P', cursive;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px 0;
}

.main-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 게임기 본체 */
.game-console {
    background: var(--console-body);
    width: 320px;
    height: 480px;
    border-radius: 160px 160px 140px 140px;
    box-shadow: 
        inset -5px -5px 15px rgba(0,0,0,0.1),
        inset 5px 5px 15px rgba(255,255,255,0.5),
        10px 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 40px;
}

.console-header {
    font-size: 12px;
    color: #b0a590;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

/* 화면 영역 */
.screen-container {
    background: #7f8c8d;
    width: 220px;
    height: 220px;
    border-radius: 30px;
    padding: 15px;
    box-shadow: inset 3px 3px 10px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.screen-glass {
    background: var(--screen-bg);
    width: 100%;
    height: 100%;
    border: 2px solid #666;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    position: absolute;
    top: 0; left: 0;
    z-index: 1;
}

/* 정보 패널 */
.info-panel {
    position: absolute;
    top: 5px; right: 5px;
    width: 60px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0.8;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.icon { font-size: 8px; }
.bar-bg { width: 40px; height: 6px; background: rgba(0,0,0,0.1); border: 1px solid var(--pixel-color); }
.bar-fill { height: 100%; background: var(--pixel-color); width: 100%; transition: width 0.3s; }
.text-stat { font-size: 8px; color: var(--pixel-color); text-align: right; margin-top: 2px; }

/* 메뉴 아이콘 */
.menu-bar {
    position: absolute;
    bottom: 5px; left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    z-index: 2;
    padding: 0 5px;
}
.menu-icon { font-size: 12px; opacity: 0.2; transition: opacity 0.2s; }
.menu-icon.active { opacity: 1; transform: scale(1.2); }

/* 조작 가이드 텍스트 */
.control-guide {
    font-size: 8px; color: #b0a590; margin-bottom: 5px;
}

/* 오버레이 */
.screen-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--screen-bg);
    z-index: 10;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center; color: var(--pixel-color);
}
.screen-overlay h1 { font-size: 20px; line-height: 1.5; margin-bottom: 10px; }
.screen-overlay p { font-size: 10px; margin: 5px 0; }
.blink { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

.egg-list { display: flex; gap: 15px; margin: 15px 0; font-size: 20px; }
.egg-item { opacity: 0.3; }
.egg-item.active { opacity: 1; transform: scale(1.3); }
.guide-text { font-size: 8px; margin-top: 10px; opacity: 0.7; }

/* 컨트롤러 */
.controls { display: flex; justify-content: center; gap: 25px; width: 100%; }
.btn-wrapper { text-align: center; }
.control-btn {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--btn-color);
    border: none;
    box-shadow: 0 4px 0 var(--btn-shadow), 0 5px 10px rgba(0,0,0,0.3);
    color: white; font-family: inherit; font-size: 12px; cursor: pointer; margin-bottom: 8px;
}
.control-btn:active, .control-btn.pressed { transform: translateY(4px); box-shadow: 0 0 0 var(--btn-shadow); }
.label { font-size: 8px; color: #7f8c8d; font-weight: bold; }

/* 리셋 */
.reset-container {
    position: absolute; top: 50px; right: 40px;
    display: flex; flex-direction: column; align-items: center;
}
#btn-reset {
    width: 12px; height: 12px; border-radius: 50%; background: #333;
    border: none; cursor: pointer; box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5);
}
.reset-container span { font-size: 6px; color: #999; margin-top: 4px; }

/* 광고 및 링크 */
.ad-container { margin: 15px 0; text-align: center; width: 100%; }
.other-games { margin-top: 10px; text-align: center; width: 100%; padding: 0 10px; }
.games-title { color: #ecf0f1; font-size: 12px; margin-bottom: 15px; border-bottom: 2px solid #555; display: inline-block; padding-bottom: 5px; }
.game-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.button-link {
    display: inline-block; padding: 8px 12px;
    background-color: var(--console-body); color: #333;
    text-decoration: none; font-size: 10px;
    border: 2px solid #555; box-shadow: 3px 3px 0 #222;
    border-radius: 4px; transition: transform 0.1s;
}
.button-link:active, .button-link:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #222; background-color: #fff; }

/* --- [Added] Toast Message Style --- */
#toast-message {
    visibility: hidden;
    min-width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 12px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 10px;
    font-family: 'Press Start 2P', cursive; /* 픽셀 폰트 */
    border: 2px solid #eee;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s;
}

/* Show State */
#toast-message.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px; /* 위로 살짝 떠오르는 효과 */
}