body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
}

#game-container {
    width: 100vw;
    height: 100vh;
    border: none;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, #87CEEB, #E0F6FF);
}

#character {
    width: 120px;
    height: 120px;
    position: absolute;
    bottom: 0;
}

#character.facing-left {
    transform: scaleX(-1);
}

#mario-icon {
    width: 100%;
    height: 100%;
}

.obstacle {
    position: absolute;
    bottom: 5px;
    width: auto;
    height: 120px;
    object-fit: contain;
    object-position: bottom;
}

.cloud {
    position: absolute;
    pointer-events: none;
    filter: drop-shadow(3px 3px 3px rgba(255,255,255,0.5));
}

#score {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 28px;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    background-color: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 10px;
}

#start-button, #restart-button {
    font-size: 24px;
    padding: 15px 30px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: auto;
    height: auto;
}

#start-button {
    top: 50%;
}

#restart-button {
    bottom: 20%;
}

#instruction {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 20px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    width: 80%;
    background-color: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 10px;
}

#pause-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 24px;
    z-index: 1000;
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 1000;
}

#game-over-text {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(255,0,0,0.5);
}

#final-score {
    font-size: 36px;
    margin-bottom: 30px;
}

#language-selection {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#language-selection h2 {
    color: white;
    font-size: 36px;
    margin-bottom: 30px;
}

#language-selection button {
    font-size: 24px;
    padding: 15px 30px;
    margin: 10px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-text {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.version-text {
    font-size: 1.2em;
    color: #888;
    margin-top: 10px;
}

/* 修改关卡选择界面样式 */
#level-selection {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#level-selection h2 {
    color: white;
    font-size: 36px;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.level-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 20px;
}

.level-button {
    width: 300px;
    height: 200px;
    padding: 0;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: none;
}

.level-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.level-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    text-align: center;
    z-index: 1;
    border-radius: 0 0 15px 15px;
}

.level-text {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.level-description {
    font-size: 16px;
    opacity: 0.9;
}

.level-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.level-button:hover .level-image {
    transform: scale(1.1);
}

/* 通关界面样式 */
#victory-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 1000;
}

#victory-text {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 255, 0, 0.5);
}

#victory-score {
    font-size: 36px;
    margin-bottom: 30px;
}

#back-to-menu-button {
    padding: 15px 30px;
    font-size: 24px;
    color: white;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

#back-to-menu-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #45a049, #4CAF50);
}

#back-to-menu-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#back-to-menu-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

#back-to-menu-button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(100, 100);
        opacity: 0;
    }
}

/* 修改关卡背景样式 */
.level-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border-radius: 15px;
    opacity: 0.9;
}

/* 确保关卡信息在背景上层 */
.level-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    text-align: center;
    z-index: 1;
    border-radius: 0 0 15px 15px;
}

.level-text {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.level-description {
    font-size: 16px;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.level-button:hover .level-background {
    opacity: 1;
}

.game-description {
    color: white;
    text-align: center;
    max-width: 800px;
    margin: 30px auto 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 添加皮肤选择界面的样式 */
#skin-selection {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#skin-selection h2 {
    color: white;
    font-size: 36px;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.skin-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 20px;
    max-width: 800px;
}

.skin-option {
    width: 150px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 3px solid transparent;
}

.skin-option:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.skin-option.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
}

.skin-option img {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
}

.skin-name {
    color: white;
    font-size: 18px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#confirm-skin {
    margin-top: 30px;
    padding: 15px 30px;
    font-size: 24px;
    color: white;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#confirm-skin:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
