/* ═══════════════════════════════════════════════════════════════════════════
   Holistic Rewards — zn-holistic-rewards.css
   Phase 3 update: full color system, voucher cards, manifesto, next-rank
   teaser, enriched cards (meaning + pills), updated empty state.
   Phase 4 adds Oracle overlay rules at the bottom.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Wrap ─────────────────────────────────────────────────────────────────── */
.zn-hr-wrap {
    padding: 0 0 32px;
}

/* ── Section header ──────────────────────────────────────────────────────── */
.zn-hr-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0 12px;
    border-bottom: 1.5px solid #f1f5f9;
    margin-bottom: 16px;
}
.zn-hr-head-icon {
    font-size: 22px;
    line-height: 1;
}
.zn-hr-head-title {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}
.zn-hr-head-sub {
    font-size: 11px;
    color: #94a3b8;
    margin: 1px 0 0;
}

/* ── UBL Manifesto block ─────────────────────────────────────────────────── */
.zn-hr-manifesto {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 16px;
    padding: 20px 20px 22px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}
.zn-hr-manifesto::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.25) 0%, transparent 70%);
    pointer-events: none;
}
.zn-hr-manifesto-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #818cf8;
    margin-bottom: 10px;
}
.zn-hr-manifesto-headline {
    font-size: 18px;
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1.35;
    margin-bottom: 12px;
    letter-spacing: -0.2px;
}
.zn-hr-manifesto-headline em {
    font-style: italic;
    color: #818cf8;
}
.zn-hr-manifesto-body {
    font-size: 12px;
    line-height: 1.7;
    color: #94a3b8;
    margin: 0 0 16px;
}
.zn-hr-manifesto-trigger-label {
    font-size: 11px;
    font-weight: 700;
    color: #818cf8;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}
.zn-hr-manifesto-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.zn-hr-manifesto-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 11.5px;
    color: #cbd5e1;
    line-height: 1.5;
}
.zn-hr-manifesto-step-num {
    flex-shrink: 0;
    background: #6366f1;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

/* ── Grid section heading ────────────────────────────────────────────────── */
.zn-hr-grid-heading {
    margin-bottom: 14px;
}
.zn-hr-grid-heading-title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}
.zn-hr-grid-heading-sub {
    font-size: 12px;
    color: #64748b;
    line-height: 1.55;
}

