/* ============================================
   BLORPS App - Dashboard Styles
   Expeditions Grid, Leaderboard
   ============================================ */

/* ============================================
   Expeditions Grid - Premium Gaming Style
   ============================================ */
.expeditions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.expedition-card {
    background: linear-gradient(165deg,
        rgba(25, 30, 45, 0.95) 0%,
        rgba(15, 18, 30, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* Top accent line */
.expedition-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 2;
}

/* Corner glow effect */
.expedition-card::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    top: -50px;
    right: -50px;
    opacity: 0.06;
    filter: blur(25px);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.expedition-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.03);
}

.expedition-card:hover::before {
    opacity: 1;
}

.expedition-card:hover::after {
    opacity: 0.12;
}

/* Mining expedition - Blue theme */
.expedition-card.mining::before {
    background: linear-gradient(90deg, var(--blue-light), transparent 80%);
}
.expedition-card.mining::after {
    background: var(--blue-light);
}
.expedition-card.mining:hover {
    border-color: rgba(107, 207, 255, 0.2);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.4),
        0 0 24px rgba(107, 207, 255, 0.1);
}

/* Raiding expedition - Pink theme */
.expedition-card.raiding::before {
    background: linear-gradient(90deg, var(--pink-light), transparent 80%);
}
.expedition-card.raiding::after {
    background: var(--pink-light);
}
.expedition-card.raiding:hover {
    border-color: rgba(244, 114, 182, 0.2);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.4),
        0 0 24px rgba(244, 114, 182, 0.1);
}

/* Under Attack - Red pulsing theme */
.expedition-card.under-attack {
    border-color: rgba(255, 100, 100, 0.4);
    animation: attackPulse 1.5s ease-in-out infinite;
}
.expedition-card.under-attack::before {
    background: linear-gradient(90deg, #ff6b6b, transparent 80%);
    animation: attackGlow 1.5s ease-in-out infinite;
}
.expedition-card.under-attack::after {
    background: #ff6b6b;
    opacity: 0.15;
}

@keyframes attackPulse {
    0%, 100% {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), 0 0 20px rgba(255, 100, 100, 0.2);
    }
    50% {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), 0 0 40px rgba(255, 100, 100, 0.4);
    }
}

@keyframes attackGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.expedition-action.defend-action {
    background: #ff6b6b !important;
    color: white !important;
    animation: defendBtnPulse 1.5s ease-in-out infinite;
}

@keyframes defendBtnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.expedition-card.pending-settlement {
    border-color: rgba(255, 193, 7, 0.4);
}
.expedition-card.pending-settlement::before {
    background: linear-gradient(90deg, #ffc107, transparent 80%);
}

.expedition-action.settle-action {
    background: #ffc107 !important;
    color: #1a1a2e !important;
}

/* ============================================
   Tavern Layout
   ============================================ */

/* Price Statistics Bar */
.price-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.price-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px 20px;
    transition: all 0.2s ease;
}

.price-stat-card:hover {
    border-color: var(--border-active);
    box-shadow: var(--glow-green);
}

.price-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-stat-value {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.price-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.price-amount .token {
    font-size: 14px;
    font-weight: 600;
    color: var(--green-main);
}

.price-change {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.price-change.positive {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
}

.price-change.positive::before {
    content: '▲ ';
    font-size: 8px;
}

.price-change.negative {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

.price-change.negative::before {
    content: '▼ ';
    font-size: 8px;
}

@media (max-width: 900px) {
    .price-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    /* Keep 2 columns on mobile for stats */
    .price-stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .price-stat-card {
        padding: 12px 14px;
    }

    .price-stat-label {
        font-size: 10px;
    }

    .price-amount {
        font-size: 16px;
    }

    .price-amount .token {
        font-size: 12px;
    }
}

/* Tavern Main Section */
.tavern-main-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 24px;
}

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

.section-header-row h3 {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--text-main);
    margin: 0;
}

.mercenary-count {
    font-size: 12px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 8px;
}

/* Tavern Inline Filters (like Crabada) */
.tavern-filters-inline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
}

