/* ==========================================================================
   WELCOME BACK RECAP
   ========================================================================== */

.wb-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(8, 6, 12, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    padding: var(--spacing-sm);
}

.wb-overlay.wb-visible {
    opacity: 1;
}

.wb-container {
    max-width: 380px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.wb-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs);
    flex: 1;
    min-height: 0;
}

.wb-scroll::-webkit-scrollbar {
    display: none;
}

/* --- Header --- */

.wb-header {
    text-align: center;
    padding: var(--spacing-md) var(--spacing-sm);
}

.wb-sun-icon {
    display: inline-flex;
    color: var(--gold);
    filter: drop-shadow(0 0 8px rgba(208,160,48,0.4));
    animation: wb-sun-glow 3s ease-in-out infinite;
    margin-bottom: var(--spacing-xs);
}

@keyframes wb-sun-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(208,160,48,0.4)); }
    50% { filter: drop-shadow(0 0 16px rgba(208,160,48,0.7)); }
}

.wb-title {
    font-family: var(--font-pixel);
    font-size: 16px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(208,160,48,0.3), 0 2px 0 rgba(0,0,0,0.5);
    margin-bottom: var(--spacing-xs);
}

.wb-time-away {
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Total XP banner --- */

.wb-total-xp {
    text-align: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background:
        linear-gradient(180deg, rgba(208,160,48,0.08) 0%, rgba(208,160,48,0.02) 100%);
    border: 1px solid var(--gold-dark);
    box-shadow: 0 0 20px rgba(208,160,48,0.08);
}

.wb-total-label {
    font-family: var(--font-pixel);
    font-size: 7px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.wb-total-value {
    font-family: var(--font-pixel);
    font-size: 22px;
    color: var(--gold-light);
    text-shadow: 0 0 16px rgba(208,160,48,0.5);
}

/* --- Section titles --- */

.wb-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.wb-section-title {
    font-family: var(--font-pixel);
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-dark);
}

/* --- Matured seedlings --- */

.wb-matured-grid {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.wb-matured-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 6px var(--spacing-sm);
    background:
        linear-gradient(180deg, rgba(60,48,30,0.12) 0%, rgba(0,0,0,0.06) 100%),
        var(--bg-surface);
    border: 1px solid var(--border-mid);
    flex: 1;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.wb-matured-sprite {
    flex-shrink: 0;
}

.wb-matured-name {
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--text-main);
    flex: 1;
}

.wb-matured-badge {
    font-family: var(--font-pixel);
    font-size: 6px;
    text-transform: uppercase;
    padding: 2px 5px;
    background: rgba(104,168,88,0.3);
    color: var(--green-light);
    border: 1px solid var(--green);
    animation: wb-badge-pulse 2s ease-in-out infinite;
}

@keyframes wb-badge-pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(104,168,88,0.2); }
    50% { box-shadow: 0 0 10px rgba(104,168,88,0.4); }
}

/* --- Plant cards --- */

.wb-plant-card {
    background:
        linear-gradient(180deg, rgba(60,48,30,0.12) 0%, rgba(0,0,0,0.06) 100%),
        var(--bg-surface);
    border: 1px solid var(--border-mid);
    border-left: 3px solid var(--border-mid);
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wb-plant-card.rarity-border-common { border-left-color: var(--rarity-common, #9ca3af); }
.wb-plant-card.rarity-border-uncommon { border-left-color: var(--rarity-uncommon, #68a858); }
.wb-plant-card.rarity-border-rare { border-left-color: var(--rarity-rare, #5090d0); }
.wb-plant-card.rarity-border-epic { border-left-color: var(--rarity-epic, #a060c8); }
.wb-plant-card.rarity-border-legendary { border-left-color: var(--rarity-legendary, #d0a028); }

.wb-plant-top {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.wb-plant-sprite {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
}

.wb-plant-info {
    flex: 1;
    min-width: 0;
}

.wb-plant-name {
    font-family: var(--font-pixel);
    font-size: 10px;
    color: var(--text-bright);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-plant-stars {
    display: flex;
    gap: 1px;
    margin-bottom: 2px;
}

.wb-star {
    font-size: 10px;
    color: var(--border-dark);
}

.wb-star.filled {
    color: var(--gold);
}

.wb-star.wb-star-new {
    color: var(--gold-light);
    animation: wb-star-up 1s ease-out;
    text-shadow: 0 0 8px rgba(208,160,48,0.6);
}

@keyframes wb-star-up {
    0% { transform: scale(1); }
    30% { transform: scale(1.8); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.wb-plant-xp-gained {
    font-family: var(--font-pixel);
    font-size: 9px;
    color: var(--green-light);
}

/* --- XP bar --- */

.wb-xp-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wb-xp-bar-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-pixel);
    font-size: 7px;
    color: var(--text-muted);
}

.wb-xp-bar {
    position: relative;
    height: 6px;
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    overflow: hidden;
}

.wb-xp-fill-before {
    position: absolute;
    inset: 0;
    background: rgba(104,168,88,0.25);
}

.wb-xp-fill-after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--green-dark), var(--green));
    box-shadow: 0 0 6px rgba(104,168,88,0.3);
}

/* --- XP breakdown --- */

.wb-xp-breakdown {
    display: flex;
    gap: var(--spacing-md);
}

.wb-xp-source {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-pixel);
    font-size: 7px;
    color: var(--text-dim);
}

.wb-xp-source-icon {
    display: inline-flex;
    color: var(--gold);
    opacity: 0.7;
}

/* --- Actions --- */

.wb-actions {
    padding: var(--spacing-sm) var(--spacing-xs);
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.wb-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 10px 28px;
    font-family: var(--font-pixel);
    font-size: 10px;
    text-transform: uppercase;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(80,140,60,0.7) 0%, rgba(42,80,34,0.8) 100%);
    color: var(--text-bright);
    border: 2px solid var(--green);
    box-shadow:
        inset 0 1px 0 rgba(152,216,112,0.15),
        0 0 12px rgba(104,168,88,0.25),
        0 2px 0 rgba(0,0,0,0.3);
    min-height: 40px;
    transition: background 0.15s, border-color 0.15s;
    letter-spacing: 1px;
}

.wb-continue-btn:hover {
    background: linear-gradient(180deg, rgba(90,150,70,0.8) 0%, rgba(50,90,40,0.9) 100%);
    border-color: var(--green-light);
}

.wb-continue-btn:active {
    transform: translate(1px, 1px);
}

/* --- Responsive --- */

@media (min-width: 600px) {
    .wb-title {
        font-size: 20px;
        letter-spacing: 3px;
    }

    .wb-total-value {
        font-size: 28px;
    }

    .wb-plant-name {
        font-size: 11px;
    }

    .wb-container {
        max-width: 440px;
    }
}
