/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0F1115;
    --bg-secondary: #1a1d23;
    --bg-tertiary: #24272f;
    --text-primary: #F2F2F2;
    --text-secondary: #9ca3af;
    --accent-blue: #4DA3FF;
    --accent-green: #6EE7B7;
    --accent-red: #EF4444;
    --accent-yellow: #FACC15;
    --border-color: #374151;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 2rem;
    width: auto;
    object-fit: contain;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.nav-toggle:hover {
    background-color: var(--bg-tertiary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--accent-blue);
}

.nav-link svg {
    color: var(--accent-blue);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        flex-direction: column;
        background-color: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        padding: 0.5rem;
        gap: 0;
        display: none;
        z-index: 100;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    position: relative;
}

.icon-btn:hover {
    background-color: var(--bg-tertiary);
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: #1f2937;
    color: var(--text-primary);
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
}

/* Script Input Section - SHOWS WHEN EMPTY, HIDES WHEN HAS CONTENT */
.script-input-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    transition: all 0.3s ease;
}

.script-input-section.hidden {
    display: none;
}

.script-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.script-input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--accent-blue);
    font-weight: 600;
}

.script-input-label svg {
    color: var(--accent-blue);
    flex-shrink: 0;
}

.btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-clear:hover {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.script-textarea {
    width: 100%;
    height: 8rem;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.script-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.1);
}

.script-textarea::placeholder {
    color: var(--text-secondary);
}

/* Teleprompter Main */
.teleprompter-main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Countdown Overlay */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.countdown-overlay.hidden {
    display: none;
}

.countdown-number {
    font-size: 10rem;
    font-weight: 700;
    color: var(--text-primary);
    animation: countdownPulse 1s ease;
}

@keyframes countdownPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Scroll Container */
.scroll-container {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.script-display {
    padding: 20vh 10%;
    font-size: 3rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.script-display::after {
    content: "";
    display: block;
    height: 80vh;
}

/* Camera Preview - Corner Mode (Default) */
.camera-preview {
    position: absolute;
    bottom: 5rem;
    right: 1rem;
    width: 16rem;
    height: 12rem;
    background-color: #000;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid var(--border-color);
    z-index: 10;
    transition: all 0.3s ease;
}

.camera-preview.hidden {
    display: none;
}

/* Camera Preview - Background Mode (BEHIND TEXT) */
.camera-preview.background-mode {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    z-index: 1; /* BEHIND text (text has z-index: 2) */
}

.camera-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-preview video.mirrored {
    transform: scaleX(-1);
}

/* Script Display - Higher z-index so it appears OVER camera background */
.scroll-container {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    z-index: 2; /* ABOVE camera background */
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.script-display {
    padding: 20vh 10%;
    font-size: 3rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
    z-index: 2; /* ABOVE camera background AND overlay */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); /* Text shadow for better readability over video */
}

.script-display::after {
    content: "";
    display: block;
    height: 80vh;
}

/* Recording Indicator */
.recording-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--accent-red);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 15;
}

.recording-indicator.hidden {
    display: none;
}

.rec-dot {
    width: 0.5rem;
    height: 0.5rem;
    background-color: white;
    border-radius: 50%;
    animation: recPulse 1.5s infinite;
}

