* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #0b0f19;
    color: #e5e7eb;
}

.reflection-body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.reflection-container {
    max-width: 640px;
    text-align: center;
}

.reflection-text {
    font-size: 1.4rem;
    line-height: 1.6;
    color: #9ca3af;
    font-style: italic;
}

.player-body {
    min-height: 100vh;
    user-select: none;
}

.ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-banner-top {
    width: 100%;
    min-height: 50px;
    background: #0f1420;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.player-logo { height: 34px; display: block; }
.player-logo-text {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: #f3f4f6;
}
.player-logo-text::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primario, #6366f1);
    margin-right: 8px;
}

.player-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    color: #9ca3af;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-layout {
    display: flex;
    gap: 16px;
    padding: 20px 16px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.ad-lateral {
    width: 160px;
    flex-shrink: 0;
    display: none;
}

@media (min-width: 1100px) {
    .ad-lateral { display: flex; }
}

.player-main {
    flex: 1;
    min-width: 0;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
}

.video-element {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

/* loading spinner */
.video-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
}
.video-wrapper.is-loading .video-loading { display: flex; }
.video-loading::after {
    content: '';
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-primario, #6366f1);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* center play button */
.center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: solid 2px rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.4);
    color: var(--color-primario, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    backdrop-filter: blur(4px);
    transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    animation: pulse-play 1.1s ease-in-out infinite alternate;
}
.center-play-btn:hover { background: var(--color-primario, #6366f1); color: #fff; border-color: var(--color-primario, #6366f1); }
.center-play-btn svg { margin-left: 3px; }
.video-wrapper.is-playing .center-play-btn { opacity: 0; pointer-events: none; animation: none; }

@keyframes pulse-play {
    from { transform: translate(-50%, -50%) scale(1); }
    to { transform: translate(-50%, -50%) scale(1.1); }
}

.video-watermark {
    position: absolute;
    top: 14px;
    right: 14px;
    height: 26px;
    opacity: 0.85;
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}
@media (max-width: 640px) {
    .video-watermark { height: 18px; top: 8px; right: 8px; }
}

.interstitial-overlay,
.adblock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 15, 25, 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 6;
    text-align: center;
    padding: 24px;
}

.interstitial-overlay.hidden { display: none; }
.adblock-overlay { display: none; }
.adblock-overlay.visible { display: flex; }
.adblock-overlay p { margin: 0; }

.interstitial-countdown {
    font-size: 0.95rem;
    color: #9ca3af;
}

/* controls bar */
.custom-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    padding: 22px 16px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9) 70%);
}

.progress-track {
    position: relative;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: height 0.12s ease;
}
.progress-track:hover { height: 7px; }

.progress-buffer {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 3px;
}

.progress-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    background: var(--color-primario, #6366f1);
    border-radius: 3px;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    right: 0;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--color-primario, #6366f1);
    transform: translate(50%, -50%);
    opacity: 0;
    transition: opacity 0.12s ease;
    pointer-events: none;
}
.progress-track:hover .progress-thumb { opacity: 1; }

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.controls-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ctrl-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #f3f4f6;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}
.ctrl-icon-btn:hover { background: rgba(255, 255, 255, 0.12); }

.ctrl-skip {
    width: auto;
    padding: 0 8px;
    border-radius: 17px;
    font-size: 0.65rem;
    font-weight: 600;
}
.ctrl-skip span { margin-top: 1px; }

.ctrl-pill-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #f3f4f6;
    padding: 7px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background 0.15s ease;
}
.ctrl-pill-btn:hover { background: var(--color-primario, #6366f1); }

.volume-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.volume-range {
    width: 0;
    opacity: 0;
    accent-color: var(--color-primario, #6366f1);
    transition: width 0.18s ease, opacity 0.18s ease, margin 0.18s ease;
    cursor: pointer;
}
.volume-group:hover .volume-range,
.volume-range:focus {
    width: 72px;
    opacity: 1;
    margin-left: 2px;
}

.time-display {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 6px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.below-player {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #f3f4f6;
    padding: 9px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.15s ease;
}
.share-btn:hover { background: var(--color-primario, #6366f1); }

.recommendations { margin-top: 28px; }
.recommendations h2 { font-size: 1rem; color: #f3f4f6; margin-bottom: 12px; }

.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.rec-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: #e5e7eb;
    font-size: 0.85rem;
    transition: transform 0.15s ease;
}
.rec-card:not(.locked):hover { transform: translateY(-2px); }

.rec-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #111827;
}
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1f2937, #111827);
}

.rec-lock-icon {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(11, 15, 25, 0.65);
    color: #9ca3af;
}

.rec-card.locked { pointer-events: none; }
.rec-card.locked .rec-thumb { filter: grayscale(0.6) brightness(0.5); }
.rec-card.locked .rec-lock-icon { display: flex; }
.rec-card.locked .rec-title { color: #6b7280; }

.rec-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rec-hint { font-size: 0.75rem; color: #6b7280; margin-top: 12px; }

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #111827;
    color: #f3f4f6;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 50;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
    .reflection-text { font-size: 1.1rem; }

    .player-header { padding: 10px 14px; gap: 10px; }
    .player-logo { height: 26px; }
    .player-title { font-size: 0.85rem; padding-left: 10px; }

    .player-layout { padding: 10px 8px 28px; gap: 8px; }

    .custom-controls { padding: 16px 8px 8px; }

    .controls-row { flex-wrap: wrap; row-gap: 6px; }
    .time-display { order: 5; margin-left: 0; flex-basis: 100%; text-align: right; }

    .volume-group:hover .volume-range,
    .volume-range:focus { width: 50px; }

    .ctrl-icon-btn { width: 30px; height: 30px; }

    .rec-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
