/* ============================================
   BLORPS App - My Blorps Styles
   Blorp Cards, Collection Grid
   ============================================ */

/* ============================================
   Battle History Section
   ============================================ */
.battle-history-section {
    margin: 40px 0;
    position: relative;
}

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

.history-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-title h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.history-icon {
    width: 22px;
    height: 22px;
    color: var(--pink-main);
    opacity: 0.8;
}

.history-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 107, 205, 0.3);
    color: var(--text-primary);
}

.history-toggle:focus-visible {
    outline: 2px solid var(--green-main);
    outline-offset: 2px;
}

.history-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.history-toggle.expanded svg {
    transform: rotate(180deg);
}

.history-battles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 8px 4px 16px;
}

.history-battles.collapsed {
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.history-battles.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--bg-primary) 0%, transparent 100%);
    pointer-events: none;
}

.history-loading,
.history-empty {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

/* History Pagination */
.history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px 0;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(236, 72, 153, 0.15);
    border-color: rgba(236, 72, 153, 0.4);
    color: var(--text-primary);
}

.pagination-btn:focus-visible {
    outline: 2px solid var(--green-main);
    outline-offset: 2px;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
}

.pagination-info {
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
}

/* History Card */
.history-card {
    position: relative;
    /* App-standard navy card (same family as the active-raid battle card) -
       the old near-black purple gradient predated the river rebrand. */
    background: linear-gradient(165deg,
        rgba(14, 38, 56, 0.95) 0%,
        rgba(5, 24, 40, 0.98) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.history-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.4;
    pointer-events: none;
}

.history-card.victory::before {
    background: radial-gradient(ellipse at 0% 0%, rgba(74, 222, 128, 0.12) 0%, transparent 60%);
}

.history-card.defeat::before {
    background: radial-gradient(ellipse at 0% 0%, rgba(255, 82, 82, 0.12) 0%, transparent 60%);
}

.history-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Outcome Banner */
.history-outcome {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.history-card.victory .history-outcome {
    background: linear-gradient(90deg,
        #4ade80 0%,
        rgba(74, 222, 128, 0.3) 50%,
        transparent 100%);
}

.history-card.defeat .history-outcome {
    background: linear-gradient(90deg,
        #ff5252 0%,
        rgba(255, 82, 82, 0.3) 50%,
        transparent 100%);
}

/* History Header */
.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px 8px;
}

.history-result {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-card.victory .result-badge {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(34, 197, 94, 0.1));
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.history-card.defeat .result-badge {
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.2), rgba(239, 68, 68, 0.1));
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.result-badge svg {
    width: 12px;
    height: 12px;
}

.role-tag {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}

.role-tag.attacker {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.25);
    background: rgba(255, 107, 107, 0.08);
}

.role-tag.defender {
    color: #4dabf7;
    border-color: rgba(77, 171, 247, 0.25);
    background: rgba(77, 171, 247, 0.08);
}

/* History Body - Battle Display */
.history-battle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    gap: 8px;
    overflow: hidden;
}

