/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Bitcount Single', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.4;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 800px;
    height: 600px;
    position: relative;
}

.content {
    background: white;
    width: 100%;
    height: 100%;
    position: relative;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* Goat illustration */
.goat-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    pointer-events: none;
}

.goat-image {
    width: 80%;
    height: 80%;
    object-fit: contain;
    animation: fadeIn 1s ease-in-out;
    pointer-events: auto;
}

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

/* Message styling */
.message {
    position: absolute;
    bottom: 8rem;
    left: 2rem;
    right: 2rem;
    text-align: left;
    z-index: 2;
    opacity: 0 !important;
    transition: opacity 0.5s ease;
}

.message.visible {
    opacity: 1 !important;
}

/* Typewriter cursor effect */
.message.visible h1 .line2::after {
    content: '|';
    animation: blink-cursor 0.8s infinite;
    color: #333;
    font-weight: bold;
}

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

.message h1 {
    font-size: 1.6rem;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    max-width: 900px;
    cursor: pointer;
    display: inline-block;
    word-wrap: normal;
    word-break: normal;
    hyphens: none;
    white-space: normal;
    overflow-wrap: normal;
    width: 100%;
    min-width: 800px;
    white-space: pre-line;
}


.message.visible h1 span:nth-child(1) { animation-delay: 0.0s; }
.message.visible h1 span:nth-child(2) { animation-delay: 0.005s; }
.message.visible h1 span:nth-child(3) { animation-delay: 0.01s; }
.message.visible h1 span:nth-child(4) { animation-delay: 0.015s; }
.message.visible h1 span:nth-child(5) { animation-delay: 0.02s; }
.message.visible h1 span:nth-child(6) { animation-delay: 0.025s; }
.message.visible h1 span:nth-child(7) { animation-delay: 0.03s; }
.message.visible h1 span:nth-child(8) { animation-delay: 0.035s; }
.message.visible h1 span:nth-child(9) { animation-delay: 0.04s; }
.message.visible h1 span:nth-child(10) { animation-delay: 0.045s; }
.message.visible h1 span:nth-child(11) { animation-delay: 0.05s; }
.message.visible h1 span:nth-child(12) { animation-delay: 0.055s; }
.message.visible h1 span:nth-child(13) { animation-delay: 0.06s; }
.message.visible h1 span:nth-child(14) { animation-delay: 0.065s; }
.message.visible h1 span:nth-child(15) { animation-delay: 0.07s; }
.message.visible h1 span:nth-child(16) { animation-delay: 0.075s; }
.message.visible h1 span:nth-child(17) { animation-delay: 0.08s; }
.message.visible h1 span:nth-child(18) { animation-delay: 0.085s; }
.message.visible h1 span:nth-child(19) { animation-delay: 0.09s; }
.message.visible h1 span:nth-child(20) { animation-delay: 0.095s; }
.message.visible h1 span:nth-child(21) { animation-delay: 0.1s; }
.message.visible h1 span:nth-child(22) { animation-delay: 0.105s; }
.message.visible h1 span:nth-child(23) { animation-delay: 0.11s; }
.message.visible h1 span:nth-child(24) { animation-delay: 0.115s; }
.message.visible h1 span:nth-child(25) { animation-delay: 0.12s; }
.message.visible h1 span:nth-child(26) { animation-delay: 0.125s; }
.message.visible h1 span:nth-child(27) { animation-delay: 0.13s; }
.message.visible h1 span:nth-child(28) { animation-delay: 0.135s; }
.message.visible h1 span:nth-child(29) { animation-delay: 0.14s; }
.message.visible h1 span:nth-child(30) { animation-delay: 0.145s; }
.message.visible h1 span:nth-child(31) { animation-delay: 0.15s; }
.message.visible h1 span:nth-child(32) { animation-delay: 0.155s; }
.message.visible h1 span:nth-child(33) { animation-delay: 0.16s; }
.message.visible h1 span:nth-child(34) { animation-delay: 0.165s; }
.message.visible h1 span:nth-child(35) { animation-delay: 0.17s; }
.message.visible h1 span:nth-child(36) { animation-delay: 0.175s; }
.message.visible h1 span:nth-child(37) { animation-delay: 0.18s; }
.message.visible h1 span:nth-child(38) { animation-delay: 0.185s; }
.message.visible h1 span:nth-child(39) { animation-delay: 0.19s; }
.message.visible h1 span:nth-child(40) { animation-delay: 0.195s; }
.message.visible h1 span:nth-child(41) { animation-delay: 0.2s; }
.message.visible h1 span:nth-child(42) { animation-delay: 0.205s; }
.message.visible h1 span:nth-child(43) { animation-delay: 0.21s; }
.message.visible h1 span:nth-child(44) { animation-delay: 0.215s; }
.message.visible h1 span:nth-child(45) { animation-delay: 0.22s; }
.message.visible h1 span:nth-child(46) { animation-delay: 0.225s; }
.message.visible h1 span:nth-child(47) { animation-delay: 0.23s; }
.message.visible h1 span:nth-child(48) { animation-delay: 0.235s; }
.message.visible h1 span:nth-child(49) { animation-delay: 0.24s; }
.message.visible h1 span:nth-child(50) { animation-delay: 0.245s; }


@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scapegoat button */
.scapegoat-button-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.scapegoat-btn {
    background: none;
    color: #333;
    border: none;
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.scapegoat-btn:hover {
    color: #666;
    text-decoration-thickness: 2px;
}

.scapegoat-btn:active {
    color: #999;
}

/* Responsive design */
@media (max-width: 1024px) {
    .message h1 {
        font-size: 1.5rem;
        max-width: 850px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .container {
        height: 500px;
    }
    
    .content {
        padding: 1.5rem;
    }
    
    .goat-container {
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
    }
    
    .goat-image {
        width: 70%;
        height: 70%;
    }
    
    .message {
        bottom: 6rem;
        left: 1.5rem;
        right: 1.5rem;
    }
    
    .message h1 {
        font-size: 1.4rem;
        max-width: 95%;
        line-height: 1.4;
    }
    
    .scapegoat-button-container {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        height: 400px;
    }
    
    .goat-container {
        width: 100%;
        height: 100%;
    }
    
    .goat-image {
        width: 60%;
        height: 60%;
    }
    
    .message {
        bottom: 5rem;
        left: 1rem;
        right: 1rem;
    }
    
    .message h1 {
        font-size: 1.2rem;
        max-width: 95%;
        line-height: 1.5;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .goat-image,
    .message,
    .scapegoat-button-container {
        animation: none;
    }
}

/* Focus states for accessibility */
button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}