/* Tavern filter groups - scoped to tavern only */
.tavern-filters-inline .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tavern-filters-inline .filter-group label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tavern-filters-inline .filter-group select {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.tavern-filters-inline .filter-group select:hover {
    border-color: var(--green-main);
    background-color: rgba(0, 0, 0, 0.5);
}

.tavern-filters-inline .filter-group select:focus {
    outline: none;
    border-color: var(--green-main);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

.tavern-filters-inline .filter-group select option {
    background: var(--bg-dark);
    color: var(--text-main);
    padding: 8px;
}

@media (max-width: 900px) {
    .tavern-filters-inline {
        grid-template-columns: repeat(2, 1fr);
    }

    /* With 3 filters the last one sits alone on its row - span both
       columns and center it so it doesn't hug the left edge. */
    .tavern-filters-inline .filter-group:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: min(60%, 320px);
        text-align: center;
    }
}

@media (max-width: 500px) {
    .tavern-filters-inline {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px;
    }

    .filter-group select {
        padding: 8px 10px;
        font-size: 12px;
    }
}

.tavern-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

.tavern-section h3 {
    font-family: var(--font-display);
    font-size: 18px;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.mercenary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.mercenary-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
    /* Vertical card: portrait hero → centered name/rarity → stat bar → footer.
       Matches the My Salmon card language and fits the 280px grid column
       (the old horizontal split cramped the footer). */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mercenary-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(107, 207, 255, 0.05), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mercenary-card:hover {
    border-color: var(--blue-main);
    transform: translateY(-4px);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(107, 207, 255, 0.15);
}

.mercenary-card:hover::before {
    opacity: 1;
}

/* Portrait hero across the top of the card: badge top-left + rarity top-right
   overlay the art, and the name sits inside the container below the salmon. */
.merc-portrait {
    position: relative;
    width: 100%;
    height: 210px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-subtle);
}

.merc-art {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.merc-art svg {
    width: 100%;
    height: 100%;
    transform: scale(1.25);
    transform-origin: center center;
}

/* Legacy header rule kept for any non-tavern callers; unused on the new
   tavern card layout. */
.merc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.merc-avatar {
    width: 50px;
    height: 50px;
}

/* Name + rarity centered under the portrait hero. */
.merc-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.merc-info h4 {
    font-size: 15px;
    margin: 0;
}

.merc-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.merc-owner {
    font-size: 12px;
    color: var(--text-dim);
}

.merc-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.merc-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.merc-stat svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Color-code all three stats to match the canonical blorp-card stat palette
   (css/mining.css .stat-block.bp/.tp/.speed): stronger shade on the icon,
   lighter shade on the number+label. Without the .speed rule SPD rendered a
   plain grey icon that didn't match BP/TP anywhere else in the UI. */
.merc-stat.bp {
    color: #ff8a8a;
}
.merc-stat.bp svg {
    color: #ff6b6b;
    filter: drop-shadow(0 0 5px rgba(255, 107, 107, 0.45));
}

.merc-stat.tp {
    color: #6ee7de;
}
.merc-stat.tp svg {
    stroke: #4ecdc4;
    filter: drop-shadow(0 0 5px rgba(78, 205, 196, 0.45));
}

.merc-stat.speed {
    color: #ffdd8a;
}
.merc-stat.speed svg {
    stroke: #ffd166;
    filter: drop-shadow(0 0 5px rgba(255, 209, 102, 0.45));
}

/* The tavern card now reuses the canonical .blorp-card-stats bar (same as the
   My Salmon / dashboard cards) for identical filled, bold, color-coded stats.
   Kill its default margin-top:auto (meant to pin the bar to the bottom of a
   tall vertical card) so it sits directly under the rarity pill here. */
.mercenary-card .blorp-card-stats {
    margin-top: 0;
    margin-bottom: 0;
}
/* Match the dashboard blorp-card proportions (14px value + icon). Outside a
   .blorp-card-wrapper the base .stat-value is 17px / svg 18px, which crowds
   the number against the next stat's icon in this narrower bar. */
.mercenary-card .blorp-card-stats .stat-value {
    font-size: 14px;
}
.mercenary-card .blorp-card-stats .stat-block svg {
    width: 14px;
    height: 14px;
}

/* Price block sits directly under the portrait; the name/rarity header row
   and stat bar follow, with the full-width action button at the bottom. */
.merc-price-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    min-width: 0;
}

/* Rarity pill overlays the top-right of the art, mirroring the class badge in
   the top-left corner. */
.merc-rarity-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
}

/* Name inside the art container, centered below the salmon. */
.merc-name {
    font-size: 15px;
    margin: 0;
    text-align: center;
    padding: 4px 12px 12px;
    flex-shrink: 0;
}