.history-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.history-portraits {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.history-portrait {
    width: 36px;
    height: 36px;
    min-width: 32px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.history-portrait svg {
    width: 100%;
    height: 100%;
}

.history-bp {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.history-team.winner .history-bp {
    color: #4ade80;
}

.history-team.loser .history-bp {
    color: #ff5252;
    opacity: 0.7;
}

/* VS Divider */
.history-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    flex-shrink: 0;
}

.history-vs-badge {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 107, 205, 0.15), rgba(77, 171, 247, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

/* History Footer */
.history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.history-reward {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reward-icon {
    width: 16px;
    height: 16px;
    color: #a3e635;
}

.reward-amount {
    font-size: 14px;
    font-weight: 600;
}

.history-card.victory .reward-amount {
    color: #a3e635;
}

.history-card.defeat .reward-amount {
    color: var(--text-dim);
}

.history-time {
    font-size: 11px;
    color: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {
    .history-battles {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .history-portrait {
        width: 30px;
        height: 30px;
    }

    .history-card-header {
        padding: 10px 12px 6px;
    }

    .history-battle {
        padding: 6px 12px;
    }

    .history-footer {
        padding: 6px 12px 10px;
    }
}

/* Dashboard Active Raids Grid */
.active-raids-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.active-raid-card {
    position: relative;
    background: linear-gradient(165deg,
        rgba(14, 38, 56, 0.95) 0%,
        rgba(5, 24, 40, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.active-raid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.active-raid-card.attacking {
    border-color: rgba(255, 138, 108, 0.35);
}

.active-raid-card.attacking::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--pink-main), transparent 80%);
    filter: blur(0.5px);
}

.active-raid-card.defending {
    border-color: rgba(95, 168, 214, 0.35);
}

.active-raid-card.defending::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue-main), transparent 80%);
    filter: blur(0.5px);
}

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

.raid-card-role {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 8px;
}

.active-raid-card.attacking .raid-card-role {
    background: rgba(255, 100, 100, 0.15);
    color: #ff6b6b;
}

.active-raid-card.defending .raid-card-role {
    background: rgba(77, 171, 247, 0.15);
    color: #4dabf7;
}

.raid-card-turn {
    font-size: 12px;
    color: var(--text-dim);
}

.raid-card-turn.your-turn {
    color: var(--green-main);
    font-weight: 600;
}

.raid-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.raid-card-mine {
    font-weight: 600;
    color: var(--text-primary);
}

.raid-card-target {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.raid-card-timer {
    font-family: var(--font-display);
    color: var(--text-dim);
    font-size: 14px;
}

.raid-card-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.active-raid-card.attacking .raid-card-btn {
    background: #ff6b6b;
    color: white;
}

.active-raid-card.defending .raid-card-btn {
    background: #4dabf7;
    color: white;
}

.raid-card-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.raid-card-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.raid-card-btn:focus-visible {
    outline: 2px solid var(--green-main);
    outline-offset: 2px;
}

.expedition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.expedition-type {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.expedition-card.mining .expedition-type {
    color: var(--blue-light);
}

.expedition-card.raiding .expedition-type {
    color: var(--pink-light);
}

.expedition-type svg {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Time badge - premium glassmorphism */
.expedition-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.time-icon {
    width: 8px;
    height: 8px;
    background: var(--green-main);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.time-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.time-dot.active {
    background: var(--blue-light);
    animation: pulseDot 2s infinite;
    box-shadow: 0 0 8px rgba(107, 207, 255, 0.5);
}

.time-dot.complete {
    background: var(--green-main);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.expedition-time.complete {
    color: var(--green-main);
}

.time-remaining {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(74, 222, 128, 0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 4px rgba(74, 222, 128, 0.3); }
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(107, 207, 255, 0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 4px rgba(107, 207, 255, 0.3); }
}

.expedition-team {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.team-blorps {
    display: flex;
}

.mini-blorp {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(20, 25, 40, 0.9);
    margin-left: -10px;
    background: linear-gradient(135deg, rgba(30, 35, 50, 0.95) 0%, rgba(20, 25, 40, 0.98) 100%);
    overflow: hidden;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease;
}

.mini-blorp:first-child {
    margin-left: 0;
}

.expedition-card:hover .mini-blorp {
    transform: translateY(-2px);
}

.expedition-card:hover .mini-blorp:nth-child(1) { transition-delay: 0s; }
.expedition-card:hover .mini-blorp:nth-child(2) { transition-delay: 0.05s; }
.expedition-card:hover .mini-blorp:nth-child(3) { transition-delay: 0.1s; }

.mini-blorp svg {
    width: 100%;
    height: 100%;
}

.team-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.expedition-progress {
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-dark), var(--green-main), var(--green-light));
    border-radius: 4px;
    transition: width 0.8s var(--ease-out-expo);
    position: relative;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-dim);
}

.progress-info .reward {
    color: var(--green-main);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
}

/* Action button - premium glass style */
.expedition-action {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(4px);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.expedition-action:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    transform: translateY(-1px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.expedition-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.expedition-action:focus-visible {
    outline: 2px solid var(--green-main);
    outline-offset: 2px;
}

/* Type-specific action button hover */
.expedition-card.mining .expedition-action:hover {
    border-color: rgba(107, 207, 255, 0.3);
    box-shadow: 0 4px 12px rgba(107, 207, 255, 0.1);
}

.expedition-card.raiding .expedition-action:hover {
    border-color: rgba(244, 114, 182, 0.3);
    box-shadow: 0 4px 12px rgba(244, 114, 182, 0.1);
}

/* Add New Card - Premium dashed style */
.expedition-card.add-new {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    min-height: 200px;
    background: linear-gradient(165deg,
        rgba(20, 25, 38, 0.6) 0%,
        rgba(12, 15, 25, 0.7) 100%);
}

.expedition-card.add-new::before {
    background: linear-gradient(90deg, var(--green-main), transparent 80%);
    opacity: 0;
}

.expedition-card.add-new::after {
    background: var(--green-main);
    opacity: 0;
}

.add-content {
    text-align: center;
    color: var(--text-dim);
    transition: all 0.3s ease;
}

.add-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15) 0%, rgba(74, 222, 128, 0.05) 100%);
    border: 1px solid rgba(74, 222, 128, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 12px rgba(74, 222, 128, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.add-icon svg {
    width: 24px;
    height: 24px;
    color: var(--green-main);
    transition: transform 0.3s ease;
}

.add-content span {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.expedition-card.add-new:hover {
    border-color: rgba(74, 222, 128, 0.4);
    background: linear-gradient(165deg,
        rgba(74, 222, 128, 0.08) 0%,
        rgba(74, 222, 128, 0.02) 100%);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.3),
        0 0 24px rgba(74, 222, 128, 0.08);
}

.expedition-card.add-new:hover::before {
    opacity: 0.5;
}

.expedition-card.add-new:hover::after {
    opacity: 0.08;
}

.expedition-card.add-new:hover .add-content {
    color: var(--green-main);
}

.expedition-card.add-new:hover .add-icon {
    transform: scale(1.05);
    border-color: rgba(74, 222, 128, 0.4);
    box-shadow:
        0 6px 16px rgba(74, 222, 128, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.expedition-card.add-new:hover .add-icon svg {
    transform: rotate(90deg);
}

/* ============================================
   Mining Overlay — Underwater foraging
   Aqua palette, water-ripple rings, bubble dots
   ============================================ */
.mining-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(45, 212, 233, 0.10) 0%,
        rgba(5, 24, 40, 0.78) 35%,
        rgba(5, 24, 40, 0.88) 100%
    );
    backdrop-filter: blur(3px) saturate(1.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 16px;
    overflow: hidden;
    pointer-events: none; /* Allow clicks to pass through to card */
}

/* Soft caustic light — slow horizontal sweep, like sun shafts on water */
.mining-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 30% at 30% 20%, rgba(127, 234, 245, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 25% at 70% 70%, rgba(45, 212, 233, 0.06) 0%, transparent 60%);
    animation: caustic-drift 9s ease-in-out infinite;
    pointer-events: none;
}

/* (expanding ripple rings removed by request - 2026-07-06) */

/* Icon — soft circular frame with concentric ripple */
.mining-overlay .mining-icon-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}


/* Solid disc behind the icon */
.mining-overlay .mining-icon-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 35% 30%,
        rgba(45, 212, 233, 0.18) 0%,
        rgba(8, 26, 42, 0.92) 70%);
    border: 1px solid rgba(127, 234, 245, 0.35);
    border-radius: 50%;
}

.mining-overlay .mining-icon {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    color: #7feaf5;
    filter: drop-shadow(0 0 8px rgba(127, 234, 245, 0.55));
    animation: drift-bob 3s ease-in-out infinite;
}

.mining-overlay .mining-icon svg {
    width: 100%;
    height: 100%;
}

/* Status label — soft aqua pill */
.mining-overlay .mining-label {
    font-family: var(--font-display, 'Lilita One', cursive);
    font-size: 11px;
    font-weight: 700;
    color: #b3f2fa;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 4px 14px;
    background: rgba(45, 212, 233, 0.12);
    border: 1px solid rgba(127, 234, 245, 0.4);
    border-radius: 999px;
    text-shadow: 0 0 8px rgba(127, 234, 245, 0.4);
}

/* Countdown timer */
.mining-overlay .mining-time {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow:
        0 0 10px rgba(127, 234, 245, 0.45),
        0 0 20px rgba(45, 212, 233, 0.25);
    margin-top: 8px;
    white-space: nowrap;
}

/* Bubble dots */
.mining-overlay .mining-progress {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.mining-overlay .mining-progress .dot {
    width: 7px;
    height: 7px;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(127, 234, 245, 0.15) 60%,
        transparent 100%);
    border: 1px solid rgba(127, 234, 245, 0.35);
    border-radius: 50%;
}

.mining-overlay .mining-progress .dot.active {
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(127, 234, 245, 0.5) 50%,
        rgba(45, 212, 233, 0.2) 100%);
    border-color: rgba(127, 234, 245, 0.7);
    box-shadow: 0 0 8px rgba(127, 234, 245, 0.6);
    animation: bubble-pulse 1.4s ease-in-out infinite;
}

@keyframes caustic-drift {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50%      { transform: translateX(10px); opacity: 0.7; }
}


@keyframes drift-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

@keyframes bubble-pulse {
    0%, 100% { transform: scale(1);   opacity: 0.85; }
    50%      { transform: scale(1.25); opacity: 1;   }
}

/* ============================================
   Overlay Animations
   ============================================ */
@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

@keyframes energy-ring {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes energy-ring-complete {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

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

@keyframes float-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes celebrate {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.2) translateY(-8px); }
    100% { transform: scale(1) translateY(0); }
}

@keyframes glitch {
    0%, 90%, 100% { opacity: 0; transform: translate(0); }
    92% { opacity: 0.8; transform: translate(-2px, 1px); }
    94% { opacity: 0; transform: translate(2px, -1px); }
    96% { opacity: 0.5; transform: translate(1px, 1px); }
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

@keyframes label-glow {
    0% { box-shadow: 0 0 5px rgba(74, 222, 128, 0.3); }
    100% { box-shadow: 0 0 15px rgba(74, 222, 128, 0.6); }
}

@keyframes diamond-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes pattern-shift {
    0% { background-position: 0 0; }
    100% { background-position: 60px 104px; }
}

@keyframes shine-sweep {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

@keyframes node-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 12px rgba(96, 165, 250, 0.9);
    }
}

/* Raiding Overlay Animations */
@keyframes raid-slash {
    0% { transform: translateX(-5px) translateY(-5px); }
    50% { transform: translateX(5px) translateY(5px); }
    100% { transform: translateX(-5px) translateY(-5px); }
}

@keyframes battle-pulse {
    0% {
        transform: scale(0.4);
        opacity: 0.9;
        border-width: 3px;
    }
    50% {
        border-width: 1px;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
        border-width: 1px;
    }
}

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

@keyframes sword-clash {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 12px rgba(255, 107, 205, 0.8));
    }
    25% {
        transform: scale(1.1) rotate(-5deg);
        filter: drop-shadow(0 0 20px rgba(255, 107, 205, 1));
    }
    50% {
        transform: scale(0.95) rotate(5deg);
        filter: drop-shadow(0 0 8px rgba(255, 107, 205, 0.6));
    }
    75% {
        transform: scale(1.1) rotate(-3deg);
        filter: drop-shadow(0 0 18px rgba(255, 107, 205, 0.9));
    }
}

@keyframes battle-flash {
    0%, 85%, 100% { opacity: 0; }
    90% { opacity: 0.9; transform: translate(-1px, 0); }
    95% { opacity: 0; transform: translate(1px, 0); }
}

@keyframes spark-burst {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

@keyframes slash-appear {
    0%, 70%, 100% { opacity: 0; }
    80% { opacity: 0.8; transform: rotate(-30deg) scaleY(1.2); }
    90% { opacity: 0.3; }
}

/* Mini Blorp Cards (Dashboard Top Blorps) */
.blorp-card-wrapper.mini {
    width: 180px;
    min-width: 180px;
    flex-shrink: 0;
}

/* Class badge — corner avatar showing the salmon's class. Same image set as
   the landing page (assets/classes/<slug>.png). Rendered by Utils.classBadge.
   Default sizing for full-size blorp cards; smaller variants below. */
.blorp-card-wrapper .class-badge,
.mercenary-card .class-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    z-index: 3;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(20, 20, 32, 0.85);
    padding: 4px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(255, 255, 255, 0.12);
    pointer-events: none; /* don't block click-to-select on the card */
}

/* Mini variant — used in deposit/withdraw modals + blorp selector picker */
.blorp-card-wrapper.mini .class-badge {
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    padding: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(255, 255, 255, 0.12);
}

/* Faction corner badge (selector modal cards): mirrors the class badge in
   the opposite corner — same size, same dark-circle treatment. Rendered by
   Utils.factionBadge; faction name is in the tooltip. */
/* Detail-modal showcase: same corner badges as the cards, sized up. */
.blorp-detail-showcase .class-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    z-index: 3;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(20, 20, 32, 0.85);
    padding: 5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(255, 255, 255, 0.12);
}

.blorp-detail-showcase .faction-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(20, 20, 32, 0.85);
    padding: 5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(255, 255, 255, 0.12);
}

