/* 小游戏平台公共样式 */

/* 主容器 */
.game-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 头部导航 */
.header-nav {
    display: flex;
    gap: 5px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #666;
}

.nav-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nav-item span {
    font-size: 1.2em;
    margin-right: 5px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 40px 20px;
}

/* 游戏卡片网格 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 游戏卡片 */
.game-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.game-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.game-icon {
    font-size: 3em;
    margin-right: 15px;
}

.game-title {
    flex: 1;
    font-size: 1.3em;
    font-weight: 600;
    color: #667eea;
}

.game-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.game-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #888;
}

.game-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-status {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
}

.game-status.ready {
    background: #d4edda;
    color: #155724;
}

.game-status.dev {
    background: #fff3cd;
    color: #856404;
}

.game-status.planning {
    background: #f8f9fa;
    color: #666;
}

.play-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.play-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 游戏画布容器 */
.game-canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.game-canvas {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 100%;
}

/* 游戏控制面板 */
.game-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.control-button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-button:hover {
    background: #5568d3;
    transform: scale(1.02);
}

.control-button.secondary {
    background: #6c757d;
}

.control-button.secondary:hover {
    background: #5a6268;
}

.control-button.danger {
    background: #dc3545;
}

.control-button.danger:hover {
    background: #c82333;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.toast-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.toast-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.toast-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

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

.modal-content p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 20px;
}

.modal-content input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 返回按钮 */
.back-button {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    text-decoration: none;
}

.back-button:hover {
    background: white;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 游戏信息面板 */
.game-info-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 0.9em;
}

.game-info-item {
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-info-label {
    font-weight: 600;
    color: #667eea;
}

.game-info-value {
    color: #333;
}

/*    动画 */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-nav {
        flex-wrap: wrap;
    }

    .nav-item {
        flex: 1 1 40%;
        font-size: 0.9em;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .game-controls {
        flex-wrap: wrap;
    }

    .control-button {
        flex: 1 1 45%;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 游戏标题 */
.game-title-banner {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-title-banner h1 {
    margin: 0;
    font-size: 2em;
    color: #667eea;
    font-weight: 600;
}

.game-title-banner p {
    margin: 10px 0 0;
    color: #666;
}
