/* ============================================
   BLORPS App - Breeding Lab Styles
   DNA Laboratory Aesthetic
   ============================================ */

/* ============================================
   Battle Modal Styles
   ============================================ */
.battle-modal {
    max-width: 700px;
    width: 95%;
}

.battle-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.battle-header h3 {
    flex: 1;
}

.battle-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 100, 100, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 20px;
    color: #ff6b6b;
    font-family: var(--font-display);
    font-size: 14px;
}

.battle-timer svg {
    width: 16px;
    height: 16px;
}

.battle-body {
    padding: 24px;
}

.battle-arena {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 24px;
}

.battle-side {
    flex: 1;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    position: relative;
}

.battle-side.defender {
    background: linear-gradient(135deg, rgba(30, 100, 200, 0.15), rgba(30, 100, 200, 0.05));
    border: 2px solid rgba(30, 100, 200, 0.3);
}

.battle-side.attacker {
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.15), rgba(255, 100, 100, 0.05));
    border: 2px solid rgba(255, 100, 100, 0.3);
}

.battle-side .side-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.battle-side.defender .side-label {
    color: #4dabf7;
}

.battle-side.attacker .side-label {
    color: #ff6b6b;
}

.battle-side .label-icon {
    font-size: 18px;
}

.battle-team {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.battle-team .battle-blorp {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-main);
    border: 2px solid var(--border-subtle);
}

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

.battle-bp {
    margin-bottom: 16px;
}

.battle-bp .bp-label {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.battle-bp .bp-value {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
}

.battle-side.defender .bp-value {
    color: #4dabf7;
}

.battle-side.attacker .bp-value {
    color: #ff6b6b;
}

.battle-side.winning .bp-value {
    color: var(--green-main);
    text-shadow: 0 0 20px rgba(0, 255, 135, 0.5);
}

.reinforcement-slot {
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.reinforcement-slot .reinforce-label {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.reinforce-blorp {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.reinforce-blorp.empty {
    background: var(--bg-hover);
    border: 2px dashed var(--border-subtle);
    color: var(--text-dim);
    font-size: 18px;
}

.reinforce-blorp.filled {
    background: var(--bg-main);
    border: 2px solid var(--green-main);
}

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

.battle-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 60px;
}

.battle-vs .vs-glow {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 200, 0, 0.3), transparent 70%);
    border-radius: 50%;
    animation: vsGlow 2s ease-in-out infinite;
}

@keyframes vsGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.battle-vs span {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: #ffc107;
    text-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
    z-index: 1;
}

.battle-turn-indicator {
    text-align: center;
    padding: 12px 24px;
    background: var(--bg-hover);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-dim);
}

.battle-turn-indicator.your-turn {
    background: rgba(0, 255, 135, 0.1);
    border: 1px solid rgba(0, 255, 135, 0.3);
    color: var(--green-main);
}

.battle-turn-indicator.opponent-turn {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.battle-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.battle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.battle-btn svg {
    width: 18px;
    height: 18px;
}

.battle-btn.reinforce-btn {
    background: var(--green-main);
    color: var(--bg-main);
}

.battle-btn.reinforce-btn:hover:not(:disabled) {
    background: var(--green-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 255, 135, 0.3);
}

.battle-btn.settle-btn {
    background: #ffc107;
    color: var(--bg-main);
}

.battle-btn.settle-btn:hover:not(:disabled) {
    background: #ffcd38;
    transform: translateY(-1px);
}

.battle-btn.wait-btn {
    background: var(--bg-hover);
    color: var(--text-dim);
    border: 1px solid var(--border-subtle);
}

.battle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

/* Battle Results Modal */
.battle-results-modal {
    max-width: 400px;
    width: 90%;
    text-align: center;
    overflow: hidden;
}

.results-banner {
    padding: 40px 24px;
    position: relative;
}

.results-banner.victory {
    background: linear-gradient(135deg, rgba(0, 255, 135, 0.2), rgba(0, 255, 135, 0.05));
}

.results-banner.defeat {
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.2), rgba(255, 100, 100, 0.05));
}

