/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Persona 5 Color Palette */
    --p5-red: #E60012;
    --p5-black: #000000;
    --p5-white: #FFFFFF;
    --p5-dark-red: #8B0000;
    --p5-gray: #2A2A2A;
    --p5-light-gray: #CCCCCC;
    
    /* Rarity Colors */
    --legendary-color: #FFD700;
    --epic-color: #9B59B6;
    --rare-color: #3498DB;
    --common-color: #95A5A6;
    --mythic-color: #E60012;
    
    /* Background Colors */
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-overlay: rgba(0, 0, 0, 0.85);
    
    /* Text Colors */
    --text-light: #FFFFFF;
    --text-gray: #CCCCCC;
    --text-dark: #2A2A2A;
    
    /* Mobile-first sizing */
    --container-padding: 15px;
    --header-height: 60px;
    --button-height: 50px;
    --card-gap: 15px;
    --font-size-base: 14px;
    --font-size-header: 20px;
}

/* Desktop variables */
@media (min-width: 769px) {
    :root {
        --container-padding: 20px;
        --header-height: 80px;
        --button-height: 60px;
        --card-gap: 20px;
        --font-size-base: 16px;
        --font-size-header: 28px;
    }
}

html {
    scroll-behavior: smooth;
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    font-size: var(--font-size-base);
    line-height: 1.5;
    position: relative;
    
    /* Mobile touch optimization */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Persona 5 diagonal stripes background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(230, 0, 18, 0.03) 10px,
            rgba(230, 0, 18, 0.03) 20px
        ),
        radial-gradient(circle at 20% 50%, rgba(230, 0, 18, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(230, 0, 18, 0.08) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Device-specific adjustments */
.mobile-device {
    font-size: 14px;
}

.desktop-device {
    font-size: 16px;
}

.tablet-device {
    font-size: 15px;
}

/* Allow text selection for content areas */
.content-text, p, span {
    -webkit-user-select: text;
    user-select: text;
}

/* Hide only truly empty elements (not buttons or interactive elements) */
div:empty:not([id]):not([class]),
span:empty:not([id]):not([class]),
p:empty:not([id]):not([class]) {
    display: none !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

/* Mobile container adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

/* ==================== BACKGROUND ==================== */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0f0f0f 0%, #2c0808 50%, #1a0a0a 100%);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(220, 20, 60, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 60px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 90px 10px, white, transparent);
    background-size: 200px 200px;
    animation: twinkle 5s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==================== HEADER ==================== */
header {
    background: linear-gradient(135deg, rgba(44, 8, 8, 0.95), rgba(26, 10, 10, 0.95));
    backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 3px solid var(--primary-color);
    box-shadow: 0 2px 20px rgba(220, 20, 60, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: var(--header-height);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Mobile header adjustments */
@media (max-width: 768px) {
    header {
        padding: 10px 0;
    }
    
    header .container {
        gap: 8px;
    }
}

.logo {
    font-size: var(--font-size-header);
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% { filter: brightness(1) drop-shadow(0 0 5px rgba(255, 215, 0, 0.3)); }
    100% { filter: brightness(1.2) drop-shadow(0 0 15px rgba(255, 215, 0, 0.6)); }
}

/* Mobile logo adjustments */
@media (max-width: 768px) {
    .logo {
        font-size: 16px;
        order: 1;
        flex: 1;
    }
}

nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Mobile navigation */
@media (max-width: 768px) {
    nav {
        gap: 6px;
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }
}

.nav-btn {
    background: linear-gradient(45deg, var(--bg-casino), var(--primary-color));
    color: var(--text-casino);
    border: 2px solid var(--border-casino);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
    min-height: var(--button-height);
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(220, 20, 60, 0.3);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.4), transparent);
    transition: left 0.5s;
}

.nav-btn:hover::before {
    left: 100%;
}

/* Mobile nav button adjustments */
@media (max-width: 768px) {
    .nav-btn {
        padding: 6px 12px;
        font-size: 11px;
        min-height: 35px;
        flex: 1;
        min-width: 70px;
    }
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

/* Ticket Display */
.ticket-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(230, 0, 18, 0.2), rgba(139, 0, 0, 0.2));
    padding: 8px 15px;
    border-radius: 25px;
    border: 2px solid var(--p5-red);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.ticket-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(230, 0, 18, 0.4);
}

.ticket-icon {
    font-size: 24px;
    animation: ticketPulse 2s ease-in-out infinite;
}

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

.ticket-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ticket-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--p5-light-gray);
    letter-spacing: 1px;
}

