* { box-sizing: border-box; }

.player {
    width: 100%;
    max-width: 720px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    overflow: hidden;
}

.stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-dim);
    cursor: pointer;
    text-align: center;
    padding: 20px;
}

.empty svg { width: 30px; height: 30px; opacity: 0.5; }
.empty span { font-size: 13px; }
#fileInput { display: none; }

.center-toggle {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.center-toggle .icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.stage:hover .center-toggle .icon,
.stage.paused .center-toggle .icon { opacity: 1; }

.center-toggle svg { width: 20px; height: 20px; fill: #fff; }

.bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
}

.seek-row {
    display: none; /* flex */
    align-items: center;
    gap: 10px;
    padding: 10px 14px 0;
}

.time {
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    color: var(--text-dim);
    min-width: 34px;
}
.time.end { text-align: right; }

.seek {
    flex: 1;
    position: relative;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.seek .rail {
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: rgba(255,255,255,0.12);
    position: relative;
    overflow: hidden;
}

.seek .buffered {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: rgba(255,255,255,0.18);
}

.seek .fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: var(--accent);
}

.seek .knob {
    position: absolute;
    top: 50%; left: 0%;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    transform: translate(-50%,-50%);
    pointer-events: none;
}

.controls {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 0.6px solid #ccc;
    border-left: 0.6px solid #ccc;
    border-right: 0.6px solid #ccc;
}

.btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 8px;
    transition: background 0.12s ease, color 0.12s ease;
}
.btn:hover { background: rgba(255,255,255,0.06); }
.btn svg { width: 17px; height: 17px; fill: currentColor; }

.spacer { flex: 1; }

.vol {
    display: flex;
    align-items: center;
    gap: 6px;
}

input[type="range"].volume {
    width: 70px;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    border-radius: 3px;
    background: rgba(255,255,255,0.12);
    outline: none;
}
input[type="range"].volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--text);
    cursor: pointer;
}
input[type="range"].volume::-moz-range-thumb {
    width: 10px; height: 10px;
    border: none;
    border-radius: 50%;
    background: var(--text);
    cursor: pointer;
}

.rate {
    font-size: 12px;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 8px;
    min-width: 34px;
}
.rate:hover { color: var(--text); }

@media (max-width: 480px){
    .vol .volume { width: 44px; }
}