/* 基本样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #000;
    color: #fff;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-x: hidden;
    text-align: center;
}

/* 游戏容器 */
.game-container {
    width: 1160px;
    height: 957px; /* 等比例放大：660 * 1.45 = 957 */
    position: relative;
    background-color: #000;
    border: 2px solid #333;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    margin: 0 auto;
    display: block;
    overflow: hidden;
}

/* 游戏头部 */
.game-header {
    width: 100%;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid #00ffff;
    text-align: center;
}

.game-header h1 {
    margin: 0;
    font-size: 46px; /* 等比例放大：32 * 1.45 = 46 */
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.info-item {
    font-size: 16px;
    font-weight: bold;
}

/* 屏幕通用样式 */
.screen {
    position: absolute;
    top: 104px; /* 等比例放大：72 * 1.45 = 104 */
    left: 0;
    width: 1160px;
    height: 783px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 20, 0.95);
    transition: opacity 0.5s ease;
    margin: 0 auto;
    overflow: hidden;
    z-index: 10;
}

/* 全屏模式下的样式 */
body:fullscreen,
body:-webkit-full-screen,
body:-moz-full-screen,
body:-ms-fullscreen {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background-color: #000 !important;
}

/* 全屏模式下的游戏容器样式 */
body:fullscreen .game-container,
body:-webkit-full-screen .game-container,
body:-moz-full-screen .game-container,
body:-ms-fullscreen .game-container {
    width: 100% !important;
    height: 100% !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 9999 !important;
    background-color: #000 !important;
}

/* 全屏模式下的屏幕样式 */
body:fullscreen .screen,
body:-webkit-full-screen .screen,
body:-moz-full-screen .screen,
body:-ms-fullscreen .screen {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 10 !important;
    background-color: rgba(0, 0, 20, 0.95) !important;
}

/* 全屏模式下隐藏游戏标题 */
body:fullscreen .game-header,
body:-webkit-full-screen .game-header,
body:-moz-full-screen .game-header,
body:-ms-fullscreen .game-header {
    display: none !important;
}

/* 全屏模式下游戏屏幕显示 */
body:fullscreen #game-screen:not(.hidden),
body:-webkit-full-screen #game-screen:not(.hidden),
body:-moz-full-screen #game-screen:not(.hidden),
body:-ms-fullscreen #game-screen:not(.hidden) {
    z-index: 20 !important;
    display: flex !important;
    background-color: #000 !important;
}

/* 全屏模式下隐藏其他屏幕 */
body:fullscreen #start-screen,
body:-webkit-full-screen #start-screen,
body:-moz-full-screen #start-screen,
body:-ms-fullscreen #start-screen,
body:fullscreen #game-over-screen,
body:-webkit-full-screen #game-over-screen,
body:-moz-full-screen #game-over-screen,
body:-ms-fullscreen #game-over-screen {
    display: none !important;
    z-index: 10 !important;
}

/* 全屏模式下的游戏画布样式 */
body:fullscreen #game-canvas,
body:-webkit-full-screen #game-canvas,
body:-moz-full-screen #game-canvas,
body:-ms-fullscreen #game-canvas {
    width: 100% !important;
    height: calc(100% - 104px) !important;
    object-fit: contain !important;
    background-color: #000 !important;
    z-index: 5 !important;
}

/* 确保游戏主界面的UI面板在游戏开始前不显示 */
#game-screen:not(.hidden) #ui-panel {
    display: flex;
}

/* 确保游戏主界面在隐藏时，其内部元素也不显示 */
#game-screen.hidden {
    visibility: hidden !important;
}

/* 确保游戏屏幕有正确的尺寸和布局 */
#game-screen {
    width: 1160px !important;
    height: 783px !important;
    background: linear-gradient(to bottom, #003366 0%, #001133 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    overflow: hidden;
}

/* UI面板 */
#ui-panel {
    width: 100% !important;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 2px solid #00ffff;
    box-sizing: border-box;
}

/* 确保UI面板只在游戏主界面显示时才可见 */
#game-screen.hidden #ui-panel {
    display: none !important;
}

/* 确保游戏画布只在游戏主界面显示时才可见 */
#game-screen.hidden #game-canvas {
    display: none !important;
}

/* 确保画布有正确的尺寸 */
#game-canvas {
    width: 1160px;
    height: 783px;
    background: linear-gradient(to bottom, #003366 0%, #001133 100%);
    cursor: none;
    display: block;
    margin: 0 auto;
    border: none;
    box-sizing: border-box;
}

.screen.hidden {
    display: none;
}

/* 标题样式 */
h1 {
    font-size: 70px; /* 等比例放大：48 * 1.45 = 70 */
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    margin-bottom: 30px;
    letter-spacing: 3px;
}

