@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
    overflow-x: hidden;
    background: #1a0033;
}

body.bg-starfield {
    background: linear-gradient(135deg, #1a0033 0%, #0d001a 50%, #1a0033 100%);
}

body.bg-rainbow {
    background: linear-gradient(45deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 400%;
    animation: rainbowShift 10s ease infinite;
}

body.bg-pattern {
    background-color: #1a0033;
    background-image: 
        linear-gradient(45deg, #2a0044 25%, transparent 25%),
        linear-gradient(-45deg, #2a0044 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a0044 75%),
        linear-gradient(-45deg, transparent 75%, #2a0044 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    animation: patternScroll 20s linear infinite;
}

body.rainbow-mode * {
    animation: rainbowText 0.5s linear infinite !important;
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes patternScroll {
    0% { background-position: 0 0, 0 20px, 20px -20px, -20px 0px; }
    100% { background-position: 40px 40px, 40px 60px, 60px 20px, 20px 40px; }
}

@keyframes rainbowText {
    0% { color: #ff0000; }
    16% { color: #ff7f00; }
    33% { color: #ffff00; }
    50% { color: #00ff00; }
    66% { color: #0000ff; }
    83% { color: #9400d3; }
    100% { color: #ff0000; }
}

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

.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.cd-button {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border: none;
    background: linear-gradient(135deg, #c0c0c0, #808080);
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    z-index: 100;
    animation: spin 3s linear infinite;
    box-shadow: 
        inset 2px 2px 4px rgba(255,255,255,0.5),
        inset -2px -2px 4px rgba(0,0,0,0.3),
        3px 3px 8px rgba(0,0,0,0.5);
}

.sound-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: 3px outset #c0c0c0;
    background: linear-gradient(180deg, #e0e0e0, #a0a0a0);
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
}

.sound-toggle:active {
    border-style: inset;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 80px;
    position: relative;
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px;
        padding-top: 80px;
    }
}

.page-header {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
}

.under-construction {
    background: repeating-linear-gradient(
        45deg,
        #000,
        #000 10px,
        #ffcc00 10px,
        #ffcc00 20px
    );
    color: #fff;
    padding: 10px 30px;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
    display: inline-block;
    margin-bottom: 20px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.main-title {
    font-size: clamp(1.2rem, 4vw, 3rem);
    font-weight: bold;
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowMove 3s linear infinite, bounce 1s ease-in-out infinite;
    cursor: pointer;
    text-shadow: none;
    margin: 20px 0;
    line-height: 1.3;
    word-wrap: break-word;
}

@keyframes rainbowMove {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.blink-new {
    color: #ff0000;
    font-size: 1.2rem;
    font-weight: bold;
    animation: blink 0.5s step-end infinite;
    text-shadow: 0 0 10px #ff0000;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.star-divider {
    color: #ffd700;
    font-size: 1rem;
    margin: 15px 0;
    text-shadow: 0 0 10px #ffd700;
    word-wrap: break-word;
}

@media (max-width: 480px) {
    .star-divider {
        font-size: 0.8rem;
    }
}

.marquee-container {
    overflow: hidden;
    background: linear-gradient(90deg, #ff00ff, #00ffff);
    padding: 10px;
    border: 3px ridge #c0c0c0;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 15s linear infinite;
    color: #fff;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.visitor-counter {
    margin: 20px auto;
    padding: 15px;
    background: linear-gradient(180deg, #000033, #000066);
    border: 4px ridge #c0c0c0;
    display: inline-block;
    border-radius: 10px;
}

.counter-label {
    color: #00ffff;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #00ffff;
}

.counter-digits {
    display: flex;
    gap: 3px;
    justify-content: center;
    flex-wrap: wrap;
}

.digit {
    background: linear-gradient(180deg, #001100, #003300);
    color: #00ff00;
    padding: 6px 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    border: 2px inset #004400;
    text-shadow: 0 0 10px #00ff00;
}

@media (max-width: 480px) {
    .digit {
        padding: 4px 6px;
        font-size: 1rem;
    }
}

.content-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.main-area {
    flex: 1;
    min-width: 280px;
}

.sidebar-area {
    width: 200px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .sidebar-area {
        display: none;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
}

.guestbook-form {
    background: linear-gradient(135deg, #ff1493, #ff69b4);
    border: 6px outset #c0c0c0;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 
        inset 3px 3px 6px rgba(255,255,255,0.3),
        5px 5px 15px rgba(0,0,0,0.5);
}

@media (max-width: 480px) {
    .guestbook-form {
        padding: 15px;
        border-width: 4px;
    }
}

.form-title {
    color: #fff;
    text-align: center;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 20px;
}

.form-field {
    margin-bottom: 15px;
}

.form-field label {
    display: block;
    color: #fff;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 1px 1px 0 #000;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 10px;
    font-family: 'Comic Neue', cursive;
    font-size: 1rem;
    border: 3px inset #000;
    background: #ffff00;
    color: #000;
}

.form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.emoji-picker {
    margin-bottom: 15px;
}

.emoji-picker label {
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
}

.emoji-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.emoji-btn {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
    border: 2px outset #c0c0c0;
    background: linear-gradient(180deg, #fff, #ccc);
    cursor: pointer;
    transition: transform 0.1s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    transform: scale(1.2);
}

.emoji-btn:active {
    border-style: inset;
}

@media (max-width: 480px) {
    .emoji-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
}

.color-picker label {
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
    display: block;
    margin-bottom: 10px;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.color-option {
    padding: 6px 10px;
    border: 3px outset #c0c0c0;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Comic Neue', cursive;
    transition: transform 0.1s;
    min-width: 100px;
    text-align: center;
}

.color-option:hover {
    transform: scale(1.05);
}

.color-option.selected {
    border-style: inset;
    box-shadow: 0 0 10px #fff;
}

@media (max-width: 480px) {
    .color-option {
        font-size: 0.7rem;
        padding: 5px 8px;
        min-width: 80px;
    }
}

.color-preview {
    padding: 15px;
    border: 3px double #000;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.form-error {
    background: #ff0000;
    color: #fff;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    margin: 10px 0;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.submit-btn {
    width: 100%;
    padding: 15px 20px;
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-family: 'Comic Neue', cursive;
    font-weight: bold;
    color: #000;
    background: linear-gradient(180deg, #fff, #c0c0c0, #808080);
    border: 4px outset #c0c0c0;
    cursor: pointer;
    text-shadow: 1px 1px 0 #fff;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.5);
    transition: all 0.1s;
}

.submit-btn:hover {
    background: linear-gradient(180deg, #fffacd, #ffd700, #daa520);
}

.submit-btn:active {
    border-style: inset;
    transform: translate(2px, 2px);
}

.messages-section {
    background: rgba(0, 0, 0, 0.5);
    border: 4px ridge #6a0dad;
    padding: 20px;
}

@media (max-width: 480px) {
    .messages-section {
        padding: 15px;
    }
}

.section-title {
    color: #00ffff;
    text-align: center;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    text-shadow: 0 0 10px #00ffff, 3px 3px 0 #000;
    margin-bottom: 20px;
}

.messages-feed {
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
}

.messages-feed::-webkit-scrollbar {
    width: 15px;
}

.messages-feed::-webkit-scrollbar-track {
    background: #1a0033;
    border: 2px inset #c0c0c0;
}

.messages-feed::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff69b4, #ff1493);
    border: 2px outset #c0c0c0;
}

.empty-state {
    text-align: center;
    color: #ffff00;
    font-size: 1.1rem;
    padding: 40px 20px;
    text-shadow: 0 0 10px #ffff00;
}

.empty-icon {
    font-size: 3rem;
    animation: bounce 1s ease-in-out infinite;
}

.arrow-up {
    font-size: 1.5rem;
    animation: bounceUp 0.5s ease-in-out infinite;
    margin-top: 20px;
}

@keyframes bounceUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.message-card {
    position: relative;
    padding: 20px;
    border-width: 4px;
    border-color: #000;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.5);
    animation: fadeIn 0.5s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-deco {
    position: absolute;
    font-size: 1rem;
    animation: sparkle 1s ease-in-out infinite;
}

.message-deco.top-left { top: 5px; left: 5px; }
.message-deco.top-right { top: 5px; right: 5px; }
.message-deco.bottom-left { bottom: 5px; left: 5px; }
.message-deco.bottom-right { bottom: 5px; right: 5px; }

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.message-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.message-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.message-date {
    font-size: 0.8rem;
    opacity: 0.8;
}

.message-divider {
    opacity: 0.5;
    overflow: hidden;
    white-space: nowrap;
    margin: 5px 0;
    font-size: 0.8rem;
}

.message-text {
    font-size: 1rem;
    line-height: 1.5;
    padding: 10px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-footer {
    text-align: center;
    opacity: 0.6;
    margin-top: 10px;
    font-size: 0.8rem;
}

.delete-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    background: #ff0000;
    color: #fff;
    border: 3px outset #c0c0c0;
    font-family: 'Comic Neue', cursive;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-section {
    background: linear-gradient(180deg, #000066, #000033);
    border: 3px ridge #c0c0c0;
    padding: 15px;
}

.sidebar-section .section-title {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.fake-link {
    color: #00ff00;
    cursor: pointer;
    padding: 5px 0;
    text-decoration: underline;
    font-size: 0.85rem;
}

.fake-link:hover {
    color: #ffff00;
}

.webring-badge {
    background: linear-gradient(180deg, #800080, #4b0082);
    color: #fff;
    text-align: center;
    padding: 10px;
    border: 3px outset #c0c0c0;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

.badge {
    background: linear-gradient(180deg, #c0c0c0, #808080);
    border: 3px outset #fff;
    padding: 10px;
    text-align: center;
}

.badge-text {
    font-size: 0.75rem;
    color: #000;
    font-weight: bold;
}

.dancing-character {
    font-size: 2.5rem;
    text-align: center;
    animation: dance 0.5s ease-in-out infinite alternate;
}

@keyframes dance {
    0% { transform: translateX(-5px) rotate(-10deg); }
    100% { transform: translateX(5px) rotate(10deg); }
}

.email-badge {
    background: linear-gradient(180deg, #0000ff, #000080);
    color: #fff;
    text-align: center;
    padding: 10px;
    border: 3px outset #c0c0c0;
    cursor: pointer;
    animation: pulse 1s ease-in-out infinite;
    font-size: 0.85rem;
}

.spinning-star {
    position: fixed;
    font-size: 1.5rem;
    color: #ffd700;
    animation: spin 2s linear infinite;
    text-shadow: 0 0 20px #ffd700;
    z-index: 50;
    pointer-events: none;
}

.top-left-deco { top: 100px; left: 50px; }
.top-right-deco { top: 100px; right: 50px; }

.spinning-at {
    position: fixed;
    bottom: 150px;
    right: 30px;
    font-size: 1.5rem;
    color: #00ffff;
    animation: spin 3s linear infinite reverse;
    text-shadow: 0 0 15px #00ffff;
    z-index: 50;
    pointer-events: none;
}

@media (max-width: 768px) {
    .spinning-star, .spinning-at {
        display: none;
    }
}

.page-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    background: linear-gradient(180deg, #1a0033, #000);
    border-top: 5px ridge #ff69b4;
}

.sparkle-divider {
    height: 5px;
    background: linear-gradient(90deg, 
        transparent, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, transparent);
    margin-bottom: 20px;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.footer-text {
    color: #ff69b4;
    font-size: 1rem;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #ff69b4;
}

.footer-copyright {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.remix-btn, .export-btn {
    padding: 10px 20px;
    font-family: 'Comic Neue', cursive;
    font-weight: bold;
    border: 3px outset #c0c0c0;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

.remix-btn {
    background: linear-gradient(180deg, #ff6b6b, #ee5a5a);
    color: #fff;
}

.export-btn {
    background: linear-gradient(180deg, #c0c0c0, #808080);
    color: #000;
}

.remix-btn:hover, .export-btn:hover {
    transform: scale(1.05);
}

.remix-btn:active, .export-btn:active {
    border-style: inset;
}

.footer-joke {
    color: #666;
    font-size: 0.75rem;
    margin-bottom: 15px;
}

.footer-icons {
    font-size: 1.3rem;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.footer-marquee {
    background: #000;
    border: 2px inset #333;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -20px;
    pointer-events: none;
    z-index: 9999;
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}