::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.card-stage {
    min-height: 330px;
    border: 10px solid #7c4a24;
    border-radius: 0.85rem;
    background: linear-gradient(180deg, #14532d 0%, #166534 100%);
    overflow: hidden;
    box-shadow: inset 0 0 0 2px #a1622d;
    position: relative;
}

.card-stage.is-locked::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    z-index: 40;
}

.card-stage.is-locked::after {
    content: '🔒';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(78px, 12vw, 130px);
    z-index: 41;
    text-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
}

.card-row {
    position: relative;
    height: 330px;
    padding-top: 22px;
    --pack-shift: -54px;
}

.card-row.is-shuffling .choice-card {
    transform: translateX(var(--pack-shift)) rotate(0deg) translateY(10px) scale(0.98) !important;
    opacity: 0.92;
}

.card-row.is-shuffling .choice-card-inner {
    animation: shuffleCard 0.24s ease-in-out infinite;
}

.choice-card {
    position: absolute;
    left: 50%;
    bottom: 56px;
    width: 148px;
    height: 220px;
    border: 0;
    padding: 0;
    background: transparent;
    transform-origin: 50% 100%;
    transform: translateX(calc(var(--offset) * 36px - 54px)) rotate(calc(var(--offset) * 6deg));
    cursor: pointer;
    transition: transform 0.28s ease, filter 0.28s ease;
}

.choice-card:hover {
    transform: translateX(calc(var(--offset) * 36px - 54px)) rotate(calc(var(--offset) * 6deg)) translateY(-14px);
    z-index: 20;
}

.choice-card:disabled {
    cursor: not-allowed;
}

.choice-card-inner {
    width: 100%;
    height: 100%;
    border-radius: 0.8rem;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.16);
    border: 1px solid #cbd5e1;
    background: #0f172a url('bg.png') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    color: #ffffff;
    user-select: none;
}

.choice-card-inner .icon {
    font-size: 1.1rem;
}

.choice-card-inner .label {
    font-size: 0.72rem;
    color: #f8fafc;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.7);
}

.choice-card.is-picking .choice-card-inner {
    animation: cardPulse 0.55s ease-in-out infinite;
}

.choice-card.is-revealed {
    z-index: 30;
    transform: translateX(-68px) rotate(0) translateY(-22px) scale(1.05);
}

.choice-card.is-revealed .choice-card-inner {
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fdba74;
    color: #9a3412;
}

.choice-card.is-disabled {
    filter: grayscale(0.2) opacity(0.65);
}

.food-name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    padding: 0 0.3rem;
    color: #9a3412;
}

.result-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 1rem;
    text-align: center;
}

.result-value {
    font-size: 1.2rem;
    line-height: 1.7;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0.3rem;
}

.result-value.waiting {
    color: #2563eb;
}

.lock-tip {
    color: #dc2626;
    animation: lockTipBlink 3s step-start infinite;
}

.toast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: #1e293b;
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

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

@keyframes shuffleCard {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-1.8deg); }
}

@keyframes lockTipBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.2; }
}

@media (max-width: 640px) {
    .card-stage,
    .card-row {
        min-height: 270px;
        height: 270px;
    }

    .choice-card {
        width: 116px;
        height: 176px;
        bottom: 44px;
        transform: translateX(calc(var(--offset) * 26px - 38px)) rotate(calc(var(--offset) * 6deg));
    }

    .card-row {
        --pack-shift: -38px;
    }

    .choice-card:hover {
        transform: translateX(calc(var(--offset) * 26px - 38px)) rotate(calc(var(--offset) * 6deg)) translateY(-9px);
    }

    .food-name {
        font-size: 0.8rem;
    }

    .choice-card.is-revealed {
        transform: translateX(-46px) rotate(0) translateY(-18px) scale(1.05);
    }
}
