/* ── Sidebar claw machine trigger ── */

.sidebar__claw {
    padding: 12px 12px calc(12px + var(--safe-bottom));
    border-top: 2px solid rgba(192, 132, 252, 0.25);
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.sidebar__claw-btn {
    background: none;
    border: none;
    padding: 0;
    width: 75%;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.sidebar__claw-btn img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 4px 0 rgba(45, 10, 78, 0.85));
}

.sidebar__claw-btn:hover {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.08);
}

.sidebar__claw-btn:active {
    transform: translateY(2px) scale(0.98);
}

/* ── Claw machine modal ── */

.claw-overlay {
    z-index: 500;
}

.claw-overlay.is-open {
    align-items: center;
}

.claw-overlay .claw-modal {
    margin: auto;
    width: min(420px, calc(94vw - var(--safe-left) - var(--safe-right)));
    max-height: calc(var(--app-height, 100dvh) - 32px - var(--safe-top) - var(--safe-bottom));
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    background-image: var(--panel-noise), var(--panel-dot);
    background-size: 400px 400px, 22px 22px;
    border: 4px solid #D4AF37;
    box-shadow:
        0 0 0 3px var(--purple-dark),
        8px 8px 0 rgba(45, 10, 78, 0.75),
        inset 0 0 0 2px rgba(212, 175, 55, 0.25);
    animation: claw-pop 0.28s ease;
}

@keyframes claw-pop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.claw-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(180deg, #5B21B6 0%, var(--purple-dark) 100%);
    border-bottom: 3px solid #D4AF37;
}

.claw-modal__title {
    font-family: 'Press Start 2P', cursive;
    font-size: 9px;
    color: #FDE68A;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.claw-modal__close {
    background: var(--purple);
    border: 2px solid #D4AF37;
    color: #fff;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--purple-dark);
    flex-shrink: 0;
}

.claw-modal__close:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.claw-modal__body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.claw-modal__footer {
    padding: 12px 16px calc(16px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 2px dashed rgba(212, 175, 55, 0.45);
    background: rgba(45, 10, 78, 0.35);
}

.claw-intro {
    font-size: 14px;
    line-height: 1.55;
    color: #E9D5FF;
    margin-bottom: 16px;
    text-align: center;
}

.claw-budget-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.claw-budget-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    color: #FDE68A;
    line-height: 1.8;
}

.claw-budget-input {
    width: 100%;
    padding: 12px 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    border: 3px solid #D4AF37;
    background: var(--surface);
    color: var(--purple-dark);
    outline: none;
    box-shadow: inset 3px 3px 0 rgba(45, 10, 78, 0.12);
}

.claw-budget-input:focus {
    border-color: var(--purple-soft);
}

.claw-budget-hint {
    font-size: 11px;
    color: var(--purple-soft);
    text-align: center;
    margin: 4px 0 0;
}

.claw-btn {
    width: 100%;
    padding: 12px;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    line-height: 1.6;
    cursor: pointer;
    border: 2px solid var(--purple-dark);
    transition: transform 0.06s, box-shadow 0.06s;
}

.claw-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none !important;
}

.claw-btn--grab {
    background: linear-gradient(180deg, #FDE68A 0%, #D4AF37 100%);
    color: var(--purple-dark);
    border-color: #92400E;
    box-shadow: 4px 4px 0 #78350F;
    font-size: 9px;
}

.claw-btn--primary {
    background: var(--purple);
    color: #fff;
    box-shadow: 3px 3px 0 var(--purple-dark);
}

.claw-btn--secondary {
    background: var(--surface);
    color: var(--purple-dark);
    box-shadow: 3px 3px 0 var(--purple-soft);
}

.claw-btn--ghost {
    background: transparent;
    color: var(--purple-soft);
    border-color: rgba(192, 132, 252, 0.4);
    box-shadow: none;
}

.claw-result-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    margin-bottom: 14px;
    padding: 10px;
    background: rgba(45, 10, 78, 0.5);
    border: 2px dashed #D4AF37;
}

.claw-result-total {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: #FDE68A;
    line-height: 1.8;
}

.claw-result-left {
    font-size: 12px;
    color: var(--purple-soft);
    font-weight: 500;
}

.claw-result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.claw-result-card {
    background: var(--surface);
    border: 2px solid var(--purple-soft);
    box-shadow: 2px 2px 0 var(--purple-dark);
    overflow: hidden;
}

.claw-result-card__img {
    aspect-ratio: 1;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.claw-result-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.claw-result-card__body {
    padding: 8px;
}

.claw-result-card__name {
    font-size: 11px;
    font-weight: 700;
    color: var(--purple-dark);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.claw-result-card__meta {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

@media (min-width: 480px) {
    .claw-result-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