.merc-price-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.merc-price-value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    /* Gold to match the ROE / caviar brand color used for token amounts. */
    color: var(--yellow-main);
}

.merc-price-value .token {
    font-size: 12px;
    color: var(--blue-main);
    margin-left: 1px;
}

/* Ownership line as a small caption under the footer, flush-left. Green when
   it's the connected user's own listing. */
.merc-caption {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.75;
    margin-top: 4px;
}

.merc-caption.owned {
    color: var(--green-main);
    opacity: 0.9;
    font-weight: 600;
}

.hire-btn {
    padding: 8px 16px;
    background: var(--green-main);
    border: none;
    border-radius: 8px;
    color: var(--purple-dark);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hire-btn:hover {
    transform: translateY(-1px);
}

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

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

/* Cancel listing button for own mercenary cards */
.cancel-listing-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--pink-main);
    border-radius: 8px;
    color: var(--pink-main);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-listing-btn:hover {
    background: rgba(255, 107, 205, 0.15);
    transform: translateY(-1px);
}

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

/* Own listing indicator */
.mercenary-card.own-listing {
    position: relative;
    border-color: rgba(157, 255, 107, 0.5) !important;
}

.mercenary-card.own-listing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(157, 255, 107, 0.05), transparent);
    pointer-events: none;
    border-radius: inherit;
}

.own-listing-badge {
    font-size: 11px;
    color: var(--green-main);
    font-weight: 600;
    width: 100%;
    text-align: left;
    margin-top: 2px;
}

/* Owned listing cards in main grid */
.mercenary-card.owned-listing {
    position: relative;
    border: 2px solid rgba(157, 255, 107, 0.4) !important;
    background: linear-gradient(135deg, rgba(157, 255, 107, 0.06), rgba(21, 30, 25, 0.95));
}

.mercenary-card.owned-listing:hover {
    border-color: rgba(157, 255, 107, 0.7) !important;
    box-shadow: 0 0 20px rgba(157, 255, 107, 0.15);
}

.merc-owner.owned {
    color: var(--green-main);
    font-weight: 600;
}

.owned-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.mercenary-card .cancel-listing-btn {
    background: rgba(255, 71, 87, 0.12);
    border: 1px solid rgba(255, 71, 87, 0.25);
    color: #ff6b7a;
    font-size: 13px;
    font-weight: 600;
    /* Full-width final action at the bottom of the card. */
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    margin-top: 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mercenary-card .cancel-listing-btn:hover {
    background: rgba(255, 71, 87, 0.25);
    border-color: rgba(255, 71, 87, 0.5);
    color: #ff4757;
}

/* Your Listed Blorps sidebar */
.your-listings-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.your-listings-grid::-webkit-scrollbar {
    width: 3px;
}

.your-listings-grid::-webkit-scrollbar-track {
    background: transparent;
}

.your-listings-grid::-webkit-scrollbar-thumb {
    background: rgba(157, 255, 107, 0.3);
    border-radius: 2px;
}

.your-listing-card {
    position: relative;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 12px;
    padding: 0 12px 0 14px;
    background: rgba(18, 24, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    transition: all 0.2s ease;
    height: 52px;
}

/* Active listing indicator - glowing left bar */
.your-listing-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--green-main);
    box-shadow: 0 0 10px rgba(157, 255, 107, 0.5);
    animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(157, 255, 107, 0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 6px rgba(157, 255, 107, 0.3); }
}

.your-listing-card:hover {
    background: rgba(25, 32, 40, 0.95);
    border-color: rgba(157, 255, 107, 0.15);
}

.your-listing-card:hover::before {
    animation: none;
    opacity: 1;
    box-shadow: 0 0 14px rgba(157, 255, 107, 0.7);
}

/* Avatar */
.your-listing-card .listing-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.your-listing-card .listing-avatar svg {
    width: 30px;
    height: 30px;
}

