/* --- 1. VARIABILI & RESET --- */
:root {
    --bg: #0f0f13;
    --card-bg: rgba(30, 30, 35, 0.7);
    --primary: #7047eb;
    --accent-bad: #ff4757;
    --accent-mid: #ffa502;
    --accent-good: #2ed573;
    --text: #ffffff;
    --text-muted: #888888;
    --gold: #d4af37;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    padding-top: env(safe-area-inset-top, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Z-INDEX LAYERS --- */
#confetti-canvas {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9000;
}

.card {
    position: relative;
    z-index: 500;
}

.insights-overlay {
    z-index: 3000;
}

#appLoader {
    z-index: 5000;
}

/* --- LOADER --- */
#appLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

#appLoader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-svg {
    width: 50px;
    height: 50px;
    animation: rotate 2s linear infinite;
}

.loader-circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-dasharray: 80, 200;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

.loader-text {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    animation: pulse 1.5s infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 200;
    }

    50% {
        stroke-dasharray: 90, 200;
        stroke-dashoffset: -35px;
    }

    100% {
        stroke-dasharray: 90, 200;
        stroke-dashoffset: -124px;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- UI ELEMENTS --- */
h1.app-title {
    margin: 10px 0 20px 0;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    animation: slideUpFade 0.6s ease backwards;
    position: relative;
    z-index: 500;
}

h2 {
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 25px;
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.user-tabs {
    z-index: 500;
    position: relative;
    animation-delay: 0.1s;
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 380px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: 0.3s;
}

.tab.active {
    background: #2d2d35;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* --- SLIDER --- */
.mood-slider-wrapper {
    width: 100%;
    padding: 10px 0 10px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 35px;
    height: 80px;
}

#scoreVal {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
    transition: color 0.2s ease;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.score-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.score-icon-container svg {
    width: 32px;
    height: 32px;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pop-anim svg {
    animation: iconPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes iconPop {
    0% {
        transform: scale(0.5) rotate(-20deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    height: 40px;
    cursor: pointer;
    margin: 0;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background: linear-gradient(90deg, #d63031 0%, #e17055 25%, #fdcb6e 50%, #00b894 75%, #a29bfe 100%);
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 28px;
    width: 28px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--thumb-color, #fff);
    margin-top: -10px;
    box-shadow: 0 0 20px var(--thumb-color, rgba(255, 255, 255, 0.2));
    transition: transform 0.1s, border-color 0.2s, box-shadow 0.2s;
}

input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.3);
    background: var(--thumb-color, #fff);
}

/* --- BUTTONS --- */
.save-btn {
    background: white;
    color: black;
    border: none;
    width: 100%;
    padding: 18px;
    border-radius: 18px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-top: 30px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, opacity 0.2s;
}

.save-btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.mood-wrapper.locked .save-btn {
    background: #333;
    color: #555;
    pointer-events: none;
    box-shadow: none;
}

.mood-wrapper.locked input[type=range] {
    opacity: 0.3;
    pointer-events: none;
}

.mood-wrapper.locked .goal-chip {
    opacity: 0.5;
    pointer-events: none;
}

.mood-wrapper.locked .goal-chip.active {
    opacity: 1;
    border-color: var(--primary);
}

.delete-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent-bad);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: 0.2s;
    z-index: 10;
}

.delete-btn:hover {
    background: var(--accent-bad);
    color: white;
}

.mood-wrapper.locked .delete-btn {
    display: flex;
}

.status-msg {
    text-align: center;
    margin-top: 15px;
    font-size: 0.8rem;
    height: 1rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* --- GOALS --- */
.goals-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    margin-bottom: 10px;
}

.goal-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.goal-chip svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    transition: stroke 0.2s;
}

.goal-chip span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.goal-chip.active {
    background: rgba(112, 71, 235, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(112, 71, 235, 0.2);
    transform: scale(1.02);
}

.goal-chip.active svg {
    stroke: #fff;
}

.goal-chip.active span {
    color: #fff;
    font-weight: 600;
}

.goal-chip:active {
    transform: scale(0.95);
}

.goals-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    text-align: center;
    opacity: 0.6;
}

/* --- CALENDAR & STATS --- */
.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day-cell {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #444;
    position: relative;
    cursor: default;
    transition: 0.2s;
}

.day-cell.today {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-row:last-child {
    border-bottom: none;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.stat-user {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.stat-bar-track {
    width: 100%;
    max-width: 120px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-score-display {
    font-size: 1.4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    margin-left: 20px;
    text-align: right;
}

.stat-score-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: right;
    margin-top: -2px;
    opacity: 0.5;
    font-weight: 600;
}

/* --- INSIGHTS --- */
.insights-btn {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    background: rgba(112, 71, 235, 0.15);
    border: 1px solid rgba(112, 71, 235, 0.3);
    border-radius: 16px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
    font-size: 0.9rem;
}

.insights-btn:hover {
    background: var(--primary);
    color: white;
}

.insights-icon {
    width: 18px;
    height: 18px;
}

/* --- MODALS --- */
.insights-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.insights-overlay.open {
    display: flex;
    opacity: 1;
}

.insights-modal {
    background: #16161c;
    width: 100%;
    max-width: 500px;
    border-radius: 30px 30px 0 0;
    padding: 30px;
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.6);
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.insights-overlay.open .insights-modal {
    transform: translateY(0);
}

@media (min-width: 500px) {
    .insights-overlay {
        align-items: center;
    }

    .insights-modal {
        border-radius: 30px;
        max-height: 90vh;
    }
}

.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 30px;
}

.metric-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 18px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-val {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.streak-val {
    color: var(--accent-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 30px 0 15px 0;
    letter-spacing: 1.5px;
    font-weight: 700;
}

canvas {
    max-width: 100%;
}

.team-compare-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.team-val {
    font-size: 1.5rem;
    font-weight: 700;
}

.team-diff {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
}

.diff-pos {
    background: rgba(46, 213, 115, 0.15);
    color: var(--accent-good);
}

.diff-neg {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-bad);
}

.diff-neu {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.dist-bar-container {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    margin-top: 15px;
}

.dist-segment {
    height: 100%;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.dist-bad {
    background: var(--accent-bad);
}

.dist-mid {
    background: var(--accent-mid);
}

.dist-good {
    background: var(--accent-good);
}

.pattern-item {
    background: rgba(112, 71, 235, 0.1);
    border-left: 3px solid var(--primary);
    padding: 12px 15px;
    border-radius: 0 10px 10px 0;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* --- THE PACT (Ridesignato) --- */
.pact-box {
    background: var(--card-bg);
    /* Usa lo sfondo vetro come le altre card */
    backdrop-filter: blur(10px);
    /* Aggiunto backdrop-filter per coerenza */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(112, 71, 235, 0.3);
    /* Bordo viola neon sottile */
    border-radius: 24px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    /* Ombra coerente */
    margin-top: 40px;
    margin-bottom: 20px;
    position: relative;
    /* Necessario per l'effetto luce superiore */
}

/* Effetto luce superiore */
.pact-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.8;
}

.pact-header {
    background: rgba(112, 71, 235, 0.1);
    /* Viola leggerissimo */
    color: var(--primary);
    padding: 15px 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 1px solid rgba(112, 71, 235, 0.1);
}

.pact-content {
    padding: 20px 25px;
}

.pact-rule {
    font-size: 0.85rem;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-family: -apple-system, sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 10px;
    text-align: left;
}

.pact-rule svg {
    width: 18px;
    height: 18px;
    color: var(--accent-mid);
    /* Arancione per le icone */
    flex-shrink: 0;
    opacity: 0.9;
}

.pact-rule strong {
    color: #fff;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-left: auto;
    /* Spinge a destra */
}

.pact-rule:last-child {
    margin-bottom: 0;
}

.pact-footer {
    font-size: 0.65rem;
    color: var(--text-muted);
    padding-bottom: 15px;
    padding-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.6;
}

/* --- DAY RECAP --- */
.day-recap-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.recap-user-row {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.recap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.recap-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recap-mood-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #000;
}

.recap-goals {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-goal-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(112, 71, 235, 0.1);
    border: 1px solid rgba(112, 71, 235, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #ddd;
}

.mini-goal-chip svg {
    width: 14px;
    height: 14px;
    stroke: var(--primary);
}

/* --- REACTION BUTTONS --- */
.reaction-bar {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.react-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.react-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2px;
    transition: 0.2s;
}

.react-btn:active {
    transform: scale(0.9);
}

.react-btn.active-heart {
    background: rgba(255, 71, 87, 0.15);
    border-color: rgba(255, 71, 87, 0.5);
    color: #ff4757;
}

.react-btn.active-heart svg {
    fill: #ff4757;
    stroke: none;
}

.react-btn.active-fire {
    background: rgba(255, 165, 2, 0.15);
    border-color: rgba(255, 165, 2, 0.5);
    color: #ffa502;
}

.react-btn.active-fire svg {
    fill: #ffa502;
    stroke: none;
}

.react-btn.active-bolt {
    background: rgba(112, 71, 235, 0.15);
    border-color: rgba(112, 71, 235, 0.5);
    color: #a29bfe;
}

.react-btn.active-bolt svg {
    fill: #a29bfe;
    stroke: none;
}

/* --- SKELETON --- */
@keyframes shimmer {
    0% {
        background-position: -400px 0;
    }

    100% {
        background-position: 400px 0;
    }
}

.skeleton {
    background: #1e1e24;
    background-image: linear-gradient(to right, #1e1e24 0%, #2d2d35 20%, #1e1e24 40%, #1e1e24 100%);
    background-repeat: no-repeat;
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear forwards;
    border-radius: 4px;
}

/* --- TOAST NOTIFICATIONS --- */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 99999999;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

.toast-message {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

/* --- COUNTDOWN TIMER --- */
.countdown-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--accent-mid) 0%, var(--accent-bad) 100%);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 15px rgba(255, 165, 2, 0.4);
    animation: pulse-glow 2s infinite;
    z-index: 600;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 165, 2, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(255, 165, 2, 0.7);
    }
}

.countdown-badge svg {
    width: 10px;
    height: 10px;
}

/* --- GOAL TOOLTIP --- */
.goal-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: rgba(20, 20, 25, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    white-space: nowrap;
    font-size: 0.75rem;
    color: var(--text);
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.goal-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(20, 20, 25, 0.98);
}

.goal-chip:active .goal-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.tooltip-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--primary);
    font-weight: 600;
}

/* --- ENHANCED GOAL CHIP ANIMATION --- */
.goal-chip {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.goal-chip:active:not(.locked .goal-chip) {
    transform: scale(0.95);
}

.goal-chip.active {
    transform: scale(1.05);
    animation: chipActivate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chipActivate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15) rotate(2deg);
    }

    100% {
        transform: scale(1.05);
    }
}

/* --- MOTIVATIONAL MESSAGE --- */
.motivational-msg {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 15px;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.5s forwards;
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.motivational-msg.positive {
    background: rgba(46, 213, 115, 0.1);
    color: var(--accent-good);
    border: 1px solid rgba(46, 213, 115, 0.2);
}

.motivational-msg.negative {
    background: rgba(255, 71, 87, 0.1);
    color: var(--accent-bad);
    border: 1px solid rgba(255, 71, 87, 0.2);
}

.motivational-msg.neutral {
    background: rgba(255, 165, 2, 0.1);
    color: var(--accent-mid);
    border: 1px solid rgba(255, 165, 2, 0.2);
}

/* --- DOUBLE TAP HINT --- */
.day-cell.has-data {
    position: relative;
}

.day-cell.has-data::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.4;
}
