/* Number Memory Test Styles - Simplified Version */

/* Fix to ensure page displays immediately */
html, body {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Basic Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Footer */
header {
    background-color: #2962ff;
    color: white;
    padding: 1rem 0;
}

.logo-link {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.tagline {
    margin: 0;
    font-size: 1rem;
}

footer {
    background-color: #333;
    color: white;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.footer-link {
    color: #ddd;
    margin-right: 20px;
    text-decoration: none;
}

/* Test Information Area */
.test-info {
    text-align: center;
    margin-bottom: 2.5rem;
}

.test-description {
    max-width: 700px;
    margin: 0 auto 2rem;
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.test-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    min-width: 140px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.test-tips {
    max-width: 700px;
    margin: 0 auto 2rem;
    background-color: rgba(0, 122, 255, 0.08);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    text-align: left;
}

/* Game Container */
#game-container {
    width: 100%;
    max-width: 600px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
    margin: 0 auto 2.5rem;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.game-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

#current-level {
    font-weight: bold;
    color: #2962ff;
    font-size: 1.5rem;
}

/* Game Screens */
.game-screen {
    display: none;
    text-align: center;
}

.game-screen.active {
    display: block;
}

.game-screen h3 {
    color: #2962ff;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Number Display */
.number-container {
    margin: 2rem 0;
    text-align: center;
}

#number-to-remember {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
    letter-spacing: 0.1em;
    display: block;
}

/* Timer */
#timer-bar {
    width: 100%;
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
}

#timer-progress {
    height: 100%;
    width: 100%;
    background: var(--primary-color);
    transform-origin: left;
    animation: timerShrink 7s linear forwards;
}

@keyframes timerShrink {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Input Area */
.input-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 300px;
    margin: 1.5rem auto;
}

#number-input {
    padding: 1rem;
    font-size: 1.3rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
    transition: border-color 0.2s ease;
}

#number-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

/* Result Messages */
.result-message {
    display: none;
    margin-bottom: 1.5rem;
}

.result-message.active {
    display: block;
}

#success-message h3 {
    color: var(--secondary-color);
}

#failure-message h3 {
    color: var(--accent-color);
}

#correct-number {
    font-weight: bold;
    color: #2962ff;
}

/* Game Over */
.final-result {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem auto 2rem;
    max-width: 90%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.highlight {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 250px;
    margin: 0 auto;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.3s;
    font-weight: 500;
    letter-spacing: 0.02em;
}

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

.btn.secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn.secondary:hover {
    background-color: rgba(0, 122, 255, 0.08);
}

.back-btn {
    display: inline-block;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .test-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-item {
        padding: 0.8rem;
        max-width: 280px;
    }
    
    #game-container {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }
    
    .results-area {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .test-info {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .test-description {
        padding: 1.2rem;
        max-width: 100%;
    }
    
    .test-stats {
        width: 100%;
        max-width: 100%;
    }
    
    #number-to-remember {
        font-size: 2.8rem;
        margin: 1.5rem 0;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.8rem;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .test-description {
        padding: 1rem;
    }
    
    #number-to-remember {
        font-size: 2.5rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
    }
    
    .game-screen h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    #number-input {
        font-size: 1.2rem;
        padding: 0.6rem;
    }
}

@media (max-width: 360px) {
    #game-container {
        padding: 1rem;
    }
    
    #number-to-remember {
        font-size: 2rem;
        margin: 1rem 0;
    }
    
    .stat-item {
        padding: 0.5rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    font-size: 1rem;
    text-align: center;
    max-width: 90%;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.hidden {
    display: none;
}

/* 增强历史记录样式 */
.history-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    padding: 10px 15px;
    background-color: #f5f5f7;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.history-item.best {
    background: linear-gradient(135deg, #fffde7, #fff9c4);
    border: 1px solid #ffd54f;
}

.history-score {
    font-weight: bold;
    color: #2962ff;
}

.history-date {
    color: #666;
    font-size: 0.8rem;
}

.history-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    background-color: #2962ff;
    color: white;
}

.history-badge.best {
    background-color: #ffd700;
    color: #333;
}

/* 结果评级样式 */
.memory-rating {
    margin-top: 20px;
    text-align: center;
}

.rating {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
}

.rating.excellent {
    background-color: #FFD700;
    color: #333;
}

.rating.great {
    background-color: #00c853;
    color: white;
}

.rating.very-good {
    background-color: #2962ff;
    color: white;
}

.rating.good {
    background-color: #2979ff;
    color: white;
}

.rating.above-average {
    background-color: #00b0ff;
    color: white;
}

.rating.average {
    background-color: #b388ff;
    color: white;
}

.rating.below-average {
    background-color: #ff9100;
    color: white;
}

.rating.needs-practice {
    background-color: #ff5252;
    color: white;
}

.rating-message {
    display: block;
    margin-top: 10px;
    font-style: italic;
    color: #666;
    padding: 0 15px;
}

/* 增强按钮样式 */
#restart-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    transform: translateY(0);
    transition: all 0.3s ease;
    margin-right: 10px;
    font-weight: bold;
}

#restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

#restart-btn:active {
    transform: translateY(1px);
}

#share-btn {
    background: linear-gradient(135deg, #2962ff, #768fff);
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.3);
    transform: translateY(0);
    transition: all 0.3s ease;
    font-weight: bold;
}

#share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(41, 98, 255, 0.4);
}

#share-btn:active {
    transform: translateY(1px);
} 