﻿/* === Pixel-Graffiti Combo Upgrade === */

/* === Контейнер === */
.combo-upgrade-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Press Start 2P', monospace;
    padding: 1rem;
    image-rendering: pixelated;
}

/* === Заголовок === */
.combo-upgrade-title {
    color: #ffe066;
    font-size: 2rem;
    text-align: center;
    text-shadow: 4px 4px 0 #000, 0 0 6px #ffbe5c;
    margin-bottom: 1.5rem;
    animation: pixel-jitter 0.4s infinite steps(2);
}

/* === Сетка карточек === */
.combo-upgrade-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* === Карточка апгрейда === */
.combo-upgrade-item {
    background: #fffdfa;
    border: 4px solid #000;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    transform: rotate(-1deg);
    transition: transform 0.2s ease;
}

.combo-upgrade-item:hover {
    transform: rotate(1deg) scale(1.05);
    box-shadow: 6px 6px 0 #222;
    animation: pixel-jitter 0.3s infinite steps(2);
}

.combo-upgrade-item h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    color: #ff5555;
    text-shadow: 2px 2px 0 #000;
}

.combo-upgrade-item p {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #333;
    line-height: 1.4;
}

/* === Последовательность комбо === */
.combo-sequence {
    display: flex;
    gap: 6px;
    margin-bottom: 1rem;
    justify-content: center;
}

.combo-key {
    background: #ffe9c4;
    border: 2px solid #000;
    border-radius: 0;
    padding: 6px 12px;
    font-weight: bold;
    box-shadow: 2px 2px 0 #000;
    font-family: 'Press Start 2P', monospace;
    color: #000;
}

/* === Кнопки покупки === */
.unlock-combo-btn,
.buy-combo-btn {
    width: 100%;
    padding: 0.8rem;
    border: 4px solid #000;
    border-radius: 0;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ff5555;
    color: #fff;
    box-shadow: 3px 3px 0 #000;
    transition: transform 0.2s ease;
    font-family: 'Press Start 2P', monospace;
}

.unlock-combo-btn:hover,
.buy-combo-btn:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 4px 4px 0 #222;
    animation: pixel-jitter 0.3s infinite steps(2);
}

/* Если уже куплено */
.unlock-combo-btn.unlocked,
.buy-combo-btn.equipped {
    background: #aaa;
    color: #333;
    cursor: not-allowed;
    box-shadow: none;
}

/* Если нет кристаллов */
.unlock-combo-btn:disabled:not(.unlocked),
.buy-combo-btn:disabled:not(.equipped) {
    background: #555;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

/* Иконка кристалла */
.crystal-icon {
    font-size: 1.2em;
    color: #00ccee;
}

/* === Пиксельная дрожащая анимация === */
@keyframes pixel-jitter {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(1px, -1px); }
    60% { transform: translate(-1px, 0); }
    80% { transform: translate(0, 1px); }
}

@keyframes comboBtnAppear {
    0%   { transform: translateX(-50%) scale(0) rotate(-10deg); }
    60%  { transform: translateX(-50%) scale(1.2) rotate(3deg); }
    100% { transform: translateX(-50%) scale(1) rotate(0deg); }
}

@keyframes comboBtnPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50%      { transform: translateX(-50%) scale(1.08); }
}

.combo-activate-btn {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000000;
    padding: 20px 40px;
    border: 3px solid #fff;
    border-radius: 16px;
    cursor: pointer;
    pointer-events: auto;
    text-align: center;
    font-family: "Press Start 2P", monospace;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    animation: comboButtonPulse 0.6s ease-in-out infinite alternate;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}

.combo-activate-btn:active {
    transform: translate(-50%, -50%) scale(0.92);
}

.combo-activate-btn .combo-btn-icon {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    text-shadow: 0 0 20px currentColor;
}

.combo-activate-btn .combo-btn-text {
    display: block;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
}

@keyframes comboButtonPulse {
    from {
        box-shadow: 0 0 30px currentColor, 0 0 60px currentColor, inset 0 0 15px rgba(255,255,255,0.2);
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        box-shadow: 0 0 50px currentColor, 0 0 100px currentColor, inset 0 0 25px rgba(255,255,255,0.3);
        transform: translate(-50%, -50%) scale(1.05);
    }
}


/* ============================================
   ★ КНОПКА «ПОПРОБОВАТЬ» НА КАРТОЧКЕ КОМБО
   ============================================ */

.try-combo-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 12px 16px;
    background: #1a1a2e;
    border: 4px solid #ffd700;
    border-radius: 0;
    color: #ffd700;
    font-family: "Press Start 2P", monospace;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 3px 3px 0 #000;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.try-combo-btn:hover {
    background: #2a2a4e;
    box-shadow: 5px 5px 0 #000, 0 0 14px rgba(255, 215, 0, 0.35);
    transform: scale(1.05) rotate(1deg);
    animation: pixel-jitter 0.3s infinite steps(2);
}

.try-combo-btn:active {
    transform: scale(0.96);
    box-shadow: 1px 1px 0 #000;
}


/* ============================================
   ★ COMBO TRIAL OVERLAY
   ============================================ */

.combo-trial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    z-index: 10000000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: comboTrialFadeIn 0.25s ease;
}

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

