@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;500;700&family=Russo+One&display=swap');

/* --- СБРОС СТИЛЕЙ И БАЗОВЫЕ НАСТРОЙКИ --- */
:root {
    /* Основная цветовая палитра в неоновом стиле */
    --neon-green: #39ff14;
    /* Ярко-зеленый (для текстов и акцентов) */
    --neon-purple: #bd00ff;
    /* Насыщенный фиолетовый (для кнопок и свечения) */
    --neon-cyan: #00e5ff;
    /* Цвет морской волны (для роботов и голосования) */
    --neon-orange: #ff5e00;
    /* Неоновый оранжевый (для человеческого наследия) */
    --deep-bg: rgba(10, 15, 20, 0.15);
    /* Полупрозрачный темный фон для карточек */
}

* {
    /* Включаем правильный расчет размеров: padding и border не увеличивают ширину элемента */
    box-sizing: border-box;
}

html {
    /* Фон для overscroll области - темный цвет из градиента */
    background-color: #053312;
    overflow-x: hidden;
    height: 100%;
}

body {
    overflow-x: hidden;
    /* Запрещаем горизонтальную прокрутку */
    width: 100%;
    height: 100%;
    position: relative;
    -webkit-overflow-scrolling: touch;
    /* Плавная прокрутка на iOS */
    margin: 0;
    padding: 0;
    font-family: 'Comfortaa', cursive;
    /* Основной шрифт сайта */

    /* ФОНОВЫЙ ГРАДИЕНТ: создает глубокий переход от темно-зеленого к фиолетовому */
    background: linear-gradient(160deg, #053312 30%, #2f0a35 70%) no-repeat;
    background-attachment: fixed;
    /* Фон остается неподвижным при прокрутке */
    color: #253b41;
    line-height: 1.6;
    min-height: 100vh;
    /* Минимальная высота - на весь экран */
    /* Поддержка всех зон безопасности iPhone */
    padding-top: env(safe-area-inset-top, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
}


#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}

#content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    /* Добавляем отступы с учетом безопасных зон */
    padding: 20px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    width: 95vw;
}

@media (max-width: 768px) {
    #content {
        padding: 8px;
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
        width: 100vw;
    }

    .dual-feed-container {
        gap: 6px;
    }

    .feed-column h3 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    #ideas-feed p {
        font-size: 0.7rem;
        margin-bottom: 6px;
        line-height: 1.3;
    }

    #feed-humans .simple-card,
    #feed-robots .simple-card {
        padding: 8px;
        margin-bottom: 8px;
        min-height: 80px;
    }
}

/* Дополнительная оптимизация для узких экранов */
@media (max-width: 415px) {
    #content {
        padding: 6px;
        padding-left: max(6px, env(safe-area-inset-left));
        padding-right: max(6px, env(safe-area-inset-right));
    }

    .dual-feed-container {
        gap: 4px;
    }

    .feed-column h3 {
        font-size: 0.75rem;
        margin-bottom: 6px;
        letter-spacing: 0.5px;
    }

    #ideas-feed p {
        font-size: 0.6rem;
        margin-bottom: 4px;
        line-height: 1.25;
    }

    #feed-humans .simple-card,
    #feed-robots .simple-card {
        padding: 6px;
        margin-bottom: 6px;
        min-height: 60px;
    }

    /* Удалено правило .simple-card { padding: 15px; } */

    /* Адаптация бейджа и кнопки голосования для Mobile (≤400px) */
    .like-badge {
        font-size: clamp(0.65rem, 2.2vw, 0.85rem);
        padding: 4px 10px;
        gap: 6px;
    }

    .vote-btn {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        margin-left: 10px;
    }

    .vote-btn svg {
        width: 22px;
        height: 22px;
    }
}

/* Экстремально узкие экраны */
@media (max-width: 350px) {
    #content {
        padding: 4px;
        padding-left: max(4px, env(safe-area-inset-left));
        padding-right: max(4px, env(safe-area-inset-right));
    }

    .feed-column h3 {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    #ideas-feed p {
        font-size: 0.55rem;
        margin-bottom: 3px;
        line-height: 1.2;
    }

    #feed-humans .simple-card,
    #feed-robots .simple-card {
        padding: 5px;
        margin-bottom: 5px;
        min-height: 50px;
    }

    /* Адаптация бейджа и кнопки для экстремально узких экранов (≤350px) */
    .like-badge {
        font-size: clamp(0.6rem, 2vw, 0.75rem);
        padding: 3px 8px;
        gap: 4px;
    }

    .vote-btn {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        margin-left: 5px;
    }

    .vote-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* --- АНИМАЦИИ (Keyframes) --- */

