/* ============ ОСНОВА ============ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}

.eggs-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* ============ ЗАГОЛОВОК ============ */

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.game-title {
    font-size: 20px;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    font-weight: bold;
}

.user-info {
    margin-top: 8px;
    font-size: 14px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.balance {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 193, 7, 0.25));
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    border: 3px solid rgba(255, 215, 0, 0.8);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4), 
                inset 0 2px 10px rgba(255, 255, 255, 0.3),
                0 0 20px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: balanceGlow 2s ease-in-out infinite;
    backdrop-filter: blur(10px);
}

.balance:hover {
    transform: scale(1.05);
    border-color: rgba(255, 215, 0, 1);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6), 
                inset 0 2px 15px rgba(255, 255, 255, 0.4),
                0 0 30px rgba(255, 215, 0, 0.5);
}

.balance span {
    animation: balancePulse 0.5s ease-out;
}

@keyframes balanceGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4), 
                    inset 0 2px 10px rgba(255, 255, 255, 0.3),
                    0 0 20px rgba(255, 215, 0, 0.3);
        border-color: rgba(255, 215, 0, 0.8);
    }
    50% {
        box-shadow: 0 6px 25px rgba(255, 215, 0, 0.7), 
                    inset 0 2px 15px rgba(255, 255, 255, 0.5),
                    0 0 35px rgba(255, 215, 0, 0.5);
        border-color: rgba(255, 215, 0, 1);
    }
}

@keyframes balancePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ============ ГЛАВНАЯ СЕКЦИЯ ============ */

.main-egg-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    padding: 10px 15px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    height: 100vh;
}

/* ============ ИНФОРМАЦИОННАЯ ПАНЕЛЬ ============ */

.egg-info-panel {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.15), rgba(245, 87, 108, 0.15));
    border: 2px solid rgba(240, 147, 251, 0.4);
    border-radius: 12px;
    padding: 8px 12px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
}

.egg-level, .egg-current-price, .egg-prize-range {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.egg-level span, .egg-current-price span, .egg-prize-range span {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #fbbf24;
    margin-top: 3px;
}

/* ============ КОНТЕЙНЕР ЯЙЦА ============ */

.single-egg-container {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.egg-glow-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 147, 251, 0.4), transparent 70%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.5; 
    }
    50% { 
        transform: scale(1.1); 
        opacity: 0.8; 
    }
}

.main-egg-image {
    width: 85%;
    height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(240, 147, 251, 0.8));
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 2;
}

.main-egg-image:active {
    transform: scale(0.95);
}

/* Анимация тряски при тапе */
.egg-tap-shake {
    animation: tapShake 0.2s ease-in-out;
}

@keyframes tapShake {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.05); }
    75% { transform: rotate(10deg) scale(1.05); }
}

/* ============ СЧЕТЧИК ТАПОВ ============ */

.tap-counter {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 3;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 18px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.tap-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
}

.tap-dot.active {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(240, 147, 251, 0.8);
    animation: tapDotPop 0.3s ease-out;
}

@keyframes tapDotPop {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ============ ИНСТРУКЦИЯ ============ */

.tap-instruction {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(240, 147, 251, 0.2);
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: bold;
    color: #f093fb;
    animation: instructionBlink 2s ease-in-out infinite;
    z-index: 3;
    white-space: nowrap;
}

@keyframes instructionBlink {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ============ КНОПКА РАЗБИТЬ ============ */

.btn-buy-crack {
    width: 100%;
    max-width: 280px;
    padding: 14px 35px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5);
    position: relative;
    overflow: hidden;
    margin: 0;
}

.btn-buy-crack::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-buy-crack:active {
    transform: scale(0.98);
}

.btn-buy-crack:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ МОДАЛЬНОЕ ОКНО ============ */

.crack-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

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

.crack-content {
    width: 90%;
    max-width: 400px;
    position: relative;
}

/* ============ АНИМАЦИЯ РАЗБИВАНИЯ ============ */

.egg-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.egg-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
}

.cracking-egg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(240, 147, 251, 0.8));
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.crack-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    animation: crackFlash 1s ease-in-out infinite;
}

@keyframes crackFlash {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.crack-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Эффект разбивания */
.cracking {
    animation: explode 0.6s ease-out forwards !important;
}

@keyframes explode {
    0% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
        opacity: 0.8;
    }
    100% { 
        transform: scale(0.3) rotate(180deg);
        opacity: 0;
    }
}

/* ============ РЕЗУЛЬТАТ ПРИЗА ============ */

