@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800&display=swap');

:root {
    --bg-dark: #0f0f15;
    --text-main: #ffffff;
    --text-muted: #c4c4d4;
    --accent-green: #00ff88;
    --accent-red: #ff2a5f;
    --accent-gold: #d4af37;
    --telegram-blue: #00a2ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; 
    transition: background-color 0.5s ease;
}

#app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    position: relative;
    background-color: var(--bg-dark);
    transition: background-color 0.5s ease;
}

/* ИСПРАВЛЕНИЕ СКРОЛЛА */
.screen {
    width: 100%;
    height: 100%; 
    padding: 40px 20px 100px 20px; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: center;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow-y: auto; 
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.screen::-webkit-scrollbar { width: 0px; background: transparent; }

.content {
    width: 100%;
    margin: auto 0; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ЛОГИКА ПЕРЕКЛЮЧЕНИЯ ЭКРАНОВ */
.active { 
    opacity: 1 !important; 
    z-index: 10 !important; 
    transform: scale(1) !important; 
    pointer-events: auto !important; 
    visibility: visible !important; 
}
.hidden { 
    opacity: 0 !important; 
    z-index: -1 !important; 
    transform: scale(0.95) !important; 
    pointer-events: none !important; 
    visibility: hidden !important; 
}

h1, h2 { font-weight: 800; margin-bottom: 15px; color: var(--accent-green); text-shadow: 0 0 15px rgba(0, 255, 136, 0.4); line-height: 1.2; }
p { font-size: 15px; line-height: 1.6; margin-bottom: 30px; color: var(--text-muted); }

/* --- КНОПКИ --- */
button, .btn-link {
    font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 700; padding: 16px 32px;
    border: none; border-radius: 30px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    width: 100%; max-width: 300px; margin-bottom: 15px; display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--accent-red), #ff003c); color: white; box-shadow: 0 5px 20px rgba(255, 0, 60, 0.4); }
.btn-primary:active, .btn-link:active { transform: scale(0.95); }
.btn-secondary { background: #2a2a35; color: #888; border: 1px solid #444; }
.btn-link { background: linear-gradient(135deg, var(--accent-red), #ff003c); color: white; box-shadow: 0 5px 20px rgba(255, 0, 60, 0.4); margin-top: 15px; }
.btn-telegram { background: #2a2a35; border: 1px solid var(--telegram-blue); color: var(--telegram-blue); box-shadow: none; }
#btn-no { position: relative; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
button:disabled, .btn-primary:disabled { background: #2a2a35 !important; color: #555 !important; box-shadow: none !important; cursor: not-allowed; border: 1px solid #444; transform: none !important; }

/* ПЛАВАЮЩИЕ КНОПКИ */
.floating-btn {
    position: fixed; 
    top: 20px; right: 20px; z-index: 1000; width: 45px; height: 45px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.5); border: 1px solid var(--accent-green); color: white;
    font-size: 20px; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(5px); padding: 0; margin: 0; transition: box-shadow 0.3s ease;
}

/* --- ПОЛЯ ВВОДА ДАТЫ И ВРЕМЕНИ --- */
.weekend-hint { color: var(--accent-gold); font-size: 14px; font-weight: 700; margin-bottom: 20px; text-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }
.datetime-container { display: flex; gap: 15px; margin-bottom: 25px; width: 100%; }
input[type="text"], input[type="date"], input[type="time"] { width: 100%; padding: 16px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.4); color: var(--accent-green); font-family: inherit; font-size: 15px; margin-bottom: 25px; outline: none; transition: border-color 0.3s; color-scheme: dark; }
.datetime-container input { margin-bottom: 0; }
input:focus { border-color: var(--accent-green); }

/* Подсветка иконки календаря/часов, чтобы её было видно на черном фоне */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) sepia(1) saturate(5) hue-rotate(90deg);
    cursor: pointer;
}

/* --- КАРТОЧКИ --- */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; width: 100%; margin-bottom: 25px; }

.card {
    background: rgba(255, 255, 255, 0.03); border: 2px solid rgba(255, 255, 255, 0.1); border-radius: 16px;
    padding: 10px; font-size: 13px; font-weight: 700; color: var(--text-main); text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,1);
    cursor: pointer; transition: all 0.3s ease; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; min-height: 85px; text-align: center; user-select: none; position: relative; overflow: hidden; 
}

.card span { position: relative; z-index: 2; }
.card img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.5; z-index: 1; transition: all 0.3s ease; }
.card:active { transform: scale(0.95); }
.card.selected { background: rgba(0, 255, 136, 0.1); border-color: var(--accent-green); color: var(--accent-green); box-shadow: 0 0 15px rgba(0, 255, 136, 0.2); }
.card.selected img { opacity: 0.6; filter: drop-shadow(0 0 10px var(--accent-green)); }

