/**
 * Стили для тренажёра "Анзан"
 */

.anzan-game .game-title { color: #41C8E5; }

/* Settings grid */
.anzan-settings {
    display: block !important;
    transition: all 0.3s ease;
    max-height: 500px;
    overflow: hidden;
}

.anzan-settings.collapsed {
    max-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
}

.anzan-settings .settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.anzan-settings .setting-item {
    flex: 1;
    min-width: 120px;
}

.anzan-settings .setting-item.wide {
    min-width: 200px;
}

/* Game buttons */
.game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.game-buttons.playing .btn-start {
    display: none;
}

.btn-reset {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 25px;
    background: #f0f0f0;
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-full);
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: #e0e0e0;
}

/* Digits grid */
.digits-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
}

.digits-grid.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.digit-check {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    cursor: pointer;
}

.digit-check.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.digit-check input {
    margin: 0;
    accent-color: #41C8E5;
}

/* Choose character button */
.btn-choose-char {
    background: linear-gradient(135deg, #9c27b0, #e91e63);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-choose-char:hover {
    transform: scale(1.02);
}

/* Character modal */
.char-modal {
    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;
    visibility: hidden;
    transition: all 0.3s;
}

.char-modal.active {
    opacity: 1;
    visibility: visible;
}

.char-modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 25px;
    max-width: 500px;
    width: 90%;
}

.char-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.char-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.char-modal-close {
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
}

.char-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.char-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 3px solid #eee;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s;
}

.char-card:hover {
    border-color: #41C8E5;
    background: #f0fafc;
}

.char-card.selected {
    border-color: #41C8E5;
    background: #e5f9fc;
    box-shadow: 0 0 0 3px rgba(65, 200, 229, 0.2);
}

.char-card img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 6px;
}

.char-card span {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}

/* Player container */
.anzan-player {
    background: white;
    border: 3px solid #41C8E5;
    border-radius: var(--radius-xl);
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

.anzan-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: linear-gradient(135deg, #41C8E5, #46D2D2);
    color: white;
    font-size: 15px;
    font-weight: 600;
}

.header-char-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
}

.anzan-player-content {
    padding: 20px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Game area with character */
.anzan-game-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    width: 100%;
}

.anzan-character {
    width: 120px;
    height: 120px;
    object-fit: contain;
    flex-shrink: 0;
}

.anzan-number-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

/* Countdown */
.countdown-num {
    font-size: 5rem;
    font-weight: 900;
    color: #41C8E5;
    animation: anzanPulse 0.8s ease-in-out;
}

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

/* Number display */
.anzan-number {
    font-size: 4rem;
    font-weight: 900;
    color: #333;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
}

/* Input */
.anzan-input-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.anzan-input {
    width: 150px;
    padding: 15px 20px;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    border: 3px solid #41C8E5;
    border-radius: var(--radius-lg);
    font-family: 'Montserrat', sans-serif;
    outline: none;
}

.anzan-input:focus {
    border-color: #46D2D2;
    box-shadow: 0 0 0 4px rgba(65, 200, 229, 0.2);
}

.anzan-submit {
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #41C8E5, #46D2D2);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: transform 0.2s;
}

.anzan-submit:hover {
    transform: scale(1.05);
}

/* Feedback */
.anzan-feedback {
    text-align: center;
    padding: 15px;
}

.anzan-feedback .feedback-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.anzan-feedback.correct .feedback-icon { color: #27ae60; }
.anzan-feedback.incorrect .feedback-icon { color: #e74c3c; }

.anzan-feedback .feedback-example {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.anzan-feedback .feedback-user {
    font-size: 0.95rem;
    color: #e74c3c;
}

/* Results */
.anzan-results {
    text-align: center;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
}

.anzan-results .res-icon { 
    font-size: 40px; 
    margin-bottom: 5px; 
}

.anzan-results .res-character {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.anzan-results h2 { 
    font-size: 22px; 
    color: var(--text-primary); 
    margin-bottom: 20px; 
}

.anzan-results .res-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 15px;
}

.anzan-results .res-stat {
    background: white;
    padding: 15px 25px;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.anzan-results .res-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.anzan-results .res-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #41C8E5;
}

.anzan-results .res-reward {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 25px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
}

.anzan-results .res-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.anzan-results .res-btns button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.anzan-results .res-btns button:first-child {
    background: linear-gradient(135deg, #41C8E5, #46D2D2);
    color: white;
}

.anzan-results .res-btns button:last-child {
    background: #f0f0f0;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 600px) {
    .anzan-game-area {
        flex-direction: column;
        gap: 15px;
    }
    
    .anzan-character {
        width: 80px;
        height: 80px;
    }
    
    .anzan-number { font-size: 3rem; }
    .anzan-input { width: 120px; font-size: 1.5rem; }
    
    .char-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .anzan-settings .setting-item {
        min-width: 100px;
    }
}