:root {
    --background: #0d1117;
    --text: #c9d1d9;
    --bleu: #58a6ff;
    --red: #f85149;
    --green: #3fb950;
    --orange: #d29922;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

body {
    background: var(--background);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

main {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 12px;
}

@media (max-width: 800px) {
    main {
        grid-template-columns: 1fr;
    }
}

.workspace {
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.video-box {
    flex: 1;
    min-height: 0;
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

#webcam {
    display: none;
}

.hud {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.controls {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

aside {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    height: 100%;
}

.card {
    flex: 1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-height: 0;
}

.card h3 {
    color: var(--bleu);
    font-size: 0.85rem;
    padding-bottom: 4px;
}

.metric, .pts {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.gauge {
    width: 100%;
    height: 8px;
    position: relative;
}

.gauge-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--red), var(--orange), var(--bleu), var(--green));
}

#gauge-cursor {
    position: absolute;
    top: -3px;
    width: 4px;
    height: 14px;
    background: var(--text);
}

input, .btn {
    background: var(--background);
    color: var(--text);
    border: none;
    padding: 6px 8px;
    font-size: 0.85rem;
}

.btn {
    cursor: pointer;
    background: var(--bleu);
    color: var(--background);
    font-weight: bold;
    border: none;
    padding: 8px 12px;
}
