:root {
    --laranja: #fe5000;
    --laranja-alt: #dd4600;
    --azul: #0e0740;
    --azul-alt: #09052b;
    --painel: #15103f;
    --painel-2: #1e1858;
    --texto: #e9e8f5;
    --texto-mute: #9a97c4;
    --ok: #2bb673;
    --warn: #f2a900;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at 20% -10%, #1a1450 0%, var(--azul) 45%, var(--azul-alt) 100%);
    color: var(--texto);
    min-height: 100vh;
}

.topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    background: rgba(9, 5, 43, .6);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 30;
}
.topo img { height: 42px; }
.topo .tag {
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--laranja);
    border: 1px solid var(--laranja);
    padding: 4px 10px;
    border-radius: 40px;
}

.wrap {
    max-width: 920px;
    margin: 0 auto;
    padding: 26px 18px 60px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.titulo-aula {
    margin: 0 0 4px;
}
.titulo-aula h1 {
    font-size: 1.35rem;
    margin: 0;
    line-height: 1.3;
}
.titulo-aula .sub {
    color: var(--texto-mute);
    font-size: .85rem;
    margin-top: 4px;
}

/* ===== Player ===== */
.player {
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
    aspect-ratio: 16 / 9;
    user-select: none;
}
.player video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

/* clique central play/pause */
.big-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity .2s;
}
.big-play span {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(254, 80, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 26px rgba(254, 80, 0, .55);
    transition: transform .15s;
}
.big-play:hover span { transform: scale(1.06); }
.big-play svg { width: 34px; height: 34px; fill: #fff; margin-left: 5px; }
.player.is-playing .big-play { opacity: 0; pointer-events: none; }

/* barra de controles */
.controls {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 8px 14px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .85));
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s;
    z-index: 10;
}
.player:hover .controls,
.player.is-paused .controls,
.player.show-ui .controls { opacity: 1; transform: none; }

/* seek bar com camadas: assistido + buffer + progresso */
.seek {
    position: relative;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 6px;
}
.seek .track {
    position: relative;
    width: 100%;
    height: 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .22);
    overflow: hidden;
}
.seek .layer { position: absolute; top: 0; bottom: 0; left: 0; }
.seek .buffer { background: rgba(255, 255, 255, .28); }
.seek .coverage { background: rgba(43, 182, 115, .55); }  /* trechos assistidos */
.seek .progress { background: var(--laranja); }
.seek .knob {
    position: absolute;
    top: 50%;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--laranja);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 4px rgba(254, 80, 0, .3);
    transition: opacity .15s;
}
.seek:hover .track { height: 7px; }
.tooltip {
    position: absolute;
    bottom: 22px;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    font-size: .72rem;
    padding: 2px 7px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    white-space: nowrap;
}
.seek:hover .tooltip { opacity: 1; }

.ctrl-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}
.ctrl-row button {
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background .15s;
}
.ctrl-row button:hover { background: rgba(255, 255, 255, .15); }
.ctrl-row svg { width: 22px; height: 22px; fill: #fff; }
.ctrl-row .time {
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
    color: #e9e8f5;
}
.ctrl-row .spacer { flex: 1; }

/* volume */
.vol { display: flex; align-items: center; gap: 4px; }
.vol input[type=range] {
    width: 0;
    opacity: 0;
    transition: width .2s, opacity .2s;
    accent-color: var(--laranja);
    cursor: pointer;
}
.vol:hover input[type=range] { width: 70px; opacity: 1; }

/* menu velocidade */
.speed { position: relative; }
.speed .btn-speed {
    font-size: .8rem;
    font-weight: 600;
    min-width: 46px;
    justify-content: center;
}
.speed-menu {
    position: absolute;
    bottom: 38px;
    right: 0;
    background: #000;
    border-radius: 8px;
    padding: 6px;
    display: none;
    flex-direction: column;
    min-width: 92px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .6);
}
.speed-menu.open { display: flex; }
.speed-menu button {
    justify-content: flex-start;
    font-size: .8rem;
    padding: 6px 10px;
    width: 100%;
}
.speed-menu button.active { color: var(--laranja); font-weight: 700; }

/* ===== Faixa de ações (sempre visível) ===== */
.barra-acoes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.btn-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(21, 16, 63, .75);
    border: 1px solid rgba(255, 255, 255, .1);
    color: var(--texto);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn-toggle:hover { background: var(--painel-2); border-color: rgba(255, 255, 255, .2); }
.btn-toggle.aberto { border-color: var(--laranja); }
.btn-toggle b { color: #fff; font-variant-numeric: tabular-nums; }
.btn-toggle .mini-bar {
    width: 60px;
    height: 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .14);
    overflow: hidden;
    flex: none;
}
.btn-toggle .mini-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--laranja), var(--warn));
    transition: width .3s;
}
.btn-toggle .chev {
    color: var(--laranja);
    font-size: .78rem;
    margin-left: 4px;
}

.atalhos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: .72rem;
    color: var(--texto-mute);
}
.atalhos span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }

/* ===== Detalhes do acompanhamento (expansível) ===== */
.acompanhamento {
    background: rgba(21, 16, 63, .75);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 14px;
    padding: 16px 20px;
}
.acompanhamento[hidden] { display: none; }
.ac-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.barra-assistido i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--laranja), var(--warn));
    transition: width .3s;
}
.ac-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: .82rem;
    color: var(--texto-mute);
}
.ac-stats b { color: #fff; font-variant-numeric: tabular-nums; }
.ac-stats .dot {
    width: 9px; height: 9px; border-radius: 50%;
    display: inline-block; margin-right: 4px; vertical-align: middle;
}
.ac-stats .dot.ok  { background: var(--ok); }
.ac-stats .dot.max { background: var(--laranja); }

.ac-reset {
    flex: none;
    align-self: flex-start;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .2);
    color: var(--texto-mute);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: .78rem;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.ac-reset:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.ac-mapa-wrap {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}
.ac-mapa-titulo {
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--texto-mute);
    margin-bottom: 8px;
}

/* linha do tempo dos trechos exibidos */
.mapa {
    height: 30px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    position: relative;
    overflow: hidden;
}
.mapa i {
    position: absolute;
    top: 0; bottom: 0;
    background: var(--ok);
    opacity: .85;
}
.legenda {
    font-size: .7rem;
    color: var(--texto-mute);
    margin-top: 8px;
    display: flex;
    gap: 18px;
}
.legenda span { display: flex; align-items: center; gap: 6px; }
.legenda b { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.dica {
    grid-column: 1 / -1;
    color: var(--texto-mute);
    font-size: .78rem;
    text-align: center;
    margin-top: 4px;
}
.dica kbd {
    background: rgba(255, 255, 255, .12);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: inherit;
    color: #fff;
}
