* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFE0B2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.game-container {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    text-align: center;
    max-width: 650px;
    width: 100%;
}

.screen {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 主菜单 */
h1 {
    color: #8B4513;
    font-size: 2em;
    margin-bottom: 10px;
}

.coins-display {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 1.3em;
    font-weight: bold;
    color: #fff;
    display: inline-block;
    margin: 15px 0;
    box-shadow: 0 3px 10px rgba(255,165,0,0.4);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

/* 按钮 */
.btn {
    padding: 12px 30px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background: linear-gradient(135deg, #87CEEB 0%, #6BB3D9 100%);
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107,179,217,0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.85em;
}

/* 关卡选择 */
.level-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.level-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f5f5f5;
    border-radius: 10px;
    opacity: 0.6;
}

.level-item.unlocked {
    opacity: 1;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border: 2px solid #4CAF50;
}

.level-item .stars { font-size: 0.9em; }
.level-item .name { font-weight: bold; flex: 1; margin-left: 10px; }
.level-item .best { color: #666; font-size: 0.9em; margin-right: 10px; }

/* 成就 */
.achievement-list {
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}

.achievement-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: #f9f9f9;
    border-radius: 8px;
}

.achievement-item.completed {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

.achievement-item .icon {
    font-size: 1.5em;
    margin-right: 10px;
}

.achievement-item .info {
    flex: 1;
}

.achievement-item .name {
    font-weight: bold;
}

.achievement-item .desc {
    font-size: 0.85em;
    color: #666;
}

/* 游戏界面 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #87CEEB 0%, #6BB3D9 100%);
    border-radius: 10px;
    color: #fff;
    font-weight: bold;
}

.header .stats span {
    margin-left: 15px;
}

.items-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.item-btn {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    border: 2px solid #ddd;
    background: #fff;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.item-btn:hover:not(:disabled) {
    border-color: #FFA500;
    transform: scale(1.05);
}

.item-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.item-btn span {
    font-size: 0.6em;
    color: #666;
}

.item-btn.active {
    background: #E3F2FD;
    border-color: #2196F3;
}

#gameCanvas {
    border-radius: 10px;
    cursor: grab;
    background: #FFF8E1;
    box-shadow: inset 0 0 20px rgba(139,69,19,0.1);
    max-width: 100%;
}

#gameCanvas:active { cursor: grabbing; }

.controls {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    font-weight: bold;
    min-height: 40px;
}

.message.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #fff;
}

.message.fail {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: #fff;
}

@media (max-width: 480px) {
    h1 { font-size: 1.5em; }
    .header { flex-wrap: wrap; gap: 5px; }
    .btn { padding: 10px 20px; font-size: 0.9em; }
}