/* Name */
.your-listing-card .listing-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price */
.your-listing-card .listing-price {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 700;
    color: var(--green-main);
    white-space: nowrap;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

/* BP */
.your-listing-card .listing-bp {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.your-listing-card .listing-bp svg {
    width: 12px;
    height: 12px;
    fill: rgba(255, 255, 255, 0.35);
}

.your-listing-card:hover .listing-bp {
    color: rgba(255, 255, 255, 0.55);
}

.your-listing-card:hover .listing-bp svg {
    fill: rgba(255, 255, 255, 0.5);
}

/* Cancel button */
.cancel-listing-btn-small {
    width: 26px;
    height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
    flex: 0 0 26px;
}

.cancel-listing-btn-small svg {
    width: 12px;
    height: 12px;
}

.cancel-listing-btn-small:hover {
    background: rgba(255, 90, 90, 0.15);
    border-color: rgba(255, 90, 90, 0.4);
    color: rgba(255, 100, 100, 1);
}

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

.no-listings {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 20px 12px;
    margin: 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.06);
}

/* Rarity-based left bar colors */
.your-listing-card.legendary::before {
    background: #ffd93d;
    box-shadow: 0 0 8px rgba(255, 217, 61, 0.6);
}

.your-listing-card.epic::before {
    background: var(--pink-main);
    box-shadow: 0 0 8px rgba(255, 107, 205, 0.6);
}

.your-listing-card.rare::before {
    background: #6bcfff;
    box-shadow: 0 0 8px rgba(107, 207, 255, 0.6);
}

/* Mercenary card rarity styling */
.mercenary-card.legendary {
    border-color: rgba(255, 217, 61, 0.4);
    background: linear-gradient(135deg, var(--bg-card), rgba(255, 217, 61, 0.08));
}

.mercenary-card.legendary:hover {
    border-color: var(--yellow-main);
    box-shadow: 0 8px 32px rgba(255, 217, 61, 0.25);
}

.mercenary-card.epic {
    border-color: rgba(255, 107, 205, 0.4);
    background: linear-gradient(135deg, var(--bg-card), rgba(255, 107, 205, 0.08));
}

.mercenary-card.epic:hover {
    border-color: var(--pink-main);
    box-shadow: 0 8px 32px rgba(255, 107, 205, 0.25);
}

.mercenary-card.rare {
    border-color: rgba(107, 207, 255, 0.4);
    background: linear-gradient(135deg, var(--bg-card), rgba(107, 207, 255, 0.08));
}

.mercenary-card.rare:hover {
    border-color: var(--blue-main);
    box-shadow: 0 8px 32px rgba(107, 207, 255, 0.25);
}

.mercenary-card.common {
    border-color: rgba(136, 136, 136, 0.3);
    background: linear-gradient(135deg, var(--bg-card), rgba(136, 136, 136, 0.05));
}

.mercenary-card.common:hover {
    border-color: rgba(136, 136, 136, 0.6);
    box-shadow: 0 8px 32px rgba(136, 136, 136, 0.15);
}

.merc-rarity {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
}

.merc-rarity.legendary {
    color: #ffd93d;
    background: rgba(255, 217, 61, 0.2);
}

.merc-rarity.epic {
    color: #ff6bcd;
    background: rgba(255, 107, 205, 0.2);
}

.merc-rarity.rare {
    color: #6bcfff;
    background: rgba(107, 207, 255, 0.2);
}

.merc-rarity.common {
    color: #888;
    background: rgba(136, 136, 136, 0.2);
}

.merc-role {
    font-size: 10px;
    color: var(--text-dim);
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.merc-price .price-amount .token {
    font-size: 12px;
    opacity: 0.8;
}

.list-blorp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 40px;
    background: var(--bg-card);
    border: 2px dashed var(--border-subtle);
    border-radius: 16px;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-blorp-btn svg {
    width: 20px;
    height: 20px;
}

.list-blorp-btn:hover {
    border-color: var(--green-main);
    color: var(--green-main);
    background: rgba(74, 222, 128, 0.05);
}

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

/* ============================================
   Enhanced Stats Display (BP/TP)
   ============================================ */
.enhanced-stats {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.enhanced-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Share the row equally and shrink with the card - at fixed widths the
       three chips needed ~330px while the railed dashboard's expedition
       card is ~280px, and the card's overflow:hidden silently CUT OFF the
       SPD chip at 100% zoom. */
    flex: 1;
    min-width: 0;
    gap: 4px;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 12px;
    overflow: visible;
    white-space: nowrap;
}

/* On the (narrow, railed) dashboard expedition card the "BP:"/"TP:"/"SPD:"
   text labels made chip content wider than the chip - the color-coded icons
   already identify each stat, same as the salmon-card stat bars. */
.expedition-card .enhanced-stat .stat-label {
    display: none;
}

/* Dashboard-only: 4-digit stat values at the full 22px display size need
   ~65px while the railed card gives each chip ~60px - step the number
   down so 4 digits fit. Mining-tab expedition cards are wider; untouched. */
#dashboard .expedition-card .enhanced-stat .stat-value {
    font-size: 17px;
}

.enhanced-stat .stat-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    overflow: visible;
    margin-left: 2px;
}

