/*==================================================
    Fish Fish - The Sacrificial Ritual
    The altar, its blood meter and the pet picker
    (ritual-client.js).
==================================================*/

.pet-header-actions .ritual-button {
    border-color: rgba(248, 113, 113, 0.7);
    background: linear-gradient(180deg, rgba(185, 28, 28, 0.55), rgba(127, 29, 29, 0.55));
    color: #fee2e2;
}

.rt-modal {
    width: min(1120px, 100%);
    border-color: rgba(220, 38, 38, 0.45);
    background:
        radial-gradient(700px 320px at 20% 0%, rgba(185, 28, 28, 0.2), transparent 60%),
        #160c10;
}

.rt-modal .book-header {
    align-items: center;
    gap: 10px 14px;
}

.rt-modal .book-header > div:first-child {
    flex: 1 1 260px;
    min-width: 0;
}

.rt-modal h2 {
    color: #fecaca;
}

.rt-muted {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.rt-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

/* The altar and the blood meter */
.rt-altar {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(220, 38, 38, 0.35);
    border-radius: var(--ff-r-lg, 16px);
    background: linear-gradient(180deg, #24121a, #170b10);
    text-align: center;
}

.rt-altar-art svg {
    width: min(220px, 80%);
    height: auto;
}

.rt-flame {
    animation: rt-flicker 0.8s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: 50% 100%;
}

.rt-altar.is-full .rt-sigil {
    animation: rt-pulse 1.6s ease-in-out infinite;
}

@keyframes rt-flicker {
    from { transform: scaleY(0.82); }
    to { transform: scaleY(1.12); }
}

@keyframes rt-pulse {
    50% { opacity: 0.35; }
}

.rt-meter {
    position: relative;
    height: 26px;
    overflow: hidden;
    border: 1px solid rgba(248, 113, 113, 0.5);
    border-radius: var(--ff-r-pill, 999px);
    background: #0d0609;
}

.rt-meter i {
    position: absolute;
    inset: 0 auto 0 0;
    background: linear-gradient(90deg, #7f1d1d, #dc2626, #f87171);
    box-shadow: 0 0 14px rgba(220, 38, 38, 0.6);
    transition: width 0.4s ease;
}

.rt-meter span {
    position: relative;
    display: block;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 24px;
    text-shadow: 0 1px 2px #000;
    font-variant-numeric: tabular-nums;
}

.rt-extra {
    margin: 0;
    color: #fca5a5;
    font-size: 0.8rem;
    font-weight: 700;
}

.rt-perform {
    justify-self: center;
    min-width: 200px;
    border-color: #f87171;
    background: linear-gradient(180deg, #b91c1c, #7f1d1d);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 0 18px rgba(220, 38, 38, 0.55);
}

.rt-perform-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.rt-table {
    display: grid;
    grid-template-columns: auto auto;
    gap: 3px 14px;
    justify-content: center;
    margin-top: 4px;
    font-size: 0.82rem;
    text-align: left;
}

.rt-table b {
    color: #fca5a5;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The pet picker */
.rt-offering {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.rt-filters,
.rt-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rt-filters button {
    padding: 5px 12px;
    border-radius: var(--ff-r-pill, 999px);
    font-size: 0.82rem;
}

.rt-filters button.active {
    border-color: #f87171;
    background: rgba(220, 38, 38, 0.2);
}

.rt-filters small {
    color: var(--muted);
}

.rt-tools button {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 0.82rem;
}

.rt-pets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 6px;
    max-height: min(430px, 52vh);
    overflow-y: auto;
    padding-right: 4px;
}

.rt-pet {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 5px 9px 5px 5px;
    border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent);
    border-radius: var(--ff-r-lg, 12px);
    background: color-mix(in srgb, var(--rc) 8%, #120a0e);
    color: var(--text);
    text-align: left;
}

.rt-pet .pet-icon {
    flex: none;
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.rt-pet > span {
    display: grid;
    flex: 1;
    min-width: 0;
}

.rt-pet strong {
    overflow: hidden;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rt-pet small {
    color: var(--muted);
    font-size: 0.72rem;
}

.rt-pet em {
    color: #fca5a5;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.rt-pet.picked {
    border-color: #f87171;
    background: rgba(185, 28, 28, 0.32);
    box-shadow: inset 0 0 0 1px #f87171;
}

.rt-warn {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #f59e0b;
    color: #1c1003;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 900;
}

.rt-empty {
    padding: 22px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: var(--ff-r-lg, 12px);
    text-align: center;
}

.rt-foot {
    display: grid;
    gap: 6px;
    justify-items: start;
}

.rt-sacrifice {
    min-width: 240px;
    border-color: #f87171;
    background: rgba(185, 28, 28, 0.35);
    font-weight: 900;
}

@media (max-width: 760px) {
    .rt-layout {
        grid-template-columns: 1fr;
    }

    .rt-pets {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        max-height: 50vh;
    }

    .rt-sacrifice {
        width: 100%;
        min-width: 0;
    }
}

html:is(.ff-low-detail, .ff-motion-off) .rt-flame,
html:is(.ff-low-detail, .ff-motion-off) .rt-sigil {
    animation: none !important;
}
