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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: #000;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#textDisplay {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    color: white;
    font-size: 3rem;
    font-weight: 100;
    font-family: 'Helvetica Neue', 'Arial', sans-serif;
    letter-spacing: 0.1em;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.8);
    min-height: 60px;
    pointer-events: none;
    white-space: nowrap;
}

#video {
    position: absolute;
    opacity: 0;
    width: 640px;
    height: 480px;
}

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: block;
    z-index: 1;
}

.input-container {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#textInput {
    padding: 15px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    outline: none;
    width: 300px;
    transition: transform 0.2s;
}

#textInput:focus {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#clearBtn {
    padding: 15px 25px;
    font-size: 1rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    backdrop-filter: blur(10px);
}

#clearBtn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#status {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 10;
}

/* Control Panel */
#controlPanel {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: 15px;
    z-index: 100;
    min-width: 200px;
}

.control-section {
    margin-bottom: 20px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section label {
    display: block;
    color: white;
    font-size: 0.85rem;
    font-weight: 300;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    font-weight: 300;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.control-btn:active {
    transform: scale(0.95);
}

#fontSizeDisplay,
#speedDisplay,
#bounceDisplay {
    color: white;
    font-size: 0.9rem;
    min-width: 30px;
    text-align: center;
    font-weight: 300;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
    margin: 8px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.toggle-btn {
    width: 100%;
    text-align: center;
}

.clear-btn {
    width: 100%;
    background: rgba(255, 59, 48, 0.3);
    border-color: rgba(255, 59, 48, 0.5);
}

.clear-btn:hover {
    background: rgba(255, 59, 48, 0.5);
    border-color: rgba(255, 59, 48, 0.7);
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    #textInput {
        width: 100%;
        max-width: 300px;
    }
}