.enhanced-stat .stat-icon svg {
    overflow: visible;
    width: 16px;
    height: 16px;
}

.enhanced-stat.battle .stat-icon {
    color: var(--pink-main);
}

.enhanced-stat.time .stat-icon {
    stroke: var(--blue-main);
}

.enhanced-stat .stat-label {
    color: var(--text-dim);
}

.enhanced-stat .stat-value {
    font-weight: 700;
    color: var(--text-main);
}

.enhanced-stat.battle .stat-value {
    color: var(--pink-main);
}

.enhanced-stat.time .stat-value {
    color: var(--blue-main);
}

/* ============================================
   Battle Timeline (Active Expeditions)
   ============================================ */
.expedition-card .battle-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 107, 205, 0.15);
    border: 1px solid rgba(255, 107, 205, 0.3);
    border-radius: 8px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--pink-light);
}

.expedition-card .battle-alert svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.expedition-card .reinforce-btn {
    padding: 8px 14px;
    background: var(--pink-main);
    border: none;
    border-radius: 8px;
    color: var(--purple-dark);
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s ease;
}

.expedition-card .reinforce-btn:hover {
    transform: translateY(-1px);
}

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

/* Cooldown Timer */
.cooldown-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 217, 61, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: var(--yellow-main);
}

.cooldown-display svg {
    width: 16px;
    height: 16px;
}

.cooldown-display.ready {
    background: rgba(74, 222, 128, 0.1);
    color: var(--green-main);
}


/* ============================================
   Mint Page
   ============================================ */
.mint-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

.mint-info-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

@media (max-width: 900px) {
    .mint-page { grid-template-columns: 1fr; }
}

.mint-supply-card,
.mint-controls-card,
.mint-rotator-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
}

/* Salmon rotator — cross-fades through all 8 class hero PNGs.
   Uses pure CSS so it stays buttery without spinning JS or burning a
   GIF/video budget. */
.mint-rotator-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 420px;
}

/* Soft caustic glow behind the salmon */
.mint-rotator-card::before {
    content: '';
    position: absolute;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(127, 234, 245, 0.18) 0%, transparent 65%);
    filter: blur(20px);
    pointer-events: none;
    animation: rotatorGlow 6s ease-in-out infinite;
}

@keyframes rotatorGlow {
    0%, 100% { transform: scale(1);    opacity: 0.7; }
    50%      { transform: scale(1.08); opacity: 1;   }
}

.salmon-rotator {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Two stacked slots — JS swaps which one is `.is-active`. Crossfading
   between two slots avoids the FOUC of swapping innerHTML on a single
   element, and lets us scale-in for a subtle "pop" on each new salmon. */
.salmon-rotator-slot {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.salmon-rotator-slot.is-active {
    opacity: 1;
    transform: scale(1);
}

.salmon-rotator-slot svg {
    width: 100%;
    height: 100%;
    /* Layer art has padding around it — push the salmon a bit larger so
       it fills the rotator card the same way the deposit/My Salmon cards
       use their 1.6 zoom. */
    transform: scale(1.4);
    transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
    .mint-rotator-card::before { animation: none; }
    .salmon-rotator-slot { transition: none; }
}

.rotator-caption {
    position: relative;
    margin-top: 36px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
}

.rotator-caption-sep { margin: 0 8px; opacity: 0.5; }

#rotatorClassName {
    color: var(--green-light);
    font-weight: 700;
    transition: opacity 0.4s ease;
}

.mint-supply-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.mint-supply-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
}

.mint-supply-value {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.mint-supply-divider {
    color: var(--text-dim);
    font-size: 22px;
}

.mint-supply-bar {
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.mint-supply-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-main), var(--green-dark));
    border-radius: 999px;
    transition: width 0.3s var(--ease-out-expo);
}

.mint-supply-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.mint-quantity {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.mint-quantity-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
}

