/* ==================================================
   ОБЩИЕ СТИЛИ ДЛЯ ВСЕГО САЙТА (единый дизайн)
   ================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Comic Sans MS", "Trebuchet MS", Arial, sans-serif;
    background-color: #000;
    color: #fff;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Анимированный фон */
.background-gifs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}
.gif-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: gifChange 20s infinite;
}
.gif-layer:nth-child(1) {
    background-image: url('https://i.pinimg.com/originals/2a/ec/b9/2aecb96150fb1375c9ad4cc8a6777178.gif');
    animation-delay: 0s;
}
.gif-layer:nth-child(2) {
    background-image: url('https://i.pinimg.com/originals/fe/5c/ad/fe5cad71ca077a3c23bece0dab5b557e.gif');
    animation-delay: 10s;
}
@keyframes gifChange {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0; }
    100% { opacity: 1; }
}
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

/* Контейнер */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #ff66cc;
    padding: 15px;
    box-shadow: 5px 5px 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    color: #333;
}

/* Шапка */
header {
    text-align: center;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    padding: 15px;
    margin-bottom: 15px;
    border: 5px double #000;
    position: relative;
    overflow: hidden;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
h1 {
    color: #fff;
    text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    font-size: 28px;
    margin: 0;
    font-weight: bold;
    letter-spacing: 2px;
}
.subtitle {
    color: #ffff00;
    font-style: italic;
    margin-top: 8px;
    font-size: 14px;
    text-shadow: 2px 2px 0 #000;
    background: rgba(0,0,0,0.5);
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    border: 2px dotted #ffff00;
}
.star {
    position: absolute;
    color: #ffff00;
    font-size: 18px;
    animation: twinkle 2s infinite;
}
.star:nth-child(1) { top: 5px; left: 20px; animation-delay: 0s; }
.star:nth-child(2) { top: 10px; right: 25px; animation-delay: 0.5s; }
.star:nth-child(3) { bottom: 5px; left: 30px; animation-delay: 1s; }
.star:nth-child(4) { bottom: 10px; right: 20px; animation-delay: 1.5s; }
@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.marquee {
    background-color: #ffff00;
    padding: 6px;
    margin-bottom: 15px;
    border: 3px dotted #ff00ff;
    color: #000;
    font-weight: bold;
    font-size: 14px;
}

/* Двухколоночный макет */
.main-layout {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ff66cc;
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
}
.sidebar-clock {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #ff3399;
    margin-bottom: 15px;
    background: #000;
    padding: 5px;
    border-radius: 8px;
    font-family: monospace;
}
.sidebar-counter {
    text-align: center;
    background: #ffffcc;
    padding: 8px;
    border: 2px solid #ffcc00;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #000;
}
.nav-box h3 {
    color: #ff3399;
    border-bottom: 2px dotted #ff66cc;
    margin-bottom: 10px;
    font-size: 16px;
    text-align: center;
}
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav li {
    margin-bottom: 10px;
}
.nav-btn-side {
    display: block;
    background: rgba(0,0,0,0.7);
    color: #ffff00;
    padding: 6px 10px;
    text-decoration: none;
    border: 2px solid #ffff00;
    border-radius: 15px;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    transition: all 0.3s ease;
}
.nav-btn-side:hover {
    background: #ffff00;
    color: #000;
    transform: scale(1.02);
}
.nav-btn-side.active {
    background: #ffff00;
    color: #000;
    box-shadow: 0 0 5px #ffff00;
}
.content {
    flex: 1;
}

/* Адаптивность для мобильных */
@media (max-width: 700px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar {
        width: auto;
        margin-bottom: 15px;
    }
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .sidebar-nav li {
        margin-bottom: 0;
        flex: 1;
    }
}

/* Стили для постов (index.php) */
.post {
    background-color: #e6f7ff;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #66ccff;
    border-radius: 10px;
}
.post-title {
    color: #ff3399;
    font-size: 20px;
    margin-bottom: 8px;
    border-bottom: 2px dashed #ff66cc;
    padding-bottom: 4px;
    text-shadow: 1px 1px 0 #fff;
}
.post-date {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    background: #fff;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid #ff66cc;
}
.post-content p {
    white-space: pre-wrap;
    line-height: 1.5;
    text-align: justify;
    text-indent: 1.5em;
    font-size: 14px;
}
.post-media {
    margin: 10px 0;
    text-align: center;
}
.post-media img {
    max-width: 60%;
    height: auto;
    border: 3px solid #ff66cc;
    margin: 5px;
    border-radius: 8px;
}
.image-container {
    margin: 8px 0;
    text-align: center;
}
.image-caption {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-top: 4px;
}

/* Стили для проектов (files.php) */
.project {
    background-color: #e6f7ff;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #66ccff;
    border-radius: 10px;
}
.project-title {
    color: #ff3399;
    font-size: 20px;
    margin-bottom: 8px;
    border-bottom: 2px dashed #ff66cc;
    padding-bottom: 4px;
}
.project-date {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    background: #fff;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid #ff66cc;
}
.project-content p {
    white-space: pre-wrap;
    line-height: 1.5;
    text-align: justify;
    text-indent: 1.5em;
}
.project-media {
    margin: 10px 0;
    text-align: center;
}
.project-media img {
    max-width: 60%;
    height: auto;
    border: 3px solid #ff66cc;
    margin: 5px;
    border-radius: 8px;
}
.project-tech {
    background-color: #ffffcc;
    padding: 8px 12px;
    margin-top: 10px;
    border: 2px solid #ffcc00;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    text-align: center;
}
.tech-badge {
    display: inline-block;
    background: #ffff00;
    color: #000;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    margin: 3px;
    font-weight: bold;
}

/* Стили для мемов (mem.php) */
.meme {
    background-color: #e6f7ff;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #66ccff;
    border-radius: 10px;
}
.meme-media {
    margin: 10px 0;
    text-align: center;
}
.meme-media img {
    max-width: 60%;
    height: auto;
    border: 3px solid #ff66cc;
    margin: 5px;
    border-radius: 8px;
}

/* Стили для гостевой книги (guestbook.php) */
.guestbook {
    background-color: #ffffcc;
    padding: 15px;
    margin-top: 15px;
    border: 3px solid #ffcc00;
    border-radius: 15px;
}
.comment-form {
    margin-top: 15px;
    padding: 10px;
    background-color: #e6ffe6;
    border: 2px dashed #66cc66;
    border-radius: 10px;
}
.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 2px inset #ccc;
    font-family: "Comic Sans MS", cursive;
    border-radius: 5px;
    font-size: 14px;
}
.comment-form button {
    padding: 8px 15px;
    background: #66cc66;
    color: white;
    border: 2px outset #66cc66;
    cursor: pointer;
    font-family: "Comic Sans MS", cursive;
    font-weight: bold;
    border-radius: 5px;
    font-size: 14px;
}
.comment-form button:hover {
    background: #55aa55;
}
.comment {
    background-color: #fff;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid #66ccff;
    border-left: 8px solid #ff66cc;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
}
.comment-author {
    font-weight: bold;
    color: #ff3399;
    margin-bottom: 5px;
    font-size: 16px;
}
.comment-date {
    font-size: 11px;
    color: #999;
    float: right;
}
.comment-text {
    margin-top: 5px;
    line-height: 1.5;
}
.admin-notice {
    background-color: #ffcccc;
    padding: 10px;
    margin: 10px 0;
    border: 2px dashed #ff0000;
    font-size: 12px;
    border-radius: 8px;
}