/* Анимация появления элементов: плавно выплывают снизу вверх */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Эффект бесконечной прокрутки полосатого фона (используется в заголовках) */
@keyframes stripeScroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}

/* Небольшое покачивание стрелки вверх при наведении */
@keyframes arrowBounceUp {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Небольшое покачивание стрелки вниз (если понадобится) */
@keyframes arrowBounceDown {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(4px);
    }
}


/* --- ШАПКА САЙТА (HEADER) --- */
.header-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    /* Отступ сверху с учетом челки/Dynamic Island */
    padding-top: max(10px, env(safe-area-inset-top, 10px));
    padding-bottom: 10px;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 20px;
    width: 100%;
    flex-wrap: wrap;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: flex-end;
    width: 100%;
}

@media (max-width: 415px) {
    .header-controls {
        gap: 8px;
    }

    /* Уменьшаем размер кнопок и текста в header */
    .simple-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }

    .lang-switcher button {
        font-size: 0.75rem;
    }
}

@media (max-width: 350px) {
    .header-controls {
        gap: 6px;
    }

    .simple-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
    }

    .lang-switcher button {
        font-size: 0.7rem;
    }
}

/* --- ГЛАВНЫЙ ЗАГОЛОВОК (HERO) --- */
.hero-section {
    text-align: center;
    margin-bottom: 50px;
    width: 100%;
    overflow: visible;
}

h1 {
    font-family: 'Russo One', sans-serif;
    font-weight: 400;
    /* Более агрессивное масштабирование для узких экранов */
    font-size: clamp(1.1rem, 5.5vw, 3.2rem);
    margin: 0 0 20px 0;
    text-align: center;
    /* Разрешаем перенос на узких экранах */
    white-space: normal;
    word-break: break-word;
    hyphens: auto;

    /* MULTI-COLOR STRIPES (Green/Purple) */
    background: repeating-linear-gradient(180deg,
            #ffffff 0px,
            #ffffff 2px,
            var(--neon-green) 3px,
            var(--neon-purple) 4px);
    background-size: 100% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: stripeScroll 6s linear infinite;
    will-change: background-position;

    text-transform: uppercase;
    /* Уменьшаем letter-spacing на узких экранах */
    letter-spacing: clamp(0.5px, 0.5vw, 2px);
    filter: drop-shadow(0 0 15px rgba(57, 255, 20, 0.4));

    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
    line-height: 1.2;
}

/* Специальная оптимизация заголовка для узких экранов */
@media (max-width: 415px) {
    h1 {
        font-size: clamp(0.95rem, 5vw, 1.5rem);
        margin: 0 0 15px 0;
        letter-spacing: 0.5px;
        padding: 0 4px;
    }
}

@media (max-width: 350px) {
    h1 {
        font-size: clamp(0.85rem, 4.8vw, 1.3rem);
        margin: 0 0 12px 0;
        letter-spacing: 0.3px;
        padding: 0 2px;
    }
}

h2 {
    font-family: 'Russo One', sans-serif;
    font-size: 1.5rem;
    color: var(--neon-green);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--neon-green);
    display: inline-block;
    padding-bottom: 5px;

    background: repeating-linear-gradient(180deg, #fff 0px, #fff 2px, #39ff14 3px, #39ff14 4px);
    background-size: 100% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: stripeScroll 10s linear infinite;
}

/* --- КАРТОЧКИ СО СКОШЕННЫМИ УГЛАМИ (Stealth Cards) --- */
.simple-card {
    background: rgba(10, 15, 20, 0.15);
    /* Темный, почти прозрачный фон */
    backdrop-filter: blur(5px);
    /* Эффект матового стекла */
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Едва заметная рамка */

    /* ГЕОМЕТРИЯ: Сложная форма со скошенными углами через clip-path */
    clip-path: polygon(25px 0, 100% 0, 100% calc(100% - 25px), calc(100% - 25px) 100%, 0 100%, 0 25px);

    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);

    /* Плавные переходы для всех интерактивных свойств */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.4s ease,
        background 0.4s ease,
        border-color 0.4s ease;

    animation: fadeInUp 0.7s ease-out forwards;
    /* Анимация появления при загрузке */
    transform: translateZ(0);
    /* Оптимизация для видеокарты (Hardware Acceleration) */
    will-change: transform, box-shadow;
    /* Подсказка браузеру для плавной анимации */
    contain: content;
    /* Оптимизация отрисовки */
    word-wrap: break-word;
    /* Автоперенос длинных слов */
    overflow-x: hidden;
    color: #ffffff;
}