.mint-quantity-stepper {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    width: fit-content;
}

.mint-qty-btn {
    width: 44px;
    background: transparent;
    border: 0;
    color: var(--green-light);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mint-qty-btn:hover { background: rgba(45, 212, 233, 0.12); }

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

.mint-qty-input {
    width: 64px;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    outline: none;
    /* Hide spinner */
    -moz-appearance: textfield;
}

.mint-qty-input::-webkit-outer-spin-button,
.mint-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mint-quantity-hint {
    font-size: 11px;
    color: var(--text-dim);
}

.mint-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.mint-option {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.mint-option:hover:not(:disabled) {
    background: rgba(45, 212, 233, 0.08);
    border-color: rgba(127, 234, 245, 0.5);
    transform: translateY(-1px);
}

.mint-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

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

.mint-option-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.mint-option-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mint-option-label {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
}

.mint-option-price {
    font-size: 12px;
    color: var(--text-muted);
}

.mint-option-total {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
    margin-left: auto;
}

.mint-option-total-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
}

.mint-option-total-value {
    font-weight: 700;
    color: var(--green-light);
}

.mint-option.roe .mint-option-total-value { color: var(--yellow-light); }

/* Caviar art reads small at 22px next to the AVAX/BANDS logos —
   bump just the ROE icon up so it visually matches their weight. */
.mint-option.roe .mint-option-icon img { transform: scale(1.4); }
.mint-option.bands .mint-option-total-value { color: var(--pink-light); }

.mint-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
    font-style: italic;
}

/* Rarity distribution row — informational pills under the mint disclaimer.
   Same pattern as the standalone premint page; keep visuals consistent. */
.mint-page .rarity-distribution {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.mint-page .rarity-distribution-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    font-weight: 700;
    margin-right: 6px;
}

.mint-page .rarity-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border: 1px solid;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.4;
}

.mint-page .rarity-pill[data-tier="legendary"] { color: #ffa157; border-color: rgba(255, 161, 87, 0.45); background: rgba(255, 161, 87, 0.08); }
.mint-page .rarity-pill[data-tier="epic"]      { color: #a86bff; border-color: rgba(168, 107, 255, 0.45); background: rgba(168, 107, 255, 0.08); }
.mint-page .rarity-pill[data-tier="rare"]      { color: #5fa8d6; border-color: rgba(95, 168, 214, 0.45); background: rgba(95, 168, 214, 0.08); }
.mint-page .rarity-pill[data-tier="common"]    { color: #b8c0c8; border-color: rgba(184, 192, 200, 0.35); background: rgba(184, 192, 200, 0.06); }

/* First-run "How to Play" banner (dismissible, shown until dismissed) */
.first-run-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 24px;
    padding: 14px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(45, 212, 233, 0.12), rgba(45, 212, 233, 0.04));
    border: 1px solid rgba(45, 212, 233, 0.35);
}

.first-run-banner .first-run-text {
    flex: 1;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 600;
}

.first-run-banner .first-run-cta {
    padding: 8px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    color: var(--bg-dark, #051828);
    background: var(--green-main);
    border: 1px solid var(--green-main);
    transition: filter 0.2s ease;
}

.first-run-banner .first-run-cta:hover {
    filter: brightness(1.1);
}

.first-run-banner .first-run-cta:focus-visible {
    outline: 2px solid var(--green-main);
    outline-offset: 2px;
}

.first-run-banner .first-run-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
}

.first-run-banner .first-run-dismiss:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.first-run-banner .first-run-dismiss:focus-visible {
    outline: 2px solid var(--green-main);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .first-run-banner {
        flex-wrap: wrap;
    }
}

/* ============================================
   Live mining yield: accrued-$ROE + pool share (#7)
   Shared by the mining tab + dashboard expedition cards.
   ============================================ */
.reward-amt {
    font-variant-numeric: tabular-nums;
}
.mine-pool-share {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-faint);
    letter-spacing: 0.02em;
}

/* Floating "+X $ROE" claim celebration counter (#6). */
.roe-claim-float {
    position: fixed;
    top: 26%;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 100000;
    pointer-events: none;
    font-family: var(--font-display, inherit);
    font-weight: 800;
    font-size: 34px;
    color: var(--yellow-main, #ffd93d);
    text-shadow: 0 2px 18px rgba(255, 217, 61, 0.55), 0 1px 2px rgba(0, 0, 0, 0.6);
    transition: opacity 0.5s ease, transform 0.5s ease;
    white-space: nowrap;
}
.roe-claim-float.leaving {
    opacity: 0;
    transform: translate(-50%, -40px);
}

/* ============================================
   Disconnected dashboard hero (#5, #14)
   ============================================ */
.dashboard-connect-hero {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 44px 24px 40px;
    margin-bottom: 24px;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: var(--bg-card);
}
.dashboard-connect-hero .dch-glow {
    position: absolute;
    inset: -40% 20% auto 20%;
    height: 220px;
    background: radial-gradient(ellipse at center, rgba(45, 212, 233, 0.22), transparent 70%);
    pointer-events: none;
}
.dashboard-connect-hero .dch-icon {
    position: relative;
    font-size: 44px;
    line-height: 1;
    margin-bottom: 12px;
}
.dashboard-connect-hero .dch-title {
    position: relative;
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
}
.dashboard-connect-hero .dch-sub {
    position: relative;
    margin: 0 auto 20px;
    max-width: 460px;
    color: var(--text-muted);
    font-size: 14px;
}
.dashboard-connect-hero .dch-connect {
    position: relative;
    min-width: 180px;
}
.dashboard-connect-hero .dch-steps {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}
.dashboard-connect-hero .dch-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-dark);
    font-size: 13px;
    color: var(--text-secondary);
}
.dashboard-connect-hero .dch-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--green-main);
    color: #04240f;
    font-weight: 800;
    font-size: 12px;
}
.dashboard-connect-hero .dch-step-arrow {
    color: var(--text-faint);
    font-size: 16px;
}
@media (max-width: 560px) {
    .dashboard-connect-hero .dch-steps { gap: 8px; }
    .dashboard-connect-hero .dch-step-arrow { display: none; }
}