/* Подвал */
footer {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: linear-gradient(to right, #ff66cc, #66ccff);
    border: 2px dashed #000;
    font-size: 11px;
    border-radius: 8px;
}

/* Мигание */
.blink {
    animation: blink 1s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Музыкальный плеер */
.music-player {
    background-color: #ffccff;
    padding: 8px;
    margin: 12px 0;
    border: 3px dotted #ff66cc;
    text-align: center;
    border-radius: 10px;
}
.volume-control {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}
.music-info {
    font-size: 12px;
    margin-bottom: 4px;
    color: #ff3399;
    font-weight: bold;
}

/* Курсор */
body {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><text y="18" font-size="18">🌟</text></svg>'), auto;
}

/* Адаптивность под мобильные */
@media (max-width: 768px) {
    .container { padding: 10px; }
    h1 { font-size: 22px; }
    .subtitle { font-size: 12px; }
    .post-title, .project-title { font-size: 18px; }
    .post-content p, .project-content p { font-size: 13px; text-indent: 1em; }
    .post-media img, .project-media img, .meme-media img { width: 100%; max-width: 100%; }
}
@media (max-width: 480px) {
    h1 { font-size: 18px; }
    .post-title, .project-title { font-size: 16px; }
    .post-content p, .project-content p { font-size: 12px; }
}