:root {
    --bg: #0e1115;
    --bg-panel: #14181f;
    --border: #262b35;
    --text: #f2f2f2;
    --text-muted: #818898;
    --accent: #f69e23;
    --accent-text: #0e1115;
    --danger: #ef5350;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #000;
    color: var(--text);
    overflow: hidden;
    cursor: none;
}

.display-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.timer-display {
    background: var(--bg-panel);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
    min-height: 70px;
}

#countdown-timer {
    font-size: 28px;
    font-weight: bold;
    color: var(--accent);
    font-family: 'Courier New', monospace;
}

#countdown-timer.warning {
    color: #ffb74d;
}

#countdown-timer.danger {
    color: var(--danger);
}

#countdown-timer.overtime {
    color: var(--danger);
    animation: blink-overtime 1s step-start infinite;
}

@keyframes blink-overtime {
    50% {
        opacity: 0.25;
    }
}

#elapsed-time {
    font-size: 20px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.text-area {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #000;
}

#prompter-text {
    padding: 40px;
    font-size: 48px;
    line-height: 1.6;
    font-weight: 300;
    text-align: center;
    position: absolute;
    width: 100%;
    transition: transform 0.1s linear;
    top: 80%;
    transform: translateY(0%);
    color: var(--text);
}

#prompter-text p {
    margin-bottom: 40px;
}

.scheduled-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(14, 17, 21, 0.92);
    padding: 40px 60px;
    border-radius: 20px;
    border: 3px solid var(--accent);
    display: none;
    z-index: 100;
}

.scheduled-countdown.active {
    display: block;
}

.pre-start-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: none;
    z-index: 150;
}

.pre-start-countdown.active {
    display: block;
}

.pre-start-number {
    font-size: 220px;
    font-weight: bold;
    color: var(--accent);
    font-family: 'Courier New', monospace;
    line-height: 1;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    animation: pre-start-pulse 1s ease-in-out infinite;
}

@keyframes pre-start-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.12); opacity: 0.85; }
}

.pre-start-label {
    font-size: 22px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 12px;
}

.live-speed-control {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(14, 17, 21, 0.85);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 8px 18px;
    z-index: 900;
    max-width: 90vw;
    opacity: 0.55;
    transition: opacity 0.25s ease;
}

.live-speed-control:hover,
.live-speed-control:focus-within {
    opacity: 1;
}

.live-speed-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.live-speed-control input[type="range"] {
    width: 160px;
    accent-color: var(--accent);
    cursor: pointer;
}

.live-speed-value {
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    min-width: 28px;
    text-align: right;
}

@media (max-width: 768px) {
    .pre-start-number {
        font-size: 140px;
    }

    .live-speed-control input[type="range"] {
        width: 110px;
    }
}

.countdown-label {
    font-size: 24px;
    color: var(--accent);
    margin-bottom: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.countdown-time {
    font-size: 72px;
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.countdown-target {
    font-size: 18px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.on-air-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    background: rgba(14, 17, 21, 0.95);
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: 1px solid var(--border);
}

.on-air-indicator.active {
    opacity: 1;
}

.on-air-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--danger);
    margin-right: 10px;
    animation: pulse 1.5s infinite;
}

.on-air-text {
    color: var(--danger);
    letter-spacing: 1px;
}

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

.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    background: rgba(14, 17, 21, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1000;
    border: 1px solid var(--border);
}

.status-indicator {
    font-size: 20px;
    margin-right: 8px;
}

.status-indicator.connected {
    color: #3ddc84;
}

.status-indicator.disconnected {
    color: var(--danger);
}

.status-indicator.connecting {
    color: var(--accent);
}

.status-text {
    font-weight: bold;
    color: var(--text);
}

/* Full screen mode adjustments */
.fullscreen {
    cursor: none;
}

.fullscreen .connection-status {
    opacity: 0.3;
    transition: opacity 0.3s;
}

.fullscreen .connection-status:hover {
    opacity: 1;
}

/* Large text mode for better readability */
.large-text #prompter-text {
    font-size: 64px;
}

.medium-text #prompter-text {
    font-size: 48px;
}

.small-text #prompter-text {
    font-size: 32px;
}

/* Mirror mode for using with teleprompter hardware */
.mirror-mode {
    transform: scaleX(-1);
}

@media (max-width: 768px) {
    #prompter-text {
        font-size: 32px;
        padding: 20px;
    }

    .timer-display {
        padding: 10px 15px;
    }

    #countdown-timer {
        font-size: 24px;
    }

    #elapsed-time {
        font-size: 18px;
    }
}
