
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 480px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    width: 100%;
    padding: 10px 15px;
    background-color: #4b7bec;
    color: white;
    text-align: center;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.level-info {
    font-size: 1rem;
    display: flex;
    justify-content: center;
    gap: 20px;
}

canvas {
    width: 100%;
    height: 70vh;
    max-height: 640px;
    display: block;
    background-color: #ffeaa7; /* 沙子的颜色 */
    touch-action: none;
}

.controls {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding: 15px;
    background-color: #f8f9fa;
}

button {
    padding: 10px 20px;
    background-color: #4b7bec;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #3867d6;
}

button:disabled {
    background-color: #a5b1c2;
    cursor: not-allowed;
}

.tutorial, .level-complete, .game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    display: none;
    z-index: 100;
    width: 80%;
    max-width: 320px;
}

.tutorial.show, .level-complete.show, .game-over.show {
    display: block !important;
}

.tutorial p {
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.level-complete h2, .game-over h2 {
    color: #4b7bec;
    margin-bottom: 15px;
}

.game-over h2 {
    color: #e74c3c;
}

.game-over p {
    margin-bottom: 15px;
}
