/* ============================================================
   IVANN JUICE 45 — feedback emotionnel (toast/combo/streak)
   Sentinel (idempotence) : JUICE_V1
   ============================================================ */
/* JUICE_V1 */

.ivann-juice__container {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 340px;
}

@keyframes ivann-juice-in {
    0%   { transform: translateX(120%) scale(0.85); opacity: 0; }
    60%  { transform: translateX(-8%)  scale(1.05); opacity: 1; }
    100% { transform: translateX(0)    scale(1);    opacity: 1; }
}
@keyframes ivann-juice-out {
    to { transform: translateX(120%) scale(0.9); opacity: 0; }
}
@keyframes ivann-juice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.45); }
    50%      { box-shadow: 0 0 0 14px rgba(255, 215, 0, 0); }
}

.ivann-juice-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #f8fafc;
    font: 600 14px/1.3 system-ui, sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04);
    animation: ivann-juice-in 320ms cubic-bezier(.18,.89,.32,1.28) both;
    border-left: 4px solid #6366f1;
    min-width: 220px;
}
.ivann-juice-toast.is-leaving {
    animation: ivann-juice-out 240ms ease-in forwards;
}
.ivann-juice-toast__icon {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.ivann-juice-toast__icon svg { width: 22px; height: 22px; }
.ivann-juice-toast__body { flex: 1; min-width: 0; }
.ivann-juice-toast__title {
    font-size: 15px; font-weight: 800; letter-spacing: 0.2px;
    margin: 0 0 2px;
}
.ivann-juice-toast__sub {
    font-size: 12px; opacity: 0.75; font-weight: 500;
}

/* Variantes par couleur */
.ivann-juice-toast--xp {
    border-left-color: #facc15;
    background: linear-gradient(135deg, #422006 0%, #1f1207 100%);
}
.ivann-juice-toast--xp .ivann-juice-toast__icon { color: #fde047; }
.ivann-juice-toast--xp .ivann-juice-toast__title { color: #fde047; }

.ivann-juice-toast--combo {
    border-left-color: #f97316;
    background: linear-gradient(135deg, #431407 0%, #1c0a03 100%);
    animation: ivann-juice-in 320ms cubic-bezier(.18,.89,.32,1.28) both,
               ivann-juice-pulse 1.6s ease-out 320ms 2;
}
.ivann-juice-toast--combo .ivann-juice-toast__icon { color: #fb923c; }
.ivann-juice-toast--combo .ivann-juice-toast__title { color: #fb923c; }

.ivann-juice-toast--streak {
    border-left-color: #22d3ee;
    background: linear-gradient(135deg, #082f49 0%, #061726 100%);
}
.ivann-juice-toast--streak .ivann-juice-toast__icon { color: #67e8f9; }
.ivann-juice-toast--streak .ivann-juice-toast__title { color: #67e8f9; }

.ivann-juice-toast--levelup {
    border-left-color: #a78bfa;
    background: linear-gradient(135deg, #2e1065 0%, #150733 100%);
    animation: ivann-juice-in 320ms cubic-bezier(.18,.89,.32,1.28) both,
               ivann-juice-pulse 1.6s ease-out 320ms 3;
}
.ivann-juice-toast--levelup .ivann-juice-toast__icon { color: #c4b5fd; }
.ivann-juice-toast--levelup .ivann-juice-toast__title { color: #c4b5fd; }

/* Combo badge (inline, p.ex. dans la barre de progression) */
.ivann-combo-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #dc2626);
    color: #fff;
    font: 800 12px/1 system-ui, sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
    animation: ivann-juice-pulse 1.6s ease-out infinite;
}
.ivann-combo-badge[data-combo="0"],
.ivann-combo-badge[data-combo=""] { display: none; }

/* Combo HUD persistent (fixed top-center) — visible tant que le combo est vivant */
@keyframes ivann-combo-hud-in {
    0%   { transform: translateX(-50%) scale(0.4); opacity: 0; }
    60%  { transform: translateX(-50%) scale(1.15); opacity: 1; }
    100% { transform: translateX(-50%) scale(1);    opacity: 1; }
}
.ivann-combo-hud {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) scale(0.4);
    z-index: 99998;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #dc2626);
    color: #fff;
    font: 800 18px/1 system-ui, sans-serif;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.55), 0 0 0 1px rgba(255,255,255,0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms ease;
}
.ivann-combo-hud.is-active {
    opacity: 1;
    animation: ivann-combo-hud-in 380ms cubic-bezier(.18,.89,.32,1.28) both,
               ivann-juice-pulse 1.8s ease-out 380ms infinite;
}
.ivann-combo-hud__icon { display: inline-grid; place-items: center; }
.ivann-combo-hud__icon svg { width: 22px; height: 22px; }
.ivann-combo-hud__count { font-weight: 900; }
.ivann-combo-hud__bonus {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.9;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,0.18);
}
@media (max-width: 720px) {
    .ivann-combo-hud { top: 56px; padding: 8px 14px; font-size: 14px; }
    .ivann-combo-hud__bonus { display: none; }
}

/* ====== Variante CRITIQUE — gros toast doré shake ====== */
@keyframes ivann-crit-shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25%      { transform: translateX(-5px) rotate(-1.5deg); }
    75%      { transform: translateX(5px) rotate(1.5deg); }
}
.ivann-juice-toast--crit {
    border-left-color: #fbbf24;
    background: linear-gradient(135deg, #78350f 0%, #451a03 100%);
    box-shadow: 0 0 35px rgba(251, 191, 36, 0.55), 0 12px 32px rgba(0,0,0,0.5);
    animation: ivann-juice-in 320ms cubic-bezier(.18,.89,.32,1.28) both,
               ivann-crit-shake 110ms ease-in-out 320ms 5,
               ivann-juice-pulse 1.6s ease-out 880ms 3;
    transform-origin: center;
    min-width: 280px;
}
.ivann-juice-toast--crit .ivann-juice-toast__icon {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.18);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
}
.ivann-juice-toast--crit .ivann-juice-toast__title {
    color: #fde047;
    font-size: 18px;
    text-shadow: 0 0 6px rgba(253, 224, 71, 0.4);
}

/* ====== Daily quests panel (bas-gauche) ====== */
.ivann-daily-hud {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 99997;
    width: 260px;
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1f2937 0%, #0f172a 100%);
    color: #f8fafc;
    font: 500 13px/1.4 system-ui, sans-serif;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
}
.ivann-daily-hud__head {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 13px;
    margin: 0 0 10px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #67e8f9;
    cursor: pointer;
    user-select: none;
}
.ivann-daily-hud__head svg { width: 16px; height: 16px; }
/* Bouton replier/deplier */
.ivann-daily-hud__toggle {
    margin-left: auto;
    display: inline-flex; align-items: center;
    background: none; border: 0; padding: 0; cursor: pointer;
    color: #67e8f9;
    transition: transform 220ms ease;
}
.ivann-daily-hud__toggle svg { width: 15px; height: 15px; }
/* Etat replie : ne reste qu'une pastille compacte */
.ivann-daily-hud.is-collapsed { width: auto; max-width: 240px; padding: 11px 14px; }
.ivann-daily-hud.is-collapsed .ivann-daily-hud__head {
    margin: 0; padding: 0; border-bottom: 0;
}
.ivann-daily-hud.is-collapsed .ivann-daily-hud__goals,
.ivann-daily-hud.is-collapsed .ivann-daily-hud__claim { display: none; }
.ivann-daily-hud.is-collapsed .ivann-daily-hud__toggle { transform: rotate(180deg); }
.ivann-daily-hud__goal { margin-bottom: 8px; }
.ivann-daily-hud__goal:last-of-type { margin-bottom: 0; }
.ivann-daily-hud__goal-label {
    display: flex; justify-content: space-between;
    font-size: 12px; margin-bottom: 4px; opacity: 0.85;
}
.ivann-daily-hud__goal-label span { font-weight: 700; opacity: 1; color: #67e8f9; }
.ivann-daily-hud__goal.is-done .ivann-daily-hud__goal-label,
.ivann-daily-hud__goal.is-done .ivann-daily-hud__goal-label span { color: #4ade80; opacity: 1; }
.ivann-daily-hud__bar {
    height: 6px; background: rgba(255,255,255,0.08);
    border-radius: 999px; overflow: hidden;
}
.ivann-daily-hud__bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
    transition: width 350ms ease;
}
.ivann-daily-hud__goal.is-done .ivann-daily-hud__bar > span {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}
.ivann-daily-hud__claim {
    display: none; width: 100%;
    margin-top: 10px; padding: 8px 14px;
    border: none; border-radius: 8px; cursor: pointer;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff; font-weight: 800; font-size: 13px;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
    animation: ivann-juice-pulse 1.6s ease-out infinite;
    transition: transform 150ms;
}
.ivann-daily-hud__claim:hover { transform: scale(1.03); }
.ivann-daily-hud__claim:disabled {
    background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5);
    cursor: default; animation: none; box-shadow: none;
}
@media (max-width: 720px) {
    .ivann-daily-hud { width: calc(100vw - 32px); bottom: 8px; left: 8px; }
}

/* ====== Bouton mute son (bas-droite) ====== */
.ivann-mute-btn {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 99996;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border: none; border-radius: 50%;
    background: rgba(15, 23, 42, 0.85);
    color: #f8fafc;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 150ms;
}
.ivann-mute-btn:hover { transform: scale(1.1); }

/* Streak badge (header / profil) */
.ivann-streak-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0891b2, #0369a1);
    color: #ecfeff;
    font: 700 12px/1 system-ui, sans-serif;
    box-shadow: 0 4px 10px rgba(8, 145, 178, 0.35);
}
.ivann-streak-badge svg { width: 14px; height: 14px; }
