/* Labubu连连看游戏样式 */

/* 游戏头部 */
.game-header {
    background: white;
    box-shadow: var(--shadow-soft);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.game-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.game-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.back-btn {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--bg-secondary);
    color: var(--labubu-pink);
}

.game-stats {
    display: flex;
    gap: 24px;
}

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

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* 游戏控制面板 */
.game-controls {
    background: var(--bg-secondary);
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.controls-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.difficulty-selector label {
    font-weight: 600;
    color: var(--text-primary);
}

.difficulty-selector select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.difficulty-selector select:focus {
    outline: none;
    border-color: var(--labubu-pink);
}

.game-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 游戏主体 */
.game-main {
    padding: 32px 0;
    min-height: 60vh;
}

.game-board-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.game-board {
    display: grid;
    gap: 4px;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    position: relative;
}

/* 游戏格子 */
.game-tile {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border: 2px solid transparent;
    user-select: none;
}

.game-tile:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.game-tile.selected {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3);
    transform: scale(1.1);
}

.game-tile.matched {
    animation: matchAnimation 0.6s ease-in-out;
}

.game-tile.hint {
    animation: hintAnimation 1s ease-in-out infinite;
}

.game-tile.empty {
    background: transparent !important;
    cursor: default;
    pointer-events: none;
}

/* 连线画布 */
.line-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

/* 动画效果 */
@keyframes matchAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

@keyframes hintAnimation {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}

/* 游戏覆盖层 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.overlay-content {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-hover);
}

.overlay-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.overlay-content h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.overlay-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.overlay-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.overlay-stat {
    text-align: center;
}

.overlay-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.overlay-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.overlay-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 游戏说明 */
.game-instructions {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 32px;
}

.game-instructions h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.25rem;
}

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

.game-instructions li {
    padding: 8px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 24px;
}

.game-instructions li::before {
    content: '🔗';
    position: absolute;
    left: 0;
    top: 8px;
}

/* 最高分记录 */
.high-scores {
    background: white;
    padding: 24px 0;
    border-top: 1px solid #e5e7eb;
}

.high-scores h3 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.25rem;
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.score-item {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.score-difficulty {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.score-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--labubu-pink);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .game-stats {
        justify-content: center;
    }
    
    .controls-content {
        flex-direction: column;
        text-align: center;
    }
    
    .game-tile {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .overlay-content {
        padding: 24px;
    }
    
    .overlay-buttons {
        flex-direction: column;
    }
    
    .game-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .game-tile {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .game-title h1 {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .game-board {
        padding: 12px;
        gap: 2px;
    }
}

/* 工具类 */
.hidden {
    display: none !important;
}

.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* 连击效果 */
.combo-text {
    position: absolute;
    font-size: 18px;
    font-weight: bold;
    color: var(--labubu-pink);
    pointer-events: none;
    z-index: 100;
    animation: comboAnimation 1s ease-out forwards;
}

@keyframes comboAnimation {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) scale(1.2);
        opacity: 0;
    }
}

/* 暂停状态 */
.game-paused .game-board {
    filter: blur(5px);
    pointer-events: none;
}

.game-paused .game-tile {
    cursor: default;
}