.ticket-count {
    font-size: 18px;
    font-weight: 800;
    color: var(--p5-red);
    text-shadow: 0 0 10px rgba(230, 0, 18, 0.5);
}

/* Mobile ticket display */
@media (max-width: 768px) {
    .ticket-display {
        padding: 5px 10px;
        gap: 6px;
        margin-bottom: 5px;
    }
    
    .ticket-icon {
        font-size: 20px;
    }
    
    .ticket-label {
        font-size: 8px;
    }
    
    .ticket-count {
        font-size: 14px;
    }
}

/* Mobile user info */
@media (max-width: 768px) {
    .user-info {
        padding: 3px 8px;
        gap: 5px;
        order: 0;
        width: 100%;
        justify-content: center;
        margin-bottom: 5px;
    }
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

/* Mobile user avatar */
@media (max-width: 768px) {
    .user-avatar {
        width: 25px;
        height: 25px;
    }
}

.user-name {
    font-weight: 600;
    font-size: 12px;
}

/* Mobile user name */
@media (max-width: 768px) {
    .user-name {
        font-size: 11px;
    }
}

/* ==================== SECTIONS ==================== */
.section {
    display: none;
    padding: 40px 0;
}

/* Mobile section adjustments */
@media (max-width: 768px) {
    .section {
        padding: 20px 0;
    }
}

.section.active {
    display: block;
}

/* ==================== USER INFO ==================== */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-dark);
    padding: 8px 15px;
    border-radius: 25px;
    border: 2px solid var(--primary-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
}

.user-name {
    font-weight: 600;
    color: var(--text-light);
}

.ticket-balance {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 14px;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite;
}

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

/* ==================== SECTIONS ==================== */
.section {
    display: none;
    padding: 40px 0;
    min-height: calc(100vh - 100px);
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* ==================== LOGIN SECTION ==================== */
.login-box {
    max-width: 500px;
    margin: 100px auto;
    background: linear-gradient(145deg, var(--bg-casino), var(--bg-card));
    border: 4px solid var(--accent-color);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(220, 20, 60, 0.3);
    text-align: center;
    width: 90%;
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
    z-index: 0;
}

.login-box > * {
    position: relative;
    z-index: 1;
}

.casino-header h2 {
    margin-bottom: 15px;
    color: var(--accent-color);
    font-size: var(--font-size-header);
    font-weight: 800;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.3);
    animation: goldShine 3s ease-in-out infinite;
}

@keyframes goldShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.casino-lights {
    font-size: 1.5rem;
    margin-bottom: 20px;
    animation: lightsFlicker 2s ease-in-out infinite;
}

@keyframes lightsFlicker {
    0%, 100% { opacity: 1; }
    25% { opacity: 0.7; }
    50% { opacity: 1; }
    75% { opacity: 0.8; }
}

/* Mobile login heading */
@media (max-width: 768px) {
    .login-box h2 {
        margin-bottom: 20px;
        font-size: 20px;
    }
}

.login-description {
    margin-bottom: 30px;
    color: var(--text-gray);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Mobile login description */
@media (max-width: 768px) {
    .login-description {
        margin-bottom: 20px;
        font-size: 14px;
        line-height: 1.5;
    }
}

.btn, .btn-discord {
    background: #5865F2;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.4);
    min-height: var(--button-height);
    text-decoration: none;
    
    /* Mobile touch optimization */
    -webkit-tap-highlight-color: transparent;
}

/* Mobile button adjustments */
@media (max-width: 768px) {
    .btn, .btn-discord {
        padding: 12px 20px;
        font-size: 14px;
        gap: 8px;
        min-height: 45px;
        border-radius: 8px;
    }
}

.btn-discord:hover, .btn:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(88, 101, 242, 0.6);
}

/* Mobile hover states (use active instead) */
@media (max-width: 768px) {
    .btn-discord:hover, .btn:hover {
        transform: none;
    }
    
    .btn-discord:active, .btn:active {
        background: #4752C4;
        transform: translateY(1px);
    }
}

