/* style.css — с живым анимированным фоном + звёзды и облака */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    padding: 1.5rem;
    margin: 0;
    overflow: hidden;
    position: relative;
}

/* ===== АНИМИРОВАННЫЙ ФОН ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    transition: background 2s ease-in-out;
}

.bg-animation.morning {
    background: linear-gradient(135deg, #fdf6e3 0%, #f5e6ca 30%, #f0d5b0 60%, #e8c9a0 100%);
}

.bg-animation.day {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 30%, #60a5fa 60%, #3b82f6 100%);
}

.bg-animation.evening {
    background: linear-gradient(135deg, #fed7aa 0%, #fb923c 30%, #f97316 60%, #ea580c 100%);
}

.bg-animation.night {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 30%, #312e81 60%, #1e1b4b 100%);
}

/* ===== СВЕТЯЩИЕСЯ ШАРЫ ===== */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: floatOrb 20s ease-in-out infinite;
    pointer-events: none;
}

.glow-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 200, 100, 0.3), transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.glow-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(100, 150, 255, 0.25), transparent 70%);
    bottom: -20%;
    right: -10%;
    animation-delay: -7s;
}

.glow-orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(200, 100, 255, 0.2), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

/* ===== ЧАСТИЦЫ ===== */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: floatParticle linear infinite;
}

/* ===== ЗВЁЗДЫ (только ночью) ===== */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.stars.active {
    opacity: 1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite alternate;
}

/* ===== ОБЛАКА (только днём) ===== */
.clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.clouds.active {
    opacity: 1;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    filter: blur(20px);
    animation: floatCloud linear infinite;
}

.cloud-1 {
    width: 300px;
    height: 80px;
    top: 10%;
    left: -10%;
    animation-duration: 25s;
    animation-delay: 0s;
}

.cloud-2 {
    width: 400px;
    height: 100px;
    top: 30%;
    left: -20%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.cloud-3 {
    width: 250px;
    height: 70px;
    top: 50%;
    left: -15%;
    animation-duration: 22s;
    animation-delay: -10s;
}

.cloud-4 {
    width: 350px;
    height: 90px;
    top: 70%;
    left: -25%;
    animation-duration: 28s;
    animation-delay: -15s;
}

.cloud-5 {
    width: 200px;
    height: 60px;
    top: 85%;
    left: -10%;
    animation-duration: 20s;
    animation-delay: -8s;
}

/* ===== АНИМАЦИИ ===== */
@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(40px, 30px) scale(1.05); }
}

@keyframes floatParticle {
    0% { transform: translateY(100vh) rotate(0deg) scale(0); opacity: 0; }
    10% { opacity: 1; transform: translateY(90vh) rotate(36deg) scale(1); }
    90% { opacity: 1; transform: translateY(10vh) rotate(324deg) scale(1); }
    100% { transform: translateY(-10vh) rotate(360deg) scale(0); opacity: 0; }
}

@keyframes twinkle {
    0% { opacity: 0.2; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

@keyframes floatCloud {
    0% { transform: translateX(0) scale(1); }
    25% { transform: translateX(20vw) scale(1.05); }
    50% { transform: translateX(40vw) scale(0.95); }
    75% { transform: translateX(60vw) scale(1.02); }
    100% { transform: translateX(80vw) scale(1); }
}

/* ===== КАРТОЧКА ===== */
.container {
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}

.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 2rem 2.5rem 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.10), 0 10px 30px rgba(0, 0, 0, 0.06);
}

/* Режим "Сервер оффлайн" */
.card.offline {
    border-color: #ef4444;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
}

.card.offline .icon-wrapper {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.3);
}

/* ===== ДАТА И ВРЕМЯ ===== */
.datetime {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #4a5568;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    margin-bottom: 1.8rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    flex-wrap: wrap;
}

.datetime i {
    color: #4f8cff;
    font-size: 0.95rem;
    width: 1.2rem;
    text-align: center;
}

.datetime span {
    font-weight: 500;
    letter-spacing: 0.3px;
}

#dateDisplay { min-width: 80px; }
#timeDisplay { min-width: 70px; font-variant-numeric: tabular-nums; }

/* ===== ИКОНКА ===== */
.icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.2rem;
    background: linear-gradient(135deg, #4f8cff, #6c5ce7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(79, 140, 255, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.icon-wrapper i {
    font-size: 2.4rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.card:hover .icon-wrapper {
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 16px 40px rgba(79, 140, 255, 0.35);
}

/* ===== ТЕКСТ ===== */
h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.3rem;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1rem;
    color: #4a5568;
    margin-bottom: 2.5rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.subtitle i {
    color: #4f8cff;
    width: 1.2rem;
    text-align: center;
}

/* ===== КНОПКА ===== */
button {
    background: linear-gradient(135deg, #4f8cff, #6c5ce7);
    border: none;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 1rem 2.5rem;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 24px rgba(79, 140, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.3px;
}

button i {
    font-size: 1.1rem;
    width: 1.2rem;
    text-align: center;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(79, 140, 255, 0.4);
    background: linear-gradient(135deg, #5a97ff, #7b6ef0);
}

button:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 4px 16px rgba(79, 140, 255, 0.25);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: scale(0.98);
}

/* Кнопка в режиме "Сервер оффлайн" */
button.offline-mode {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
    cursor: not-allowed;
}

button.offline-mode:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: none;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

/* ===== АНИМАЦИИ ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes slideUp {
    0% { opacity: 0; transform: translateY(30px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 520px) {
    .card { padding: 1.5rem 1.5rem 2rem; border-radius: 24px; }
    .datetime { font-size: 0.85rem; padding: 0.5rem 1rem; gap: 4px; }
    #dateDisplay { min-width: 70px; }
    #timeDisplay { min-width: 60px; }
    h1 { font-size: 1.6rem; }
    .icon-wrapper { width: 64px; height: 64px; }
    .icon-wrapper i { font-size: 2rem; }
    button { font-size: 1rem; padding: 0.9rem 1.8rem; }
}

@media (max-width: 380px) {
    .card { padding: 1.2rem 1rem 1.5rem; }
    .datetime { font-size: 0.75rem; padding: 0.4rem 0.8rem; flex-wrap: wrap; gap: 2px; }
    h1 { font-size: 1.3rem; }
    .subtitle { font-size: 0.9rem; }
    .icon-wrapper { width: 56px; height: 56px; }
    .icon-wrapper i { font-size: 1.6rem; }
    button { font-size: 0.9rem; padding: 0.8rem 1.2rem; }
}