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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.container {
    width: 800px;
    max-width: 95%;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 10px;
    background-color: #104978;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.game-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10;
    color: white;
    text-align: center;
    padding: 20px;
}

.game-screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-screen p {
    font-size: 18px;
    max-width: 500px;
    margin-bottom: 40px;
    line-height: 1.5;
}

.game-screen button {
    padding: 12px 30px;
    font-size: 20px;
    background: linear-gradient(45deg, #ff7f50, #ff2f95);
    border: none;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    margin-bottom: 15px;
}

.game-screen button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.game-screen button:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.hidden {
    display: none;
}

/* 排行榜样式 */
.leaderboard-container {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
    width: 90%;
    max-width: 500px;
}

#leaderboardTable {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

#leaderboardTable th, 
#leaderboardTable td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#leaderboardTable th {
    background-color: rgba(0, 0, 0, 0.3);
    font-weight: bold;
    position: sticky;
    top: 0;
}

#leaderboardTable tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

#leaderboardTable tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.secondary-button {
    background: linear-gradient(45deg, #3498db, #2980b9) !important;
    font-size: 16px !important;
    padding: 10px 20px !important;
}

.danger-button {
    background: linear-gradient(45deg, #e74c3c, #c0392b) !important;
    font-size: 16px !important;
    padding: 10px 20px !important;
}

.leaderboard-buttons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.name-input-container {
    display: flex;
    margin-bottom: 20px;
    width: 100%;
    max-width: 400px;
    justify-content: center;
}

#playerName {
    padding: 10px 15px;
    border-radius: 20px 0 0 20px;
    border: none;
    font-size: 16px;
    width: 70%;
    background-color: rgba(255, 255, 255, 0.9);
}

#saveScoreButton {
    border-radius: 0 20px 20px 0;
    margin: 0;
    font-size: 16px;
    padding: 10px 15px;
}

/* 高亮当前玩家的分数 */
.current-player {
    background-color: rgba(255, 215, 0, 0.2) !important;
    font-weight: bold;
}

.sound-control {
    display: flex;
    align-items: center;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-control {
    display: flex;
    align-items: center;
}

.icon-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-left: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

.icon-button:hover {
    transform: scale(1.2);
}

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

.settings-container {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    width: 90%;
    max-width: 400px;
}

.volume-control {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.volume-control label {
    margin-right: 10px;
    font-weight: bold;
    min-width: 120px;
}

.volume-control input[type="range"] {
    flex: 1;
    margin: 0 10px;
    min-width: 150px;
}

.volume-control span {
    min-width: 40px;
    text-align: right;
}

.language-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.1);
}

.language-item {
    padding: 12px 15px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    color: white;
    font-size: 16px;
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.language-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-item.active {
    background-color: rgba(255, 215, 0, 0.3);
    font-weight: bold;
    border-color: rgba(255, 215, 0, 0.5);
}

/* RTL语言支持 */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .icon-button {
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .volume-control label {
    margin-right: 0;
    margin-left: 10px;
}

.quick-language-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    width: 90%;
    max-width: 400px;
}

.language-button {
    padding: 10px 15px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.language-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.language-button.active {
    background-color: rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.5);
    font-weight: bold;
} 