.hint {
    margin-top: 20px;
    color: var(--text-gray);
    font-size: 14px;
    font-style: italic;
}

/* Mobile hint */
@media (max-width: 768px) {
    .hint {
        margin-top: 15px;
        font-size: 12px;
        line-height: 1.4;
    }
}

.discord-icon {
    width: 24px;
    height: 24px;
}

/* Mobile discord icon */
@media (max-width: 768px) {
    .discord-icon {
        width: 20px;
        height: 20px;
    }
}

.login-box input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    background: var(--bg-dark);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

/* Mobile input fields */
@media (max-width: 768px) {
    .login-box input {
        padding: 12px;
        margin-bottom: 15px;
        font-size: 14px;
        border-radius: 8px;
    }
}

.login-box input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(162, 155, 254, 0.5);
}

/* ==================== PERSONA 5 BUTTONS ==================== */
.btn {
    padding: 15px 40px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.p5-btn {
    position: relative;
    background: var(--p5-black);
    border: 3px solid var(--p5-red);
    color: var(--p5-white);
    padding: 18px 50px;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.3s ease;
}

.p5-btn .btn-bg {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--p5-red);
    transition: left 0.4s ease;
    z-index: 0;
}

.p5-btn .btn-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.p5-btn .btn-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.p5-btn:hover {
    transform: translateX(5px);
    box-shadow: -5px 5px 0 var(--p5-red);
}

.p5-btn:hover .btn-bg {
    left: 0;
}

.p5-btn:hover .btn-arrow {
    transform: translateX(5px);
}

.p5-btn:active {
    transform: translateX(3px) translateY(2px);
    box-shadow: -3px 3px 0 var(--p5-red);
}

.p5-btn-special {
    border-color: var(--p5-red);
    background: linear-gradient(135deg, var(--p5-black) 0%, #1a0000 100%);
}

.p5-btn-special::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(230, 0, 18, 0.1) 10px,
        rgba(230, 0, 18, 0.1) 20px
    );
    pointer-events: none;
}

/* Gacha buttons container */
.gacha-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 40px 0;
}

/* Mobile button adjustments */
@media (max-width: 768px) {
    .p5-btn {
        padding: 15px 35px;
        font-size: 0.9rem;
    }
    
    .gacha-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .p5-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* ==================== PERSONA 5 HEADER ==================== */
.p5-header {
    position: relative;
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
    overflow: hidden;
}

.p5-stripes {
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 20px,
        rgba(230, 0, 18, 0.1) 20px,
        rgba(230, 0, 18, 0.1) 40px
    );
    animation: stripesMove 20s linear infinite;
    z-index: 0;
}

@keyframes stripesMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(80px); }
}

.p5-title {
    position: relative;
    z-index: 1;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--p5-white);
    text-transform: uppercase;
    letter-spacing: 8px;
    margin: 0;
    text-shadow: 
        4px 4px 0 var(--p5-red),
        8px 8px 20px rgba(230, 0, 18, 0.5);
    animation: titlePulse 3s ease-in-out infinite;
}

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

.p5-subtitle {
    position: relative;
    z-index: 1;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--p5-red);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-top: 10px;
    font-weight: 700;
}

/* ==================== FEATURED PRIZE (PERSONA 5 STYLE) ==================== */
.featured-prize {
    position: relative;
    background: linear-gradient(135deg, var(--bg-card) 0%, #1a0a0a 100%);
    border: 3px solid var(--p5-red);
    margin: 30px auto;
    max-width: 800px;
    padding: 30px;
    clip-path: polygon(
        0 0, calc(100% - 20px) 0, 100% 20px,
        100% 100%, 20px 100%, 0 calc(100% - 20px)
    );
}

.prize-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid var(--p5-red);
    z-index: 2;
}

.prize-corner.top-left {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.prize-corner.top-right {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
}

.prize-corner.bottom-left {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
}

.prize-corner.bottom-right {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

.prize-label {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--p5-red);
    color: var(--p5-white);
    padding: 8px 30px;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 100%, 0 100%);
    box-shadow: 0 5px 15px rgba(230, 0, 18, 0.5);
}

