/* Mario PC: modo claro y switch de tema (compartido por todas las páginas) */

html[data-theme="light"] {
    --bg: #f4f6f5;
    --bg-alt: #e9eeeb;
    --white: #0d1210;
    --muted: #4f5a56;
    --green: #087035;
    --green-dim: rgba(8, 112, 53, 0.08);
    --green-border: rgba(8, 112, 53, 0.28);
    --bg-rgb: 244, 246, 245;
    --ink-rgb: 13, 18, 16;
    --green-rgb: 8, 112, 53;
    --white-rgb: 13, 18, 16;
    --red: #b42318;
    --cert-head: #d9e0dc;
    color-scheme: light;
}

html[data-theme="light"] .grain {
    opacity: 0.06;
}

/* Botón del switch */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--green-border);
    border-radius: 2px;
    background: transparent;
    color: var(--green);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    background: var(--green-dim);
    border-color: var(--green);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.theme-toggle--float {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 300;
    background: rgba(var(--bg-rgb), 0.85);
}

/* Destello */
.theme-flash {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #fff;
    opacity: 0;
    pointer-events: none;
}

/* Aviso */
.theme-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 100001;
    transform: translate(-50%, 12px);
    padding: 10px 18px;
    border: 1px solid var(--green-border);
    border-radius: 2px;
    background: var(--bg-alt);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.theme-toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}

html.theme-instant,
html.theme-instant *,
html.theme-instant *::before,
html.theme-instant *::after {
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .theme-toast { transition: none; }
}

html[data-theme="light"] img[src*="mercadopago-logo"] {
    filter: brightness(0);
    opacity: 0.85;
}

/* Ventanas que siempre van en oscuro (consola y video): recuperan la paleta oscura */
html[data-theme="light"] .egg-term,
html[data-theme="light"] .rickroll-overlay {
    --bg: #07090a;
    --bg-alt: #0c0f10;
    --white: #e8edea;
    --muted: #788480;
    --green: #1ddd65;
    --green-dim: rgba(29, 221, 101, 0.1);
    --green-border: rgba(29, 221, 101, 0.22);
    --bg-rgb: 7, 9, 10;
    --ink-rgb: 255, 255, 255;
    --green-rgb: 29, 221, 101;
    --white-rgb: 232, 237, 234;
    --red: #ff9a9a;
    color-scheme: dark;
    color: var(--white);
}
