* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Segoe UI', sans-serif; 
    background: #1e1e1e; 
    color: #e0e0e0; 
    line-height: 1.6;
    scroll-behavior: smooth;
}
.flipping-star {
    display: inline-block;
    animation: 
        slow3dSpin 5s linear infinite,
        jumpPulse 10s ease-in-out infinite;
    transform-style: preserve-3d;
    color: #FFC107;
    text-shadow: 
        0 0 0px transparent,
        0 1px 1px rgba(0,0,0,0.3);
    font-weight: normal;
    position: relative;
    animation-delay: 0s, 5s;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.flipping-star::before {
    content: "⭐";
    position: absolute;
    top: 0;
    left: 0;
    color: rgba(255,193,7,0.8);
    z-index: -1;
    transform: translateZ(-2px) scale(0.95);
}

@keyframes slow3dSpin {
    0% { transform: rotateY(0deg) scale(1); }
    100% { transform: rotateY(360deg) scale(1); }
}

@keyframes jumpPulse {
    0%, 10%, 100% { 
        transform: translateY(0) rotateY(0deg) scale(1);
        animation-timing-function: ease-out;
    }
    5% { 
        transform: translateY(-15px) rotateY(1080deg) scale(1.15);
        animation-timing-function: ease-in;
        filter: drop-shadow(0 3px 5px rgba(0,0,0,0.3));
    }
    7.5% { 
        transform: translateY(-5px) rotateY(1440deg) scale(1.05);
        animation-timing-function: ease-out;
    }
    50%, 90% { 
        transform: translateY(0) rotateY(360deg) scale(1);
    }
}
.container {
    max-width: 800px;
    margin: 30px auto;
    padding: 15px;
}
.header {
    text-align: center;
    margin-bottom: 20px;
}
.header h1 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 24px;
}
.header p {
    font-size: 14px;
    color: #ccc;
}
.subscription-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.subscription-plans.four-plans {
    grid-template-columns: repeat(4, 1fr);
}
.subscription-plans.three-plans {
    grid-template-columns: repeat(3, 1fr);
}
.subscription-plans.two-plans {
    grid-template-columns: repeat(2, 1fr);
}
.subscription-plans.one-plan {
    grid-template-columns: 1fr;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.plan-card {
    background: #2a2a2a;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #3a3a3a;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.plan-card:hover {
    border-color: #7ab4de;
    transform: translateY(-2px);
}
.plan-card.selected {
    border-color: #7ab4de;
    background: #6fb0de48;
}
.plan-card.blocked {
    opacity: 0.6;
    cursor: not-allowed;
    background: #3a2a2a;
    border-color: #5a3a3a;
    position: relative;
}
.plan-card.blocked:hover {
    transform: none;
    border-color: #5a3a3a;
    background: #3a2a2a;
}
.plan-card.blocked::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255, 107, 107, 0.1) 50%, transparent 51%);
    background-size: 10px 10px;
    z-index: 1;
}
.plan-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #fff;
}
.plan-price {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    margin: 10px 0;
}
.plan-duration {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 10px;
}
.plan-features {
    list-style: none;
    text-align: left;
    margin: 10px 0;
    font-size: 11px;
}
.plan-features li {
    padding: 3px 0;
    border-bottom: 1px solid #3a3a3a;
}
.plan-features li:before {
    content: "✓";
    color: #fff;
    margin-right: 6px;
    font-size: 10px;
}
.plan-status-message {
    color: #ff6b6b;
    font-size: 12px;
    font-weight: bold;
    margin-top: 10px;
    text-align: center;
    position: relative;
    z-index: 2;
}
.plan-card.blocked .plan-name,
.plan-card.blocked .plan-price,
.plan-card.blocked .plan-duration,
.plan-card.blocked .plan-features {
    opacity: 0.7;
    position: relative;
    z-index: 2;
}
.subscription-card {
    background: #2a2a2a;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #3a3a3a;
    margin-bottom: 15px;
    position: relative;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #ccc;
    font-size: 14px;
}
.form-group input {
    width: 100%;
    padding: 10px;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
}
.form-group input:focus {
    outline: none;
    border-color: #51b58c;
}
.btn {
    width: 100%;
    padding: 12px;
    background: #51b58c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}
.btn:hover {
    background: #429c77;
}
.btn:disabled {
    background: #666;
    cursor: not-allowed;
}
.btn-extend {
    background: #ffc107 !important;
    color: #333 !important;
    font-weight: bold;
}
.btn-extend:hover {
    background: #e0a800 !important;
}
.btn-test {
    background: #51b58c !important;
    color: white !important;
}
.btn-test:hover {
    background: #429c77 !important;
}
.btn-pay {
    background: #51b58c !important;
    color: white !important;
}
.btn-pay:hover {
    background: #429c77 !important;
}
.message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}
.message.error {
    background: #5a2a2a;
    color: #ff9999;
    border: 1px solid #7a3a3a;
}
.message.warning {
    background: #5a4a2a;
    color: #ffd699;
    border: 1px solid #7a6a3a;
}
.message.success {
    background: #2a5a4a;
    color: #99ffcc;
    border: 1px solid #3a7a6a;
}
.message.info {
    background: #5a4a2a;
    color: #ffd699;
    border: 1px solid #7a6a3a;
}
.message.not-found {
    background: #5a2a2a;
    color: #ff9999;
    border: 1px solid #7a3a3a;
}
.message-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}
.message-btn {
    padding: 6px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s;
    min-width: 60px;
}
.message-btn-yes {
    background: #51b58c;
    color: white;
}
.message-btn-yes:hover {
    background: #429c77;
}
.message-btn-no {
    background: #d96262;
    color: white;
}
.message-btn-no:hover {
    background: #c85252;
}
.instructions {
    background: #2a2a3a;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 13px;
}
.instructions h3 {
    color: #9497ff;
    margin-bottom: 8px;
    font-size: 14px;
}
.instructions ol {
    margin-left: 15px;
}
.instructions li {
    margin-bottom: 6px;
    font-size: 13px;
}
.back-link {
    text-align: center;
    margin-top: 15px;
}
.back-link a {
    color: #51b58c;
    text-decoration: none;
    font-size: 14px;
}
.back-link a:hover {
    text-decoration: underline;
}
.auto-filled-notice {
    background: #2a5a4a;
    color: #99ffcc;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 12px;
    text-align: center;
    border: 1px solid #3a7a6a;
    font-size: 12px;
}
.uid-help {
    background: #5a4a2a;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: left;
    border: 1px solid #7a6a3a;
    font-size: 13px;
}
.uid-help h4 {
    color: #ffd699;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}
.uid-help ol {
    margin-left: 15px;
}
.uid-help li {
    margin-bottom: 6px;
    font-size: 13px;
}
.notification-icon {
    font-size: 16px;
}
.clickable-link {
    color: #ff9999;
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
}
.clickable-link:hover {
    color: #ff7777;
}
.scroll-to-top {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 50px;
    height: 50px;
    background: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s;
    z-index: 1000;
}
.scroll-to-top:hover {
    background: #4a4a4a;
    border-color: #666;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.hidden {
    display: none;
}
.plan-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}
.selected-plan-info {
    background: #6fb0de48;
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
    border: 1px solid #7ab4de;
    font-size: 14px;
    font-weight: bold;
}
.form-group small {
    color: #888;
    font-size: 11px;
    display: block;
    margin-top: 4px;
}
.no-plans-message {
    background: #5a2a2a;
    color: #ff9999;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #7a3a3a;
    margin: 20px 0;
}

/* Стили для красной полосы уведомления */
.payments-alert {
    position: fixed;
    top: -30px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(217, 98, 98, 0.85), rgba(194, 82, 82, 0.85));
    color: white;
    padding: 6px 0;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    z-index: 10000;
    transition: top 0.3s ease-in-out;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255, 153, 153, 0.5);
    backdrop-filter: blur(3px);
}

.payments-alert.visible {
    top: 0;
}

.alert-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 800px;
    margin: 0 auto;
}

.alert-icon {
    font-size: 14px;
}

.alert-text {
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* Стили для заблокированной кнопки */
.btn-payment-disabled {
    background: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.btn-payment-disabled:hover {
    background: #666 !important;
    transform: none !important;
}

@media (max-width: 768px) {
    .subscription-plans {
        grid-template-columns: 1fr !important;
    }
    .container {
        padding-top: 40px;
    }
    .scroll-to-top {
        top: 45px;
    }
}