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

body {
    background: #0a0a0f;
    color: #e0e0e0;
    font-family: 'Bricolage Grotesque', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

#wrapper {
    width: 100%;
    max-width: 1320px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    text-align: center;
}

.page-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 300;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

#canvas-container {
    width: 100%;
    max-width: 1280px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(220, 40, 80, 0.15), 0 4px 30px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.06);
    position: relative;
}

#canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#controls {
    width: 100%;
    max-width: 1280px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-top: none;
    border-radius: 0 0 12px 12px;
    margin-bottom: 8px;
}

#controls button {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
    white-space: nowrap;
}

#controls button:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(220, 40, 80, 0.4);
    box-shadow: 0 0 12px rgba(220, 40, 80, 0.2);
}

#btn-download {
    background: rgba(220, 40, 80, 0.15) !important;
    border-color: rgba(220, 40, 80, 0.3) !important;
}

#btn-download:hover {
    background: rgba(220, 40, 80, 0.3) !important;
    border-color: rgba(220, 40, 80, 0.6) !important;
}

#btn-download:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#progress-wrapper {
    flex: 1;
    padding: 8px 0;
    cursor: pointer;
}

#progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    position: relative;
    overflow: visible;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #dc2850, #ff6b8a);
    border-radius: 3px;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(220, 40, 80, 0.4);
}

#progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(220, 40, 80, 0.6);
    transition: left 0.1s linear;
    pointer-events: none;
}

#time-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 300;
    color: #888;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

#download-status {
    width: 100%;
    max-width: 1280px;
    padding: 10px 16px;
    background: rgba(220, 40, 80, 0.08);
    border: 1px solid rgba(220, 40, 80, 0.15);
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
}

#download-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}

#download-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #dc2850, #ff6b8a);
    border-radius: 3px;
    transition: width 0.15s linear;
}

#download-status-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 300;
    color: #dc2850;
    white-space: nowrap;
    min-width: 140px;
}

footer {
    text-align: center;
    padding: 16px;
}

footer a {
    color: #666;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    transition: color 0.3s;
}

footer a:hover {
    color: #dc2850;
}

@media (max-width: 640px) {
    .page-title { font-size: 20px; }
    .page-subtitle { font-size: 11px; }
    #controls { gap: 8px; padding: 10px 12px; }
    #controls button { font-size: 11px; padding: 4px 8px; }
    #time-display { font-size: 11px; min-width: 70px; }
    #download-status { padding: 8px 12px; gap: 10px; }
    #download-status-text { font-size: 11px; min-width: 110px; }
}