/* ============================================================
   TarotAI v19 · ORACULUM (supra-lectura) + VOX (narración)
   ============================================================ */

/* ── Bloque general ───────────────────────────────────── */
.or-block {
    margin: 24px 0;
    padding: 0;
}

.or-head {
    position: relative;
    text-align: center;
    padding: 20px 16px 18px;
    margin-bottom: 14px;
    background:
        radial-gradient(120% 100% at 50% 0%, rgba(124, 58, 237, .28), transparent 70%),
        linear-gradient(160deg, rgba(30, 20, 58, .92), rgba(18, 12, 36, .95));
    border: 1px solid rgba(212, 175, 55, .3);
    border-radius: 18px;
}

.or-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #150d2b;
    background: linear-gradient(135deg, #f6e08a, #d4af37);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.or-head h3 {
    font-family: Cinzel, Georgia, serif;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.or-sub {
    font-size: 12.5px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .72);
    margin: 0 auto;
    max-width: 42ch;
}

/* Botón de escucha */
.or-listen {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    min-height: 44px;
    padding: 11px 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #150d2b;
    background: linear-gradient(135deg, #f6e08a, #d4af37);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(212, 175, 55, .3);
    transition: transform .18s ease, box-shadow .18s ease;
}

.or-listen:hover { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(212, 175, 55, .42); }
.or-listen:active { transform: translateY(0); }

.or-listen.playing {
    background: linear-gradient(135deg, #fca5a5, #ef4444);
    color: #fff;
    animation: orPulse 1.6s ease-in-out infinite;
}

@keyframes orPulse {
    0%, 100% { box-shadow: 0 6px 18px rgba(239, 68, 68, .35); }
    50%      { box-shadow: 0 6px 26px rgba(239, 68, 68, .6); }
}

/* ── Veredicto ────────────────────────────────────────── */
.or-verdict {
    padding: 16px 18px;
    margin-bottom: 14px;
    border-radius: 16px;
    border-left: 4px solid #a78bfa;
    background: linear-gradient(135deg, rgba(124, 58, 237, .16), rgba(124, 58, 237, .05));
}

.or-v-good { border-left-color: #34d399; background: linear-gradient(135deg, rgba(16, 185, 129, .16), rgba(16, 185, 129, .04)); }
.or-v-hard { border-left-color: #f87171; background: linear-gradient(135deg, rgba(239, 68, 68, .16), rgba(239, 68, 68, .04)); }
.or-v-inner { border-left-color: #60a5fa; background: linear-gradient(135deg, rgba(59, 130, 246, .16), rgba(59, 130, 246, .04)); }

.or-verdict-tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
    margin-bottom: 6px;
}

.or-verdict-txt {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 600;
    color: #fff;
}

/* ── Tarjetas de sección ──────────────────────────────── */
.or-card {
    padding: 16px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 16px;
}

.or-card h4 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: Cinzel, Georgia, serif;
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
}

.or-ico { font-size: 18px; line-height: 1; }

.or-note {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .62);
    margin: 0 0 12px;
}

/* Voz del tarotista: texto largo, cómodo de leer */
.or-reader p {
    font-size: 13.5px;
    line-height: 1.75;
    color: rgba(255, 255, 255, .88);
    margin: 0 0 11px;
}

.or-reader p:last-child { margin-bottom: 0; }

.or-reader p:first-of-type::first-letter {
    font-family: Cinzel, Georgia, serif;
    font-size: 2.4em;
    font-weight: 700;
    float: left;
    line-height: .9;
    padding: 3px 8px 0 0;
    color: #d4af37;
}

/* ── Tablas ───────────────────────────────────────────── */
.or-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px 4px;
}

.or-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 12px;
}

.or-table-2 { min-width: 320px; }
.or-table-3 { min-width: 400px; }

.or-caption {
    caption-side: bottom;
    font-size: 11px;
    color: rgba(255, 255, 255, .5);
    text-align: left;
    padding-top: 8px;
}

.or-table thead th {
    text-align: left;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #d4af37;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(212, 175, 55, .3);
    white-space: nowrap;
}

.or-table tbody th,
.or-table tbody td {
    padding: 10px;
    vertical-align: top;
    line-height: 1.55;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .8);
    text-align: left;
    font-weight: 400;
}

.or-table tbody th {
    color: #fff;
    font-weight: 600;
    min-width: 118px;
}

.or-table tbody tr:last-child th,
.or-table tbody tr:last-child td { border-bottom: none; }