.blorp-detail-showcase .faction-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.blorp-card-wrapper .faction-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(20, 20, 32, 0.85);
    padding: 4px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(255, 255, 255, 0.12);
}

.blorp-card-wrapper .faction-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.blorp-card-wrapper.mini .faction-badge {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(255, 255, 255, 0.12);
}

/* Hide on the very small contexts where the badge would clutter — battle
   portraits, history portraits, and reinforcement slots are <80px wide and
   the class is communicated by the SVG already. */
.battle-blorp .class-badge,
.battle-portrait .class-badge,
.history-portrait .class-badge,
.reinforce-blorp .class-badge {
    display: none;
}

.blorp-card-wrapper.mini .blorp-card-inner {
    padding: 12px;
    padding-bottom: 4px;
    min-height: 260px;
}

.blorp-card-wrapper.mini .blorp-showcase {
    height: 150px;
    margin-bottom: 4px;
    /* overflow: hidden inherited from base .blorp-showcase rule */
}

/* The 1.6 zoom is now handled by the base `.blorp-creature svg` rule in
   mining.css — applies to both full-size and mini cards uniformly. */

.blorp-card-wrapper.mini .blorp-card-info {
    padding: 0;
    margin-bottom: 8px;
}

.blorp-card-wrapper.mini .blorp-card-name {
    font-size: 12px;
    margin-bottom: 5px;
}

