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

/* Body - centered viewport */
body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Player container - 80vw × 90vh, 16/10 aspect ratio */
.player-container {
    width: min(80vw, calc(85vh * 16 / 10));
    height: min(85vh, calc(80vw * 10 / 16));
    aspect-ratio: 16 / 10;
    display: flex;
    flex-direction: column;
}

/* Header */
.player-header {
    text-align: center;
    padding: 1rem 0;
    flex-shrink: 0;
}

.player-header h1 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.02em;
}

/* Video display - fills remaining vertical space */
.frame-display {
    flex: 1;
    background: #000000;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-display pre {
    font-family: "Courier New", Courier, monospace;
    font-size: clamp(0.45rem, 1.1vw, 1.1rem);
    line-height: 1;
    white-space: pre;
    color: #ffffff;
    text-align: center;
}

/* Controls bar */
.controls {
    background: #0f0f0f;
    padding: 1rem 1.25rem;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.control-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.scrubber {
    flex: 1;
}

/* Play/Pause button */
button {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

button:active {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0.98);
}

/* Play icon */
button.play::before {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 3px;
}

/* Pause icon */
button.pause::before,
button.pause::after {
    content: "";
    width: 3px;
    height: 16px;
    background: #ffffff;
}

button.pause::before {
    margin-right: 4px;
}

button.pause::after {
    margin-left: 4px;
}

/* Range slider */
input[type="range"] {
    width: 100%;
    height: 5px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    transition: all 0.15s ease;
    margin-top: -5.5px;
}

input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    transition: all 0.15s ease;
}

input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
}

input[type="range"]::-moz-range-track {
    height: 5px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
}

/* Time display */
.time-display {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 90px;
    text-align: right;
}

/* Footer */
.player-footer {
    text-align: center;
    padding: 0.75rem 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.player-footer a {
    color: #ffaff3;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.player-footer a:hover {
    color: #fffbe8;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .player-container {
        width: 95vw;
        height: 95vh;
    }

    .frame-display pre {
        font-size: clamp(0.3rem, 1.2vw, 0.6rem);
    }

    button {
        width: 36px;
        height: 36px;
    }

    button.play::before {
        border-width: 7px 0 7px 12px;
    }

    button.pause::before,
    button.pause::after {
        height: 14px;
    }

    .time-display {
        font-size: 0.75rem;
        min-width: 80px;
    }
}