.prize-content {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 10px;
}

.prize-image-wrapper {
    position: relative;
    flex-shrink: 0;
}

.prize-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 3px solid var(--p5-red);
    clip-path: polygon(
        0 10px, 10px 0, calc(100% - 10px) 0, 100% 10px,
        100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px)
    );
    animation: prizeGlow 2s ease-in-out infinite;
}

@keyframes prizeGlow {
    0%, 100% { 
        filter: brightness(1) drop-shadow(0 0 10px rgba(230, 0, 18, 0.5));
    }
    50% { 
        filter: brightness(1.2) drop-shadow(0 0 20px rgba(230, 0, 18, 0.8));
    }
}

.prize-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prize-rarity {
    display: inline-block;
    padding: 5px 15px;
    background: var(--p5-red);
    color: var(--p5-white);
    font-weight: 900;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 100%, 0 100%);
    width: fit-content;
}

.prize-rarity.mythic {
    animation: rarityPulse 1.5s ease-in-out infinite;
}

@keyframes rarityPulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

.prize-name {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 900;
    color: var(--p5-white);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 2px 2px 0 var(--p5-red);
}

.prize-desc {
    font-size: 0.95rem;
    color: var(--p5-light-gray);
    line-height: 1.6;
    margin: 0;
}

.prize-rate {
    font-size: 0.9rem;
    color: var(--p5-red);
    font-weight: 700;
    letter-spacing: 1px;
}

/* Mobile responsive untuk featured prize */
@media (max-width: 768px) {
    .featured-prize {
        padding: 20px;
        margin: 20px auto;
    }
    
    .prize-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .prize-image {
        width: 120px;
        height: 120px;
    }
    
    .prize-rarity {
        margin: 0 auto;
    }
}

.casino-icons {
    font-size: 3rem;
    animation: casinoSpin 3s linear infinite;
}

@keyframes casinoSpin {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.slot-symbols {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.symbol {
    font-size: 2rem;
    padding: 10px;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    background: rgba(220, 20, 60, 0.2);
    animation: symbolFloat 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.2s);
}

.symbol:nth-child(1) { --i: 0; }
.symbol:nth-child(2) { --i: 1; }
.symbol:nth-child(3) { --i: 2; }
.symbol:nth-child(4) { --i: 3; }

@keyframes symbolFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Mobile slot machine adjustments */
@media (max-width: 768px) {
    .slot-machine-frame {
        margin: 20px auto;
        padding: 15px;
    }
    
    .slot-gif {
        height: 150px;
    }
    
    .slot-symbols {
        gap: 10px;
    }
    
    .symbol {
        font-size: 1.5rem;
        padding: 8px;
    }
    
    .casino-icons {
        font-size: 2rem;
    }
}

/* ==================== GACHA SECTION ==================== */
.gacha-container {
    text-align: center;
    padding: 20px 0;
}

.gacha-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(162, 155, 254, 0.5);
}

/* Mobile gacha title */
@media (max-width: 768px) {
    .gacha-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
}

/* ==================== PERSONA 5 CARD STYLE ==================== */
.gacha-display {
    margin: 40px auto;
    min-height: 400px;
    position: relative;
    width: 100%;
    max-width: 900px;
}

.p5-card {
    position: relative;
    background: linear-gradient(135deg, var(--bg-card) 0%, #0a0a0a 100%);
    border: 3px solid var(--p5-red);
    padding: 50px;
    clip-path: polygon(
        0 0, calc(100% - 15px) 0, 100% 15px,
        100% 100%, 15px 100%, 0 calc(100% - 15px)
    );
    overflow: hidden;
}

.p5-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(230, 0, 18, 0.2),
        transparent
    );
    animation: cardShine 3s ease-in-out infinite;
}

@keyframes cardShine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--p5-red);
}

.card-accent::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 100vh;
    background: var(--p5-red);
}

.card-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 900;
    color: var(--p5-white);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0 0 15px 0;
    text-shadow: 3px 3px 0 var(--p5-red);
}

.card-text {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--p5-light-gray);
    letter-spacing: 1px;
    margin: 0;
}

/* Mobile gacha display */
@media (max-width: 768px) {
    .gacha-display {
        margin: 20px auto;
        min-height: 250px;
    }
    
    .p5-card {
        padding: 30px 20px;
    }
}