.secret-box { background: rgba(0, 255, 136, 0.05); border: 1px dashed var(--accent-green); border-radius: 12px; padding: 15px; margin-top: 15px; margin-bottom: 15px; text-align: center; animation: fadeInBlock 0.4s ease forwards; }
@keyframes fadeInBlock { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.secret-box h3 { color: var(--accent-green); font-size: 18px; margin-bottom: 10px; }
.secret-box p { color: var(--text-main); font-size: 14px; line-height: 1.4; margin-bottom: 0; }

/* --- БИЛЕТ --- */
.vip-ticket {
    /* Полупрозрачный темный градиент поверх арта для читаемости текста */
    background: 
        linear-gradient(165deg, rgba(15, 10, 22, 0.2) 0%, rgba(25, 12, 35, 0.3) 100%), 
        url('img/ticket-bg.jpg') center/cover no-repeat;
    
    border: 2px solid var(--accent-gold);
    border-radius: 18px;
    padding: 22px 20px;
    margin: 20px auto 30px;
    width: 100%;
    max-width: 350px;
    
    /* Двойное свечение: глубокая тень + магический фиолетово-золотой ореол */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(186, 85, 211, 0.25);
    
    color: var(--accent-gold);
    font-family: 'Courier New', Courier, monospace;
    position: relative;
    overflow: hidden;
}

/* Дополнительный контраст для текста на фоне арта */
.ticket-row strong {
    text-align: right;
    max-width: 65%;
    color: var(--accent-green);
    font-family: 'Montserrat', sans-serif;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.ticket-header h3 {
    color: var(--accent-red);
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(255, 42, 95, 0.5);
}
/* --- ЗОНА ПОДТВЕРЖДЕНИЯ С КВАДРАТИКОМ --- */
.signature-zone {
    width: 100%;
    margin: 18px 0;
    padding: 12px 16px;
    background: rgba(10, 8, 18, 0.85); /* Плотный темный фон: не сливается с картинкой */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.signature-zone:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.signature-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 4px;
}

.sig-label {
    color: var(--accent-gold);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.sig-hint {
    color: var(--text-muted);
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    transition: color 0.3s ease;
}

/* Квадратик для печати */
.stamp-box {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px dashed var(--accent-gold);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

/* Лапка внутри квадратика */
.paw-print {
    font-size: 26px;
    opacity: 0;
    transform: scale(0.2) rotate(-25deg);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 10px var(--accent-green));
}

/* Состояние ПОСЛЕ НАЖАТИЯ */
.signature-zone.signed {
    border-color: var(--accent-green);
    background: rgba(10, 20, 15, 0.9);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.25);
}

.signature-zone.signed .sig-hint {
    color: var(--accent-green);
}

.signature-zone.signed .stamp-box {
    border: 2px solid var(--accent-green);
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.signature-zone.signed .paw-print {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* --- ГАЛЕРЕЯ И АНИМАЦИИ --- */
.gallery-container { display: flex; flex-direction: column; align-items: center; gap: 30px; margin-top: 20px; height: 60vh; overflow-y: auto; padding: 10px 10px 40px 10px; }
.polaroid { background: #ffffff; padding: 12px 12px 35px 12px; border-radius: 4px; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6); width: 90%; max-width: 280px; transition: transform 0.3s ease, z-index 0.3s; position: relative; }
.polaroid img { width: 100%; height: auto; border-radius: 2px; display: block; min-height: 200px; background: #eee; }
.polaroid:nth-child(1) { transform: rotate(-3deg); }
.polaroid:nth-child(2) { transform: rotate(4deg); }
.polaroid:nth-child(3) { transform: rotate(-2deg); }
.polaroid:active, .polaroid:hover { transform: scale(1.05) rotate(0deg); z-index: 10; box-shadow: 0 20px 40px rgba(0, 255, 136, 0.3); }

.btn-evaporate { transition: none !important; will-change: transform, opacity; animation: evaporate-smooth 0.5s ease-out forwards !important; pointer-events: none; }
@keyframes evaporate-smooth { 0% { transform: scale(1) translateZ(0); opacity: 1; } 100% { transform: scale(1.6) translateZ(0); opacity: 0; } }
.butterfly-entity { position: absolute; width: 70px; height: 70px; object-fit: contain; pointer-events: none; z-index: 9999; animation: flyAwayButterfly 4s ease-in-out forwards; }
@keyframes flyAwayButterfly { 0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; } 15% { opacity: 1; transform: translate(-50%, -150%) scale(1); } 100% { transform: translate(150%, -900%) scale(1.2) rotate(20deg); opacity: 0; } }
.kwami-entity { position: absolute; width: 110px; height: 110px; object-fit: contain; pointer-events: none; z-index: 9998; animation: circleAndFlyKwami 5s ease-in-out forwards; }
@keyframes circleAndFlyKwami { 0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; } 15% { transform: translate(-200%, -150%) scale(1.1); opacity: 1; } 35% { transform: translate(-100%, -300%) scale(1) rotate(15deg); opacity: 1; } 55% { transform: translate(50%, -150%) scale(1) rotate(-15deg); opacity: 1; } 100% { transform: translate(300%, -1000%) scale(1.2) rotate(30deg); opacity: 0; } }
.falling-item { position: absolute; top: -50px; z-index: 9997; pointer-events: none; user-select: none; animation: fall linear forwards; filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.4)); }
@keyframes fall { 0% { transform: translateY(0) rotate(0deg); opacity: 0; } 25% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(110vh) rotate(360deg); opacity: 0; } }

/* --- ЭКРАН ВЫЗОВА И АВАТАРКА --- */
.call-content { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.caller-avatar { width: 120px; height: 120px; background-image: url('img/cat-avatar.webp'); background-size: cover; background-position: center; background-repeat: no-repeat; border: 3px solid var(--accent-green); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 50px; margin-bottom: 20px; box-shadow: 0 0 30px rgba(0, 255, 136, 0.4); animation: pulseCall 1.5s infinite; }
@keyframes pulseCall { 0% { transform: scale(1); box-shadow: 0 0 10px rgba(0, 255, 136, 0.4); } 50% { transform: scale(1.1); box-shadow: 0 0 40px rgba(0, 255, 136, 0.8); } 100% { transform: scale(1); box-shadow: 0 0 10px rgba(0, 255, 136, 0.4); } }
.caller-name { color: white; font-size: 28px; margin-bottom: 5px; text-shadow: none; }
.caller-status { color: var(--accent-green); font-size: 16px; margin-bottom: 50px; }
.call-buttons { display: flex; gap: 20px; width: 100%; justify-content: center; }
.btn-call { width: 70px; height: 70px; border-radius: 50%; border: none; font-size: 14px; font-weight: bold; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; }
.btn-call.decline { background: #ff2a5f; box-shadow: 0 0 15px rgba(255, 42, 95, 0.5); opacity: 0.5; }
.btn-call.answer { background: #00ff88; color: #000; box-shadow: 0 0 20px rgba(0, 255, 136, 0.6); animation: jumpAnswer 1s infinite; }
@keyframes jumpAnswer { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* --- РЕЖИМ СУПЕР-КОТА --- */
body.cat-vision { --bg-dark: #051005; --text-main: #b8ffc9; --text-muted: #5e9c6f; --accent-red: #00ff88; --accent-gold: #00ff88; }
body.cat-vision .screen { background-color: rgba(0, 50, 0, 0.7) !important; background-blend-mode: overlay; }
.secret-msg { opacity: 0; visibility: hidden; color: #00ff88; text-shadow: 0 0 8px #00ff88; font-size: 14px; font-weight: 800; transition: all 0.4s ease; margin-top: 5px; pointer-events: none; height: 0; margin-bottom: 0; }
body.cat-vision .secret-msg { opacity: 1; visibility: visible; height: auto; transform: scale(1.05); margin-bottom: 10px; }

/* --- ВСПЛЫВАЮЩИЕ УВЕДОМЛЕНИЯ И МОДАЛКИ --- */
.toast-container { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.toast { background: rgba(0, 0, 0, 0.8); border: 1px solid var(--accent-green); color: var(--text-main); padding: 12px 20px; border-radius: 20px; font-size: 14px; text-align: center; box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3); backdrop-filter: blur(5px); animation: slideUpFade 0.4s ease forwards; transition: opacity 0.4s ease; }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.custom-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 15, 21, 0.85); backdrop-filter: blur(8px); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.custom-modal.show { opacity: 1; visibility: visible; }
.modal-content { background: rgba(20, 20, 28, 0.95); border: 2px solid var(--accent-green); border-radius: 20px; padding: 25px 20px; max-width: 350px; width: 100%; text-align: center; box-shadow: 0 10px 40px rgba(0, 255, 136, 0.2); transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.custom-modal.show .modal-content { transform: scale(1); }
.modal-title { color: var(--accent-green); font-size: 18px; margin-bottom: 15px; text-shadow: 0 0 10px rgba(0, 255, 136, 0.4); }
.modal-text { font-size: 13px; color: var(--text-main); line-height: 1.6; margin-bottom: 15px; text-align: justify; }
.modal-question { font-weight: 800; color: var(--accent-red); margin-bottom: 15px; font-size: 15px; }
#secret-password-input { text-align: center; margin-bottom: 5px; border-color: var(--accent-green); background: rgba(0, 255, 136, 0.05); }
.modal-hint { font-size: 11px; color: #888; margin-bottom: 20px; }
.modal-buttons { display: flex; gap: 10px; }
.modal-buttons button { margin-bottom: 0; padding: 14px 10px; font-size: 14px; }
.modal-error { color: var(--accent-red); font-size: 12px; margin-top: 15px; margin-bottom: 0; text-shadow: 0 0 8px rgba(255, 42, 95, 0.5); animation: shake 0.4s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* --- ФОНЫ ЭКРАНОВ --- */
#screen-entry { background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('img/bg-entry.webp'); background-size: cover; background-position: center; }
#screen-call { background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('img/bg-call.webp'); background-size: cover; background-position: center; }
#screen-1 { background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('img/bg-1.webp'); }
#screen-2, #screen-date { background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('img/bg-2.webp'); }
#screen-3, #screen-4 { background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('img/bg-3.webp'); }
#screen-5, #screen-gallery { background-image: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)), url('img/bg-4.webp'); }
#btn-start { background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('img/btn-start.webp'); background-size: cover; background-position: center; color: var(--text-main); text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,1); border: 2px solid var(--accent-green); }
#btn-yes { background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('img/btn-yes.webp'); background-size: cover; background-position: center; color: var(--text-main); text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,1); border: 2px solid var(--accent-red); }
#btn-no { background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('img/btn-no.webp'); background-size: cover; background-position: center; color: var(--text-main); text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,1); border: 2px solid #888; }