.or-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .022); }

.or-t-ico { font-size: 15px; margin-right: 5px; display: inline-block; }
.or-t-ico.rev { transform: rotate(180deg); }
.or-t-name { display: inline; }

.or-t-rev {
    display: inline-block;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #fca5a5;
    background: rgba(239, 68, 68, .16);
    padding: 2px 6px;
    border-radius: 5px;
    margin-left: 4px;
}

.or-table tbody th small {
    display: block;
    font-size: 10.5px;
    font-weight: 400;
    color: rgba(255, 255, 255, .5);
    margin-top: 3px;
}

.or-t-step { color: #fde68a !important; }
.or-num { font-variant-numeric: tabular-nums; color: #fff !important; font-weight: 600; }

.or-example-foot {
    font-size: 11.5px;
    line-height: 1.55;
    font-style: italic;
    color: rgba(255, 255, 255, .55);
    margin: 10px 0 0;
}

/* ── Figuras ──────────────────────────────────────────── */
.or-fig { margin: 0 0 10px; padding: 0; }

.or-fig-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
}

.or-fig-half { margin: 0; }

/* Altura explícita: con width:100% los navegadores ignoran max-height en SVG */
.or-arc {
    height: min(26vh, 150px);
    width: 100%;
    display: block;
}

.or-donut {
    height: min(18vh, 122px);
    width: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.or-arc-grid { stroke: rgba(255, 255, 255, .09); stroke-width: 1; }
.or-arc-line { fill: none; stroke: #a78bfa; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }

.or-arc-lbl {
    font-size: 9px;
    fill: rgba(255, 255, 255, .55);
    text-anchor: middle;
}

.or-donut-n {
    font-size: 20px;
    font-weight: 700;
    fill: #fff;
    text-anchor: middle;
}

.or-donut-t {
    font-size: 8.5px;
    fill: rgba(255, 255, 255, .55);
    text-anchor: middle;
}

.or-figcap {
    font-size: 11px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .58);
    margin-top: 8px;
    text-align: center;
}

.or-key {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 6px 3px 0;
    font-size: 10.5px;
    color: rgba(255, 255, 255, .72);
}

.or-key i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

/* Barras de composición */
.or-bars { display: flex; flex-direction: column; gap: 9px; padding: 6px 0; }

.or-bar-row { display: flex; align-items: center; gap: 8px; }

.or-bar-lbl {
    flex: 0 0 auto;
    width: 78px;
    font-size: 10.5px;
    color: rgba(255, 255, 255, .72);
}

.or-bar-track {
    flex: 1 1 auto;
    height: 8px;
    background: rgba(255, 255, 255, .08);
    border-radius: 999px;
    overflow: hidden;
}

.or-bar-track i {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width .6s cubic-bezier(.2, .8, .2, 1);
}

.or-bar-val {
    flex: 0 0 auto;
    width: 34px;
    text-align: right;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

/* ── El hilo de la historia ───────────────────────────── */
.or-beats { list-style: none; margin: 0; padding: 0; }

.or-beat {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.or-beat:last-child { border-bottom: none; }

.or-beat-tag {
    flex: 0 0 auto;
    width: 74px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #d4af37;
    padding-top: 4px;
}

.or-beat-ico { flex: 0 0 auto; font-size: 22px; line-height: 1; }

.or-beat strong { display: block; font-size: 13px; color: #fff; }

.or-beat small {
    display: block;
    font-size: 10.5px;
    color: rgba(255, 255, 255, .5);
    margin-bottom: 5px;
}

.or-beat p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .8);
}

/* ── Listas ───────────────────────────────────────────── */
.or-list { margin: 0; padding-left: 20px; }

.or-list li {
    font-size: 12.5px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .82);
    margin-bottom: 9px;
}

.or-list li:last-child { margin-bottom: 0; }

.or-list-num { padding-left: 22px; }
.or-list-num li { color: #fff; font-weight: 500; }

.or-honesty {
    border-color: rgba(96, 165, 250, .3);
    background: linear-gradient(135deg, rgba(59, 130, 246, .08), rgba(255, 255, 255, .02));
}

.or-ask {
    border-color: rgba(212, 175, 55, .3);
    background: linear-gradient(135deg, rgba(212, 175, 55, .08), rgba(255, 255, 255, .02));
}

/* ── Glosario ─────────────────────────────────────────── */
.or-gloss {
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    padding: 0 14px;
}

.or-gloss summary {
    cursor: pointer;
    padding: 14px 0;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.or-gloss[open] summary { border-bottom: 1px solid rgba(255, 255, 255, .09); margin-bottom: 8px; }
.or-gloss > .or-scroll { padding-bottom: 14px; }

/* ============================================================
   VOX — Barra de narración
   ============================================================ */
.vox-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(28, 18, 54, .97), rgba(18, 12, 36, .97));
    border: 1px solid rgba(212, 175, 55, .34);
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .55);
    backdrop-filter: blur(12px);
    animation: voxIn .28s cubic-bezier(.2, .9, .2, 1);
}

@keyframes voxIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Onda: indica que hay una voz hablando ahora mismo */
.vox-wave {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
}

.vox-wave i {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, #f6e08a, #d4af37);
    animation: voxWave 1s ease-in-out infinite;
}

.vox-wave i:nth-child(1) { height: 40%; animation-delay: 0s; }
.vox-wave i:nth-child(2) { height: 75%; animation-delay: .12s; }
.vox-wave i:nth-child(3) { height: 100%; animation-delay: .24s; }
.vox-wave i:nth-child(4) { height: 65%; animation-delay: .36s; }
.vox-wave i:nth-child(5) { height: 35%; animation-delay: .48s; }

@keyframes voxWave {
    0%, 100% { transform: scaleY(.35); opacity: .6; }
    50%      { transform: scaleY(1);   opacity: 1; }
}

.vox-bar.paused .vox-wave i { animation-play-state: paused; opacity: .35; }

/* Subtítulo: leer lo que se está oyendo (accesibilidad real) */
.vox-sub {
    flex: 1 1 auto;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .9);
    max-height: 3.1em;
    overflow: hidden;
}

