/* =========================================================
   STARTER PACK JÁTÉK - stílusok
   A saját színek változókban élnek, így a világos / sötét / buzi téma is felülírhatja.
   ========================================================= */

#sp-root {
    --sp-surface: #ffffff;
    --sp-surface-2: #fff0f3;
    --sp-line: rgba(245, 169, 184, 0.55);
    --sp-ink: #4a4a4a;
    --sp-soft: #6c757d;
    --sp-plus: #1b8a5a;
    --sp-plus-bg: rgba(48, 180, 120, 0.14);
    --sp-minus: #c0364a;
    --sp-minus-bg: rgba(220, 70, 90, 0.14);
    --sp-track: rgba(0, 0, 0, 0.09);
}

[data-bs-theme="dark"] #sp-root {
    --sp-surface: #1f1a2e;
    --sp-surface-2: #2a2340;
    --sp-line: rgba(245, 169, 184, 0.35);
    --sp-ink: #ebe7f5;
    --sp-soft: #b9b3cc;
    --sp-plus: #6fe0a8;
    --sp-plus-bg: rgba(80, 210, 150, 0.16);
    --sp-minus: #ff8a98;
    --sp-minus-bg: rgba(255, 110, 130, 0.16);
    --sp-track: rgba(255, 255, 255, 0.12);
}

[data-theme="buzi"] #sp-root {
    --sp-surface: rgba(28, 14, 52, 0.90);
    --sp-surface-2: rgba(52, 30, 88, 0.94);
    --sp-ink: #ffffff;
    --sp-soft: #efe6ff;
}

/* ---------- Üzlet: tárgykártyák ---------- */
.sp-slot-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.sp-slot-icon {
    font-size: 1.3rem;
}

.sp-item {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    text-align: left;
    padding: 14px 14px 12px;
    border: 3px dashed var(--pink);
    border-radius: 20px;
    background: var(--sp-surface);
    color: var(--sp-ink);
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.sp-item:hover {
    transform: translateY(-4px);
    border-style: solid;
    box-shadow: 0 10px 20px rgba(245, 169, 184, 0.3);
}

.sp-item:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

.sp-item.selected {
    border: 3px solid var(--blue);
    background: var(--sp-surface-2);
    box-shadow: 0 5px 18px rgba(91, 206, 250, 0.45);
}

.sp-item.selected::after {
    content: '✔';
    position: absolute;
    top: 10px;
    right: 12px;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
}

.sp-item.cant:not(.selected) {
    opacity: 0.45;
    filter: grayscale(0.6);
    border-style: dotted;
}

.sp-item.cant:not(.selected):hover {
    transform: none;
    box-shadow: none;
}

.sp-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 32px;
}

.sp-item-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.sp-item-name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
}

.sp-price {
    display: inline-block;
    margin: 8px 0 4px;
    padding: 1px 10px;
    border-radius: 999px;
    background: rgba(245, 169, 184, 0.22);
    border: 1px solid var(--sp-line);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.sp-item-desc {
    margin: 0 0 4px;
    font-size: 0.85rem;
    color: var(--sp-soft);
}

.sp-item-joke {
    margin: 0 0 8px;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--pink);
}

.sp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sp-chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.sp-chip.plus {
    color: var(--sp-plus);
    background: var(--sp-plus-bg);
}

.sp-chip.minus {
    color: var(--sp-minus);
    background: var(--sp-minus-bg);
}

@keyframes spShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

.sp-item.shake {
    animation: spShake 0.35s ease;
}

#sp-root.busy .sp-item {
    pointer-events: none;
}

