.hidden { display: none !important; }

/* 🌟 终极拦截：如果有 skip-cover 类，强制干掉封面并显示游戏机 */
body.skip-cover #start-screen { display: none !important; }
body.skip-cover #main-game { display: flex !important; }

/* 基础设置 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: linear-gradient(135deg, #e0f2fe, #f3e8ff, #fce7f3);
    color: #1e293b;
    font-family: 'Press Start 2P', monospace;
    display: flex; flex-direction: column; align-items: center;
    min-height: 100vh; overflow-x: hidden; line-height: 1.6; padding-top: 80px;
}

/* 开始封面 */
.start-screen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, #fdf4ff, #e0e7ff);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 9999; transition: opacity 0.8s ease, visibility 0.8s;
}
.start-screen.fade-out { opacity: 0; visibility: hidden; }
.game-title {
    font-size: 40px; color: #4d7c0f; text-shadow: 4px 4px 0 #fde047, 0 0 20px rgba(163, 230, 53, 0.5);
    text-align: center; line-height: 1.2; margin-bottom: 50px; animation: float 3s ease-in-out infinite;
}
@keyframes float { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); } }
.start-btn {
    font-size: 16px; padding: 20px 30px; background: linear-gradient(180deg, #fde047, #eab308) !important;
    color: #422006 !important; box-shadow: 0 8px 0 #a16207, 0 0 15px rgba(253, 224, 71, 0.8) !important;
    animation: blink 1.5s step-end infinite;
}
@keyframes blink { 50% { opacity: 0.8; filter: brightness(1.1); } }

/* 游戏机主界面 */
.main-game { width: 100%; display: flex; flex-direction: column; align-items: center; }
.top-nav {
    background-color: #fefce8; width: 100%; padding: 15px 10px; position: fixed; top: 0; left: 0; z-index: 1000;
    border-bottom: 4px solid #a3e635; display: flex; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.nav-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.nav-links a { color: #854d0e; text-decoration: none; font-size: 10px; transition: all 0.2s; padding: 5px 10px; border-radius: 3px; }
.nav-links a:hover { color: #fff; background-color: #84cc16; box-shadow: 0 0 8px #84cc16; }

.console {
    background: linear-gradient(135deg, #fef08a, #d9f99d, #bef264); 
    padding: 25px; border-radius: 25px; border: 4px solid #4d7c0f; 
    box-shadow: 0px 12px 0px #3f6212, 0px 20px 20px rgba(0,0,0,0.15), inset 0px 5px 10px rgba(255,255,255,0.8), inset 0px -5px 10px rgba(0,0,0,0.1);
    width: 95%; max-width: 460px; margin-top: 40px; margin-bottom: 40px;
}
.screen {
    background: linear-gradient(180deg, #f5f3ff, #e0e7ff); border: 8px solid #4d7c0f; border-radius: 15px;
    padding: 20px; display: flex; flex-direction: column; gap: 15px; position: relative; overflow: hidden; box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}
.screen::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.05) 50%); background-size: 100% 4px; pointer-events: none; z-index: 10;
}

.status-bar { display: flex; flex-direction: column; gap: 12px; font-size: 9px; color: #3730a3; z-index: 20; font-weight: bold; }
.bar { background-color: #c7d2fe; height: 16px; border: 3px solid #4d7c0f; border-radius: 2px; width: 100%; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.fill { height: 100%; width: 50%; transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.hunger-fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow: 0 0 8px #fbbf24; }
.happy-fill { background: linear-gradient(90deg, #10b981, #34d399); box-shadow: 0 0 8px #34d399; }

.pet-display {
    background-color: rgba(255, 255, 255, 0.6); height: 160px; border-radius: 8px;
    display: flex; justify-content: center; align-items: center; border: 4px solid #a7f3d0; box-shadow: inset 0 0 15px rgba(255,255,255,0.8);
    position: relative; z-index: 20;
}
.pet-render-area { display: grid; grid-template-columns: repeat(16, 1fr); width: 140px; height: 140px; background-color: #ffffff; border: 2px solid #4d7c0f; transition: transform 0.2s; }
.pet-render-cell { background-color: #ffffff; width: 100%; height: 100%; }

/* 气泡与动画 */
.pet-bubble {
    position: absolute; top: 10px; right: 10px; background: #fff; border: 3px solid #4d7c0f; border-radius: 15px; padding: 5px 10px;
    font-size: 20px; z-index: 30; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pet-bubble::after { content: ''; position: absolute; bottom: -8px; left: 10px; border-width: 8px 8px 0; border-style: solid; border-color: #4d7c0f transparent transparent; }
.pet-bubble::before { content: ''; position: absolute; bottom: -4px; left: 11px; border-width: 7px 7px 0; border-style: solid; border-color: #fff transparent transparent; z-index: 1; }
@keyframes popIn { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.animate-bounce { animation: bounce 0.5s ease infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-15px); } }
.animate-shake { animation: shake 0.3s ease infinite; }
@keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-5px); } 100% { transform: translateX(0); } }

.inventory-bar {
    display: flex; justify-content: space-around; font-size: 11px; color: #3730a3; font-weight: bold;
    background-color: rgba(255, 255, 255, 0.7); padding: 8px; border-radius: 5px; border: 3px solid #a7f3d0; z-index: 20;
}
.controls { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 25px; justify-content: center; }
.pixel-btn {
    background: linear-gradient(180deg, #fef08a, #eab308); color: #422006; font-family: 'Press Start 2P', monospace;
    font-size: 10px; padding: 12px 16px; border: 3px solid #4d7c0f; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block;
    box-shadow: 0 6px 0 #4d7c0f; transition: all 0.1s; text-transform: uppercase;
}
.pixel-btn:hover { filter: brightness(1.05); box-shadow: 0 6px 0 #4d7c0f, 0 0 10px #fde047; }
.pixel-btn:active { transform: translateY(6px); box-shadow: 0 0 0 #4d7c0f; }

.console-footer {
    background-color: #f8fafc; width: 100%; margin-top: 50px; padding: 40px 20px; text-align: center; border-top: 5px solid #a3e635;
    display: flex; flex-direction: column; align-items: center; gap: 15px; box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }
.footer-nav a { color: #4d7c0f; text-decoration: none; font-size: 10px; transition: color 0.2s; font-weight: bold;}
.footer-nav a:hover { color: #84cc16; }
.footer-credits p { font-size: 8px; color: #64748b; line-height: 1.8; margin-bottom: 8px; letter-spacing: 1px; }
#lang-toggle { background: linear-gradient(180deg, #bae6fd, #38bdf8); box-shadow: 0 6px 0 #0284c7; margin-top: 15px; color: #082f49;}

/* 画板 / 菜园 / 商店 */
.pixel-grid { display: grid; grid-template-columns: repeat(16, 1fr); gap: 1px; background-color: #4d7c0f; border: 4px solid #4d7c0f; width: 100%; max-width: 400px; aspect-ratio: 1 / 1; margin: 0 auto; box-shadow: inset 0 0 10px #000; z-index: 20; }
.pixel-cell { background-color: #ffffff; cursor: crosshair; transition: background-color 0.05s; }
.pixel-cell:hover { opacity: 0.8; box-shadow: inset 0 0 0 1px #e94560; }
.color-palette { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 15px; z-index: 20; }
.color-swatch { width: 32px; height: 32px; border: 3px solid #4d7c0f; cursor: pointer; border-radius: 4px; display: flex; justify-content: center; align-items: center; font-size: 16px; box-shadow: 0 3px 0 #4d7c0f; transition: transform 0.1s; }
.color-swatch:active { transform: translateY(3px); box-shadow: none; }
.color-swatch.active { border: 3px solid #e94560; transform: scale(1.15) translateY(-2px); box-shadow: 0 5px 0 #4d7c0f, 0 0 10px rgba(233, 69, 96, 0.6); }
.preset-buttons { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.preset-btn { font-size: 12px !important; padding: 12px 18px !important; background: linear-gradient(180deg, #ffffff, #e2e8f0); color: #1e293b; border-radius: 8px; border: 3px solid #4d7c0f; box-shadow: 0 5px 0 #4d7c0f; cursor: pointer; font-family: 'Press Start 2P', monospace; transition: transform 0.1s; }
.preset-btn:active { transform: translateY(5px); box-shadow: none; }

.garden-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; width: 100%; max-width: 300px; margin: 0 auto; z-index: 20; }
.plot { background-color: #fed7aa; background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(0,0,0,0.05) 5px, rgba(0,0,0,0.05) 10px); width: 100%; aspect-ratio: 1 / 1; border: 4px dashed #92400e; border-radius: 8px; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 40px; transition: all 0.2s; box-shadow: inset 0 0 15px rgba(0,0,0,0.1); }
.plot:hover { transform: scale(1.05); filter: brightness(0.95); }
.plot.sprout { border-style: solid; background-color: #86efac; border-color: #166534; }
.plot.mature { border-style: solid; background-color: #fdba74; border-color: #c2410c; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: inset 0 0 15px rgba(0,0,0,0.1), 0 0 5px #c2410c; } 50% { box-shadow: inset 0 0 15px rgba(0,0,0,0.1), 0 0 20px #f97316; } 100% { box-shadow: inset 0 0 15px rgba(0,0,0,0.1), 0 0 5px #c2410c; } }

.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; width: 100%; z-index: 20; }
.shop-item { background: #ffffff; border: 4px solid #4d7c0f; border-radius: 8px; padding: 15px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 4px 0 #4d7c0f, 0 4px 10px rgba(0,0,0,0.1); transition: transform 0.2s; }
.shop-item:hover { transform: translateY(-5px); }
.item-icon { font-size: 45px; filter: drop-shadow(0 5px 3px rgba(0,0,0,0.15)); }
.item-name { font-size: 9px; color: #1e293b; font-weight: bold; }
.item-price { font-size: 11px; color: #e74c3c; font-weight: bold; }

/* 聊天页面专属 */
.chat-container {
    background-color: #ffffff; border: 4px solid #4d7c0f; border-radius: 8px; height: 250px; padding: 15px;
    overflow-y: auto; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 0 10px rgba(0,0,0,0.1); z-index: 20; margin-bottom: 15px;
}
.message { max-width: 80%; padding: 10px; border-radius: 10px; font-size: 9px; line-height: 1.5; word-wrap: break-word; }
.pet-msg { background-color: #e0e7ff; color: #3730a3; border: 2px solid #c7d2fe; align-self: flex-start; border-bottom-left-radius: 0; }
.user-msg { background-color: #fef08a; color: #422006; border: 2px solid #fde047; align-self: flex-end; border-bottom-right-radius: 0; }
.chat-input-area { display: flex; gap: 10px; z-index: 20; }
#chat-input { flex: 1; padding: 12px; border: 3px solid #4d7c0f; border-radius: 6px; font-family: 'Press Start 2P', monospace; font-size: 10px; outline: none; }
#chat-input:focus { box-shadow: 0 0 10px #a3e635; }
/* 修复聊天框透明背景的问题 */
.chat-container {
    background-color: #ffffff !important;
    background-image: none !important; 
}