.combo-trial-content {
    background: linear-gradient(180deg, #0d0d1a 0%, #1a1a2e 100%);
    border: 4px solid #ffd700;
    border-radius: 0;
    padding: 24px 20px;
    width: 92%;
    max-width: 400px;
    max-height: 88vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    box-shadow: 6px 6px 0 #000, 0 0 30px rgba(255, 215, 0, 0.15);
    image-rendering: pixelated;
}

/* --- Шапка --- */
.combo-trial-header {
    margin-bottom: 14px;
}

.combo-trial-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 6px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.combo-trial-name {
    font-family: "Press Start 2P", monospace;
    font-size: 14px;
    color: #ffd700;
    text-shadow: 3px 3px 0 #000;
}

/* --- Последовательность --- */
.combo-trial-sequence {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 0;
    padding: 12px;
    background: #0a0a18;
    border: 2px solid #333;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.combo-trial-seq-item {
    font-family: "Press Start 2P", monospace;
    font-size: 11px;
    text-shadow: 1px 1px 0 #000;
}

.combo-trial-seq-arrow {
    color: #555;
    font-size: 16px;
    font-weight: bold;
}

/* --- Подсказка --- */
.combo-trial-hint {
    font-family: "Press Start 2P", monospace;
    font-size: 9px;
    color: #aaaaaa;
    margin: 10px 0 16px;
    min-height: 22px;
    transition: color 0.3s;
    text-shadow: 1px 1px 0 #000;
}

/* --- Слоты прогресса --- */
.combo-trial-slots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.combo-trial-slot {
    width: 54px;
    height: 54px;
    border: 4px solid #333;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: #0a0a12;
    box-shadow: 3px 3px 0 #000;
    transition: all 0.25s ease;
    opacity: 0.35;
}

.combo-trial-slot.active {
    border-color: #ffd700;
    opacity: 1;
    box-shadow: 3px 3px 0 #000, 0 0 14px rgba(255, 215, 0, 0.4);
    animation: trialSlotPulse 1s ease-in-out infinite;
}

@keyframes trialSlotPulse {
    0%, 100% { box-shadow: 3px 3px 0 #000, 0 0 10px rgba(255, 215, 0, 0.3); }
    50%      { box-shadow: 3px 3px 0 #000, 0 0 22px rgba(255, 215, 0, 0.6); }
}

.combo-trial-slot.correct {
    border-color: #00ff44;
    background: #0a1a0a;
    opacity: 1;
    box-shadow: 3px 3px 0 #000, 0 0 14px rgba(0, 255, 68, 0.4);
    animation: trialSlotCorrect 0.3s ease;
}

@keyframes trialSlotCorrect {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.combo-trial-slot.wrong {
    border-color: #ff4444;
    background: #1a0a0a;
    opacity: 1;
    animation: trialSlotWrong 0.4s ease;
}

@keyframes trialSlotWrong {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(3px); }
}

/* --- Кнопки действий --- */
.combo-trial-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.combo-trial-action-btn {
    width: 86px;
    height: 78px;
    border: 4px solid;
    border-radius: 0;
    font-size: 26px;
    cursor: pointer;
    font-family: "Press Start 2P", monospace;
    transition: all 0.12s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-shadow: 3px 3px 0 #000;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.combo-trial-action-label {
    font-size: 7px;
    margin-top: 3px;
    letter-spacing: 0.5px;
}

.combo-trial-action-btn:hover {
    transform: scale(1.08);
    filter: brightness(1.2);
    box-shadow: 4px 4px 0 #000;
}

.combo-trial-action-btn:active {
    transform: scale(0.92);
    box-shadow: 1px 1px 0 #000;
}

.combo-trial-btn-flash {
    animation: trialBtnFlash 0.2s ease;
}

@keyframes trialBtnFlash {
    0%   { filter: brightness(1); }
    50%  { filter: brightness(2.8); box-shadow: 0 0 24px currentColor; }
    100% { filter: brightness(1); }
}

/* --- Результат --- */
.combo-trial-result {
    min-height: 34px;
    margin-bottom: 14px;
}

.combo-trial-success {
    font-family: "Press Start 2P", monospace;
    font-size: 14px;
    color: #ffd700;
    text-shadow: 3px 3px 0 #000, 0 0 12px rgba(255, 215, 0, 0.5);
    animation: trialSuccessPop 0.4s ease;
}

@keyframes trialSuccessPop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Кнопка «Ещё раз» --- */
.combo-trial-retry-btn {
    padding: 12px 24px;
    background: #0a1a0a;
    border: 4px solid #00ff44;
    border-radius: 0;
    color: #00ff44;
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 3px 3px 0 #000;
    transition: all 0.2s;
}

.combo-trial-retry-btn:hover {
    background: #1a2a1a;
    box-shadow: 4px 4px 0 #000, 0 0 10px rgba(0, 255, 68, 0.3);
    transform: scale(1.05);
}

.combo-trial-retry-btn:active {
    transform: scale(0.95);
    box-shadow: 1px 1px 0 #000;
}

/* --- Кнопка «Закрыть» --- */
.combo-trial-close-btn {
    padding: 12px 28px;
    background: #1a0a0a;
    border: 4px solid #ff4444;
    border-radius: 0;
    color: #ff4444;
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 3px 3px 0 #000;
    transition: all 0.2s;
}

.combo-trial-close-btn:hover {
    background: #2a1a1a;
    box-shadow: 4px 4px 0 #000, 0 0 10px rgba(255, 68, 68, 0.3);
    transform: scale(1.05);
}

.combo-trial-close-btn:active {
    transform: scale(0.95);
    box-shadow: 1px 1px 0 #000;
}

/* --- Адаптив для маленьких экранов --- */
@media (max-width: 380px) {
    .combo-trial-content {
        padding: 16px 12px;
    }

    .combo-trial-slot {
        width: 44px;
        height: 44px;
        font-size: 18px;
        border-width: 3px;
    }

    .combo-trial-action-btn {
        width: 72px;
        height: 66px;
        font-size: 22px;
        border-width: 3px;
    }

    .combo-trial-name {
        font-size: 12px;
    }

    .combo-trial-seq-item {
        font-size: 9px;
    }
}