.banner-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.2) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.gacha-banner h3 {
    font-size: 2rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

/* Mobile gacha banner heading */
@media (max-width: 768px) {
    .gacha-banner h3 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
}

.gacha-banner p {
    font-size: 1.2rem;
    color: var(--text-gray);
    position: relative;
    z-index: 1;
    line-height: 1.4;
}

/* Mobile gacha banner text */
@media (max-width: 768px) {
    .gacha-banner p {
        font-size: 14px;
        line-height: 1.3;
    }
}

/* ==================== GACHA BUTTONS ==================== */
.gacha-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Mobile gacha buttons */
@media (max-width: 768px) {
    .gacha-buttons {
        gap: 15px;
        margin: 20px 0;
        flex-direction: column;
        align-items: center;
    }
}

.btn-gacha {
    background: linear-gradient(145deg, var(--bg-casino), var(--primary-color));
    border: 4px solid var(--accent-color);
    color: var(--text-casino);
    padding: 20px 50px;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    border-radius: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 
        0 8px 25px rgba(220, 20, 60, 0.4),
        inset 0 1px 0 rgba(255, 215, 0, 0.3);
    position: relative;
}

.btn-gacha::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8), transparent);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.btn-gacha:hover::before {
    width: 100%;
    height: 100%;
}

.btn-gacha:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(220, 20, 60, 0.6),
        0 0 20px rgba(255, 215, 0, 0.5);
    border-color: #fff;
}

/* Mobile gacha buttons */
@media (max-width: 768px) {
    .btn-gacha {
        padding: 15px 25px;
        font-size: 14px;
        gap: 8px;
        min-width: 150px;
        width: 100%;
        max-width: 250px;
        border-width: 2px;
        border-radius: 12px;
    }
}

.btn-gacha:hover {
    background: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.5);
}

/* Mobile hover states */
@media (max-width: 768px) {
    .btn-gacha:hover {
        transform: none;
    }
    
    .btn-gacha:active {
        background: var(--primary-color);
        transform: scale(0.98);
    }
}

.btn-gacha.btn-multi {
    border-color: var(--legendary-color);
}

.btn-gacha.btn-multi:hover {
    background: linear-gradient(135deg, var(--legendary-color), #ffed4e);
    color: var(--bg-dark);
}

.btn-icon {
    font-size: 2rem;
}

/* Mobile button icon */
@media (max-width: 768px) {
    .btn-icon {
        font-size: 1.5rem;
    }
}

/* ==================== RATES DISPLAY ==================== */
.rates-display {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
    margin-top: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile rates display */
@media (max-width: 768px) {
    .rates-display {
        padding: 20px 15px;
        margin-top: 30px;
        border-radius: 12px;
    }
}

.rates-display h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
    font-size: 1.5rem;
}

/* Mobile rates heading */
@media (max-width: 768px) {
    .rates-display h3 {
        margin-bottom: 15px;
        font-size: 1.2rem;
    }
}

#ratesList {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Mobile rates list */
@media (max-width: 768px) {
    #ratesList {
        gap: 10px;
    }
}

.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: 10px;
    border-left: 5px solid;
}

/* Mobile rate items */
@media (max-width: 768px) {
    .rate-item {
        padding: 12px 10px;
        border-radius: 8px;
        border-left-width: 4px;
    }
}

.rate-item.legendary { border-color: var(--legendary-color); }
.rate-item.epic { border-color: var(--epic-color); }
.rate-item.rare { border-color: var(--rare-color); }
.rate-item.common { border-color: var(--common-color); }

.rate-name {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
}

/* Mobile rate name */
@media (max-width: 768px) {
    .rate-name {
        font-size: 12px;
    }
}

.rate-percentage {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Mobile rate percentage */
@media (max-width: 768px) {
    .rate-percentage {
        font-size: 14px;
    }
}

/* ==================== CHARACTER GRID ==================== */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* Mobile character grid */
@media (max-width: 768px) {
    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        margin-top: 20px;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.character-card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-casino));
    border: 3px solid var(--border-casino);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    min-height: 300px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 215, 0, 0.1);
}