/* КИБЕРПАНК-ЭФФЕКТ: Световая обводка карточки при наведении (через псевдоэлемент) */
.simple-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2px;
    /* Толщина светящейся линии */

    /* Цветной градиент, который будет вращаться */
    background: conic-gradient(from var(--angle), transparent 70%, var(--neon-green), var(--neon-purple), var(--neon-cyan));

    /* Маска, чтобы оставить только тонкую рамку */
    clip-path: polygon(25px 0, 100% 0, 100% calc(100% - 25px), calc(100% - 25px) 100%, 0 100%, 0 25px);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;

    opacity: 0;
    /* Изначально рамка скрыта */
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* РЕГИСТРАЦИЯ ПЕРЕМЕННОЙ УГЛА: Позволяет анимировать градиент (conic-gradient) */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBorder {
    to {
        --angle: 360deg;
    }
}

.simple-card:hover::before {
    opacity: 1;
    /* Показываем рамку при наведении мыши */
    animation: rotateBorder 2s linear infinite;
    /* Запускаем бесконечное вращение света */
}

#project-info:hover,
#nft-section:hover,
.simple-card:hover {
    background: rgba(10, 15, 20, 0.4);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(189, 0, 255, 0.4);
    border-color: rgba(189, 0, 255, 0.5);
    z-index: 10;
}

/* --- ФОРМЫ И ВВОД ДАННЫХ --- */
.simple-input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 15, 10, 0.6);
    border: 1px solid var(--neon-green);
    color: #fff;
    font-family: 'Comfortaa', cursive;
    font-size: 1rem;
    margin-bottom: 20px;
    outline: none;
    transition: box-shadow 0.3s ease, background 0.3s ease;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.simple-input:focus {
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
    background: rgba(10, 30, 20, 0.8);
}

/* --- КНОПКИ (Акцентный цвет: Фиолетовый) --- */
.simple-btn {
    background: transparent;
    border: 1px solid var(--neon-purple);
    color: var(--neon-purple);
    padding: 12px 30px;
    font-family: 'Russo One';
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    white-space: nowrap;
}

.simple-btn:hover {
    background: #bd00ff;
    color: #fff;
    box-shadow: 0 0 40px #bd00ff;
    transform: scale(1.05);
}

.simple-btn.primary {
    background: #bd00ff;
    color: #fff;
    border: none;
}

.simple-btn.primary:hover {
    background: #fff;
    color: #bd00ff;
    box-shadow: 0 0 40px #fff;
}

/* --- ДВОЙНАЯ ЛЕНТА ИДЕЙ --- */
#ideas-feed {
    text-align: center;
}

#ideas-feed h2 {
    display: inline-block;
    margin-top: 80px;
    margin-bottom: 40px;
}

/* Адаптивные размеры для заголовка идей на узких экранах */
@media (max-width: 415px) {
    #ideas-feed h2 {
        margin-top: 40px;
        margin-bottom: 20px;
        font-size: 1.2rem;
    }
}

@media (max-width: 350px) {
    #ideas-feed h2 {
        margin-top: 30px;
        margin-bottom: 15px;
        font-size: 1rem;
    }
}

.dual-feed-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

@media(max-width: 415px) {
    .dual-feed-container {
        gap: 10px;
    }
}

.feed-column {
    min-width: 0;
}

.feed-column h3 {
    text-align: center;
    font-family: 'Russo One';
    font-size: 1.3rem;
    margin-bottom: 20px;
    background-size: 100% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: stripeScroll 12s linear infinite;
}

/* Дополнительные адаптивные размеры для заголовков колонок */
@media (max-width: 415px) {
    .feed-column h3 {
        font-size: 0.75rem;
        margin-bottom: 6px;
        letter-spacing: 0.5px;
    }
}

@media (max-width: 350px) {
    .feed-column h3 {
        font-size: 0.7rem;
        margin-bottom: 4px;
        letter-spacing: 0.3px;
    }
}

