/* Built-in Overlay System Styles */

/* Main Overlay Container */
.builtin-overlay {
    position: absolute;
    top: 5vh; /* Position 5% of viewport height from top */
    left: 50%; /* Center horizontally */
    width: 80%;
    max-width: 1800px;
    height: auto; /* Auto height to fit content */
    min-height: 380px; /* Minimum height to fit all initial controls */
    transform: translateX(-50%); /* Center horizontally only - top anchored */
    background: rgba(26, 26, 26, 0.92);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 12px;
    padding: 10px;
    color: #e5e7eb;
    font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    gap: 0px;
    box-sizing: border-box;
    z-index: 2147483000;
}

/* Overlay Header */
.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    flex-shrink: 0;
    margin-bottom: 24px;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
}

.overlay-title {
    font-size: 20px;
    color: #6b7280;
    font-weight: 700;
    align-self: flex-start;
    width: auto;
    text-align: center;
}

.speed-display {
    font-size: 12px;
    color: #FBBF24;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    font-family: inherit;
}

.overlay-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.overlay-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Overlay Content */
.overlay-content {
    flex: 1;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.overlay-body {
    flex: 1;
    overflow-y: visible;
    line-height: 1.6;
    font-size: 18px;
    padding-right: 8px;
}


/* Overlay Resizer Handle */
.overlay-resizer {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 14px;
    height: 14px;
    opacity: 0.9;
    border-right: 2px solid #fbbf24;
    border-bottom: 2px solid #fbbf24;
    border-radius: 2px;
    touch-action: none;
}

.overlay-resizer:hover {
    opacity: 1;
}

/* Watermark */
.watermark {
    position: fixed;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 3px;
    text-transform: uppercase;
    z-index: 1;
    pointer-events: none;
    backdrop-filter: blur(2px);
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
    opacity: 1.0;
    transition: opacity 0.5s ease;
}
