/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    color: #fff;
}

/* ===== MAIN CONTAINER & ANIMATIONS ===== */
.container {
    width: 100%;
    max-width: 1000px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 25px;
    padding: 80px 30px 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 4px solid #ffcc00;
}

.container::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, #ff00cc, #3333ff, #00ffcc, #ffcc00);
    background-size: 400% 400%;
    z-index: -1;
    border-radius: 30px;
    animation: gradient 12s ease infinite;
    filter: blur(25px);
    opacity: 0.6;
}

/* ANIMATIONS */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.7);
    }

    100% {
        transform: scale(1.1);
        box-shadow: 0 0 0 20px rgba(255, 204, 0, 0);
    }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(1000px) rotate(720deg);
        opacity: 0;
    }
}

@keyframes prize-reveal {
    0% {
        transform: scale(0.1) rotate(-30deg);
        opacity: 0;
    }

    70% {
        transform: scale(1.15) rotate(5deg);
        opacity: 1;
    }

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

@keyframes resultReveal {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

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

@keyframes cardReveal {
    0% {
        transform: scale(0.1) rotate(0deg);
        opacity: 0;
    }

    70% {
        transform: scale(1.2) rotate(5deg);
        opacity: 1;
    }

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

@keyframes staggeredReveal {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }

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

@keyframes border-pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 10px currentColor;
    }

    50% {
        box-shadow: 0 0 40px currentColor;
    }

    100% {
        box-shadow: 0 0 10px currentColor;
    }
}

@keyframes legendaryGlow {
    0% {
        box-shadow: 0 0 20px rgba(255, 152, 0, 0.5);
    }

    100% {
        box-shadow: 0 0 40px rgba(255, 152, 0, 0.8);
    }
}

/* ===== HEADER & TYPOGRAPHY ===== */
header {
    margin: 20px 0 30px;
    position: relative;
    z-index: 2;
}

h1 {
    font-size: 3.8rem;
    margin-bottom: 10px;
    text-shadow: 0 0 15px #00eeff, 0 0 30px #00eeff;
    color: #fff;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.8rem;
    color: #ffcc00;
    margin-bottom: 5px;
}

.instructions {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 25px;
    color: #ccc;
    line-height: 1.6;
}

.footer {
    margin-top: 35px;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== BUTTON STYLES ===== */
.btn {
    background: linear-gradient(to bottom, #ff3366, #cc0066);
    color: white;
    border: none;
    padding: 20px 50px;
    font-size: 1.8rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 25px rgba(255, 51, 102, 0.5);
    font-weight: bold;
    letter-spacing: 1px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.btn::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40px;
    height: 200%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(30deg);
    transition: all 0.6s;
    z-index: -1;
}

.btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 51, 102, 0.7);
}

.btn:hover::after {
    left: 120%;
}

/* Button variants */
.passcode-submit {
    background: linear-gradient(to bottom, #4CAF50, #2E7D32);
    width: 100%;
}

.pull-ten {
    background: linear-gradient(to bottom, #ff9800, #f57c00);
}

.pull-ten:hover {
    background: linear-gradient(to bottom, #ff9800, #e65100);
}

.gacha-pull-btn {
    background: linear-gradient(to bottom, #ff3366, #cc0066);
    min-width: 200px;
    padding: 25px 40px;
    font-size: 1.8rem;
    border-radius: 60px;
    position: relative;
    overflow: hidden;
}

.gacha-pull-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.gacha-pull-btn:disabled:hover {
    transform: none;
}

.admin-btn {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 3px solid #ff3366;
    padding: 15px 35px;
    font-size: 1.3rem;
    border-radius: 35px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    margin: 20px 0;
}

.admin-btn:hover {
    background: rgba(255, 51, 102, 0.4);
    transform: translateY(-3px);
}

.skip-btn {
    position: fixed;
    z-index: 1002;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid #ffcc00;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}


.skip-btn:hover {
    background: rgba(255, 204, 0, 0.3);
    transform: scale(1.05);
}

.skip-btn {
    bottom: 30px;
    right: 30px;
}

.return-btn {
    bottom: 30px;
    left: 30px;
}

/* ===== BOX GRID & BOXES ===== */
.box-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    margin: 40px 0;
}

.box-grid.adaptive {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.box {
    width: 160px;
    height: 160px;
    background: linear-gradient(145deg, #ff9966, #ff5e62);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 4px solid #ffcc00;
}

.box.opened {
    background: linear-gradient(145deg, #555, #333);
    transform: scale(0.95);
    cursor: not-allowed;
    opacity: 0.7;
}

.box.opened::before {
    content: "" !important;
}

.box.opened .opened-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.box:hover {
    transform: translateY(-10px) scale(1.1);
    box-shadow: 0 18px 30px rgba(255, 94, 98, 0.6);
    z-index: 5;
}

.box::before {
    content: "?";
    font-size: 6rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.box.selected {
    animation: pulse 0.7s infinite alternate;
}

.opened-content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.opened-image {
    width: 80%;
    height: 80%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.opened-emoji {
    font-size: 3rem;
}

/* ===== PRIZE CONTAINER STYLES ===== */
.prize-container {
    margin: 30px 0;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.prize-card {
    background: linear-gradient(135deg, #00c9ff, #92fe9d);
    border-radius: 25px;
    padding: 35px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    border: 4px solid #ffcc00;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.prize-title {
    font-size: 2.8rem;
    margin-bottom: 25px;
    color: #333;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.prize-image {
    width: 220px;
    height: 220px;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    margin: 25px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 7rem;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.5s ease;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    max-width: 100%;
}

.prize-description {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 10px 0 20px;
  line-height: 1.4;
  font-style: italic;
  max-width: 80%;
  text-align: center;
}

.prize-image:hover {
    transform: rotate(5deg) scale(1.05);
}

.prize-details {
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.prize-name {
    font-size: 2.4rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}

.code-display {
    background: #333;
    color: #ffcc00;
    padding: 20px;
    border-radius: 15px;
    font-size: 2.8rem;
    letter-spacing: 6px;
    margin: 25px 0;
    font-family: monospace;
    border: 3px solid #ffcc00;
    display: inline-block;
    min-width: 350px;
    text-align: center;
    width: auto;
    max-width: 100%;
    overflow-wrap: break-word;
}

.note {
    margin-top: 25px;
    font-size: 1.4rem;
    color: #333;
    font-weight: 600;
    text-align: center;
}

/* ===== SCREEN STYLES ===== */
.screen {
    display: none;
    min-height: 500px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#passcode-screen {
    display: flex;
}

.passcode-form {
    width: 100%;
    max-width: 500px;
    margin: 30px auto;
}

.passcode-input {
    width: 100%;
    padding: 20px;
    font-size: 2rem;
    text-align: center;
    border-radius: 15px;
    border: 3px solid #ffcc00;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 25px;
    letter-spacing: 8px;
}

.passcode-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: normal;
}

.error-message {
    color: #ff5252;
    margin-top: 15px;
    font-size: 1.2rem;
    display: none;
}

.config-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 1.1rem;
}

/* ===== ADMIN CONTROLS ===== */

.admin-controls {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 3px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.admin-controls .btn,
.admin-controls .admin-btn {
    margin: 5px;
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}


.draws-input {
    margin: 20px 0;
    width: 100%;
    max-width: 400px;
}

.draws-input label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.3rem;
    color: #ffcc00;
}

.draws-input input {
    width: 100%;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    border-radius: 15px;
    border: 3px solid #ffcc00;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.draws-counter {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 1.2rem;
    color: #ffcc00;
}

.custom-draw-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.custom-draw-dialog {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    border: 3px solid #9c27b0;
    box-shadow: 0 0 30px rgba(156, 39, 176, 0.5);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dialog-header h3 {
    color: #fff;
    font-size: 1.8rem;
    margin: 0;
}

.close-dialog-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-content p {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
}

.custom-draw-input {
    width: 100%;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    border-radius: 10px;
    border: 2px solid #9c27b0;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 20px;
}

.custom-draw-input:focus {
    outline: none;
    border-color: #e1bee7;
    box-shadow: 0 0 10px rgba(225, 190, 231, 0.5);
}

.dialog-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.dialog-buttons .btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.2rem;
}

.confirm-btn {
    background: linear-gradient(to bottom, #4CAF50, #2E7D32);
}

.cancel-btn {
    background: linear-gradient(to bottom, #f44336, #c62828);
}



/* ===== UTILITY CONTROLS ===== */
.sound-control,
.language-switcher {
    position: absolute;
    top: 30px;
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100;
}

.sound-control:hover,
.language-switcher:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sound-control {
    right: 30px;
    font-size: 1.5rem;
}

.language-switcher {
    right: 90px;
    font-size: 1.1rem;
    font-weight: bold;
}

.rarity-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ffcc00;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    z-index: 5;
}

/* ===== SUMMARY SCREEN ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    width: 100%;
    margin: 30px 0;
}

.summary-item {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 2px solid #ffcc00;
}

.summary-item .rarity-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    padding: 3px 10px;
}

.summary-prize-image {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.2);
}

.summary-image {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
}

.summary-emoji {
    font-size: 3rem;
}

.summary-prize-name {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #ffcc00;
}

.summary-prize-code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    font-size: 1.1rem;
}

/* ===== GACHA SYSTEM STYLES ===== */
.gacha-controls {
    display: flex;
    gap: 30px;
    margin: 40px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.gacha-machine {
    margin: 40px 0;
    text-align: center;
}

.gacha-display {
    width: 300px;
    height: 200px;
    background: linear-gradient(145deg, #222, #444);
    border: 8px solid #ffcc00;
    border-radius: 20px;
    margin: 0 auto 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.gacha-ready {
    font-size: 2rem;
    color: #ffcc00;
    text-align: center;
}

.gacha-ready i {
    display: block;
    font-size: 4rem;
    margin-bottom: 10px;
}

.gacha-counter {
    font-size: 1.5rem;
    margin: 20px 0;
    color: #ffcc00;
    font-weight: bold;
}

/* Gacha Results */
.gacha-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
    width: 100%;
    max-width: 800px;
}

.gacha-result-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 3px solid #ffcc00;
    position: relative;
    animation: resultReveal 0.8s ease-out;
}

.gacha-result-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
}

.gacha-result-name {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #ffcc00;
}

.gacha-result-code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 1rem;
}

/* Rarity styles */
.gacha-result-item.common {
    border-color: #a0a0a0;
    box-shadow: 0 0 20px rgba(160, 160, 160, 0.3);
}

.gacha-result-item.rare {
    border-color: #4caf50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.gacha-result-item.epic {
    border-color: #9c27b0;
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.3);
}

.gacha-result-item.legendary {
    border-color: #ff9800;
    box-shadow: 0 0 30px rgba(255, 152, 0, 0.5);
    animation: legendaryGlow 2s infinite alternate;
}

/* ===== GACHA CARD SYSTEM ===== */
.gacha-display-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    justify-content: flex-start;
    align-items: flex-start;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.gacha-display-container.active {
    display: flex;
}

.gacha-display-container .gacha-display {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border: 12px solid #ffcc00;
    border-radius: 30px;
    box-shadow: 0 0 100px rgba(255, 204, 0, 0.5);
    background: rgba(0, 0, 0, 0.8);
    min-height: auto;
    height: auto;
    padding: 20px;
    box-sizing: border-box;
    /* Add flex properties for better content distribution */
    display: flex;
    flex-direction: column;
}

.gacha-results-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    max-height: calc(100vh - 200px);
    /* Reserve space for buttons */
    overflow-y: auto;
    padding: 15px;
    box-sizing: border-box;
    flex: 1;
}

.gacha-card {
    height: 350px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
    margin: 0 auto;
    width: 100%;
}

.gacha-card.new::after {
    content: "NEW";
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4757;
    color: white;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 10;
    animation: pulse 1.5s infinite;
}

.gacha-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    border-radius: 15px;
}


.gacha-card:hover .gacha-card-inner {
    transform: rotateY(180deg);
}


.gacha-card-front {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 15px;
  overflow: hidden;
  
}

.gacha-card-back {
        position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    transform: rotateY(180deg);
  padding: 20px;
  background: #16213e;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
}



.gacha-card-back .gacha-card-name {
  margin-bottom: 10px;
}

.gacha-card-back .gacha-card-description {
  flex: 1;
  margin-bottom: 15px;
}

.gacha-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.summary-prize-description {
  font-size: 0.9rem;
  color: #ccc;
  margin: 8px 0;
  line-height: 1.4;
  font-style: italic;
}

.gacha-card-description {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 5px 0;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.gacha-card-code {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.9rem;
  margin: 8px 0;
}

.gacha-card-rarity-text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 5px 0;
}



.gacha-card-name {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: white;
    font-weight: bold;
}



.gacha-card-rarity {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    z-index: 2;
    -webkit-backface-visibility: hidden; /* Crucial for Safari/Chrome Mobile */
    backface-visibility: hidden;
}

/* Rarity-specific styles */
.gacha-card.common .gacha-card-rarity {
    background: #b0b0b0;
}

.gacha-card.uncommon .gacha-card-rarity {
    background: #27ae60;
}

.gacha-card.rare .gacha-card-rarity {
    background: #3498db;
}

.gacha-card.epic .gacha-card-rarity {
    background: #9b59b6;
}

.gacha-card.legendary .gacha-card-rarity {
    background: #f39c12;
}

/* Rarity animations */
.gacha-card.common .gacha-card-inner {
    transition: transform 0.6s;
}

.gacha-card.uncommon .gacha-card-inner {
    transition: transform 0.6s;
}

.gacha-card.rare .gacha-card-inner {
    transition: transform 0.6s;
}

.gacha-card.epic .gacha-card-inner {
    transition: transform 0.6s;
}

.gacha-card.legendary .gacha-card-inner {
    transition: transform 0.6s;
    animation: float 3s ease-in-out infinite;
}

.gacha-card.uncommon .gacha-card-front::before,
.gacha-card.rare .gacha-card-front::before,
.gacha-card.epic .gacha-card-front::before,
.gacha-card.legendary .gacha-card-front::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: -1;
    border-radius: 16px;
    animation: border-pulse 3s infinite;
}

.gacha-card.uncommon .gacha-card-front::before {
    background: linear-gradient(45deg, #27ae60, transparent, #27ae60);
}

.gacha-card.rare .gacha-card-front::before {
    background: linear-gradient(45deg, #3498db, transparent, #3498db);
    animation-duration: 2s;
}

.gacha-card.epic .gacha-card-front::before {
    background: linear-gradient(45deg, #9b59b6, transparent, #ff00cc, transparent, #9b59b6);
    background-size: 400% 400%;
    animation: gradient-shift 3s ease infinite, border-pulse 3s infinite;
}

.gacha-card.legendary .gacha-card-front::before {
    background: linear-gradient(45deg, #f39c12, #ff0000, #ffff00, #f39c12);
    background-size: 400% 400%;
    animation: gradient-shift 3s ease infinite, border-pulse 1.5s infinite;
}

/* Single card reveal */
.gacha-card-reveal {
    animation: cardReveal 2s forwards;
    width: 400px;
    height: 560px;
    margin: 20px auto;
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.animation-content {
    width: 100%;
    text-align: center;
    padding: 20px;
    background: rgba(255, 204, 0, 0.1);
    border-radius: 15px;
    margin-bottom: 20px;
    border: 2px solid #ffcc00;
}

.animation-content h2 {
    font-size: 2.5rem;
    color: #ffcc00;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.animation-content p {
    font-size: 1.3rem;
    color: white;
    margin: 0;
}

.staggered {
    animation: staggeredReveal 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(50px);
}

/* ===== CONFETTI ===== */
.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffcc00;
    border-radius: 50%;
    opacity: 0;
    z-index: 10;
}

.confetti:nth-child(5n) {
    background: #ff3366;
}

.confetti:nth-child(5n+1) {
    background: #00eeff;
}

.confetti:nth-child(5n+2) {
    background: #92fe9d;
}

.confetti:nth-child(5n+3) {
    background: #ff9966;
}

.reveal-animation {
    animation: prize-reveal 0.9s ease-out forwards;
}

/* ===== SCROLLBAR STYLING ===== */
.gacha-results-cards::-webkit-scrollbar {
    width: 8px;
}

.gacha-results-cards::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.gacha-results-cards::-webkit-scrollbar-thumb {
    background: #ffcc00;
    border-radius: 4px;
}

.gacha-results-cards::-webkit-scrollbar-thumb:hover {
    background: #ffaa00;
}

/* ===== LEGENDARY REVEAL SCREEN ===== */
.legendary-reveal-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(255, 152, 0, 0.3) 0%, rgba(0, 0, 0, 0.95) 70%);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    transition: opacity 0.5s ease-in;
}

.legendary-reveal-container {
    display: flex;
    max-width: 1200px;
    height: 80vh;
    width: 90%;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 0 100px rgba(255, 152, 0, 0.5);
    border: 4px solid #ff9800;
    position: relative;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.legendary-card {
    display: flex;
    width: 100%;
    gap: 40px;
    align-items: center;
}

.legendary-description-container {
  margin: 20px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 204, 0, 0.3);
  backdrop-filter: blur(10px);
  max-height: 150px;
  overflow-y: auto;
}

.legendary-description {
  font-size: 1.3rem;
  line-height: 1.6;
  color: #e0e0e0;
  margin: 0;
  text-align: center;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.legendary-description-container {
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.legendary-description-container::-webkit-scrollbar {
  width: 6px;
}

.legendary-description-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.legendary-description-container::-webkit-scrollbar-thumb {
  background: rgba(255, 204, 0, 0.6);
  border-radius: 3px;
}

.legendary-description-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 204, 0, 0.8);
}

.legendary-image-container {
    flex: 1;
    position: relative;
    top: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.legendary-image {
    width: 400px;
    height: 400px;
    border-radius: 20px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(255, 255, 255, 0.1);
    border: 3px solid #ff9800;
    box-shadow: 0 0 50px rgba(255, 152, 0, 0.7);
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 8rem;
}

.legendary-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.4) 0%, transparent 70%);
    z-index: 1;
    animation: legendaryPulse 2s ease-in-out infinite;
}

@keyframes legendaryPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.legendary-details {
  flex: 1;
  color: white;
  text-align: left;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.legendary-badge {
    background: linear-gradient(45deg, #ff9800, #ff5722);
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 1.5rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    animation: glow 2s ease-in-out infinite;
}

.legendary-name {
    font-size: 3.5rem;
    color: #ffcc00;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.legendary-code {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    font-family: monospace;
    font-size: 1.8rem;
    letter-spacing: 3px;
    color: #ffcc00;
    border: 2px solid #ff9800;
    margin-bottom: 30px;
    display: inline-block;
}

.legendary-instruction {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

.legendary-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffcc00;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    border: 2px solid #ff9800;
}

/* Legendary effects */
.legendary-sparkle {
    position: absolute;
    background: radial-gradient(circle, #ffcc00, #ff9800);
    border-radius: 50%;
    pointer-events: none;
    animation: sparkleFloat 2s ease-in-out forwards;
    z-index: 3;
}

@keyframes sparkleFloat {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0;
    }
}

.legendary-particle {
    position: absolute;
    background: #ff9800;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 3s ease-in-out infinite;
    z-index: 2;
    opacity: 50%;
}

@keyframes particleFloat {

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

    25% {
        transform: translateY(-20px) translateX(10px);
    }

    50% {
        transform: translateY(-40px) translateX(-10px);
        opacity: 1;
    }

    75% {
        transform: translateY(-20px) translateX(10px);
    }
}

.legendary-summary {
    background: linear-gradient(45deg, rgba(255, 152, 0, 0.2), rgba(255, 204, 0, 0.2));
    border: 2px solid #ff9800;
}

.legendary-summary h2 {
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

@keyframes sparkleBurst {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes shineSweep {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    50% {
        transform: translateX(100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

@keyframes legendaryPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

@keyframes sparkleFloat {
    0% {
        transform: translateY(0) rotate(0deg) scale(0);
        opacity: 0;
    }

    20% {
        transform: translateY(-20px) rotate(90deg) scale(1);
        opacity: 1;
    }

    80% {
        transform: translateY(-80px) rotate(270deg) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) rotate(360deg) scale(0);
        opacity: 0;
    }
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.8;
    }

    25% {
        transform: translateY(-30px) translateX(15px) scale(1.2);
    }

    50% {
        transform: translateY(-60px) translateX(-15px) scale(1);
        opacity: 1;
    }

    75% {
        transform: translateY(-30px) translateX(15px) scale(0.8);
    }
}

/* Legendary reveal elements */
.legendary-shine-overlay {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 45%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0.1) 55%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.legendary-sparkle-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #ffcc00, #ff9800, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}

.legendary-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 50%;
}

/* ===== TRANSFER SCREEN STYLES ===== */
.transfer-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px; /* Add padding to prevent cropping */
    box-sizing: border-box;
}

.transfer-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh; /* Limit height to viewport */
    text-align: center;
    border: 3px solid #ffcc00;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Add scrolling if content is too long */
}

.transfer-prize-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

.transfer-prize-image {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    background-color: rgba(255, 255, 255, 0.2);
}

.transfer-prize-details {
    flex: 1;
    text-align: left;
}

.transfer-prize-details h3 {
    color: #ffcc00;
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.transfer-prize-code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 8px;
}

.transfer-instructions {
    margin: 25px 0;
}

.transfer-instructions p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #fff;
}

.nfc-icon {
    font-size: 4rem;
    color: #4e54c8;
    margin: 20px 0;
    animation: pulse 2s infinite;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.nfc-icon.long-press-active {
    transform: scale(1.1);
    color: #ffcc00;
}


.transfer-status {
    margin: 20px 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transfer-status p {
    font-size: 1.1rem;
    margin: 0;
}

.transfer-status .error {
    color: #ff6b6b;
}

.transfer-status .success {
    color: #51cf66;
}

.transfer-controls {
    margin-top: 25px;
    position: sticky;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 0 0 25px 25px;
    margin: 25px -40px -40px -40px; /* Extend to container edges */
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid #ff6b6b;
}

.cancel-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

.button-group {
    position: fixed;
    bottom: 30px;
    align-items: center;
    width: max-content;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    box-sizing: border-box;
    z-index: 1002;
    pointer-events: none; /* Allow clicks to pass through container */
}

.button-group .transfer-btn,
.button-group .return-btn {
    background: rgba(255, 255, 255, 0.2);
         width:max-content;
    color: white;
    border: 2px solid #ffcc00;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto; /* Re-enable clicks for buttons */
    position: static; /* Remove fixed positioning */
    margin: 0; /* Remove any default margins */
}

.button-group .transfer-btn:hover,
.button-group .return-btn:hover {
    background: rgba(255, 204, 0, 0.3);
    transform: translateY(-3px) scale(1.05);
}

.button-group .left-btn {
    display: flex;
    margin-right: 10px;
    gap: 15px;
}

.button-group .right-btn {
    display: flex;
     margin-left: 10px;
    gap: 15px;
}



/* Animation Overlay */
.animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.transfer-animation {
    max-width: 90%;
    max-height: 90%;
    border-radius: 15px;
}


.transfer-prize-header {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #ffcc00;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.transfer-prize-header h3 {
    color: #ffcc00;
    margin: 0;
    font-size: 1.4rem;
}

.transfer-total {
    background: rgba(255, 204, 0, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    color: #ffcc00;
    border: 1px solid #ffcc00;
}

.transfer-prize-list {
    max-height: 200px; /* Reduced from 300px */
    overflow-y: auto;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.manual-input-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #4e54c8;
    border: 2px solid #4e54c8;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 15px;
    transition: all 0.3s;
}

.manual-input-btn:hover {
    background: rgba(78, 84, 200, 0.3);
    transform: translateY(-2px);
}

.manual-input-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.manual-input-dialog {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    border: 3px solid #4e54c8;
    box-shadow: 0 0 30px rgba(78, 84, 200, 0.5);
}

.manual-input-dialog h3 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.manual-input-field {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border-radius: 10px;
    border: 2px solid #4e54c8;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 20px;
    text-align: center;
}

.manual-input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.manual-input-field:focus {
    outline: none;
    border-color: #8a90ff;
    box-shadow: 0 0 10px rgba(138, 144, 255, 0.5);
}

.manual-input-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.manual-input-buttons .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 1.1rem;
}

.mock-buttons {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.mock-buttons.active {
    display: flex;
}


.mock-transfer-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #ffcc00;
    border: 2px solid #ffcc00;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 15px;
    transition: all 0.3s; 
}

.mock-transfer-btn:hover {
    background: rgba(255, 204, 0, 0.3);
    transform: translateY(-2px);
}

.transfer-prize-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #ffcc00;
}

.transfer-prize-item:last-child {
    margin-bottom: 0;
}

.transfer-prize-item-image {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.transfer-prize-item-details {
    flex: 1;
    text-align: left;
}

.transfer-prize-item-name {
    color: #ffcc00;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.transfer-prize-item-code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #fff;
}

.gacha-reset-btn {
    position: absolute;
    top: 30px;
    left: 30px; /* Instead of right: 30px */
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid #ff6b6b;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gacha-reset-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.05);
}

/* Continue button styles */
.continue-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid #4CAF50;
}

.continue-btn:hover {
    background: rgba(76, 175, 80, 0.3);
}


.simulation-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid #ffcc00;
    z-index: 3000;
    text-align: center;
    color: white;
    font-size: 1.2rem;
}

.simulation-loading h3 {
    color: #ffcc00;
    margin-bottom: 15px;
}

.simulation-progress {
    width: 300px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 15px 0;
    overflow: hidden;
}

.simulation-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff3366, #ffcc00);
    transition: width 0.3s ease;
}



/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 70px 20px 20px;
    }

    h1 {
        font-size: 2.8rem;
    }

    .subtitle {
        font-size: 1.5rem;
    }

    .box-grid {
        gap: 25px;
    }

    .box-grid.adaptive {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }

    .box {
        width: 130px;
        height: 130px;
    }

    .box::before {
        font-size: 5rem;
    }

    .prize-title {
        font-size: 2.2rem;
    }

    .prize-image {
        width: 180px;
        height: 180px;
        font-size: 5.5rem;
    }

    .prize-name {
        font-size: 2rem;
    }

    .code-display {
        font-size: 2.2rem;
        min-width: 300px;
        padding: 15px;
        letter-spacing: 4px;
    }

    .btn {
        padding: 18px 40px;
        font-size: 1.6rem;
    }

    .passcode-input {
        font-size: 1.6rem;
        padding: 15px;
    }

    .admin-controls {
        flex-direction: column;
    }

    .language-switcher {
        top: 20px;
        right: 70px;
        width: 40px;
        height: 40px;
    }

    header {
        margin-top: 50px;
    }

    .sound-control {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    .draws-counter {
        top: 20px;
        left: 20px;
        padding: 8px 15px;
    }

    .gacha-results-cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
        max-height: calc(100vh - 150px);
        /* Adjust for mobile */
        padding: 10px;
    }


    .gacha-card-reveal {
        width: 300px;
        height: 420px;
        margin: 10px auto;
    }


    .gacha-card {
        height: 300px;
         max-width: 280px;
    }



    .gacha-controls {
        flex-direction: column;
        gap: 15px;
    }

    .gacha-display {
        width: 250px;
        height: 150px;
    }

    .gacha-ready {
        font-size: 1.5rem;
    }

    .gacha-ready i {
        font-size: 3rem;
    }

    .gacha-pull-btn {
         width: 100%;
        max-width: 250px
    }

     .gacha-reset-btn {
        top: 20px;
        left: 20px;
        padding: 10px 16px;
        font-size: 1rem;
    }

    .pull-custom {
    background: linear-gradient(to bottom, #9c27b0, #6a1b9a);
}

.pull-custom:hover {
    background: linear-gradient(to bottom, #9c27b0, #4a148c);
}

    .gacha-results {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .gacha-display-container {
        padding: 15px;
    }

    .gacha-display-container .gacha-display {
        border-width: 8px;
        padding: 15px;
        min-height: 80vh;
        max-height: 85vh;
        /* Ensure minimum height on mobile */
    }

    .gacha-display-container .gacha-results {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
        max-height: calc(100vh - 150px);
    }
  
  .legendary-description-container {
    padding: 12px;
    max-height: 120px;
    margin: 15px 0;
  }

   .legendary-reveal-container {
        flex-direction: column;
        height: auto;
        min-height: 80vh;
        padding: 20px 15px;
        overflow-y: auto;
    }

    .legendary-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        width: 100%;
    }

    .legendary-image-container {
        flex: none;
        width: 100%;
        top: 0;
        margin-bottom: 10px;
    }

    .legendary-image {
        width: 250px;
        height: 250px;
        font-size: 5rem;
        margin: 0 auto;
    }

    .legendary-glow {
        width: 280px;
        height: 280px;
        left: 50%;
        transform: translateX(-50%);
    }

    .legendary-details {
        flex: none;
        width: 100%;
        text-align: center;
        padding: 0;
    }

    .legendary-badge {
        font-size: 1.2rem;
        padding: 10px 20px;
        margin-bottom: 15px;
    }

    .legendary-name {
        font-size: 2.2rem;
        margin-bottom: 15px;
        line-height: 1.2;
    }

    .legendary-code {
        font-size: 1.3rem;
        padding: 12px 20px;
        margin-bottom: 20px;
        letter-spacing: 2px;
    }

    .legendary-description-container {
        margin: 15px 0;
        padding: 12px;
        max-height: 120px;
    }

    .legendary-description {
        font-size: 1.1rem;
        line-height: 1.4;
    }

    .legendary-instruction {
        font-size: 1rem;
        margin-top: 15px;
    }

    .legendary-counter {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px auto;
        display: inline-block;
    }

    .legendary-name {
        font-size: 2.8rem;
    }

     .transfer-container {
        padding: 30px 20px;
        max-height: 85vh;
    }
    
    .transfer-controls {
        margin: 25px -20px -30px -20px;
        padding: 15px;
    }
    
    .transfer-prize-list {
        max-height: 150px;
    }
    .transfer-prize-info {
        flex-direction: column;
        text-align: center;
    }

    .transfer-prize-details {
        text-align: center;
    }

    .transfer-prize-image {
        width: 100px;
        height: 100px;
        font-size: 3rem;
    }

    .button-group .transfer-btn,
    .button-group .return-btn {
             width:max-content;
     font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 60px 15px 15px;
    }

    header {
        margin-top: 40px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 2.2rem;
        margin-top: 10px;
    }

    .box-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .box-grid.adaptive {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .box {
        width: 120px;
        height: 120px;
    }

    .prize-card {
        padding: 25px 15px;
    }

    .prize-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .prize-image {
        width: 140px;
        height: 140px;
        font-size: 4.5rem;
        margin: 15px auto;
    }

    .prize-image .rarity-badge {
        font-size: 0.8rem;
        padding: 3px 10px;
        top: 8px;
        right: 8px;
    }

    .prize-name {
        font-size: 1.6rem;
    }

    .code-display {
        font-size: 1.6rem;
        min-width: 250px;
        letter-spacing: 3px;
        padding: 12px;
        margin: 15px 0;
    }

    .note {
        font-size: 1.2rem;
        margin-top: 15px;
    }

    .btn {
        padding: 15px 35px;
        font-size: 1.4rem;
    }

    .admin-btn {
        padding: 12px 25px;
        margin: 0 10px 10px;
    }

    .passcode-input {
        font-size: 1.4rem;
        padding: 12px;
        letter-spacing: 4px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .language-switcher {
        top: 15px;
        right: 60px;
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .sound-control {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
    }

    .draws-counter {
        top: 15px;
        left: 15px;
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .gacha-results-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        max-height: calc(100vh - 120px);
        padding: 10px;
    }

    .gacha-card {
        height: 280px;
        max-width: 100%;
    }

    .gacha-card-reveal {
        width: 280px;
        height: 390px;
    }

     .gacha-reset-btn {
        top: 15px;
        left: 15px;
        padding: 8px 14px;
        font-size: 0.9rem;
    }

    .animation-content h2 {
        font-size: 1.8rem;
    }

    .animation-content p {
        font-size: 1rem;
    }

    .gacha-card-name {
        font-size: 1.1rem;
    }

    .gacha-card-description {
        font-size: 0.8rem;
    }

    .gacha-display {
        width: 200px;
        height: 120px;
    }

    .gacha-ready {
        font-size: 1.2rem;
    }

    .gacha-ready i {
        font-size: 2.5rem;
    }

    .gacha-pull-btn {
        padding: 15px 30px;
        font-size: 1.5rem;
    }

    .gacha-results {
        grid-template-columns: 1fr;
    }

    .gacha-display-container .gacha-display {
        min-height: 70vh;
        max-height: 85vh;
        padding: 10px;
    }

    .gacha-display-container .gacha-results {
        grid-template-columns: 1fr;
    }

    .skip-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 1rem;
    }

     .legendary-reveal-container {
        padding: 15px 10px;
        min-height: 85vh;
    }

    .legendary-image {
        width: 200px;
        height: 200px;
        font-size: 4rem;
    }

    .legendary-glow {
        width: 230px;
        height: 230px;
    }

    .legendary-name {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }

    .legendary-code {
        font-size: 1.1rem;
        padding: 10px 15px;
        margin-bottom: 15px;
        letter-spacing: 1px;
    }

    .legendary-badge {
        font-size: 1rem;
        padding: 8px 15px;
    }

    .legendary-description-container {
        padding: 10px;
        max-height: 100px;
        margin: 12px 0;
    }

    .legendary-description {
        font-size: 1rem;
        line-height: 1.3;
    }

    .legendary-instruction {
        font-size: 0.9rem;
    }

     .button-group .transfer-btn,
    .button-group .return-btn {
        width:max-content;
     font-size: 1rem;
    }

    .transfer-container {
        padding: 25px 15px;
        max-height: 80vh;
    }
    
    .transfer-controls {
        margin: 25px -15px -25px -15px;
        padding: 12px;
    }
    
    .nfc-icon {
        font-size: 3rem;
    }

    .custom-draw-dialog {
        padding: 20px;
    }
    
    .dialog-header h3 {
        font-size: 1.5rem;
    }
    
    .dialog-buttons {
        flex-direction: column;
    }
    
    .dialog-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 50px 10px 10px;
        border-radius: 20px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .prize-card {
        padding: 20px 10px;
        border-radius: 20px;
    }

    .prize-title {
        font-size: 1.5rem;
    }

    .prize-image {
        width: 110px;
        height: 110px;
        font-size: 3.5rem;
    }

    .prize-image .rarity-badge {
        font-size: 0.7rem;
        padding: 2px 8px;
        top: 5px;
        right: 5px;
    }

    .prize-name {
        font-size: 1.3rem;
    }

    .code-display {
        font-size: 1.3rem;
        min-width: 200px;
        letter-spacing: 2px;
        padding: 10px;
    }

    .note {
        font-size: 1rem;
    }

    .box {
        width: 100px;
        height: 100px;
    }

    .box-grid.adaptive {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .box::before {
        font-size: 4rem;
    }

    .btn {
        padding: 12px 25px;
        font-size: 1.2rem;
    }

    .language-switcher,
    .sound-control {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .language-switcher {
        right: 50px;
    }

    .gacha-results-cards {
        grid-template-columns: 1fr;
        gap: 10px;
        max-height: calc(100vh - 100px);
        padding: 8px;
    }

    .gacha-card {
        height: 250px;
        width: 70%;
    }

    .gacha-card-reveal {
        width: 250px;
        height: 350px;
    }


    .gacha-card-name {
        font-size: 1rem;
    }

    .gacha-card-description {
        font-size: 0.8rem;
    }

    .gacha-display-container {
        padding: 10px;
    }

    .gacha-display-container .gacha-display {
        min-height: 70vh;
        max-height: 85vh;
        padding: 8px;
    }

    .gacha-results-cards {
        padding: 10px;
        gap: 10px;
        max-height: calc(100vh - 100px);
    }
    
    .gacha-reset-btn {
        top: 15px;
        left: 10px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .animation-content {
        padding: 15px;
    }

    .animation-content h2 {
        font-size: 1.5rem;
    }

    .legendary-reveal-container {
        padding: 12px 8px;
        min-height: 90vh;
    }

    .legendary-image {
        width: 180px;
        height: 180px;
        font-size: 3.5rem;
    }

    .legendary-glow {
        width: 200px;
        height: 200px;
    }

    .legendary-name {
        font-size: 1.6rem;
    }

    .legendary-code {
        font-size: 1rem;
        padding: 8px 12px;
        min-width: 200px;
    }

    .legendary-description-container {
        max-height: 80px;
        margin: 10px 0;
    }

    .legendary-description {
        font-size: 0.9rem;
    }

    .transfer-container {
        padding: 25px 15px;
    }

    .transfer-prize-image {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }

    .nfc-icon {
        font-size: 3rem;
    }
    .button-group .transfer-btn,
    .button-group .return-btn {
    width:max-content;
     font-size: 0.8rem;
    }
}


@media (min-width: 1200px) {
    /* Wide screen styles - allow cards to be larger */
    .gacha-card {
        height: 380px;
        /* Remove max-width constraint for wide screens */
        max-width: none;
    }

    .gacha-card-reveal {
        width: 450px;
        height: 630px;
    }

    /* Adjust grid for larger cards on wide screens */
    .gacha-results-cards {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
    }
}

@media (min-width: 1400px) {
    /* Extra wide screens - even larger cards */
    .gacha-card {
        height: 420px;
    }

    .gacha-card-reveal {
        width: 500px;
        height: 700px;
    }

    .gacha-results-cards {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 30px;
    }
}

/* For single card reveals on wide screens, make them even more prominent */
@media (min-width: 1200px) {
    .gacha-display-container.single-card .gacha-card {
        height: 500px;
        width: 350px;
    }

    .gacha-display-container.single-card .gacha-card-reveal {
        width: 550px;
        height: 770px;
    }
}

/* Ensure card content scales properly */
.gacha-card-name {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: white;
    font-weight: bold;
}

.gacha-card-description {
    font-size: 0.9rem;
    opacity: 0.8;
    color: white;
    margin: 2px 0;
}

/* Scale text for larger cards on wide screens */
@media (min-width: 1200px) {
    .gacha-card .gacha-card-name {
        font-size: 1.4rem;
    }

    .gacha-card .gacha-card-description {
        font-size: 1rem;
    }

    .gacha-card-reveal .gacha-card-name {
        font-size: 1.6rem;
    }

    .gacha-card-reveal .gacha-card-description {
        font-size: 1.1rem;
    }
}
