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

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

/* Main container */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #000;
}

/* Header/Controls */
.controls {
    background: #1a1a1a;
    padding: 12px;
    border-bottom: 1px solid #333;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 100;
}

.btn {
    padding: 8px 12px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

.btn:hover {
    background: #3a3a3a;
    border-color: #555;
}

.btn:active {
    background: #444;
}

.btn-primary {
    background: #0066cc;
    border-color: #0052a3;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-danger {
    background: #cc0000;
    border-color: #990000;
}

.btn-danger:hover {
    background: #990000;
}

/* Controls group */
.control-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-label {
    font-size: 12px;
    color: #bbb;
    white-space: nowrap;
}

input[type="range"] {
    width: 100px;
    cursor: pointer;
}

input[type="number"] {
    width: 60px;
    padding: 6px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}

.mode-indicator {
    margin-left: auto;
    font-size: 12px;
    color: #bbb;
    padding: 4px 8px;
    background: #2a2a2a;
    border-radius: 4px;
}

/* Main content area */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Editor mode - removed */
.editor-panel {
    display: none;
}

.editor-panel.hidden {
    display: none;
}

.editor-label {
    padding: 8px 12px;
    background: #000;
    font-size: 12px;
    color: #888;
    border-bottom: 1px solid #333;
}

#textInput {
    flex: 1;
    padding: 16px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    outline: none;
    line-height: 1.6;
}

/* Prompter display */
.prompter-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
    overflow: hidden;
}

.prompter-panel.hidden {
    display: none;
}

.prompter-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 40px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Custom scrollbar */
.prompter-scroll::-webkit-scrollbar {
    width: 8px;
}

.prompter-scroll::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.prompter-scroll::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.prompter-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.prompter-text {
    font-size: 48px;
    line-height: 1.6;
    /* max-width: 90%; */
    text-align: center;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #fff;
    outline: none;
}

.prompter-text:focus {
    outline: 2px solid #0066cc;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Text alignment */
.prompter-text.left-align {
    text-align: left;
}

/* Horizontal flip (left-right mirror) */
.prompter-text.flip-lr {
    transform: scaleX(-1);
}

/* Vertical flip (up-down mirror) */
.prompter-text.flip-ud {
    transform: scaleY(-1);
}

/* Both flips */
.prompter-text.flip-lr.flip-ud {
    transform: scaleX(-1) scaleY(-1);
}

/* Scroll speed indicator overlay */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #bbb;
    pointer-events: none;
}

/* Mobile/Tablet view */
.split-view {
    width: 100%;
    gap: 0;
}

.split-view .editor-panel {
    display: none;
}

/* Responsive design */
@media (max-width: 1024px) {
    .split-view .editor-panel {
        display: none;
    }

    .prompter-panel {
        width: 100%;
    }
}

@media (max-height: 600px) {
    .prompter-text {
        font-size: 32px;
    }

    .controls {
        padding: 8px;
        gap: 4px;
    }

    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .prompter-text {
        font-size: 36px;
    }

    .control-group {
        width: 100%;
    }

    input[type="range"] {
        width: 60%;
    }

    .split-view .editor-panel {
        width: 100%;
    }

    .editor-panel {
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .main-content {
        flex-direction: column;
    }
}

/* Auto-scroll animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.auto-scrolling .scroll-indicator {
    animation: pulse 1s infinite;
}
