* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: white;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#status-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.status-box {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    max-width: 300px;
}

.status-box:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.status-box i {
    font-size: 18px;
    color: #4fc3f7;
}

.status-box span {
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
}

#instructions {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#instructions h3 {
    color: #4fc3f7;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#instructions ul {
    list-style: none;
    padding: 0;
}

#instructions li {
    margin-bottom: 10px;
    font-size: 14px;
    color: #b0b0b0;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

#instructions li i {
    color: #4fc3f7;
    width: 20px;
    text-align: center;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(100, 200, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalAppear 0.5s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content h2 {
    color: #4fc3f7;
    margin-bottom: 20px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.modal-content p {
    color: #b0b0b0;
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 16px;
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

button {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 200px;
}

.btn-primary {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1976D2, #0D47A1);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(33, 150, 243, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    #instructions {
        display: none;
    }
    
    .status-box {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .status-box span {
        font-size: 12px;
    }
    
    button {
        min-width: 150px;
        padding: 12px 20px;
    }
    
    .modal-content {
        padding: 20px;
    }
}

/* 游戏状态提示 */
#game-state {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 50px;
    border-radius: 15px;
    text-align: center;
    z-index: 200;
    display: none;
    border: 2px solid #4fc3f7;
    box-shadow: 0 0 30px rgba(79, 195, 247, 0.3);
}

#game-state h2 {
    color: #4fc3f7;
    margin-bottom: 15px;
    font-size: 36px;
}

#game-state p {
    color: white;
    font-size: 18px;
    margin: 10px 0;
}

/* 加载动画 */
.loader {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(79, 195, 247, 0.3);
    border-radius: 50%;
    border-top-color: #4fc3f7;
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 移除p5.js的默认边框 */
canvas {
    display: block;
    outline: none;
}