.blorp-card-wrapper.mini .rarity-badge {
    padding: 3px 8px;
    font-size: 8px;
}

.blorp-card-wrapper.mini .rarity-icon {
    font-size: 9px;
}

.blorp-card-wrapper.mini .blorp-card-stats {
    /* Mini cards are ~180px wide (stats bar ~150px), so keep the horizontal
       padding tight - 16px here left no room for three 3-digit stats and
       mashed them together. */
    padding: 8px 4px;
    margin: auto 4px 8px 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.4);
}

.blorp-card-wrapper.mini .stat-block {
    gap: 4px;
}

.blorp-card-wrapper.mini .stat-block svg {
    width: 12px;
    height: 12px;
}

.blorp-card-wrapper.mini .stat-value {
    font-size: 13px;
}

.blorp-card-wrapper.mini .stat-label {
    font-size: 8px;
}

.blorp-card-wrapper.mini .stat-divider {
    height: 18px;
}

.blorp-card-wrapper.mini .card-corner {
    width: 10px;
    height: 10px;
}

.blorp-card-wrapper.mini .card-corner.bl,
.blorp-card-wrapper.mini .card-corner.br {
    bottom: 8px;
}

/* Disable heavy hover effects for mini cards */
.blorp-card-wrapper.mini:hover {
    transform: translateY(-4px) scale(1);
}

