@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0a0f;
    --surface: #13131a;
    --surface-hover: #1a1a24;
    --border: #1e1e2a;
    --text: #e4e4e7;
    --text-dim: #71717a;
    --accent: #a855f7;
    --accent-glow: rgba(168, 85, 247, 0.15);
    --radius: 12px;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 720px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 16px;
    flex-shrink: 0;
}

.logo {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.logo span {
    color: var(--accent);
}

#rotButton {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#rotButton:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

#rotButton:active {
    transform: scale(0.97);
}

#brainRotOutput {
    flex: 1;
    min-height: 0;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-y: hidden;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 20px;
    text-align: justify;
    hyphens: auto;
}

#brainRotOutput:empty::before {
    content: 'Hit the button to rot your brain...';
    color: var(--text-dim);
    font-style: italic;
}

#tempDiv {
    position: absolute;
    visibility: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 600px) {
    .container { padding: 0 14px; }
    header { padding: 14px 0 12px; }
    .logo { font-size: 16px; }
    #rotButton { font-size: 13px; padding: 8px 16px; }
    #brainRotOutput {
        padding: 16px;
        font-size: 14px;
        line-height: 1.65;
        border-radius: 10px;
        margin-bottom: 14px;
    }
}