.prize-result {
    text-align: center;
    animation: prizeAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes prizeAppear {
    from {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.prize-shine {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 280px;
    height: 280px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent);
    border-radius: 50%;
    animation: shineRotate 3s linear infinite;
    pointer-events: none;
}

@keyframes shineRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.prize-item {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.2), rgba(245, 87, 108, 0.2));
    padding: 25px;
    border-radius: 20px;
    border: 3px solid #f093fb;
    box-shadow: 0 0 40px rgba(240, 147, 251, 0.6);
    position: relative;
    z-index: 1;
}

.prize-item img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.6));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.prize-item h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #fff;
}

.prize-price {
    font-size: 26px;
    color: #fbbf24;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.prize-rarity {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.prize-rarity.common {
    background: rgba(107, 114, 128, 0.5);
    color: #fff;
}

.prize-rarity.rare {
    background: rgba(59, 130, 246, 0.5);
    color: #fff;
}

.prize-rarity.epic {
    background: rgba(168, 85, 247, 0.5);
    color: #fff;
}

.prize-rarity.legendary {
    background: rgba(255, 107, 107, 0.5);
    color: #fff;
}

.prize-rarity.super-legendary {
    background: linear-gradient(135deg, #ff6b6b, #fbbf24);
    color: #fff;
}

.btn-collect {
    margin-top: 15px;
    padding: 14px 45px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.5);
}

.btn-collect:active {
    transform: scale(0.95);
}

/* ============ МОБИЛЬНАЯ АДАПТАЦИЯ ============ */

@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
    }
    
    .game-title {
        font-size: 16px;
        margin: 0;
    }
    
    .user-info {
        margin-top: 6px;
        font-size: 12px;
    }
    
    .balance {
        padding: 4px 12px;
    }
    
    .main-egg-section {
        padding: 8px 12px;
    }
    
    .egg-info-panel {
        padding: 6px 10px;
        gap: 6px;
    }
    
    .egg-level, .egg-current-price, .egg-prize-range {
        font-size: 9px;
    }
    
    .egg-level span, .egg-current-price span, .egg-prize-range span {
        font-size: 14px;
        margin-top: 2px;
    }
    
    .single-egg-container {
        max-width: 240px;
    }
    
    .tap-counter {
        gap: 8px;
        padding: 5px 12px;
    }
    
    .tap-dot {
        width: 12px;
        height: 12px;
    }
    
    .tap-instruction {
        font-size: 11px;
        padding: 5px 12px;
    }
    
    .btn-buy-crack {
        padding: 12px 30px;
        font-size: 15px;
        max-width: 240px;
    }
    
    .egg-wrapper {
        width: 180px;
        height: 180px;
    }
    
    .prize-item {
        padding: 20px;
    }
    
    .prize-item img {
        width: 130px;
        height: 130px;
    }
    
    .prize-item h3 {
        font-size: 18px;
    }
    
    .prize-price {
        font-size: 24px;
    }
    
    .btn-collect {
        padding: 12px 38px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 15px;
    }
    
    .main-egg-section {
        padding: 6px 10px;
    }
    
    .egg-info-panel {
        gap: 5px;
        padding: 6px 8px;
    }
    
    .egg-level span, .egg-current-price span, .egg-prize-range span {
        font-size: 13px;
    }
    
    .single-egg-container {
        max-width: 220px;
    }
    
    .btn-buy-crack {
        max-width: 220px;
        font-size: 14px;
        padding: 12px 28px;
    }
}

@media (max-height: 700px) {
    .game-title {
        font-size: 14px;
        margin: 0;
    }
    
    .main-egg-section {
        padding: 6px 10px;
        justify-content: space-around;
    }
    
    .egg-info-panel {
        padding: 6px 8px;
    }
    
    .single-egg-container {
        max-width: 200px;
    }
    
    .btn-buy-crack {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .tap-instruction {
        font-size: 10px;
        padding: 4px 10px;
    }
}

@media (max-height: 600px) {
    .game-title {
        font-size: 13px;
    }
    
    .main-egg-section {
        padding: 4px 8px;
    }
    
    .egg-info-panel {
        padding: 4px 6px;
        gap: 4px;
    }
    
    .egg-level, .egg-current-price, .egg-prize-range {
        font-size: 8px;
    }
    
    .egg-level span, .egg-current-price span, .egg-prize-range span {
        font-size: 12px;
        margin-top: 1px;
    }
    
    .single-egg-container {
        max-width: 180px;
    }
    
    .btn-buy-crack {
        padding: 9px 22px;
        font-size: 13px;
    }
    
    .tap-counter {
        padding: 4px 10px;
        gap: 6px;
    }
    
    .tap-dot {
        width: 10px;
        height: 10px;
    }
}

/* Поддержка touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .btn-buy-crack:hover {
        transform: none;
    }
    
    .btn-buy-crack:hover::before {
        left: -100%;
    }
}

/* ============ СКРОЛЛБАР (скрыт) ============ */

::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