.vox-ctrl { flex: 0 0 auto; display: flex; gap: 6px; }

.vox-ctrl button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    font-size: 14px;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.vox-ctrl button:hover { background: rgba(255, 255, 255, .18); transform: translateY(-1px); }
.vox-ctrl button:active { transform: translateY(0); }

/* ── Adaptaciones ─────────────────────────────────────── */
@media (max-width: 480px) {
    .or-head h3 { font-size: 15.5px; }
    .or-fig-grid { grid-template-columns: 1fr; }
    .or-beat-tag { width: 64px; }
    .vox-sub { font-size: 11.5px; max-height: 2.9em; }

    /* En móvil una tabla de 4 columnas obliga a scroll horizontal y recorta
       el texto. Se convierte en fichas apiladas: cada celda lleva su propia
       etiqueta (data-label), así se sigue leyendo qué significa cada dato
       sin perder la semántica de <table> para lectores de pantalla. */
    .or-scroll { overflow-x: visible; margin: 0; padding: 0; }

    .or-table,
    .or-table-2,
    .or-table-3 { min-width: 0; width: 100%; display: block; }

    .or-table thead { display: none; }
    .or-table tbody { display: block; }

    .or-table tbody tr {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, .1);
    }

    .or-table tbody tr:last-child { border-bottom: none; }
    .or-table tbody tr:nth-child(even) { background: none; }

    .or-table tbody th,
    .or-table tbody td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 0;
        border: none;
        overflow-wrap: break-word;
    }

    .or-table tbody th {
        font-size: 13px;
        margin-bottom: 7px;
        padding-bottom: 6px;
        border-bottom: 1px solid rgba(212, 175, 55, .22);
    }

    .or-table tbody td { margin-bottom: 9px; }
    .or-table tbody td:last-child { margin-bottom: 0; }

    /* La etiqueta de la columna, ahora encima del dato */
    .or-table tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 9.5px;
        font-weight: 800;
        letter-spacing: .07em;
        text-transform: uppercase;
        color: #d4af37;
        margin-bottom: 2px;
    }

    .or-caption { padding-top: 10px; }
}

@media (max-width: 380px) {
    .or-beat { flex-wrap: wrap; }
    .or-beat-tag { width: 100%; padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .or-listen, .or-bar-track i, .vox-bar { transition: none; animation: none; }
    .or-listen.playing { animation: none; }
    .vox-wave i { animation: none; height: 70%; }
}

@media (prefers-contrast: more) {
    .or-card, .or-gloss { border-color: rgba(255, 255, 255, .4); }
    .or-note, .or-figcap { color: rgba(255, 255, 255, .85); }
}