/* 规则说明样式 */
.rules {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border: 1px solid #00ffff;
    border-radius: 10px;
    margin-bottom: 30px;
    width: 300px;
}

.rules h3 {
    color: #00ffff;
    margin-bottom: 15px;
    text-align: center;
    font-size: 23px; /* 等比例放大：16 * 1.45 = 23 */
}

.rules p {
    margin: 8px 0;
    font-size: 23px; /* 等比例放大：16 * 1.45 = 23 */
    color: #fff;
    text-align: center;
}

/* 按钮样式 */
button {
    padding: 17px 44px; /* 等比例放大：12 * 1.45 = 17, 30 * 1.45 = 44 */
    font-size: 26px; /* 等比例放大：18 * 1.45 = 26 */
    background-color: #00ffff;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

button:hover {
    background-color: #00cccc;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

button:active {
    transform: scale(0.95);
}

/* 游戏主界面 */
#game-screen {
    background: linear-gradient(to bottom, #003366 0%, #001133 100%);
    display: flex;
    flex-direction: column;
}

/* UI面板 */
#ui-panel {
    width: 100%;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 2px solid #00ffff;
}

#ui-panel > div {
    font-size: 23px; /* 等比例放大：16 * 1.45 = 23 */
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 氧气条容器 */
#oxygen-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 200px;
}

#oxygen-text {
    margin-bottom: 7px; /* 等比例放大：5 * 1.45 = 7 */
    font-size: 20px; /* 等比例放大：14 * 1.45 = 20 */
}

#oxygen-bar-container {
    width: 100%;
    height: 15px; /* 等比例放大：10 * 1.45 = 15 */
    background-color: #333;
    border: 1px solid #00ffff;
    border-radius: 7px; /* 等比例放大：5 * 1.45 = 7 */
    overflow: hidden;
}

#oxygen-bar {
    height: 100%;
    width: 100%;
    background-color: #00ff00;
    transition: width 0.1s ease, background-color 0.3s ease;
}

#oxygen-bar.low {
    background-color: #ff0000;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* 游戏画布 */
#game-canvas {
    flex: 1;
    background: linear-gradient(to bottom, #003366 0%, #001133 100%);
    cursor: none;
    /* 明确禁止缩放效果 */
    transition: none !important;
    transform: none !important;
    scale: none !important;
}

/* 确保游戏画布在鼠标悬停时不会缩放 */
#game-canvas:hover {
    transform: none !important;
    scale: none !important;
}

/* 游戏消息 */
#game-messages {
    position: absolute;
    top: 102px; /* 等比例放大：70 * 1.45 = 102 */
    left: 0;
    width: 100%;
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

.message {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.7);
    color: #00ffff;
    padding: 5px 15px;
    margin: 5px;
    border-radius: 5px;
    font-weight: bold;
    animation: fadeOut 1s forwards;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
}

.message.score {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

.message.life {
    color: #ff6600;
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.8);
}

.message.bonus {
    color: #ffff00;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.8);
    font-size: 24px;
    padding: 10px 20px;
    animation: pulse 0.5s infinite alternate, fadeOut 1.5s forwards;
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* 游戏结束屏幕 */
#game-over-screen {
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 100;
}

#final-score {
    font-size: 35px; /* 等比例放大：24 * 1.45 = 35 */
    margin: 29px 0 44px; /* 等比例放大：20 * 1.45 = 29, 30 * 1.45 = 44 */
    color: #00ffff;
}

#final-score-value {
    color: #ffcc00;
    font-size: 46px; /* 等比例放大：32 * 1.45 = 46 */
}

/* 游戏开始按钮样式 */
#start-btn {
    background-color: #00ffff;
    color: #000;
    border: none;
    padding: 17px 44px; /* 等比例放大：12 * 1.45 = 17, 30 * 1.45 = 44 */
    font-size: 26px; /* 等比例放大：18 * 1.45 = 26 */
    font-weight: bold;
    border-radius: 7px; /* 等比例放大：5 * 1.45 = 7 */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    z-index: 200;
    margin-top: 29px; /* 等比例放大：20 * 1.45 = 29 */
}

#start-btn:hover {
    background-color: #00cccc;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

/* 游戏控制说明样式 */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px auto;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    border: 1px solid #00ffff;
    width: 1160px;
    z-index: 100;
    position: relative;
    flex-wrap: wrap;
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.control-item .key {
    background-color: #333;
    color: #00ffff;
    padding: 7px 15px; /* 等比例放大：5 * 1.45 = 7, 10 * 1.45 = 15 */
    border-radius: 7px; /* 等比例放大：5 * 1.45 = 7 */
    font-weight: bold;
    font-size: 20px; /* 等比例放大：14 * 1.45 = 20 */
    border: 1px solid #00ffff;
}

