@font-face {
    font-family: 'Subsoccer';
    src: url('fonts/Subsoccer-2-Regular.woff2') format('woff2'),
         url('fonts/Subsoccer-2-Regular.woff') format('woff'),
         url('fonts/Subsoccer-2-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Resolve';
    src: url('fonts/Resolve-BoldNrw.otf') format('opentype');
    font-weight: bold;
    font-display: swap;
}

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

body.dark-mode {
    background: #0e0e0e;
    color: #e8e8e8;
    font-family: 'Resolve', 'Open Sans', system-ui, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─── Header ─── */
.hl-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #161616;
    border-bottom: 1px solid #2a2a2a;
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-back {
    color: #888;
    font-size: 1.1rem;
    text-decoration: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    transition: all 0.2s;
}
.btn-back:hover { background: #222; color: #fff; }

.header-logo { height: 20px; opacity: 0.8; }

.header-badge {
    font-family: 'Subsoccer', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #c41e2a;
    background: rgba(196,30,42,0.1);
    border: 1px solid rgba(196,30,42,0.25);
    padding: 4px 10px;
    border-radius: 4px;
    margin-left: auto;
}


/* ─── Container ─── */
.hl-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px 60px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ─── Cards ─── */
.hl-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.3s;
}
.hl-card:hover { border-color: #333; }

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.step-num {
    width: 28px;
    height: 28px;
    background: #c41e2a;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.card-header h2 {
    font-family: 'Subsoccer', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 1px;
    color: #e0e0e0;
    text-align: left;
}

/* ─── Form ─── */
.match-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row { display: flex; gap: 12px; }
.form-row.two-col label { flex: 1; }
.form-row label { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.label-text {
    font-family: 'Resolve', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #888;
    text-transform: uppercase;
}

.match-form input {
    padding: 10px 12px;
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 1.1rem;
    font-family: 'Subsoccer', sans-serif;
    letter-spacing: 1px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.match-form input:focus {
    outline: none;
    border-color: #c41e2a;
    box-shadow: 0 0 0 3px rgba(196,30,42,0.15);
}
.match-form input::placeholder { color: #555; }

.match-form select {
    padding: 10px 12px;
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 1.6rem;
    font-weight: normal;
    font-family: 'Subsoccer', sans-serif;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.match-form select:focus {
    outline: none;
    border-color: #c41e2a;
    box-shadow: 0 0 0 3px rgba(196,30,42,0.15);
}

.score-row {
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
}
.score-row label { flex: 0 0 80px; }
.score-dash {
    font-size: 1.6rem;
    font-weight: 700;
    color: #c41e2a;
    padding-bottom: 8px;
}

/* ─── Dropzone ─── */
.dropzone {
    border: 2px dashed #333;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}
.dropzone:hover,
.dropzone.drag-over {
    border-color: #c41e2a;
    background: rgba(196,30,42,0.05);
}
.dropzone-icon {
    font-size: 2rem;
    color: #555;
    margin-bottom: 10px;
    display: block;
}
.dropzone p {
    font-size: 0.95rem;
    font-weight: 500;
    color: #aaa;
}
.dropzone-sub {
    font-size: 0.8rem;
    color: #555;
}

/* ─── Video Options Grid ─── */
.video-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-label {
    font-family: 'Resolve', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    color: #888;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.option-label i {
    color: #c41e2a;
    font-size: 0.75rem;
}

.format-selector-row {
    display: flex;
    gap: 8px;
}

.format-btn {
    flex: 1;
    padding: 10px 8px;
    background: #141414;
    border: 1px solid #2a2a2a;
    color: #888;
    border-radius: 6px;
    font-family: 'Resolve', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.format-btn:hover {
    background: #1e1e1e;
    color: #fff;
    border-color: #444;
}

.format-btn.active {
    background: #c41e2a;
    border-color: #c41e2a;
    color: #ffffff;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(196,30,42,0.35);
}


.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ─── Preview ─── */
.preview-wrapper {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: transparent;
}

.preview-canvas-box {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    border: 1px solid #2a2a2a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#source-video {
    display: none; /* hidden; we render to canvas */
}

#preview-canvas {
    width: 100%;
    display: block;
    border-radius: 9px;
}

/* ─── Controls & Trimmer Panel ─── */
.video-controls-panel {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ─── Export ─── */
.export-area {
    display: flex;

    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-export {
    width: 100%;
    padding: 14px 20px;
    background: #c41e2a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.25rem;
    letter-spacing: 1.5px;
    font-family: 'Subsoccer', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-export:hover:not(:disabled) { background: #a51824; transform: translateY(-1px); }
.btn-export:active:not(:disabled) { transform: scale(0.98); }
.btn-export:disabled { background: #333; color: #666; cursor: not-allowed; }

.export-note {
    font-size: 0.7rem;
    color: #555;
    text-align: center;
    letter-spacing: 0.3px;
}

/* ─── Progress bar ─── */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #222;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #c41e2a, #ff4757);
    border-radius: 3px;
    width: 0%;
    transition: width 0.15s ease;
}

.progress-text {
    position: absolute;
    right: 0;
    top: 12px;
    font-size: 0.7rem;
    color: #888;
    font-variant-numeric: tabular-nums;
}

/* ─── Download / Success ─── */
.hl-card-success {
    text-align: center;
    border-color: #2ecc71;
    background: rgba(46,204,113,0.06);
    animation: successPop 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@keyframes successPop {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0;
}

.success-icon {
    font-size: 1.8rem;
    color: #2ecc71;
}

.hl-card-success h2 {
    font-family: 'Subsoccer', sans-serif;
    letter-spacing: 1.5px;
    font-size: 1.3rem;
    color: #2ecc71;
    text-align: center;
    margin-bottom: 0;
}

.export-preview-box {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid #333;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.export-preview-box video {
    width: 100%;
    max-height: 480px;
    display: block;
    object-fit: contain;
    background: #000;
}

.download-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-share {
    flex: 1;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: #c41e2a;
    color: #fff;
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 1.2px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Resolve', sans-serif;
    box-shadow: 0 4px 15px rgba(196,30,42,0.4);
}
.btn-share:hover { background: #e02432; transform: translateY(-1px); }

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    font-family: 'Resolve', sans-serif;
}
.btn-download:hover { background: #333; border-color: #666; transform: translateY(-1px); }

.export-hint {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.4;
    max-width: 440px;
    margin: 0 auto;
}
.export-hint b { color: #fff; }
.export-hint i { color: #c41e2a; }

/* ─── Trim section ─── */
.trim-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

.trim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.trim-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Resolve', sans-serif;
    font-size: 0.75rem;
    color: #eee;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.trim-label i {
    color: #c41e2a;
    font-size: 0.85rem;
}

.trim-badge {
    background: rgba(196, 30, 42, 0.15);
    border: 1px solid rgba(196, 30, 42, 0.35);
    color: #c41e2a;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
}

.trim-timeline {
    position: relative;
    height: 36px;
    background: #080808;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
}

.trim-window {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(196, 30, 42, 0.25);
    border: 2px solid #c41e2a;
    border-radius: 5px;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(196, 30, 42, 0.2);
    transition: left 0.1s ease, width 0.1s ease;
}

.trim-timeline input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: grab;
    z-index: 2;
}
.trim-timeline input[type="range"]:active { cursor: grabbing; }

.trim-times {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #888;
    font-variant-numeric: tabular-nums;
    padding: 0 2px;
}

.trim-hint {
    color: #555;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ─── Preview Playback Toolbar ─── */
.preview-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #222;
}

.playback-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    background: #202020;
    border: 1px solid #333;
    border-radius: 50%;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s ease;
}
.btn-icon:hover {
    background: #c41e2a;
    border-color: #c41e2a;
    transform: scale(1.06);
}

.video-time {
    font-size: 0.82rem;
    color: #aaa;
    font-family: monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.btn-change-video {
    background: #202020;
    border: 1px solid #333;
    color: #ccc;
    border-radius: 6px;
    padding: 7px 12px;
    font-family: 'Resolve', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.btn-change-video:hover {
    background: #2a2a2a;
    border-color: #555;
    color: #fff;
    transform: translateY(-1px);
}


/* ─── Responsive ─── */
@media (max-width: 480px) {
    .form-row.two-col { flex-direction: column; }
    .hl-container { padding: 12px 10px 40px; }
    .hl-card { padding: 16px; }
}