@keyframes recPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Control Panel - NORMAL SIZE */
.control-panel {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.controls-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto 1rem;
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

/* Control Buttons - Slightly smaller */
.control-btn {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    position: relative;
}

.control-btn:hover {
    background-color: #2d3139;
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn-play {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
}

.control-btn-play:hover {
    background-color: #5cd4a7;
}

.control-btn-reset {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
}

.control-btn-reset:hover {
    background-color: #dc2626;
}

.control-btn-record {
    position: relative;
}

.control-btn-record.recording {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    animation: recordPulse 1.5s infinite;
}

.record-dot {
    position: absolute;
}

.record-dot.hidden {
    display: none;
}

.control-btn-record.recording .record-dot {
    display: block;
}

@keyframes recordPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.control-btn.active {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Control Group (Speed & Font Size) */
.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    min-width: 6rem;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.control-label svg {
    color: var(--accent-blue);
}

.control-label-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-slider {
    width: 100%;
    height: 0.25rem;
    background: linear-gradient(to right, var(--accent-blue) 0%, var(--accent-blue) 50%, var(--bg-primary) 50%);
    border-radius: 0.125rem;
    outline: none;
    cursor: pointer;
    appearance: none;
}

.control-slider::-webkit-slider-thumb {
    appearance: none;
    width: 0.875rem;
    height: 0.875rem;
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.control-slider::-moz-range-thumb {
    width: 0.875rem;
    height: 0.875rem;
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Timer Box */
.timer-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-green);
}

.timer-box svg {
    color: var(--accent-green);
}

/* Ready Timer Control */
.control-timer {
    min-width: 4rem;
}

.control-timer .control-label {
    font-size: 1.25rem;
    color: var(--accent-yellow);
}

.control-timer .control-label svg {
    color: var(--accent-yellow);
}

/* Coffee and Footer - ON SAME LINE */
.footer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem; /* Reduced */
    flex-wrap: wrap;
}

.btn-coffee {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem; /* Slightly smaller */
    background: linear-gradient(135deg, #FFDD00 0%, #FBB034 100%);
    color: #000;
    text-decoration: none;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.8125rem; /* Slightly smaller */
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(251, 176, 52, 0.3);
}

.btn-coffee:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 176, 52, 0.5);
}

.btn-coffee svg {
    color: #000;
}

.powered-by {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.powered-by a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.powered-by a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 42rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-small {
    max-width: 28rem;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #3d8fdb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(77, 163, 255, 0.3);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #2d3139;
    border-color: var(--accent-blue);
}

.btn-full {
    width: 100%;
}

/* Script Editor */
.editor-section {
    margin-bottom: 1rem;
}

.color-picker-inline {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.color-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.color-circle.active {
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.script-editor-textarea {
    width: 100%;
    min-height: 16rem;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}

.script-editor-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.1);
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.75rem 0 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.editor-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.editor-tip {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Form Elements */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.1);
}

.label-with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.label-with-icon svg {
    color: var(--accent-blue);
}

/* Privacy Notice */
.privacy-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background-color: rgba(77, 163, 255, 0.1);
    border: 1px solid var(--accent-blue);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.privacy-icon {
    flex-shrink: 0;
    color: var(--accent-blue);
}

.privacy-notice p {
    color: #bfdbfe;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* Settings Section */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section.hidden {
    display: none;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-title svg {
    color: var(--accent-blue);
}

/* Form Elements */
.form-label {
    display: block;
    margin-bottom: 1rem;
}

.label-text {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.1);
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 0.5rem;
}

.color-btn,
.bg-color-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 0.375rem;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.color-btn:hover,
.bg-color-btn:hover {
    border-color: var(--text-secondary);
    transform: scale(1.05);
}

.color-btn.active,
.bg-color-btn.active {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Custom Alert */
.custom-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.custom-alert.hidden {
    display: none;
}

.alert-content {
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 24rem;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    animation: alertSlideIn 0.3s ease;
}

@keyframes alertSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    background-color: rgba(77, 163, 255, 0.2);
    border-radius: 50%;
}

.alert-icon svg {
    color: var(--accent-blue);
}

.alert-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.alert-message {
    font-size: 0.9375rem;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.alert-button {
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .script-display {
        padding: 15vh 5%;
        font-size: 2rem;
    }

    .camera-preview {
        width: 10rem;
        height: 7.5rem;
        bottom: 5rem;
        right: 0.5rem;
    }

    .controls-container {
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .control-btn {
        width: 3rem;
        height: 3rem;
    }

    .control-btn svg {
        width: 20px;
        height: 20px;
    }

    .control-group {
        min-width: 5rem;
        padding: 0.375rem 0.5rem;
    }

    .control-label {
        font-size: 1rem;
    }

    .timer-box {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .countdown-number {
        font-size: 5rem;
    }

    .modal-content {
        padding: 1.25rem;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .btn {
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.125rem;
    }

    .script-display {
        font-size: 1.5rem;
        padding: 10vh 3%;
    }

    .camera-preview {
        width: 8rem;
        height: 6rem;
        bottom: 4.5rem;
    }

    .controls-container {
        gap: 0.375rem;
    }

    .control-btn {
        width: 2.75rem;
        height: 2.75rem;
    }

    .control-btn svg {
        width: 18px;
        height: 18px;
    }

    .control-group {
        min-width: 4.5rem;
    }

    .control-label {
        font-size: 0.875rem;
    }

    .control-label-small {
        font-size: 0.625rem;
    }

    .timer-box {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }

    .btn-coffee {
        font-size: 0.75rem;
        padding: 0.5rem 0.875rem;
    }

    .btn-coffee svg {
        width: 16px;
        height: 16px;
    }

    .countdown-number {
        font-size: 4rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}