.results-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    animation: resultsIconPulse 1.5s ease-in-out infinite;
}

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

.results-banner h2 {
    font-family: var(--font-display);
    font-size: 32px;
    margin: 0;
}

.results-banner.victory h2 {
    color: var(--green-main);
    text-shadow: 0 0 30px rgba(0, 255, 135, 0.5);
}

.results-banner.defeat h2 {
    color: #ff6b6b;
    text-shadow: 0 0 30px rgba(255, 100, 100, 0.5);
}

.results-body {
    padding: 24px;
}

.results-rewards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.reward-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    background: var(--bg-hover);
}

.reward-row.your-reward {
    background: rgba(0, 255, 135, 0.1);
    border: 1px solid rgba(0, 255, 135, 0.3);
}

.reward-label {
    font-size: 13px;
    color: var(--text-dim);
    min-width: 100px;
    text-align: left;
}

.reward-amount {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.reward-row.your-reward .reward-amount {
    color: var(--green-main);
}

.reward-token {
    font-size: 14px;
    color: var(--purple-light);
}

.results-close-btn {
    width: 100%;
    padding: 16px;
    border-radius: 10px;
    border: none;
    background: var(--green-main);
    color: var(--bg-main);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.results-close-btn:hover {
    background: var(--green-light);
    transform: translateY(-1px);
}

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

/* ============================================
   Breed Button Disabled State
   ============================================ */
.breed-btn-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

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

.coming-soon-badge.breed-soon {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 217, 61, 0.2);
    color: #ffd93d;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
}


/* ============================================
   Breed readiness + result reveal
   ============================================ */

.parent-breed-status {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.parent-breed-status.ready {
    color: #4ade80;
}

.parent-breed-status.cooldown {
    color: #facc15;
}

.breed-result-reveal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    animation: breedRevealPop 0.5s ease-out;
}

.breed-result-reveal .breed-result-art {
    width: 140px;
    height: 140px;
}

.breed-result-reveal .breed-result-art svg {
    width: 100%;
    height: 100%;
}

@keyframes breedRevealPop {
    0%   { transform: scale(0.6); opacity: 0; }
    70%  { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   Pending breed banner (VRF finalize / rescue)
   ============================================ */

.breed-pending-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0;
    padding: 10px 14px;
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.35);
    border-radius: 8px;
}

.breed-pending-text {
    font-size: 13px;
    color: #facc15;
}

.breed-rescue-btn {
    padding: 8px 14px;
    border: 1px solid rgba(250, 204, 21, 0.6);
    border-radius: 8px;
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.breed-rescue-btn:hover {
    background: rgba(250, 204, 21, 0.3);
}

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

.breed-rescue-btn.finalize {
    border-color: rgba(74, 222, 128, 0.6);
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.breed-rescue-btn.finalize:hover {
    background: rgba(74, 222, 128, 0.3);
}

/* ============================================
   Parent lineage (one generation up)
   ============================================ */

.lineage-section {
    margin: 12px 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.lineage-section .section-header h4 {
    margin: 0 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim, #9ca3af);
}

.lineage-panels {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.lineage-panel {
    flex: 1 1 240px;
    min-width: 220px;
}

.lineage-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text, #e5e7eb);
}

.lineage-parents {
    display: flex;
    gap: 10px;
}

.lineage-parents.loading {
    font-size: 12px;
    color: var(--text-dim, #9ca3af);
}

.lineage-parents.genesis {
    flex-direction: column;
    gap: 2px;
}

/* Transient RPC failure while reading lineage - distinct from Genesis so a
   network blip isn't mislabelled as a first-run mint. Reopen the panel to
   retry (the failed result is never cached). */
.lineage-parents.unavailable {
    font-size: 12px;
    color: var(--text-dim, #9ca3af);
    font-style: italic;
}

.lineage-genesis-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.4);
    color: #60a5fa;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lineage-genesis-hint {
    font-size: 11px;
    color: var(--text-dim, #9ca3af);
}

.lineage-parent-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 0;
}

.lineage-parent-card.clickable {
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.lineage-parent-card.clickable:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.lineage-parent-art {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lineage-parent-art svg {
    width: 100%;
    height: 100%;
}

.lineage-art-fallback {
    font-size: 18px;
    color: #555;
}

.lineage-parent-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.lineage-parent-id {
    font-size: 12px;
    font-weight: 700;
    color: var(--text, #e5e7eb);
}

.lineage-parent-class {
    font-size: 11px;
    color: var(--text-dim, #9ca3af);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lineage-parent-rarity {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lineage-parent-rarity.legendary { color: #ffd93d; }
.lineage-parent-rarity.mythic { color: #ff6b3d; }
.lineage-parent-rarity.epic      { color: #c084fc; }
.lineage-parent-rarity.rare      { color: #60a5fa; }
.lineage-parent-rarity.common    { color: #9ca3af; }

.lineage-parent-card.unknown {
    color: var(--text-dim, #9ca3af);
    font-size: 12px;
    padding: 10px 14px;
}

/* ============================================
   Mutation info hint (cost bar)
   ============================================ */
.cost-item.mutation {
    position: relative;
}

.mutation-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    margin-left: 4px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-dim, #9ca3af);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.mutation-info:hover,
.mutation-info:focus-visible,
.mutation-info[aria-expanded="true"] {
    background: rgba(45, 212, 233, 0.25);
    color: var(--text-main, #e5e7eb);
    outline: none;
}

.mutation-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: max-content;
    max-width: 240px;
    padding: 8px 10px;
    border: 1px solid rgba(45, 212, 233, 0.3);
    border-radius: 8px;
    background: var(--surface-2, #1a1f2e);
    color: var(--text-main, #e5e7eb);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.mutation-popover::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--surface-2, #1a1f2e);
}

.mutation-popover[hidden] {
    display: none;
}

/* ============================================
   Newborn Reveal Modal (built inline on .modal-shell)
   ============================================ */
.breed-reveal {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.breed-reveal-art {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 96px;
    border-radius: 16px;
    background: radial-gradient(circle at 50% 35%, rgba(45, 212, 233, 0.18), rgba(3, 12, 22, 0.35));
    border: 1px solid var(--border-active, rgba(45, 212, 233, 0.35));
    box-shadow: 0 0 30px rgba(45, 212, 233, 0.18);
    animation: breed-reveal-pop 0.45s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
}

.breed-reveal-art svg {
    width: 100%;
    height: 100%;
}

@keyframes breed-reveal-pop {
    0%   { transform: scale(0.6) rotate(-6deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.breed-reveal-id {
    font-family: var(--font-display, inherit);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main, #e5e7eb);
}

.breed-reveal-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.breed-reveal-tags span {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main, #e5e7eb);
}

.breed-reveal-rarity {
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.breed-reveal-stats {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
    margin-top: 4px;
}

.breed-reveal-stat {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.breed-reveal-stat .brs-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-dim, #9ca3af);
    cursor: help;
}

.breed-reveal-stat .brs-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main, #e5e7eb);
    font-variant-numeric: tabular-nums;
}

.breed-reveal-note {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-dim, #9ca3af);
}


/* Class badge (top-left) + faction badge (top-right) overlay the reveal art,
   mirroring the salmon-card corner treatment; the old text pills below the
   name are gone (rarity pill remains). */
.breed-reveal-art .class-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    z-index: 3;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(20, 20, 32, 0.85);
    padding: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(255, 255, 255, 0.12);
}

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

.breed-reveal-art .faction-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}
