/* 全局设置，禁止滚动 */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #f0f2f5; /* 柔和的背景灰 */
    font-family: 'Helvetica Neue', Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* 禁止移动端默认触摸行为 */
}

#game-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* UI 层悬浮在 Canvas 之上 */
#ui-layer {
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
    z-index: 10;
    pointer-events: none; /* 让点击穿透到 Canvas，除了按钮 */
}

#start-btn {
    pointer-events: auto;
    padding: 12px 24px;
    font-size: 18px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.1s;
}

#start-btn:active {
    transform: scale(0.95);
}

#instruction {
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

/* 编辑菜单样式 */
#edit-menu {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    z-index: 20;
    transform: translate(-50%, -120%); /* 默认向上偏移，居中 */
    transition: opacity 0.2s;
}

.hidden {
    display: none !important;
    opacity: 0;
}

.menu-btn {
    width: 40px;
    height: 40px;
    background: #eef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    font-weight: bold;
    color: #444;
}

.menu-btn:hover {
    background: #dde;
}

.close-btn {
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
    cursor: pointer;
}

/* 信息按钮 */
#info-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    font-style: italic;
    font-family: Georgia, serif;
    color: #666;
    cursor: pointer;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s, background 0.2s;
}

#info-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

#info-btn:active {
    transform: scale(0.95);
}

/* 信息弹窗 */
#info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#info-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 85%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

#info-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s;
}

#info-close:hover {
    transform: scale(1.1);
}

#info-content h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
    text-align: center;
}

#info-content h3 {
    margin: 15px 0 10px 0;
    color: #555;
    font-size: 16px;
}

.info-section {
    margin-bottom: 20px;
}

.info-section p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.info-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.info-section li {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.author {
    text-align: center;
    font-size: 18px !important;
    font-weight: bold;
    color: #4D96FF !important;
}