/* ============================================
   Leaderboard social layer: identicon, copyable
   address, View affordance + profile popover (#12)
   ============================================ */
.lb-identicon {
    flex: 0 0 auto;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.lb-addr {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    letter-spacing: 0.02em;
}
.lb-addr:hover {
    color: var(--green-main);
    text-decoration: underline dotted;
}
.lb-addr:focus-visible {
    outline: 2px solid var(--green-main);
    outline-offset: 2px;
}
.lb-view-btn {
    margin-left: auto;
    padding: 3px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-dark);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.lb-view-btn:hover {
    border-color: var(--border-active);
    color: var(--text-main);
    background: var(--bg-card-hover);
}
.lb-view-btn:focus-visible {
    outline: 2px solid var(--green-main);
    outline-offset: 2px;
}

.lb-profile-popover {
    position: absolute;
    z-index: 10000;
    width: 240px;
    padding: 14px;
    border: 1px solid var(--border-active);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: var(--shadow-elevated, 0 12px 40px rgba(0, 0, 0, 0.5));
    animation: lbPopIn 0.14s ease-out;
}
@keyframes lbPopIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lb-profile-popover .lb-pop-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.lb-profile-popover .lb-pop-id {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.lb-profile-popover .lb-pop-addr {
    font-weight: 700;
    color: var(--text-main);
    font-size: 13px;
}
.lb-profile-popover .lb-pop-copy {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    color: var(--green-main);
    font-size: 11px;
    cursor: pointer;
}
.lb-profile-popover .lb-pop-copy:hover { text-decoration: underline; }
.lb-profile-popover .lb-pop-copy:focus-visible {
    outline: 2px solid var(--green-main);
    outline-offset: 2px;
}
.lb-profile-popover .lb-pop-body {
    padding: 8px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 13px;
}
.lb-profile-popover .lb-pop-explorer {
    display: inline-block;
    margin-top: 10px;
    color: var(--blue-light);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.lb-profile-popover .lb-pop-explorer:hover { text-decoration: underline; }

/* Mining start-summary risk framing (#8) */
.mining-risk-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--yellow-main, #ffd93d);
    border-radius: 8px;
    background: rgba(255, 217, 61, 0.06);
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.45;
}
.mining-risk-note svg {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--yellow-main, #ffd93d);
}

/* Inline "permanent team" note in the new-team row (#11) */
.team-row-note {
    margin-top: 3px;
    font-size: 11px;
    color: var(--text-faint);
}

/* ============================================
   River Activity rail (dashboard right column)
   Live feed of recent public events from all players — populated by
   js/features/activityFeed.js from GET /api/activity.
   ============================================ */
.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    /* Stretch (not start): the rail runs the full height of the main
       column, so the feed reaches the bottom of the page instead of
       leaving dead water beside My Top Salmon. */
    align-items: stretch;
}

/* The rail narrows the main column, and css/stats.css globally overrides
   .stats-grid to auto-fill minmax(220px) (a class shared with the Stats tab),
   which wraps the four stat cards 3+1 here. Pin a clean 2x2 in the railed
   layout; 4-across returns on ultra-wide screens and when the rail stacks. */
.dashboard-main .stats-grid {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 1700px) {
    .dashboard-main .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.activity-rail {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 18px;
    /* The rail must NEVER define the row height - height:0 removes its
       content from grid track sizing (so the main column ends the row at
       My Top Salmon), then min-height refills the resolved track. Older
       events scroll inside .activity-feed. */
    height: 0;
    min-height: 100%;
}

.activity-rail .section-header {
    margin-bottom: 10px;
}

.activity-rail .section-header h2 {
    font-size: 18px;
}

/* Pulsing "live" indicator next to the heading. */
.activity-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green-main);
    box-shadow: 0 0 8px var(--green-main);
    animation: activityPulse 2.4s ease-in-out infinite;
}