.character-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--primary-color));
    border-radius: 15px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.character-card:hover::before {
    opacity: 1;
    animation: borderGlow 1.5s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* Mobile character card */
@media (max-width: 768px) {
    .character-card {
        padding: 15px 10px;
        border-radius: 12px;
        border-width: 2px;
        min-height: 220px;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .character-card {
        padding: 12px 8px;
        min-height: 200px;
    }
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.character-card.legendary { border-color: var(--legendary-color); }
.character-card.epic { border-color: var(--epic-color); }
.character-card.rare { border-color: var(--rare-color); }
.character-card.common { border-color: var(--common-color); }
.character-card.uncommon { border-color: #2ecc71; }
.character-card.mythic { border-color: #e74c3c; }
.character-card.secret { border-color: #ff00ff; }
.character-card.lore { border-color: #000000; }

.character-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

/* Mobile hover states */
@media (max-width: 768px) {
    .character-card:hover {
        transform: none;
    }
    
    .character-card:active {
        transform: scale(0.98);
    }
}

.character-img {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 3px solid;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile character image */
@media (max-width: 768px) {
    .character-img {
        width: 100px;
        height: 100px;
        margin-bottom: 10px;
        border-radius: 8px;
        border-width: 2px;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .character-img {
        width: 80px;
        height: 80px;
        margin-bottom: 8px;
    }
}

.character-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 10px;
    line-height: 1.3;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    text-align: center;
}

/* Mobile character name */
@media (max-width: 768px) {
    .character-name {
        font-size: 12px;
        margin-bottom: 8px;
        min-height: 30px;
        line-height: 1.2;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .character-name {
        font-size: 11px;
        min-height: 25px;
        margin-bottom: 5px;
    }
}

.character-rarity {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 5px;
}

/* Mobile character rarity */
@media (max-width: 768px) {
    .character-rarity {
        font-size: 10px;
        padding: 3px 8px;
        border-radius: 15px;
        margin-top: 3px;
    }
}

.rarity-legendary { background: var(--legendary-color); color: var(--bg-dark); }
.rarity-epic { background: var(--epic-color); }
.rarity-rare { background: var(--rare-color); }
.rarity-common { background: var(--common-color); }
.rarity-uncommon { background: #2ecc71; }
.rarity-mythic { background: #e74c3c; }
.rarity-secret { background: #ff00ff; }
.rarity-lore { background: #000000; }

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
    .modal.active {
        padding: 5px;
        align-items: flex-start;
        padding-top: 20px;
    }
}

.modal-content {
    background: linear-gradient(145deg, var(--bg-casino), #1a0a0a);
    border: 4px solid var(--accent-color);
    padding: 0;
    border-radius: 20px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(220, 20, 60, 0.5);
    width: 100%;
}

/* Mobile modal content */
@media (max-width: 768px) {
    .modal-content {
        border-radius: 15px;
        max-height: 95vh;
        border-width: 3px;
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-gray);
    transition: all 0.3s;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

/* Mobile close button */
@media (max-width: 768px) {
    .close {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}

.close:hover {
    color: var(--text-light);
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(90deg);
}

/* Mobile close hover */
@media (max-width: 768px) {
    .close:hover {
        transform: none;
    }
    
    .close:active {
        background: rgba(231, 76, 60, 0.8);
        color: var(--text-light);
    }
}

.result-display {
    padding: 40px;
}

/* Mobile result display */
@media (max-width: 768px) {
    .result-display {
        padding: 20px 15px;
    }
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

/* Mobile result header */
@media (max-width: 768px) {
    .result-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
}

.result-header h2 {
    font-size: 2.5rem;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s infinite;
}

/* Mobile result header text */
@media (max-width: 768px) {
    .result-header h2 {
        font-size: 1.8rem;
    }
}

.result-count {
    color: var(--text-gray);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Mobile result count */
@media (max-width: 768px) {
    .result-count {
        font-size: 14px;
        margin-top: 8px;
    }
}

.result-cards {
    display: grid;
    gap: 25px;
    margin-top: 30px;
}

/* Mobile result cards */
@media (max-width: 768px) {
    .result-cards {
        gap: 15px;
        margin-top: 20px;
    }
}

.result-cards.single {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile single result */
@media (max-width: 768px) {
    .result-cards.single {
        max-width: 100%;
    }
}

.result-cards.multi {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.result-card {
    background: linear-gradient(135deg, #1e2139 0%, #2a2d4a 100%);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    animation: cardReveal 0.6s ease forwards;
}

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

.result-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.result-card-border {
    height: 6px;
    width: 100%;
}

.result-card-content {
    padding: 20px;
    position: relative;
}

.duplicate-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.5);
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.result-cards.multi {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Mobile multi result cards */
@media (max-width: 768px) {
    .result-cards.multi {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .result-cards.multi {
        grid-template-columns: 1fr;
    }
}

.duplicate-icon {
    font-size: 1rem;
}

/* Mobile duplicate icon */
@media (max-width: 768px) {
    .duplicate-icon {
        font-size: 0.9rem;
    }
}

.coin-reward {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.5);
    animation: pulse 2s infinite;
}

/* Mobile coin reward */
@media (max-width: 768px) {
    .coin-reward {
        padding: 8px 15px;
        margin-top: 10px;
        font-size: 14px;
        gap: 6px;
        border-radius: 20px;
    }
}

.coin-icon {
    font-size: 1.3rem;
}

/* Mobile coin icon */
@media (max-width: 768px) {
    .coin-icon {
        font-size: 1.1rem;
    }
}

.owned-count {
    margin-top: 10px;
    color: var(--text-gray);
    font-size: 0.85rem;
    font-style: italic;
}

/* Mobile owned count */
@media (max-width: 768px) {
    .owned-count {
        margin-top: 8px;
        font-size: 12px;
    }
}

.result-card-image {
    position: relative;
    width: 100%;
    height: 280px;
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
}

/* Mobile result card image */
@media (max-width: 768px) {
    .result-card-image {
        height: 200px;
        margin-bottom: 12px;
        border-radius: 8px;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .result-card-image {
        height: 180px;
        margin-bottom: 10px;
    }
}

.result-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.result-card:hover .result-card-image img {
    transform: scale(1.1);
}

/* Mobile result card hover */
@media (max-width: 768px) {
    .result-card:hover .result-card-image img {
        transform: none;
    }
}

.result-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0.3;
}

.result-card-info {
    text-align: center;
}

.result-card-rarity {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.result-card-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 10px 0;
    color: var(--text-light);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.result-card-description {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.5;
    margin-top: 10px;
}

.modal-footer {
    text-align: center;
    padding: 20px 40px 40px;
    border-top: 2px solid rgba(102, 126, 234, 0.2);
    margin-top: 30px;
}

.modal-btn {
    min-width: 200px;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* Confetti effect for legendary pulls */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 1;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ==================== HISTORY ==================== */
.history-list {
    max-width: 800px;
    margin: 30px auto;
}

.history-item {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border-left: 5px solid var(--primary-color);
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.history-type {
    font-weight: 700;
    text-transform: uppercase;
}

.history-time {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.history-results {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-character {
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==================== STATS ==================== */
.stats-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    border: 2px solid var(--primary-color);
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 15px 0;
}

.stat-label {
    color: var(--text-gray);
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* ==================== ANIMATIONS ==================== */
@keyframes pullAnimation {
    0% { transform: scale(0.8) rotateY(0deg); opacity: 0; }
    50% { transform: scale(1.1) rotateY(180deg); }
    100% { transform: scale(1) rotateY(360deg); opacity: 1; }
}

.character-reveal {
    animation: pullAnimation 1s ease;
}

/* ==================== LOADING STATES ==================== */
.loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 3px solid transparent;
    border-top: 3px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mobile loading */
@media (max-width: 768px) {
    .loading::after {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.character-card.loading {
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.character-card.loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.shimmer-effect {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ==================== MOBILE OPTIMIZATIONS ==================== */
/* Disable hover effects on touch devices */
@media (hover: none) {
    .character-card:hover,
    .btn:hover,
    .nav-btn:hover,
    .btn-gacha:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Improve scroll performance on mobile */
.character-grid {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Better mobile navigation */
@media (max-width: 768px) {
    nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(26, 30, 62, 0.95);
        backdrop-filter: blur(10px);
        padding: 10px 0;
        border-top: 2px solid var(--primary-color);
        z-index: 100;
        display: flex !important;
        justify-content: space-around;
        align-items: center;
    }
    
    .nav-btn {
        flex: 1;
        max-width: 80px;
        padding: 8px 4px;
        font-size: 10px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    main.container {
        padding-bottom: 80px; /* Account for fixed nav */
    }
}

/* ==================== RESPONSIVE OVERRIDES ==================== */
@media (max-width: 768px) {
    .logo { 
        font-size: 1.3rem; 
        text-align: center;
        width: 100%;
        margin-bottom: 10px;
    }
    
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        order: -1;
        margin-bottom: 10px;
    }
    
    .gacha-title { 
        font-size: 1.8rem; 
        margin-bottom: 20px;
    }
    
    .gacha-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .btn-gacha {
        min-width: 250px;
        width: 100%;
        max-width: 300px;
    }
    
    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    /* Modal responsive */
    .modal-content {
        max-width: 98%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .result-display {
        padding: 20px 15px;
    }
    
    .result-header h2 {
        font-size: 1.6rem;
    }
    
    .modal-footer {
        padding: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.2);
    }
    
    .modal-btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .gacha-banner {
        padding: 20px 15px;
    }
    
    .rates-display {
        padding: 15px;
        margin-top: 20px;
    }
    
    .result-cards {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 5px 0;
    }
    
    .logo {
        font-size: 1.1rem;
        margin-bottom: 5px;
    }
    
    .section {
        padding: 15px 0;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* Print styles */
@media print {
    .nav-btn, .btn, .modal, .background {
        display: none !important;
    }
    
    .section {
        display: block !important;
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --bg-dark: #000000;
        --bg-card: #1a1a1a;
        --text-light: #ffffff;
        --text-gray: #cccccc;
    }
}
    
    .result-header h2 {
        font-size: 1.8rem;
    }
    
    .result-cards.multi {
        grid-template-columns: 1fr;
    }
    
    .result-card-image {
        height: 220px;
    }
    
    .result-card-name {
        font-size: 1.3rem;
    }
/* ==================== MOBILE ANIMATIONS ==================== */
.mobile-animation {
    /* Reduce complex animations on mobile for better performance */
    animation-duration: 0.5s;
    transition-duration: 0.3s;
}

.mobile-animation .character-card {
    will-change: auto; /* Prevent unnecessary GPU layers */
}

.mobile-device .pull-animation-container {
    /* Simplified animations for mobile */
    animation-duration: 0.5s !important;
}

.mobile-device .result-card {
    transform: none !important; /* Disable 3D transforms on mobile */
}

.mobile-device .banner-glow {
    animation: none; /* Disable expensive animations on mobile */
}

/* Touch-specific styles */
.touch-device button:active,
.touch-device .btn:active,
.touch-device .nav-btn:active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* Active states for mobile */
.mobile-device .active {
    background-color: rgba(108, 92, 231, 0.3) !important;
}

/* Better mobile scrolling */
.mobile-device .character-grid {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-device .character-card {
    scroll-snap-align: start;
}

/* Fixed mobile navigation */
@media (max-width: 768px) {
    body.mobile-device {
        padding-bottom: 70px;
    }
    
    nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: rgba(26, 30, 62, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        border-top: 2px solid var(--primary-color) !important;
        border-bottom: none !important;
        padding: 8px 0 !important;
        z-index: 1000 !important;
    }
    
    nav .container {
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding: 0 10px !important;
        max-width: 100% !important;
    }
    
    .nav-btn {
        flex: 1 !important;
        margin: 0 2px !important;
        padding: 8px 4px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
        min-width: 60px !important;
        max-width: 80px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .user-info {
        position: absolute !important;
        top: -50px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        background: rgba(26, 30, 62, 0.95) !important;
        padding: 5px 15px !important;
        border-radius: 20px 20px 0 0 !important;
        border: 2px solid var(--primary-color) !important;
        border-bottom: none !important;
        z-index: 999 !important;
    }
}

/* Performance optimizations */
.mobile-device * {
    -webkit-tap-highlight-color: transparent;
}

.mobile-device .character-img {
    image-rendering: optimizeSpeed;
}

/* Reduce motion for better performance */
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* END OF STYLES */