.blorp-card-wrapper.mini:hover .blorp-creature {
    animation: none;
}

.blorp-card-wrapper.mini.legendary:hover,
.blorp-card-wrapper.mini.epic:hover,
.blorp-card-wrapper.mini.rare:hover,
.blorp-card-wrapper.mini.common:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}


/* ============================================
   Overlay Toggle Switch
   ============================================ */
.overlay-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border-subtle);
}

.overlay-toggle input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-subtle);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px;
    left: 3px;
    transition: all 0.3s ease;
}

.overlay-toggle input:checked + .toggle-slider {
    background: rgba(74, 222, 128, 0.2);
    border-color: var(--green-main);
}

.overlay-toggle input:checked + .toggle-slider::after {
    background: var(--green-main);
    transform: translateX(19px);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.toggle-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.overlay-toggle:hover .toggle-slider {
    border-color: var(--border-active);
}

/* Hide overlays when toggle is off */
.hide-overlays .mining-overlay,
.hide-overlays .raiding-overlay,
.hide-overlays .team-overlay,
.hide-overlays .lending-overlay {
    display: none !important;
}

/* "Deposit to play" hint on wallet-held (undeposited) salmon cards.
   First-timers otherwise only discover depositing via the header button. */
.wallet-deposit-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    padding: 6px 12px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
    cursor: pointer;
    color: var(--bg-dark, #051828);
    background: var(--green-main);
    border: 1px solid var(--green-main);
    box-shadow: 0 4px 14px rgba(45, 212, 233, 0.35);
    transition: all 0.2s ease;
}

.wallet-deposit-hint:hover {
    filter: brightness(1.1);
    transform: translateX(-50%) translateY(-1px);
}

.wallet-deposit-hint:focus-visible {
    outline: 2px solid var(--green-main);
    outline-offset: 2px;
}

/* Battle-cooldown state in the selector modal: same non-selectable treatment
   as tavern-lent salmon - the contract rejects locked salmon from teams,
   mining, breeding, and lending with BlorpLocked. */
.blorp-card-wrapper.cooling-down {
    opacity: 0.45;
    cursor: not-allowed;
}

.cooldown-overlay {
    position: absolute;
    inset: auto 6px 6px 6px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(10, 22, 34, 0.9);
    border: 1px solid rgba(255, 196, 76, 0.5);
    color: var(--yellow-main, #ffc44c);
    font-size: 10.5px;
    font-weight: 700;
    pointer-events: none;
}

.cooldown-overlay .cooldown-time { font-variant-numeric: tabular-nums; }
