﻿.story-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
    gap: 1rem;
    font-family: "Courier New", Courier, monospace;
}

.writer-block-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.prompt-box {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.prompt-label {
    color: var(--text-muted);
    font-weight: bold;
}

.prompt-text {
    color: var(--accent);
    font-style: italic;
}

.btn-action {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

    .btn-action:hover {
        background: var(--bg-surface-hover);
        border-color: var(--text-muted);
    }

.paper-container {
    flex-grow: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    overflow-y: auto;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    position: relative;
}

.story-content {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-main);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.story-word {
    display: inline-block;
    margin-right: 0.4em;
    position: relative;
    transition: color 0.3s ease;
}

    .story-word:hover::after {
        content: attr(data-author);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: var(--bg-base);
        color: var(--accent);
        font-size: 0.7rem;
        padding: 2px 6px;
        border-radius: 4px;
        border: 1px solid var(--border-color);
        white-space: nowrap;
        z-index: 10;
    }

/* Typewriter Animation for Incoming Words */
.typewriter-reveal {
    animation: typeWord 0.3s steps(10, end) forwards;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
}

@keyframes typeWord {
    0% {
        width: 0;
        opacity: 1;
    }

    100% {
        width: 100%;
        opacity: 1;
    }
}

.typing-indicator {
    display: inline-block;
    width: 10px;
    height: 1.2rem;
    background: var(--accent);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 5px;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.input-area {
    background: var(--bg-surface);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.word-input {
    flex-grow: 1;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1.1rem;
    outline: none;
}

    .word-input:focus {
        border-color: var(--accent);
    }

.input-controls button {
    padding: 0 1.5rem;
    font-family: inherit;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-base);
    color: var(--text-muted);
    border: 1px solid var(--border-color) !important;
}

.input-controls button:hover {
    opacity: 0.8;
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
}

.fanfare-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Fanfare Level 1 & 2 Animations on the container */
@keyframes sentenceFlash {
    0% {
        box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    }

    50% {
        box-shadow: inset 0 0 40px var(--accent);
    }

    100% {
        box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    }
}

@keyframes paragraphFlash {
    0% {
        transform: scale(1);
        border-color: var(--border-color);
    }

    10% {
        transform: scale(1.01);
        border-color: var(--accent);
    }

    100% {
        transform: scale(1);
        border-color: var(--border-color);
    }
}

.fanfare-lvl-1 {
    animation: sentenceFlash 1s ease;
}

.fanfare-lvl-2 {
    animation: paragraphFlash 1s ease;
}
