/* Sequence Memory Test 专用样式 */

/* 游戏状态显示 */
.game-status {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--background-secondary) 0%, rgba(88, 86, 214, 0.05) 100%);
    border-radius: var(--border-radius-large);
    border: 1px solid rgba(88, 86, 214, 0.1);
}

.status-item {
    text-align: center;
    min-width: 120px;
}

.status-label {
    display: block;
    font-size: var(--font-size-small);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    display: block;
    font-size: var(--font-size-2xl);
    color: var(--secondary-color);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(88, 86, 214, 0.1);
}

/* 序列测试容器 */
.sequence-test-container {
    max-width: 600px;
    margin: 0 auto;
}

/* 指示区域 */
.instruction-area {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background-color: var(--background-secondary);
    border-radius: var(--border-radius-large);
    transition: all 0.3s ease;
}

.instruction-icon {
    width: 80px;
    height: 80px;
    margin-bottom: var(--spacing-lg);
    color: var(--secondary-color);
    opacity: 0.8;
}

.instruction-area h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.instruction-area p {
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* 9宫格游戏区域 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: var(--spacing-md);
    max-width: 400px;
    margin: 0 auto var(--spacing-xl);
    aspect-ratio: 1;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--background-primary) 0%, var(--background-secondary) 100%);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-large);
}

.grid-cell {
    background: linear-gradient(135deg, var(--background-tertiary) 0%, #D1D1D6 100%);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    min-height: 80px;
}

.grid-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(88, 86, 214, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-cell:hover::before {
    opacity: 1;
}

.grid-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--secondary-color);
}

/* 网格单元状态 */
.grid-cell.active {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #7B68EE 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(88, 86, 214, 0.4);
    animation: cellActivate 0.3s ease;
}

.grid-cell.showing {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056CC 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 122, 255, 0.5);
    animation: cellShow 0.6s ease;
}

.grid-cell.correct {
    background: linear-gradient(135deg, var(--success-color) 0%, #28A745 100%);
    color: white;
    animation: cellCorrect 0.4s ease;
}

.grid-cell.incorrect {
    background: linear-gradient(135deg, var(--error-color) 0%, #DC3545 100%);
    color: white;
    animation: cellIncorrect 0.5s ease;
}

.grid-cell.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 动画效果 */
@keyframes cellActivate {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
    100% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes cellShow {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 8px 30px rgba(0, 122, 255, 0.6);
    }
    100% {
        transform: scale(1.1);
        box-shadow: 0 6px 25px rgba(0, 122, 255, 0.5);
    }
}

@keyframes cellCorrect {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: rotate(5deg) scale(1.05); }
    75% { transform: rotate(-5deg) scale(1.05); }
    100% { transform: rotate(0deg) scale(1); }
}

@keyframes cellIncorrect {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* 进度指示器 */
.progress-indicator {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--background-tertiary);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background-color: var(--secondary-color);
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(88, 86, 214, 0.3);
}

.progress-dot.completed {
    background-color: var(--success-color);
}

.progress-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    font-weight: 500;
}

/* 序列结果容器 */
.sequence-results-container {
    background: linear-gradient(135deg, var(--background-secondary) 0%, rgba(88, 86, 214, 0.05) 100%);
    border-radius: var(--border-radius-large);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    border: 1px solid rgba(88, 86, 214, 0.1);
}

.sequence-results-container h3 {
    text-align: center;
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-xl);
    color: var(--text-primary);
}

.sequence-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.result-card.highlight {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #7B68EE 100%);
    color: white;
    transform: scale(1.02);
    box-shadow: var(--shadow-large);
}

.result-card.highlight .result-icon {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.result-card.highlight .result-label {
    color: rgba(255, 255, 255, 0.9);
}

.result-card.highlight .result-value {
    color: white;
    font-size: var(--font-size-2xl);
}

/* 性能分析 */
.performance-analysis {
    border-top: 1px solid var(--background-tertiary);
    padding-top: var(--spacing-xl);
    text-align: center;
}

.performance-analysis h4 {
    font-size: var(--font-size-large);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.analysis-content {
    background-color: var(--background-primary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-small);
}

.analysis-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.analysis-content .highlight {
    color: var(--secondary-color);
    font-weight: 600;
}

/* 特殊效果 */
.sequence-glow {
    animation: sequenceGlow 1s ease-in-out;
}

@keyframes sequenceGlow {
    0%, 100% {
        box-shadow: var(--shadow-medium);
    }
    50% {
        box-shadow: 0 0 30px rgba(88, 86, 214, 0.4), var(--shadow-large);
    }
}

.level-up-effect {
    animation: levelUpEffect 1.5s ease-in-out;
}

@keyframes levelUpEffect {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    25% {
        transform: scale(1.05);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    75% {
        transform: scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 序列显示动画 */
.sequence-display {
    pointer-events: none;
}

.sequence-display .grid-cell {
    cursor: default;
}

/* 用户输入阶段 */
.user-input-phase .grid-cell:not(.disabled) {
    cursor: pointer;
    transition: all 0.1s ease;
}

.user-input-phase .grid-cell:not(.disabled):active {
    transform: scale(0.95);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-status {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .status-item {
        min-width: auto;
    }
    
    .game-grid {
        max-width: 350px;
        gap: var(--spacing-sm);
        padding: var(--spacing-md);
    }
    
    .grid-cell {
        min-height: 70px;
    }
    
    .instruction-icon {
        width: 60px;
        height: 60px;
    }
    
    .instruction-area {
        padding: var(--spacing-lg);
    }
    
    .sequence-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .game-grid {
        max-width: 300px;
        gap: var(--spacing-xs);
    }
    
    .grid-cell {
        min-height: 60px;
        border-radius: var(--spacing-sm);
    }
    
    .instruction-area h3 {
        font-size: var(--font-size-large);
    }
    
    .status-value {
        font-size: var(--font-size-xl);
    }
    
    .sequence-results-container {
        padding: var(--spacing-lg);
    }
}

/* 无障碍支持 */
.grid-cell:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.grid-cell[aria-pressed="true"] {
    background: var(--secondary-color);
    color: white;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .grid-cell {
        border: 2px solid var(--text-primary);
    }
    
    .grid-cell.active,
    .grid-cell.showing {
        border-color: white;
        border-width: 3px;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    .grid-cell,
    .progress-dot,
    .instruction-area {
        transition: none;
    }
    
    .grid-cell.active,
    .grid-cell.showing,
    .grid-cell.correct,
    .grid-cell.incorrect {
        animation: none;
    }
    
    @keyframes cellActivate,
    @keyframes cellShow,
    @keyframes cellCorrect,
    @keyframes cellIncorrect,
    @keyframes sequenceGlow,
    @keyframes levelUpEffect {
        animation-duration: 0.01ms;
    }
}