/* ── Six area cards grid ─────────────────────────────────────────────────── */
.zn-hr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 540px) {
    .zn-hr-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Individual card ─────────────────────────────────────────────────────────── */
.zn-hr-card {
    background: var(--zn-hr-bg, #f8fafc);
    border: 1.5px solid var(--zn-hr-border, #e2e8f0);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s, opacity 0.18s;
}
.zn-hr-card:hover {
    border-color: var(--zn-hr-glow, #6366f1);
    box-shadow: 0 2px 14px color-mix(in srgb, var(--zn-hr-glow, #6366f1) 18%, transparent);
    transform: translateY(-1px);
}
.zn-hr-card--unlocked {
    border-color: var(--zn-hr-border, #e2e8f0);
}
.zn-hr-card--unlocked.zn-hr-card--open {
    border-width: 2px;
    border-color: var(--zn-hr-glow, #6366f1);
    box-shadow: 0 3px 18px color-mix(in srgb, var(--zn-hr-glow, #6366f1) 20%, transparent);
}
.zn-hr-card--locked {
    opacity: 0.78;
    cursor: pointer;
}
.zn-hr-card--locked:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.zn-hr-card--expired {
    opacity: 0.70;
}

/* Card header row */
.zn-hr-card-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 13px 8px;
    user-select: none;
}
.zn-hr-card-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}
.zn-hr-card-info {
    flex: 1;
    min-width: 0;
}
.zn-hr-card-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--zn-hr-txt, #1e293b);
    display: block;
    margin-bottom: 2px;
}
.zn-hr-card-meaning {
    font-size: 9.5px;
    color: var(--zn-hr-txt, #64748b);
    opacity: 0.65;
    line-height: 1.4;
    display: block;
}
.zn-hr-card--unlocked .zn-hr-card-meaning {
    color: var(--zn-hr-txt, #94a3b8);
    opacity: 0.75;
}
.zn-hr-card-status {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}
.zn-hr-card-status--unlocked {
    background: #dcfce7;
    color: #15803d;
}
.zn-hr-card-status--locked {
    background: #f1f5f9;
    color: #94a3b8;
}
.zn-hr-card-status--expired {
    background: #fef2f2;
    color: #dc2626;
}
.zn-hr-card-chevron {
    font-size: 11px;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: transform 0.2s;
    margin-top: 3px;
}
.zn-hr-card--open .zn-hr-card-chevron {
    transform: rotate(180deg);
}

/* Example reward items — bordered boxes matching old design */
.zn-hr-card-pills {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 12px 12px;
}
.zn-hr-card-pill {
    font-size: 10px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.7);
    color: var(--zn-hr-txt, #64748b);
    border: 1px solid var(--zn-hr-border, #e2e8f0);
    text-align: left;
    line-height: 1.3;
}

/* Card body */
.zn-hr-card-body {
    display: none;
    border-top: 1px solid #f1f5f9;
    animation: znHrSlideIn 0.18s ease;
}
.zn-hr-card--open .zn-hr-card-body {
    display: block;
}
@keyframes znHrSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Voucher card ────────────────────────────────────────────────────────── */
.zn-hr-voucher {
    position: relative;
    overflow: hidden;
}
.zn-hr-voucher--expired {
    filter: grayscale(0.5);
    opacity: 0.8;
}

/* Colored top strip (4px gradient per category) */
.zn-hr-voucher-strip {
    height: 4px;
    background: linear-gradient(90deg, var(--zn-hr-glow, #6366f1), var(--zn-hr-border, #a5b4fc));
}

.zn-hr-voucher-content {
    padding: 12px 14px 14px;
}

.zn-hr-voucher-cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--zn-hr-txt, #64748b);
}
.zn-hr-voucher-status-badge {
    font-size: 8px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}
.zn-hr-vsb--active {
    background: #dcfce7;
    color: #15803d;
}
.zn-hr-vsb--expired {
    background: #fee2e2;
    color: #dc2626;
}

.zn-hr-voucher-partner {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 4px;
}
.zn-hr-voucher-desc {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 12px;
}

/* Ticket dashed divider with punch circles */
.zn-hr-voucher-divider {
    position: relative;
    border-top: 1.5px dashed #e2e8f0;
    margin: 0 -14px 12px;
}
.zn-hr-voucher-punch {
    position: absolute;
    top: -7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
}
.zn-hr-voucher-punch--left  { left: -7px; }
.zn-hr-voucher-punch--right { right: -7px; }

/* Dark terminal code box */
.zn-hr-codebox {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 10px;
}
.zn-hr-codebox-label {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #475569;
    text-transform: uppercase;
    flex-shrink: 0;
}
.zn-hr-codebox-code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    flex: 1;
    word-break: break-all;
}
.zn-copy-code {
    background: var(--zn-hr-glow, #6366f1);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.zn-copy-code:hover {
    opacity: 0.85;
}

.zn-hr-codebox-instr {
    font-size: 10px;
    color: #64748b;
    line-height: 1.5;
    border-left: 3px solid var(--zn-hr-glow, #22c55e);
    padding-left: 8px;
    margin-bottom: 10px;
    background: #f0fdf4;
    padding: 6px 8px;
    border-radius: 0 6px 6px 0;
}

/* Voucher footer */
.zn-hr-voucher-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 9px;
    color: #94a3b8;
    margin-top: 10px;
}
.zn-hr-voucher-rank-tag {
    margin-left: auto;
    background: #1e293b;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Voucher entry animation — stagger per nth-child */
.zn-hr-card:nth-child(1) { animation: znHrCardIn 0.3s ease 0.00s both; }
.zn-hr-card:nth-child(2) { animation: znHrCardIn 0.3s ease 0.06s both; }
.zn-hr-card:nth-child(3) { animation: znHrCardIn 0.3s ease 0.12s both; }
.zn-hr-card:nth-child(4) { animation: znHrCardIn 0.3s ease 0.18s both; }
.zn-hr-card:nth-child(5) { animation: znHrCardIn 0.3s ease 0.24s both; }
.zn-hr-card:nth-child(6) { animation: znHrCardIn 0.3s ease 0.30s both; }
@keyframes znHrCardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Next rank teaser ────────────────────────────────────────────────────── */
.zn-hr-teaser {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
}
@media (max-width: 480px) {
    .zn-hr-teaser {
        grid-template-columns: 1fr;
    }
}
.zn-hr-teaser-eyebrow {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 4px;
}
.zn-hr-teaser-rank {
    font-size: 16px;
    font-weight: 900;
    color: #1e293b;
    text-transform: capitalize;
    margin-bottom: 6px;
}
.zn-hr-teaser-dist {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
}
.zn-hr-teaser-bar-wrap {
    background: #e2e8f0;
    border-radius: 6px;
    height: 6px;
    margin-bottom: 4px;
    overflow: hidden;
}
.zn-hr-teaser-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 6px;
    transition: width 0.6s ease;
}
.zn-hr-teaser-pct {
    font-size: 10px;
    color: #94a3b8;
}
.zn-hr-teaser-areas-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.zn-hr-teaser-area-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 11px;
    color: #475569;
}
.zn-hr-teaser-area-icon {
    font-size: 14px;
}
.zn-hr-teaser-area-name {
    font-weight: 600;
}
.zn-hr-teaser-area-ex {
    color: #94a3b8;
    font-size: 10px;
}

/* ── Rank achievement block ──────────────────────────────────────────────── */
.zn-hr-rank-block {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1.5px solid #86efac;
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 4px;
}
.zn-hr-rank-block--empty {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.zn-hr-rank-block-label {
    font-size: 10px;
    font-weight: 700;
    color: #166534;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}
.zn-hr-rank-block--empty .zn-hr-rank-block-label {
    color: #94a3b8;
}
.zn-hr-rank-block-title {
    font-size: 14px;
    font-weight: 800;
    color: #15803d;
    margin: 0 0 10px;
}
.zn-hr-rank-block--empty .zn-hr-rank-block-title {
    color: #475569;
}
.zn-hr-rank-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.zn-hr-rank-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 3px 9px 3px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #166534;
}
.zn-hr-rank-date {
    font-size: 10px;
    color: #86efac;
    margin: 0;
}
.zn-hr-rank-block--empty .zn-hr-rank-date {
    color: #94a3b8;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.zn-hr-empty {
    text-align: center;
    padding: 28px 16px 20px;
    border: 1.5px dashed #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    margin-bottom: 20px;
}
.zn-hr-empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
    animation: znHrGiftPulse 2.4s ease-in-out infinite;
}
@keyframes znHrGiftPulse {
    0%,100% { transform: scale(1) rotate(0deg); }
    30%      { transform: scale(1.08) rotate(-3deg); }
    60%      { transform: scale(1.04) rotate(2deg); }
}
.zn-hr-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
}
.zn-hr-empty-sub {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 4 — Life Oracle Overlay
   ═══════════════════════════════════════════════════════════════════════════ */

#zn-oracle-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
}
#zn-oracle-overlay.zn-oracle--active {
    pointer-events: auto;
    opacity: 1;
}

/* Backdrop */
#zn-oracle-backdrop {
    position: absolute;
    inset: 0;
    background: var(--oracle-dark, #0f172a);
    opacity: 0;
    transition: opacity 0.65s ease;
}
.zn-oracle--active #zn-oracle-backdrop {
    opacity: 0.96;
}

/* Cosmic particle field */
#zn-oracle-cosmos {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.zn-oracle-star {
    position: absolute;
    border-radius: 50%;
    background: var(--oracle-glow, #6366f1);
    opacity: 0;
    animation: znOracleTwinkle 3s ease-in-out infinite;
}
@keyframes znOracleTwinkle {
    0%,100% { opacity: 0; transform: scale(0.5); }
    50%     { opacity: 0.7; transform: scale(1); }
}

/* Glow ring behind emoji */
#zn-oracle-glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--oracle-glow, #6366f1) 0%, transparent 70%);
    opacity: 0.18;
    filter: blur(20px);
    pointer-events: none;
}

/* Main panel */
#zn-oracle-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f172a;
    border-radius: 28px 28px 0 0;
    padding: 16px 28px 40px;
    text-align: center;
    transform: translateY(110vh);
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.zn-oracle--active #zn-oracle-panel {
    transform: translateY(0);
}
.zn-oracle--dismissing #zn-oracle-panel {
    transform: translateY(110vh);
    transition: transform 0.45s ease-in;
}
.zn-oracle--dismissing #zn-oracle-backdrop {
    opacity: 0;
    transition: opacity 0.35s ease;
}

/* Swipe handle */
#zn-oracle-dismiss-bar {
    width: 40px;
    height: 4px;
    background: #334155;
    border-radius: 4px;
    margin: 0 auto 20px;
}

/* Area label */
#zn-oracle-area-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--oracle-glow, #6366f1);
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease 0.9s, transform 0.4s ease 0.9s;
}
.zn-oracle--active #zn-oracle-area-label {
    opacity: 1;
    transform: translateY(0);
}

