.gacha-page {
    min-height: 100vh;
    background: #fcfaf7;
    color: #333;
}

.gacha-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #e2d9c2;
    position: sticky;
    top: 0;
    z-index: 10;
}

.gacha-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.gacha-brand h2 {
    font-size: 1.1rem;
    font-weight: 900;
    color: #1e3a8a;
}

.gacha-brand span {
    color: #ff6b00;
}

.gacha-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #1e3a8a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gacha-balance {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: #f8f6f1;
    border: 1px solid #e2d9c2;
    font-weight: 700;
}

.gacha-content {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem 3rem;
}

.gacha-lobby {
    text-align: center;
    max-width: 520px;
}

.gacha-lobby img {
    width: 160px;
    height: 160px;
    margin-bottom: 1rem;
}

.gacha-banner-card {
    width: 180px;
    height: 260px;
    margin: 0 auto 1.5rem;
    perspective: 1000px;
}

.gacha-banner-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: gacha-rotate 6s linear infinite;
}

.gacha-banner-front,
.gacha-banner-back {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #3b82f6;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.gacha-banner-front {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    color: #ffffff;
    font-weight: 800;
}

.gacha-banner-back {
    transform: rotateY(180deg);
    background: #ffffff;
    color: #f59e0b;
    font-size: 2rem;
}

@keyframes gacha-rotate {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

.gacha-orb {
    position: absolute;
    width: 240px;
    height: 240px;
    background: rgba(59, 130, 246, 0.15);
    filter: blur(60px);
    border-radius: 50%;
    z-index: -1;
}

.gacha-actions {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.gacha-actions button {
    border: 2px solid #e2d9c2;
    border-radius: 1.4rem;
    padding: 1.2rem;
    background: #ffffff;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    cursor: pointer;
}

.gacha-actions button.primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff;
    border-color: transparent;
}

.gacha-message {
    margin-top: 1rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.8rem;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
}

.gacha-results {
    width: 100%;
    max-width: 980px;
    text-align: center;
}

.gacha-note {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

.gacha-grid {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.gacha-card {
    width: 190px;
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
}

.gacha-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.gacha-card.flipped .gacha-card-inner {
    transform: rotateY(180deg);
}

.gacha-card-front,
.gacha-card-back {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    backface-visibility: hidden;
}

.gacha-card-front {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #3b82f6;
    overflow: hidden;
}

.gacha-card-front .pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#ffffff 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
}

.gacha-card-back {
    background: #ffffff;
    transform: rotateY(180deg);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.gacha-card-back img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
}

.gacha-grade {
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748b;
}

.gacha-card-back strong {
    display: block;
    margin-top: 0.4rem;
    font-size: 1rem;
    font-weight: 800;
}

.gacha-card-back.legendary {
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
    border: 2px solid #fbbf24;
}

.gacha-card-back.epic {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.4);
    border: 2px solid #a855f7;
}

.gacha-card-back.rare {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
    border: 2px solid #3b82f6;
}

.gacha-reset {
    margin-top: 2rem;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 0.9rem;
    padding: 0.8rem 2rem;
    font-weight: 700;
    cursor: pointer;
}
