* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    background: #ffffff;
    color: #222;
}

/* ── Barra de topo ─────────────────────────── */
.barra {
    height: 44px;
    background: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    position: relative;
    z-index: 5;
}
.titulo {
    font-weight: bold;
    color: #555;
    font-size: 13px;
}
.btn-instalar {
    background: #cc2222;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

/* ── Ecrã base ─────────────────────────────── */
.ecra {
    height: calc(100vh - 44px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}

/* ── Ecrã gravador ─────────────────────────── */
.ecra-gravador {
    justify-content: space-between;
}

.preview-container {
    width: 60%;
    max-width: 240px;
    aspect-ratio: 1;
    margin: 8px auto 0;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #bbb;
    transition: border-color 0.3s;
    background: #000;
    position: relative;
    z-index: 10000;
}
.preview-container.gravando { border-color: #cc2222; }
.preview-container.pausado { border-color: #ff8800; }

#preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* espelhado como selfie */
}

.status {
    font-size: 16px;
    color: #999;
    margin-top: 12px;
}
.status.gravando { color: #cc2222; font-weight: bold; }
.status.pausado { color: #ff8800; font-weight: bold; }
.status.sucesso { color: #44aa44; font-weight: bold; }

.timer {
    font-size: 44px;
    font-weight: bold;
    color: #222;
    margin: 4px 0;
    letter-spacing: 2px;
}

.botoes {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    margin: 4px 0;
}
.btn-gravar, .btn-pausa {
    flex: 1;
    border: none;
    border-radius: 10px;
    padding: 16px 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}
.btn-gravar {
    background: #cc2222;
    flex: 2;
}
.btn-gravar.ativo { background: #333; }
.btn-gravar:active { background: #aa1111; }
.btn-pausa {
    background: #888;
}
.btn-pausa:disabled { opacity: 0.5; }
.btn-pausa.retomar { background: #44aa44; }

.info-ficheiro {
    font-size: 12px;
    color: #888;
    text-align: center;
    min-height: 18px;
    word-break: break-all;
    padding: 0 10px;
}

.aviso {
    font-size: 12px;
    color: #bbb;
    text-align: center;
}

/* ── Caixa de avisos de preparação ────────────── */
.avisos-preparacao {
    background: #fff8e1;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 8px auto;
    max-width: 420px;
    font-size: 12px;
    color: #7a5c00;
    line-height: 1.5;
}
.avisos-preparacao h3 {
    font-size: 12px;
    color: #cc2222;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.avisos-preparacao ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.avisos-preparacao li {
    padding: 3px 0;
}
.avisos-preparacao li::before {
    content: "⚠ ";
    color: #ff9800;
    font-weight: bold;
}
.avisos-preparacao.ocultos {
    display: none;
}

/* ── Overlay preto para flashes ────────────── */
.overlay-preto {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: none;
    pointer-events: none;
}
.overlay-preto.visivel { display: block; }