@keyframes activityPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
    .activity-live-dot { animation: none; }
}

.activity-feed {
    display: flex;
    flex-direction: column;
    /* Fill the stretched rail; internal scroll takes over past the fetch
       window (30 events). */
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.activity-feed::-webkit-scrollbar {
    display: none;
}

.activity-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12.5px;
}

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

.activity-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.activity-icon svg {
    width: 14px;
    height: 14px;
}

/* Per-family accent colors (match the app palette: cyan actions, red combat,
   gold rewards/prices, pink breeding, blue market). */
.activity-row.mint .activity-icon           { color: var(--green-main); background: rgba(45, 212, 233, 0.12); }
.activity-row.mine_started .activity-icon   { color: #a78bfa; background: rgba(167, 139, 250, 0.12); }
.activity-row.raid_started .activity-icon   { color: #ff6b7a; background: rgba(255, 107, 122, 0.12); }
.activity-row.raid_settled .activity-icon   { color: var(--yellow-main); background: rgba(255, 161, 87, 0.12); }
.activity-row.bred .activity-icon           { color: #ff8ab8; background: rgba(255, 138, 184, 0.12); }
.activity-row.market_sale .activity-icon    { color: var(--yellow-main); background: rgba(255, 161, 87, 0.12); }
.activity-row.market_listing .activity-icon { color: var(--blue-main); background: rgba(95, 168, 214, 0.14); }
.activity-row.tavern_listing .activity-icon { color: #ffd166; background: rgba(255, 209, 102, 0.12); }

.activity-body {
    flex: 1;
    min-width: 0;
    color: var(--text-muted);
    line-height: 1.45;
    overflow-wrap: break-word;
}

.activity-actor {
    color: #fff;
    font-weight: 600;
}

.activity-actor.you {
    color: var(--green-main);
}

.activity-time {
    flex-shrink: 0;
    font-size: 10.5px;
    color: var(--text-faint, rgba(255, 255, 255, 0.4));
    margin-top: 2px;
    white-space: nowrap;
}

.activity-empty {
    padding: 24px 8px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-faint, rgba(255, 255, 255, 0.4));
}

/* Stack below the main column on narrow screens; cap the feed height so it
   doesn't swallow the page. */
@media (max-width: 1279px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
    .activity-rail {
        /* Stacked below the main column: the height-0 trick would collapse
           the rail entirely - restore natural sizing with a capped feed. */
        height: auto;
        min-height: 0;
    }
    .activity-feed {
        flex: none;
        max-height: 420px;
    }
    /* Rail stacked → main column is full width again. 4-across down to the
       existing 900px/2-col mobile breakpoints (marketplace.css). */
    .dashboard-main .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .dashboard-main .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Battles W/L: color the halves so the ratio reads at a glance. */
.stat-value-dual .stat-won { color: var(--green-light, #4ade80); }
.stat-value-dual .stat-separator { opacity: 0.45; margin: 0 4px; }
.stat-value-dual .stat-lost { color: var(--pink-main, #ff6a8a); }