/* ---------- Karakterlap ---------- */
@media (min-width: 992px) {
    .sp-sheet {
        position: sticky;
        top: 92px;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

.sp-sheet:hover {
    transform: none;
}

.sp-avatar {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-face {
    position: relative;
    z-index: 1;
    font-size: 4.2rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.sp-avatar:hover .sp-face {
    transform: scale(1.12) rotate(-6deg);
}

.sp-aura {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 169, 184, 0.35), rgba(91, 206, 250, 0.18) 60%, transparent 72%);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.sp-avatar.full .sp-aura {
    background: conic-gradient(#ff2d55, #ff9500, #ffd60a, #30d158, #0a84ff, #bf5af2, #ff2d55);
    -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%, #000 66%, transparent 68%);
    mask: radial-gradient(circle, transparent 54%, #000 56%, #000 66%, transparent 68%);
    animation: spSpin 6s linear infinite;
}

@keyframes spSpin {
    to {
        transform: rotate(360deg);
    }
}

.sp-score {
    line-height: 1.1;
}

.sp-money-track,
.sp-bar-track {
    height: 10px;
    border-radius: 999px;
    background: var(--sp-track);
    overflow: hidden;
}

.sp-money-track {
    margin-top: 4px;
}

.sp-money-fill {
    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #30d158, #ffd60a);
    transition: width 0.35s ease;
}

.sp-money-track.low .sp-money-fill {
    background: linear-gradient(90deg, #ff9500, #ff2d55);
}

.sp-bar-row {
    display: grid;
    grid-template-columns: 92px 1fr 32px;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.sp-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--blue), var(--pink));
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sp-bar-val {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sp-bar-val.neg {
    color: var(--sp-minus);
}

.sp-equip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sp-equip-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 2px;
    border: 2px dashed var(--sp-line);
    border-radius: 14px;
    background: transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sp-equip-cell.filled {
    border-style: solid;
    border-color: var(--blue);
    background: var(--sp-surface-2);
}

.sp-equip-cell:not(.filled) .sp-equip-emoji {
    opacity: 0.3;
    filter: grayscale(1);
}

.sp-equip-emoji {
    font-size: 1.6rem;
    line-height: 1.2;
}

.sp-equip-label {
    font-size: 0.68rem;
    color: var(--sp-soft);
}

@keyframes spPop {
    0% {
        transform: scale(0.4) rotate(-12deg);
    }

    60% {
        transform: scale(1.25) rotate(6deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

.sp-equip-cell.pop .sp-equip-emoji {
    animation: spPop 0.4s ease;
}

.sp-list li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 6px 0;
    font-size: 0.88rem;
    border-top: 1px solid var(--sp-line);
}

.sp-list li:first-child {
    border-top: 0;
}

.sp-combo-icon,
.sp-quest-box {
    font-size: 1.25rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.sp-quest:not(.done) {
    opacity: 0.8;
}

.sp-quest.done strong {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--pink);
}

/* ---------- Mobil összegző sáv és értesítés ---------- */
.sp-mobile-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 1040;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border: 2px solid var(--pink);
    border-radius: 999px;
    background: var(--sp-surface-2, #fff0f3);
    color: var(--dark);
    font-family: inherit;
    font-size: 0.95rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .sp-mobile-bar {
    background: #2a2340;
}

[data-theme="buzi"] .sp-mobile-bar {
    background: rgba(28, 14, 52, 0.94);
    color: #fff;
}

.sp-toast {
    position: fixed;
    left: 50%;
    bottom: 76px;
    z-index: 1070;
    max-width: calc(100vw - 32px);
    transform: translate(-50%, 20px);
    padding: 10px 20px;
    border-radius: 999px;
    background: #2b2433;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.sp-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (min-width: 992px) {
    .sp-toast {
        bottom: 28px;
    }
}

/* A mobil sáv ne takarja a lábléc alját */
@media (max-width: 991.98px) {
    #footer-placeholder {
        padding-bottom: 70px;
    }
}

/* ---------- Buzi mód ---------- */
[data-theme="buzi"] .sp-item {
    border: 3px solid transparent;
    background:
        linear-gradient(var(--sp-surface), var(--sp-surface)) padding-box,
        linear-gradient(90deg, #ff2d55, #ff9500, #ffd60a, #30d158, #0a84ff, #bf5af2, #ff2d55) border-box;
    background-size: auto, 300% 100%;
    animation: buziFlow 10s linear infinite;
}

[data-theme="buzi"] .sp-item.selected {
    background:
        linear-gradient(var(--sp-surface-2), var(--sp-surface-2)) padding-box,
        linear-gradient(90deg, #ff2d55, #ff9500, #ffd60a, #30d158, #0a84ff, #bf5af2, #ff2d55) border-box;
    background-size: auto, 300% 100%;
    box-shadow: 0 0 24px rgba(191, 90, 242, 0.75);
    animation-duration: 3s;
}

[data-theme="buzi"] .sp-item.selected::after {
    background: #bf5af2;
}

[data-theme="buzi"] .sp-slot-title,
[data-theme="buzi"] .sp-slot-title small {
    color: #fff !important;
    text-shadow: 0 2px 0 rgba(20, 5, 40, 0.55), 0 0 16px rgba(20, 5, 40, 0.55);
}

[data-theme="buzi"] .sp-aura {
    background: conic-gradient(#ff2d55, #ff9500, #ffd60a, #30d158, #0a84ff, #bf5af2, #ff2d55);
    -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%, #000 66%, transparent 68%);
    mask: radial-gradient(circle, transparent 54%, #000 56%, #000 66%, transparent 68%);
    animation: spSpin 6s linear infinite;
}

[data-theme="buzi"] .sp-item-joke {
    color: #ffb3d9;
}

[data-theme="buzi"] .sp-bar-fill,
[data-theme="buzi"] .sp-money-fill {
    background: linear-gradient(90deg, #ff2d55, #ff9500, #ffd60a, #30d158, #0a84ff, #bf5af2);
}

@media (prefers-reduced-motion: reduce) {

    .sp-aura,
    .sp-item,
    .sp-equip-cell.pop .sp-equip-emoji {
        animation: none !important;
    }
}