/* Emoji */
#zn-oracle-emoji {
    font-size: 52px;
    display: block;
    margin-bottom: 16px;
    opacity: 0;
    transform: scale(0.4) rotate(-15deg);
    transition: opacity 0.35s ease 0.7s, transform 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.7s;
    filter: drop-shadow(0 0 12px var(--oracle-glow, #6366f1));
}
.zn-oracle--active #zn-oracle-emoji {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    animation: znOracleBreath 4s ease-in-out 1.4s infinite;
}
@keyframes znOracleBreath {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.06); }
}

/* Loading dots */
#zn-oracle-loading {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
    height: 14px;
}
#zn-oracle-loading span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--oracle-glow, #6366f1);
    animation: znOracleDot 0.9s ease-in-out infinite;
}
#zn-oracle-loading span:nth-child(2) { animation-delay: 0.15s; }
#zn-oracle-loading span:nth-child(3) { animation-delay: 0.30s; }
@keyframes znOracleDot {
    0%,80%,100% { transform: scale(0.6); opacity: 0.4; }
    40%         { transform: scale(1);   opacity: 1; }
}

/* Sentence */
#zn-oracle-sentence {
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.6;
    min-height: 58px;
    letter-spacing: 0.2px;
}
.zn-oracle-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    margin-right: 4px;
}
.zn-oracle-word--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Divider */
#zn-oracle-divider {
    width: 0;
    height: 1.5px;
    background: var(--oracle-glow, #6366f1);
    margin: 20px auto;
    transition: width 0.5s ease 1.2s;
    opacity: 0.5;
}
.zn-oracle--active #zn-oracle-divider {
    width: 70px;
}

/* Close hint */
#zn-oracle-close-hint {
    font-size: 11px;
    color: #475569;
    opacity: 0;
    transition: opacity 0.5s ease;
    margin-top: 8px;
}

/* Lock badge — shown only for locked area taps */
#zn-oracle-lock-badge {
    font-size: 11px;
    color: #64748b;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 4px 14px;
    display: inline-block;
    margin-bottom: 14px;
    letter-spacing: 0.2px;
}
