* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Noto Sans", sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

#app {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
}

#loading {
    text-align: center;
    padding: 50px;
    font-size: 18px;
}

#loading p {
    margin-top: 20px;
    color: #888;
}

header {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    gap: 0 10px;
    justify-content: space-between;
    align-items: center;
}

#age-cycle {
    font-size: 14px;
    color: #4a9eff;
    text-align: left;
}

#cycle-num {
    margin-bottom: 10px;
}

.author {
    text-align: center;
    color: #2d5a8d;
    margin: 20px 0;
    cursor: pointer;
}

#timer {
    font-size: 20px;
    font-weight: bold;
    color: #ff6b6b;
    background: #2a2a2a;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
}

main {
    margin-bottom: 30px;
}

section {
    background: #2a2a2a;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

section h2 {
    color: #4a9eff;
    margin-bottom: 15px;
    font-size: 18px;
}

#options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.option-btn {
    background: #3a3a3a;
    border: 2px solid #4a4a4a;
    color: #ffffff;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    font-size: 14px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-btn:hover {
    background: #4a4a4a;
    border-color: #4a9eff;
}

.option-btn.selected {
    background: #2d5a8d;
    border-color: #2d5a8d;
    color: #ffffff;
}

.option-btn.popular .vote-count {
    background: #ffd700;
    color: #000000;
}

.option-text {
    flex: 1;
}

.vote-count {
    color: #888;
    font-size: 14px;
    background: #2a2a2a;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    margin-left: 10px;
}

.timer.warning {
    color: #ff9500;
    animation: pulse 1s infinite;
}

.timer.expired {
    color: #ff4444;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4444;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    z-index: 1000;
    width: 90%;
    display: none;
}

.option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a9eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

footer {
    text-align: center;
    color: #888;
    font-size: 14px;
}

.history-btn {
    background: #4a9eff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s ease-in-out;
    width: 100%;
    margin-top: 20px;
}

.history-btn:hover {
    background: #3a8eef;
}

.next-cycle-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    margin-left: 10px;
    transition: background 0.15s ease-in-out;
}

.next-cycle-btn:hover {
    background: #ff5555;
}

/* Модалка */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #2a2a2a;
    max-width: 600px;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #4a4a4a;
}

.modal-header h2 {
    color: #4a9eff;
    margin: 0;
    font-size: 16px;
}

.close {
    color: #888;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.history-entry {
    border-radius: 10px;
    margin-bottom: 15px;
}

.history-entry h3 {
    color: #9d9d9d;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.history-entry p {
    margin: 5px 0;
    line-height: 1.5;
}

.history-entry .fact {
    color: #ccc;
    font-style: italic;
}

.load-more-container {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
}

.load-more-btn {
    background: #4a9eff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s ease-in-out;
}

.load-more-btn:hover {
    background: #3a8eef;
}

.modal-open {
    overflow: hidden;
}

.separator.info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0 10px;
}

.separator.info img {
    width: 70px;
    border-radius: 50%;
    border: 4px solid #2a2a2a;
}

@media (max-width: 480px) {
    #timer {
        font-size: 18px;
        padding: 8px 16px;
    }

    section {
        padding: 15px;
    }
}

/* Стил
и для системы подтверждения выборов */
.option-btn.pending {
    background: #ff9500;
    border-color: #ff9500;
    color: #ffffff;
    animation: pulse-pending 1.5s infinite;
}

.option-btn.confirmed {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #ffffff;
}

.option-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.option-btn.disabled:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

@keyframes pulse-pending {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.user-status {
    margin: 10px 0;
}

.status-confirmed {
    color: #4CAF50;
    font-weight: bold;
    margin: 0;
}

.status-pending {
    color: #ff9500;
    font-weight: bold;
    margin: 0 0 10px 0;
}

.status-info {
    color: #888;
    margin: 0;
}

.confirm-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    transition: all 0.15s ease-in-out;
    animation: pulse-confirm 2s infinite;
}

.confirm-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

@keyframes pulse-confirm {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.success-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    z-index: 1000;
    width: 90%;
    display: none;
    text-align: center;
}

.error-message,
.success-message {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.3s ease-out;
}

.error-message.show,
.success-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Анимации для модального окна */
.modal {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.modal.show {
    opacity: 1;
}

.modal.show .modal-content {
    animation: slideInFromBottom 0.3s ease-out;
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Стили для покупки выборов */
.buy-choices {
    margin-top: 15px;
    padding: 15px;
    background: #ff4444;
    border-radius: 10px;
    text-align: center;
}

.low-choices-warning {
    color: #ffffff;
    font-weight: bold;
    margin: 0 0 15px 0;
    font-size: 14px;
}

.buy-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.buy-btn {
    background: #4caf50;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin: 10px 0;
    font-size: 14px;
    transition: all 0.15s ease-in-out;
}

/* Улучшенные анимации для кнопок */
.option-btn {
    transition: all 0.2s ease-out;
}

.option-btn:active {
    transform: scale(0.95);
}

.confirm-btn:active {
    transform: scale(0.95);
}

.history-btn:active {
    transform: scale(0.95);
}

/* Анимация загрузки для истории */
.history-entry {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Улучшенная анимация для pending кнопок */
@keyframes pulse-pending {
    0% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.7);
    }

    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 10px rgba(255, 149, 0, 0);
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 149, 0, 0);
    }
}

/* Анимация для подтвержденных кнопок */
.option-btn.confirmed {
    animation: confirmPulse 0.5s ease-out;
}

@keyframes confirmPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Стили для модалки покупки выборов */
.buy-info {
    text-align: center;
    margin-bottom: 25px;
}

.buy-info p {
    margin-bottom: 10px;
    color: #ccc;
}

.buy-info strong {
    color: #4a9eff;
    font-size: 18px;
}

.buy-description {
    color: #888;
    font-size: 14px;
}

.buy-packages {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.package-card {
    background: #3a3a3a;
    border: 2px solid #4a4a4a;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.package-card:hover {
    background: #4a4a4a;
    border-color: #4a9eff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 158, 255, 0.2);
}

.package-card.popular {
    border-color: #ffd700;
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a2a 100%);
}

.package-card.popular:hover {
    border-color: #ffd700;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.package-card.best {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #3a3a3a 0%, #4a2a2a 100%);
}

.package-card.best:hover {
    border-color: #ff6b6b;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.package-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff6b6b;
    color: white;
    padding: 5px 10px;
    border-radius: 0 13px 0 10px;
    font-size: 12px;
    font-weight: bold;
}

.package-card.popular .package-badge {
    background: #ffd700;
    color: #000;
}

.package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.package-amount {
    font-size: 18px;
    font-weight: bold;
    color: #4a9eff;
}

.package-price {
    font-size: 16px;
    font-weight: bold;
    color: #ffd700;
}

.package-description {
    color: #888;
    font-size: 14px;
    text-align: center;
}

.package-card:active {
    transform: translateY(0) scale(0.98);
}

/* Стили для мобильных устройств */
@media (max-width: 480px) {
    .buy-buttons {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .modal-content {
        height: 100vh;
        width: 100%;
        border-radius: 0;
    }

    .package-card {
        padding: 15px;
    }

    .package-amount {
        font-size: 16px;
    }

    .package-price {
        font-size: 14px;
    }
}