* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
}
body,
html {
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    color: #fff;
}

.start-screen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
}
.pulse-logo {
    width: 220px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

#audio-control {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 1000;
}
.speaker-toggle {
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    outline: none;
}
.speaker-toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s;
}
.speaker-toggle:active img {
    transform: scale(0.9);
}

#bg-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
}

#coin-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.coin {
    position: absolute;
    top: -100px;
    animation: coinFall linear forwards;
}
@keyframes coinFall {
    to {
        transform: translateY(110vh);
    }
}

#ui-layer {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
}
.main-logo {
    width: 260px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px gold);
}

.gacha-board-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.gacha-wrapper {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 260px;
    background: rgba(15, 15, 15, 0.9);
    border: 2px solid gold;
    border-radius: 20px;
    overflow: hidden;
}

.fade-overlay-left,
.fade-overlay-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 150px;
    z-index: 50;
    pointer-events: none;
}
.fade-overlay-left {
    left: 0;
    background: linear-gradient(to right, rgba(15, 15, 15, 1), transparent);
}
.fade-overlay-right {
    right: 0;
    background: linear-gradient(to left, rgba(15, 15, 15, 1), transparent);
}

.selector-arrow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 35px solid #ffcc00;
    z-index: 100;
}

#slider-anchor {
    position: absolute;
    top: 50%;
    left: 0;
    height: 220px;
    transform: translateY(-50%);
}
.card-slider {
    display: flex;
    gap: 15px;
    position: absolute;
    left: 0;
    top: 0;
    will-change: transform;
}

.showcase-run {
    animation: smoothShowcase 60s linear infinite;
}
@keyframes smoothShowcase {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-5000px);
    }
}

.gacha-card-item {
    min-width: 160px;
    height: 220px;
    border-radius: 12px;
    border: 2px solid gold;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    transition: transform 0.5s ease;
}

.card-pop-in {
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes popIn {
    0% {
        transform: scale(0.5) rotateY(180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

.popup-box {
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid gold;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    width: 420px;
    max-width: 90%;
}
.popup-float {
    animation: floating 3s ease-in-out infinite;
}
@keyframes floating {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.winner-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    animation: floatingWinner 3s ease-in-out infinite;
    width: 380px;
    z-index: 2000;
    box-shadow: 0 0 50px rgba(255, 204, 0, 0.4);
    padding: 30px;
}
@keyframes floatingWinner {
    0%,
    100% {
        transform: translate(-50%, -50%);
    }
    50% {
        transform: translate(-50%, -55%);
    }
}

input {
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    background: #222;
    border: 1px solid gold;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    font-size: 16px;
}
.primary-btn {
    width: 100%;
    padding: 15px;
    background: gold;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    color: #000;
    font-size: 16px;
    transition: transform 0.2s;
    margin-top: 10px;
}
.primary-btn:active {
    transform: scale(0.95);
}

.secondary-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid gold;
    color: gold;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 14px;
}
.secondary-btn:hover {
    background: rgba(255, 215, 0, 0.1);
}

.flip-card-container {
    width: 160px;
    height: 220px;
    margin: 0 auto 15px;
    perspective: 1000px;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: spin 4s linear infinite;
}
@keyframes spin {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border: 2px solid gold;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
}
.flip-card-front {
    transform: rotateY(180deg);
}


.winner-info h2 {
    margin-bottom: 15px;
    color: gold;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
