* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: #000;
}

#canvas-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* 加载屏幕：海洋主题，小船随波浪起伏 */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #1a3a52 0%, #0d1f33 40%, #061018 100%);
    color: #fff;
    text-align: center;
}

.loading-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%;
    overflow: hidden;
}

.loading-waves .wave {
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 120px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath fill='%231a5fb4' fill-opacity='0.4' d='M0,60 C300,120 600,0 900,60 C1050,90 1125,90 1200,60 L1200,120 L0,120 Z'/%3E%3C/svg%3E") repeat-x;
    background-size: 600px 120px;
    animation: wave 4s ease-in-out infinite;
}

.loading-waves .wave-1 { bottom: 0; opacity: 0.6; animation-duration: 3s; animation-delay: 0s; }
.loading-waves .wave-2 { bottom: 8px; opacity: 0.45; animation-duration: 4s; animation-delay: -0.5s; background-position-x: 300px; }
.loading-waves .wave-3 { bottom: 16px; opacity: 0.3; animation-duration: 5s; animation-delay: -1s; background-position-x: 150px; }

@keyframes wave {
    0%, 100% { transform: translateX(0) translateZ(0) scaleY(1); }
    50% { transform: translateX(-25%) translateZ(0) scaleY(1.1); }
}

.loading-boat {
    position: relative;
    z-index: 2;
    font-size: 56px;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    animation: boat-bob 2s ease-in-out infinite;
}

@keyframes boat-bob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

.loading-bar-wrap {
    width: 200px;
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.loading-bar {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #5eb3f6, #a8e4ff);
    border-radius: 3px;
    animation: loading-run 1.8s ease-in-out infinite;
}

@keyframes loading-run {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(250%); }
    100% { transform: translateX(-100%); }
}

.loading-text {
    font-size: 16px;
    color: rgba(255,255,255,0.95);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.loading-dots {
    display: inline-block;
    animation: dots-pulse 0.8s ease-in-out infinite;
}

@keyframes dots-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* 游戏风格标签 */
#game-label {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translate(-50%, -100%);
}

#game-label.hidden {
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.8);
}

#game-label:not(.hidden) {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
}

/* 左下角控制面板（两个开关垂直排列，避免重叠） */
.controls-panel {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}
.control-row input {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #1a5fb4;
    flex-shrink: 0;
}

.label-content {
    text-align: center;
    white-space: nowrap;
}

.label-title {
    font-size: 26px;
    font-weight: normal;
    font-family: "KaiTi", "楷体", "STKaiti", serif;
    color: #1a5fb4;
    letter-spacing: 1px;
}

@keyframes label-pulse {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 228, 181, 0.5));
    }
    50% { 
        transform: scale(1.05);
        filter: drop-shadow(0 0 20px rgba(255, 228, 181, 0.8));
    }
}

@keyframes hint-blink {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.6; }
}

/* 鼠标样式 */
body {
    cursor: default;
}

body.interactive {
    cursor: pointer;
}

/* 边缘暗角遮罩（Coastal World 风格：更柔和） */
#vignette-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    background: radial-gradient(
        ellipse 80% 80% at 50% 48%,
        transparent 40%,
        transparent 60%,
        rgba(0, 0, 0, 0.06) 80%,
        rgba(0, 0, 0, 0.22) 100%
    );
}
