/* 游戏页面样式 */
.game-page {
    padding: 100px 0 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.game-header {
    text-align: center;
    color: var(--white);
    margin-bottom: 2rem;
}

.game-header h2 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 游戏容器 */
.game-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* 游戏信息面板 */
.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.info-item {
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.info-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* 游戏棋盘 */
.game-board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #2c3e50;
    border-radius: 12px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 2px;
    background: #34495e;
    padding: 4px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
}

.cell {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cell.filled {
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

.cell.highlight {
    background: rgba(255, 255, 255, 0.3);
    animation: pulse 0.5s ease-in-out;
}

.cell.clearing {
    animation: clearAnimation 0.5s ease-out forwards;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes clearAnimation {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* 方块选择区域 */
.blocks-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    min-height: 120px;
}

.block-preview {
    display: grid;
    gap: 2px;
    cursor: grab;
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.block-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.block-preview.dragging {
    opacity: 0.3;
    transform: scale(1);
    pointer-events: none;
}

/* 拖拽中的克隆元素 */
.block-preview.drag-clone {
    cursor: grabbing;
    opacity: 0.95;
    transform: scale(1.15);
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

/* 放置成功动画 */
.block-preview.placed {
    animation: placeSuccess 0.3s ease-out;
}

@keyframes placeSuccess {
    0% {
        transform: scale(1.15);
        opacity: 0.95;
    }
    50% {
        transform: scale(0.8);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.block-cell {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2);
}

/* 游戏控制按钮 */
.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn-control {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    color: var(--secondary-color);
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-control:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 游戏规则 */
.game-rules {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
}

.game-rules h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.game-rules ul {
    list-style: none;
    padding-left: 0;
}

.game-rules li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #555;
}

.game-rules li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* 游戏结束弹窗 */
.game-over-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.game-over-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.4s ease;
}

.modal-content h3 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.final-score, .best-score-display {
    margin-bottom: 1.5rem;
}

.final-score p, .best-score-display p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .game-page {
        padding: 80px 0 40px;
    }

    .game-header h2 {
        font-size: 2rem;
    }

    .game-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .game-board {
        max-width: 320px;
    }

    .block-cell {
        width: 16px;
        height: 16px;
    }

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

    .btn-control {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    .modal-content {
        padding: 2rem;
    }

    .modal-content h3 {
        font-size: 2rem;
    }

    .score-value {
        font-size: 2.5rem;
    }
}

/* 方块颜色 */
.block-color-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.block-color-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.block-color-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.block-color-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.block-color-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.block-color-6 { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.block-color-7 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