/* VARIETY: Neon Orange & Cyan */
.human-col h3 {
    background-image: repeating-linear-gradient(180deg, #fff 0px, #fff 2px, var(--neon-orange) 3px, var(--neon-orange) 4px);
    /* Orange */
}

.robot-col h3 {
    background-image: repeating-linear-gradient(180deg, #fff 0px, #fff 2px, var(--neon-cyan) 3px, var(--neon-cyan) 4px);
    /* Cyan */
}

/* СТИЛИЗАЦИЯ КАРТОЧЕК В ЛЕНТЕ: Специальные настройки для идей в колонках */
#feed-humans .simple-card,
#feed-robots .simple-card {
    padding: 20px;
    min-height: 120px;
    margin-bottom: 25px;
    display: flex;
    /* Используем Flexbox для удобного выравнивания содержимого внутри */
    flex-direction: column;
    /* Элементы внутри карточки располагаются вертикально */
    justify-content: space-between;
    /* Распределяем контент: текст сверху, кнопка снизу */
}

/* ЦВЕТОВЫЕ ИНДИКАТОРЫ: Верхняя граница карточки подчеркивает тип идеи */
.simple-card.human-idea {
    border-top: 3px solid #ff5e00;
    /* Оранжевый для людей */
}

.simple-card.robot-idea {
    border-top: 3px solid #00e5ff;
    /* Голубой для роботов */
}

/* ЭФФЕКТЫ ХОВЕРА: Карточки светятся соответствующим цветом при наведении */
#feed-humans .human-idea:hover {
    background: rgba(255, 0, 255, 0.25);
    border-color: #ff00ff;
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 0, 255, 0.5);
    z-index: 20;
}

#feed-robots .robot-idea:hover {
    background: rgba(0, 229, 255, 0.25);
    border-color: #00e5ff;
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 229, 255, 0.5);
    z-index: 20;
}


#ideas-feed p {
    /* Базовый размер для больших экранов */
    font-size: clamp(0.55rem, 2vw, 1rem);
    color: #ffffff;
    /* Ultra contrast white */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    margin: 0 0 10px 0;
    line-height: 1.35;
    font-weight: 500;
    word-break: break-word;
    hyphens: auto;
}

/* --- СИСТЕМА ГОЛОСОВАНИЯ --- */
.vote-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.like-badge {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    /* Динамический размер шрифта для предотвращения переполнения */
    font-size: clamp(0.7rem, 2.5vw, 1.0rem);
    color: var(--neon-cyan);
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.35);
    padding: 6px 14px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.1);
    /* Запрет переноса строк */
    white-space: nowrap;
    flex-shrink: 0;
}

.vote-btn {
    width: 44px;
    height: 44px;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    padding: 0;
}

.vote-btn svg {
    width: 28px;
    height: 28px;
    color: var(--neon-cyan);
    /* Тонкая светящаяся обводка самой стрелки */
    filter: drop-shadow(0 0 1px var(--neon-cyan)) drop-shadow(0 0 3px rgba(0, 229, 255, 0.5));
    transition: transform 0.3s ease;
}

.vote-btn path {
    fill: rgba(0, 229, 255, 0.15);
    stroke: var(--neon-cyan);
    stroke-width: 1.5px;
}

.vote-btn.up:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--neon-cyan);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 229, 255, 0.2);
}

.vote-btn.up:hover svg {
    transform: scale(1.1);
    filter: drop-shadow(0 0 2px var(--neon-cyan)) drop-shadow(0 0 8px var(--neon-cyan));
}

.vote-btn.up:hover path {
    fill: rgba(0, 229, 255, 0.3);
}

.vote-btn:active {
    transform: scale(0.9) translateY(0);
}

/* --- ЭЛЕМЕНТЫ УПРАВЛЕНИЯ В ШАПКЕ --- */
.lang-switcher button {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Comfortaa';
    opacity: 0.6;
}

.lang-switcher button.active {
    opacity: 1;
    color: #39ff14;
}

.close-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #bd00ff;
    color: #bd00ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.close-icon:hover {
    transform: rotate(90deg);
    background: #bd00ff;
    color: #fff;
    box-shadow: 0 0 15px #bd00ff;
}

.type-selector .radio-custom {
    padding: 10px 20px;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #555;
    color: #888;
    font-family: 'Russo One';
    transition: 0.3s;
}

.radio-label input:checked+.radio-custom.human {
    background: rgba(255, 94, 0, 0.2);
    color: var(--neon-orange);
    border-color: var(--neon-orange);
}

.radio-label input:checked+.radio-custom.robot {
    background: rgba(0, 229, 255, 0.2);
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
}

footer {
    text-align: center;
    margin-top: 50px;
    /* Отступ снизу с учетом Home Indicator */
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    color: #555;
    font-size: 0.8rem;
}