.control-item span:not(.key) {
    color: #00ffff;
    font-size: 20px; /* 等比例放大：14 * 1.45 = 20 */
    font-weight: bold;
}

/* 全屏按钮容器样式 */
.fullscreen-container {
    text-align: center;
    margin: 20px auto;
}

/* 全屏按钮样式 */
.fullscreen-btn {
    padding: 10px 20px;
    font-size: 24px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #00ffff;
    border: 1px solid #00ffff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.fullscreen-btn:hover {
    background-color: rgba(0, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

/* 全屏模式样式 */
:fullscreen {
    background-color: #000;
    overflow: hidden;
}

:-webkit-full-screen {
    background-color: #000;
    overflow: hidden;
}

:-moz-full-screen {
    background-color: #000;
    overflow: hidden;
}

:-ms-fullscreen {
    background-color: #000;
    overflow: hidden;
}

/* 全屏模式下的游戏容器 */
:fullscreen .game-container {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5) !important;
    position: relative !important;
    display: block !important;
}

:-webkit-full-screen .game-container {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5) !important;
    position: relative !important;
    display: block !important;
}

:-moz-full-screen .game-container {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5) !important;
    position: relative !important;
    display: block !important;
}

:-ms-fullscreen .game-container {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5) !important;
    position: relative !important;
    display: block !important;
}

/* 全屏模式下的游戏画布 */
:fullscreen #game-canvas {
    width: 100% !important;
    height: calc(100% - 72px) !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    background-color: #000 !important;
    background: linear-gradient(to bottom, #003366 0%, #001133 100%) !important;
}

:-webkit-full-screen #game-canvas {
    width: 100% !important;
    height: calc(100% - 72px) !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    background-color: #000 !important;
    background: linear-gradient(to bottom, #003366 0%, #001133 100%) !important;
}

:-moz-full-screen #game-canvas {
    width: 100% !important;
    height: calc(100% - 72px) !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    background-color: #000 !important;
    background: linear-gradient(to bottom, #003366 0%, #001133 100%) !important;
}

:-ms-fullscreen #game-canvas {
    width: 100% !important;
    height: calc(100% - 72px) !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    background-color: #000 !important;
    background: linear-gradient(to bottom, #003366 0%, #001133 100%) !important;
}

/* 全屏模式下的游戏屏幕 */
:fullscreen .screen {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    background-color: rgba(0, 0, 20, 0.95) !important;
}

:-webkit-full-screen .screen {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    background-color: rgba(0, 0, 20, 0.95) !important;
}

:-moz-full-screen .screen {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    background-color: rgba(0, 0, 20, 0.95) !important;
}

:-ms-fullscreen .screen {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    background-color: rgba(0, 0, 20, 0.95) !important;
}

/* 全屏模式下的UI面板 */
:fullscreen #ui-panel {
    width: 100% !important;
    height: 104px !important; /* 等比例放大：72 * 1.45 = 104 */
    padding: 10px 20px !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 2px solid #00ffff !important;
    box-sizing: border-box !important;
}

:-webkit-full-screen #ui-panel {
    width: 100% !important;
    height: 104px !important; /* 等比例放大：72 * 1.45 = 104 */
    padding: 10px 20px !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 2px solid #00ffff !important;
    box-sizing: border-box !important;
}

:-moz-full-screen #ui-panel {
    width: 100% !important;
    height: 104px !important; /* 等比例放大：72 * 1.45 = 104 */
    padding: 10px 20px !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 2px solid #00ffff !important;
    box-sizing: border-box !important;
}

:-ms-fullscreen #ui-panel {
    width: 100% !important;
    height: 104px !important; /* 等比例放大：72 * 1.45 = 104 */
    padding: 10px 20px !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 2px solid #00ffff !important;
    box-sizing: border-box !important;
}

/* 全屏模式下的游戏控制说明 */
:fullscreen .game-controls {
    display: none !important;
}

:-webkit-full-screen .game-controls {
    display: none !important;
}

:-moz-full-screen .game-controls {
    display: none !important;
}

:-ms-fullscreen .game-controls {
    display: none !important;
}

/* 全屏模式下的全屏按钮 */
:fullscreen .fullscreen-container {
    display: none !important;
}

:-webkit-full-screen .fullscreen-container {
    display: none !important;
}

:-moz-full-screen .fullscreen-container {
    display: none !important;
}

:-ms-fullscreen .fullscreen-container {
    display: none !important;
}

/* 潜水员图标样式 */
.divers-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.diver-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
}

/* 生命值图标样式 */
.lives-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.life-icon {
    width: 32px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}
