/* Base styles */
body {
    font-family: 'Fredoka One', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: none !important;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
    background: #1a4d1a;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(76, 128, 48, 0.4) 3px, transparent 3px),
        radial-gradient(circle at 80% 80%, rgba(76, 128, 48, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 60% 40%, rgba(76, 128, 48, 0.25) 2.5px, transparent 2.5px),
        radial-gradient(circle at 40% 60%, rgba(76, 128, 48, 0.2) 2px, transparent 2px),
        radial-gradient(circle at 10% 90%, rgba(76, 128, 48, 0.3) 1.5px, transparent 1.5px),
        radial-gradient(circle at 90% 10%, rgba(76, 128, 48, 0.25) 2px, transparent 2px);
    background-size: 50px 50px, 70px 70px, 60px 60px, 80px 80px, 45px 45px, 65px 65px;
    min-height: 100vh;
    /* Prevent text size adjustment on orientation change */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Smooth scrolling for all devices */
html {
    scroll-behavior: smooth;
}

* {
    /* Better tap highlighting for mobile */
    -webkit-tap-highlight-color: rgba(255, 140, 0, 0.2);
}

.font-fredoka {
    font-family: 'Fredoka One', cursive;
}

/* Popup styles */
.popup-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-size: 18px;
    line-height: 1.4;
    color: #333;
    text-align: center;
}

.gif-container {
    margin-bottom: 20px;
}

.instruction-gif {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.instruction-text {
    font-family: 'Fredoka One', cursive;
    font-size: 16px;
    color: #333;
    margin: 0;
    line-height: 1.4;
}


.tiktok-icon {
    display: inline-block;
    width: 25px;
    height: 25px;
    background-image: url('tiktokicon.webp');
    background-size: 80%;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    margin: 0 5px;
    vertical-align: middle;
}

.three-dots {
    display: inline-block;
    width: 25px;
    height: 25px;
    background: #666;
    border-radius: 50%;
    margin: 0 5px;
    position: relative;
    vertical-align: middle;
}

.three-dots::after {
    content: '⋯';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.highlight {
    color: rgb(0,122,255);
    font-weight: bold;
}

/* Utility class to prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Generator Modal Custom Styles */
#generator-modal {
    background: transparent !important;
    -webkit-overflow-scrolling: touch;
}

#generator-modal .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.3);
    border: 3px solid #e9ecef;
    position: relative;
    overflow: hidden;
    animation: modal-appear 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#generator-modal .modal-content::before {
    display: none;
}

#generator-modal .modal-content > * {
    position: relative;
    z-index: 1;
}

#generator-title {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: #2c3e50;
    text-shadow: none;
    margin-bottom: 1.5rem;
    animation: urgency-blink 3s ease-in-out infinite;
}

.generator-urgent {
    color: #ff6b35 !important;
    font-weight: bold;
    animation: urgency-blink 1s ease-in-out infinite !important;
}

#loading-item-img {
    border-radius: 1rem;
    box-shadow: 0 4px 16px #FF4C4C22;
    border: 2px solid #FF4C4C;
    background: #fff;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 1rem;
    border: 2px solid #dee2e6;
    overflow: hidden;
    height: 1.5rem;
    margin-bottom: 1rem;
    width: 100%;
    margin: 8px 0;
}

#progress-fill {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    font-weight: bold;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    border-radius: 1rem;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.6);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.4s cubic-bezier(.4,2,.6,1), background 0.3s;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

#progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progress-shine 2s infinite;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8fff5a, #a0ff73, #b0ff8a);
    border-radius: 0.5rem;
    transition: width 0.5s ease-in-out;
    box-shadow: 0 0 20px rgba(160, 255, 115, 0.8);
}

#game-tip {
    color: #6c757d !important;
    font-size: 1.1rem;
    font-family: 'Poppins', 'Fredoka One', cursive;
    margin-bottom: 1.2rem;
}

#verify-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    border: none;
    border-radius: 1.5rem;
    padding: 1rem 0;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
    outline: none;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    animation: pulse-glow 2s ease-in-out infinite, button-bounce 3s ease-in-out infinite;
    text-transform: uppercase;
}



#verify-btn:hover {
    background: linear-gradient(135deg, #e55a2b 0%, #d67e14 100%);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.8);
    animation: pulse-glow 1s ease-in-out infinite, button-bounce 2s ease-in-out infinite;
}

.verify-btn-appear {
    animation: verify-appear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#verify-btn:focus, #verify-btn:active {
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px #222;
}

/* Rainbow animated border for legendary claim buttons */
.legendary-claim {
    position: relative;
    z-index: 1;
}

.legendary-claim::before {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: 9999px;
    z-index: -1;
    background: linear-gradient(270deg, #ff0000, #ff9900, #ffee00, #33ff00, #00ffee, #0066ff, #cc00ff, #ff0000);
    background-size: 1600% 1600%;
    animation: legendary-rainbow 4s linear infinite;
}

.legendary-claim::after {
    content: '';
    position: absolute;
    top: -8px; left: -8px; right: -8px; bottom: -8px;
    border-radius: 9999px;
    z-index: -2;
    border: 3px solid #000;
}

/* Rainbow banner */
.rainbow-banner {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #D2691E 100%);
    border-radius: 1.5rem;
    padding: 0.75rem 2.5rem;
    display: inline-block;
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
    border: 2px solid #ffffff;
}

.rainbow-banner-text {
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), -1px -1px 0 #2c3e50, 1px -1px 0 #2c3e50, -1px 1px 0 #2c3e50, 1px 1px 0 #2c3e50;
    opacity: 1;
    filter: none;
    -webkit-text-stroke: 0;
    line-height: 1.2;
    padding: 0.5rem 1.5rem;
    text-align: center;
}

/* Animated, 20% transparent background for legendary items */
.legendary-claim-bg {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 90px;
    height: 90px;
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
    animation: legendary-float 3s ease-in-out infinite alternate;
}

.pet-img-bg { 
    position: relative; 
}

/* Modal styling */
.modal-backdrop {
    background-color: transparent;
    backdrop-filter: blur(10px);
}

.price-text-old {
    color: #ff6f61;
    text-shadow: 0 0 10px rgba(255, 111, 97, 0.5);
}

/* Style for the item title with white text and black outline */
.item-title-glow {
    color: white;
    text-shadow: 
        -1px -1px 0 #000,  
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

/* Loading Animation Styles */
.loading-spinner {
    border: 4px solid rgba(160, 255, 115, 0.2);
    border-top: 4px solid #a0ff73;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

/* Pulsing animation for the modal title */
.pulse-title {
    animation: pulse 2s ease-in-out infinite;
}

/* Bright yellow card design with black border */
.card-bg {
    background: linear-gradient(145deg, rgba(29, 155, 240, 0.95), rgba(163, 78, 255, 0.9));
    border: 3px solid #000000;
    background-clip: padding-box;
    box-shadow: 
        0 8px 32px rgba(29, 155, 240, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.card-bg::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, #1D9BF0, #A34EFF, #FF4C4C, #1D9BF0);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    z-index: -1;
    margin: -3px;
    border-radius: inherit;
}

.card-bg:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(29, 155, 240, 0.4),
        0 0 30px rgba(29, 155, 240, 0.6);
}

/* Green claim button with black border */
.green-claim-button {
    background: #61ff4c;
    border: 3px solid #000000;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 0 20px rgba(9, 255, 42, 0.925);
    position: relative;
    overflow: hidden;
    color: #ffffff;
    font-weight: bold;
}

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

.green-claim-button:hover::before {
    left: 100%;
}

.green-claim-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(36, 224, 11, 0.8);
    background: #48fc42;
}

/* Bright yellow button styles for other buttons */
.yellow-button {
    background: #A34EFF;
    border: 3px solid #000000;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 0 20px rgba(163, 78, 255, 0.5);
    position: relative;
    overflow: hidden;
    color: #ffffff;
    font-weight: bold;
}

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

.yellow-button:hover::before {
    left: 100%;
}

.yellow-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(163, 78, 255, 0.8);
    background: #B34EFF;
}

/* Floating items background animation */
#floating-items-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -2;
    pointer-events: none;
}

.floating-item {
    position: absolute;
    opacity: 0.15;
    will-change: transform;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    filter: drop-shadow(0 0 10px rgba(135, 206, 235, 0.3));
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Section headers with white text and black outline */
.section-header, .header-title-outline {
    color: white;
    text-shadow: 
        -1px -1px 0 #000,  
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

/* Modal styling with black border */
.modal-content {
    background: linear-gradient(145deg, rgba(29, 155, 240, 0.98), rgba(163, 78, 255, 0.95));
    border: 3px solid #000000;
    backdrop-filter: blur(20px);
}

/* Input field styling with black border */
.yellow-input {
    background: rgba(29, 155, 240, 0.9);
    border: 3px solid #000000;
    color: #ffffff;
    transition: all 0.3s ease;
}

.yellow-input:focus {
    border-color: #000000;
    box-shadow: 0 0 20px rgba(29, 155, 240, 0.4);
    outline: none;
}

.yellow-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Text colors for better contrast on yellow background */
.text-dark {
    color: #ffffff !important;
}

.text-darker {
    color: #f0f0f0 !important;
}

.blocky-bg {
    background: linear-gradient(135deg, #FFB347 0%, #FF8C00 50%, #FF7F00 100%);
    position: relative;
    z-index: 1;
    border: 3px solid #000000;
    box-sizing: border-box;
    outline: none;
    outline-offset: 0px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(255, 140, 0, 0.4), 0 8px 30px rgba(255, 140, 0, 0.3);
    margin-top: 0;
    overflow: hidden;
    min-width: 0;
}

.blocky-banner-bar {
    width: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 21px 21px 0 0;
    border: none;
    border-bottom: none;
    box-sizing: border-box;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 24px 0 20px 0;
    margin: 0 auto 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}



.blocky-banner-bar > * { 
    position: relative; 
    z-index: 2; 
}

.blocky-banner-bar-text {
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-size: 2.1rem;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 100%;
}

.pet-row {
    border: 2px solid #000000;
    outline: 1px solid #FF8C00;
    outline-offset: 2px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
    position: relative;
    min-width: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #FFB347 0%, #FF8C00 50%, #FF7F00 100%);
    padding: 16px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    /* Performance optimization */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.pet-row:not(:last-child)::after {
    display: none;
}

.pet-row:hover {
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.5), 0 4px 12px rgba(255, 140, 0, 0.4);
    background: linear-gradient(135deg, #FFCC80 0%, #FFB347 50%, #FF8C00 100%);
    transform: translateY(-2px);
    border-color: #000000;
    outline-color: #FF8C00;
    z-index: 3;
}

.pet-img-bg {
    background: radial-gradient(circle, #FFFFFF 0%, #FFE4B5 50%, #FFB347 100%);
    border-radius: 12px;
    border: 2px solid #000000;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 4px 8px rgba(255, 140, 0, 0.3);
    min-width: 80px;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pet-img-bg::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: pulse-glow 2s ease-in-out infinite;
}

.pet-img-bg:hover {
    box-shadow: 0 0 25px rgba(255, 255, 255, 1), 0 6px 15px rgba(255, 140, 0, 0.5);
    border: 2px solid #000000;
    background: radial-gradient(circle, #FFFFFF 0%, #FFE4B5 50%, #FFB347 100%);
}

.pet-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    color: #ffffff;
    text-shadow: -1px -1px 0 #8B4513, 1px -1px 0 #8B4513, -1px 1px 0 #8B4513, 1px 1px 0 #8B4513, 0 2px 4px rgba(139, 69, 19, 0.5);
    margin-right: 10px;
    word-break: break-word;
    letter-spacing: 0.5px;
    font-weight: bold;
}

.claim-pill {
    background: linear-gradient(135deg, #32CD32 0%, #228B22 50%, #006400 100%);
    background-size: 100% 100%;
    color: #ffffff;
    font-weight: bold;
    font-family: 'Fredoka One', cursive;
    font-size: 0.9rem;
    border-radius: 8px;
    padding: 8px 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid #000000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    min-width: 80px;
    height: 36px;
    margin-left: auto;
    flex-shrink: 0;
}

.claim-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 8px 8px;
    opacity: 0.3;
}

.claim-pill:hover {
    background: linear-gradient(135deg, #228B22 0%, #006400 50%, #004d00 100%);
    background-size: 100% 100%;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    border: 2px solid #000000;
}

/* Username Modal Styles */
.username-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(40, 40, 60, 0.18);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    /* Performance optimization */
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.username-modal {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px 36px 36px 36px;
    min-width: 380px;
    max-width: 90vw;
    text-align: center;
    position: relative;
    border: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.username-modal-title {
    font-family: 'Fredoka One', cursive;
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 12px;
    text-shadow: none;
    font-weight: bold;
}

.username-modal-sub {
    font-family: 'Fredoka One', cursive;
    font-size: 1.15rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.username-modal-input {
    width: 100%;
    padding: 16px 20px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    font-size: 1.1rem;
    margin-bottom: 20px;
    outline: none;
    font-family: 'Fredoka One', cursive;
    background: #ffffff;
    color: #2c3e50;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.username-modal-input:focus {
    border: 2px solid #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.username-modal-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    border: none;
    border-radius: 12px;
    padding: 18px 0;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    margin: 0 0 0 0;
    width: 100%;
    font-weight: bold;
    letter-spacing: 1px;
    outline: none;
    transition: all 0.3s ease;
}

.username-modal-btn:hover {
    background: linear-gradient(135deg, #e55a2b 0%, #d67e14 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6);
}

.username-modal-error {
    color: #dc3545;
    font-size: 1rem;
    min-height: 1.2em;
    margin-bottom: 8px;
    font-family: 'Fredoka One', cursive;
}

.username-modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    font-weight: bold;
    z-index: 2;
    transition: color 0.3s ease;
}

.username-modal-close:hover {
    color: #2c3e50;
}

/* Touch-friendly improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
    .claim-pill,
    .username-modal-btn,
    .username-modal-close,
    #verify-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .claim-pill:active,
    .username-modal-btn:active,
    #verify-btn:active {
        transform: scale(0.95);
    }
    
    /* Improve touch targets */
    .pet-row {
        min-height: 80px;
    }
}

/* iPad and tablets in portrait */
@media (min-width: 601px) and (max-width: 768px) {
    .blocky-bg {
        padding: 1.5rem !important;
    }
    
    .pet-img-bg {
        width: 85px !important;
        height: 85px !important;
        min-width: 85px !important;
    }
    
    .pet-img-bg img {
        width: 65px !important;
        height: 65px !important;
    }
    
    .pet-title {
        font-size: 1.05rem;
    }
    
    .claim-pill {
        font-size: 0.95rem;
        padding: 10px 15px;
        min-width: 75px;
    }
    
    .rainbow-banner-text {
        font-size: 1rem !important;
        letter-spacing: 0.7px !important;
    }
    
    .username-modal {
        min-width: 340px;
        max-width: 80vw;
    }
}

/* Medium tablets and landscape phones */
@media (max-width: 768px) {
    .blocky-bg {
        padding: 1.25rem !important;
    }
    
    .pet-img-bg {
        width: 75px !important;
        height: 75px !important;
        min-width: 75px !important;
    }
    
    .pet-title {
        font-size: 1rem;
    }
    
    .claim-pill {
        font-size: 0.9rem;
        padding: 9px 14px;
        min-width: 72px;
    }
    
    .rainbow-banner-text {
        font-size: 0.9rem !important;
        letter-spacing: 0.6px !important;
    }
    
    .username-modal {
        min-width: 300px;
        max-width: 88vw;
    }
}

/* Responsive styles */
@media (max-width: 900px) {
    .blocky-bg { 
        border-radius: 22px; 
        border-width: 5px; 
        outline-width: 2px;
        padding: 1.5rem !important; 
    }
    .blocky-bg::before { 
        border-radius: 30px; 
        top: -5px; 
        left: -5px; 
        right: -5px; 
        bottom: -5px; 
    }
    .blocky-banner-bar { 
        border-radius: 22px 22px 0 0; 
        border-width: 5px; 
        outline-width: 2px; 
    }
    .blocky-banner-bar::before { 
        border-radius: 30px 30px 0 0; 
        top: -5px; 
        left: -5px; 
        right: -5px; 
        bottom: -5px; 
    }
    .pet-title { 
        font-size: 1.05rem; 
    }
    .claim-pill { 
        font-size: 0.95rem; 
        padding: 10px 16px;
        min-width: 75px;
        height: 40px;
    }
    .pet-img-bg { 
        width: 80px !important; 
        height: 80px !important;
        min-width: 80px !important;
    }
    
    .pet-row {
        padding: 14px 10px;
        gap: 10px;
    }
    
    /* Center the rainbow banner on tablets */
    .rainbow-banner {
        display: block !important;
        text-align: center;
        margin: 0 auto !important;
        width: fit-content;
        max-width: 95vw;
        padding: 0.75rem 2rem;
    }
    
    .rainbow-banner-text {
        font-size: 1.3rem !important;
        letter-spacing: 1.5px !important;
        text-align: center !important;
    }
    
    .popup {
        max-width: 380px;
        width: 85%;
        padding: 25px;
    }
    
    .instruction-gif {
        max-width: 280px;
    }
    
    /* Username modal adjustments */
    .username-modal {
        min-width: 320px;
        max-width: 85vw;
        padding: 32px 24px;
    }
    
    .username-modal-title {
        font-size: 1.8rem;
    }
    
    .username-modal-sub {
        font-size: 1rem;
    }
    
    /* Generator modal adjustments */
    #generator-modal .modal-content {
        margin: 0 1rem;
        max-width: 90vw;
    }
    
    #generator-title {
        font-size: 1.5rem;
    }
    
    #verify-btn {
        font-size: 1.1rem;
        padding: 0.85rem 0;
    }
    
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (max-width: 600px) {
    body {
        padding: 0.5rem 0;
    }
    
    .blocky-bg { 
        border-radius: 16px; 
        border-width: 3px; 
        outline-width: 2px;
        padding: 1rem !important;
        margin: 0.5rem;
    }
    .blocky-bg::before { 
        border-radius: 18px; 
        top: -3px; 
        left: -3px; 
        right: -3px; 
        bottom: -3px; 
    }
    .blocky-banner-bar { 
        border-radius: 16px 16px 0 0; 
        border-width: 3px; 
        outline-width: 2px; 
        padding: 12px 0 10px 0; 
    }
    .blocky-banner-bar::before { 
        border-radius: 18px 18px 0 0; 
        top: -3px; 
        left: -3px; 
        right: -3px; 
        bottom: -3px; 
    }
    .blocky-banner-bar-text { 
        font-size: 1.2rem; 
    }
    .pet-title { 
        font-size: 0.9rem;
        line-height: 1.3;
    }
    .claim-pill { 
        font-size: 0.85rem; 
        padding: 10px 12px;
        min-width: 70px;
        height: 38px;
    }
    .pet-img-bg { 
        width: 70px !important; 
        height: 70px !important;
        min-width: 70px !important;
    }
    .pet-img-bg img {
        width: 50px !important;
        height: 50px !important;
    }
    
    .pet-row {
        padding: 12px 8px;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .pet-row .flex-col {
        flex: 1;
        min-width: 0;
    }
    
    .container { 
        padding: 0.5rem !important;
    }
    
    /* Center the rainbow banner on mobile */
    .rainbow-banner {
        display: block !important;
        text-align: center;
        margin: 0 auto !important;
        width: fit-content;
        max-width: 90vw;
        padding: 0.6rem 1.5rem;
    }
    
    .rainbow-banner-text {
        font-size: 0.85rem !important;
        letter-spacing: 0.5px !important;
        padding: 0.3rem 0.8rem !important;
        display: block;
        text-align: center !important;
        line-height: 1.2;
        word-break: break-word;
    }
    
    /* Username modal adjustments */
    .username-modal {
        min-width: 280px;
        max-width: 92vw;
        padding: 28px 20px;
    }
    
    .username-modal-title {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .username-modal-sub {
        font-size: 0.95rem;
        margin-bottom: 16px;
    }
    
    .username-modal-input {
        padding: 14px 16px;
        font-size: 1rem;
        margin-bottom: 16px;
    }
    
    .username-modal-btn {
        font-size: 1.1rem;
        padding: 14px 0;
    }
    
    /* Generator modal adjustments */
    #generator-modal .modal-content {
        margin: 0 0.75rem;
        max-width: 95vw;
        padding: 1.5rem;
    }
    
    #generator-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    #loading-item-img {
        width: 80px;
        height: 80px;
    }
    
    #game-tip {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    #verify-btn {
        font-size: 1rem;
        padding: 0.75rem 0;
    }
    
    .progress-bar {
        height: 1.25rem;
    }
    
    #progress-fill {
        font-size: 0.95rem;
    }
    
    /* Winner popup adjustments */
    #winner-popup {
        min-width: 280px;
        max-width: 92vw;
        padding: 0.3rem 1.5rem;
        font-size: 0.85rem;
        border-radius: 1.8rem;
        gap: 12px;
    }
    
    #winner-popup-icon img {
        width: 32px !important;
        height: 32px !important;
    }
    
    /* Popup adjustments */
    .popup {
        max-width: 340px;
        width: 90%;
        padding: 20px;
    }
    
    .instruction-gif {
        max-width: 260px;
    }
    
    .instruction-text {
        font-size: 15px;
    }
}

/* Large phones (iPhone Plus, Pixel XL, etc.) */
@media (min-width: 401px) and (max-width: 600px) {
    .pet-img-bg {
        width: 75px !important;
        height: 75px !important;
        min-width: 75px !important;
    }
    
    .pet-img-bg img {
        width: 55px !important;
        height: 55px !important;
    }
    
    .pet-title {
        font-size: 0.92rem;
    }
    
    .claim-pill {
        font-size: 0.88rem;
        padding: 9px 11px;
        min-width: 68px;
        height: 37px;
    }
    
    .rainbow-banner-text {
        font-size: 1.15rem !important;
    }
}

/* Extra small phones */
@media (max-width: 400px) {
    body {
        padding: 0.25rem 0;
    }
    
    .blocky-bg {
        margin: 0.25rem;
        padding: 0.75rem !important;
        border-radius: 12px;
    }
    
    .rainbow-banner {
        padding: 0.5rem 1rem !important;
        max-width: 95vw;
    }
    
    .rainbow-banner-text {
        font-size: 0.75rem !important;
        letter-spacing: 0.3px !important;
        padding: 0.2rem 0.5rem !important;
        word-break: break-word;
        line-height: 1.2;
        display: block;
        text-align: center !important;
    }
    
    .pet-title {
        font-size: 0.85rem;
        line-height: 1.2;
    }
    
    .pet-row {
        padding: 10px 6px;
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .pet-img-bg {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        margin-right: 8px !important;
    }
    
    .pet-img-bg img {
        width: 40px !important;
        height: 40px !important;
    }
    
    .claim-pill {
        font-size: 0.8rem;
        padding: 8px 10px;
        min-width: 60px;
        height: 36px;
    }
    
    .bar-title-og, .bar-title-secret {
        font-size: 0.65rem;
        padding: 2px 6px;
        top: -6px;
        left: -10px;
    }
    
    .popup {
        padding: 16px;
        max-width: 300px;
        width: 95%;
    }
    
    .instruction-gif {
        max-width: 240px;
    }
    
    .instruction-text {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .username-modal {
        min-width: 260px;
        max-width: 95vw;
        padding: 24px 16px;
    }
    
    .username-modal-title {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }
    
    .username-modal-sub {
        font-size: 0.85rem;
        margin-bottom: 14px;
        line-height: 1.4;
    }
    
    .username-modal-input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .username-modal-btn {
        font-size: 1rem;
        padding: 12px 0;
    }
    
    #generator-modal .modal-content {
        margin: 0 0.5rem;
        padding: 1.25rem;
    }
    
    #generator-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    #loading-item-img {
        width: 70px;
        height: 70px;
    }
    
    #game-tip {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    #verify-btn {
        font-size: 0.95rem;
        padding: 0.7rem 0;
    }
    
    .progress-bar {
        height: 1.1rem;
    }
    
    #progress-fill {
        font-size: 0.85rem;
    }
    
    #winner-popup {
        min-width: 260px;
        padding: 0.25rem 1rem;
        font-size: 0.8rem;
        border-radius: 1.5rem;
        gap: 10px;
    }
    
    #winner-popup-icon img {
        width: 28px !important;
        height: 28px !important;
    }
    
    .container {
        padding: 0.25rem !important;
    }
}

/* Very narrow devices (foldable phones, etc.) */
@media (max-width: 320px) {
    body {
        padding: 0.15rem 0;
    }
    
    .blocky-bg {
        margin: 0.15rem;
        padding: 0.5rem !important;
        border-radius: 10px;
    }
    
    .rainbow-banner {
        padding: 0.4rem 0.8rem !important;
    }
    
    .rainbow-banner-text {
        font-size: 0.7rem !important;
        letter-spacing: 0.2px !important;
        padding: 0.15rem 0.4rem !important;
        display: block;
        text-align: center !important;
        line-height: 1.1;
    }
    
    .pet-title {
        font-size: 0.8rem;
    }
    
    .pet-row {
        padding: 8px 5px;
        gap: 5px;
    }
    
    .pet-img-bg {
        width: 55px !important;
        height: 55px !important;
        min-width: 55px !important;
    }
    
    .pet-img-bg img {
        width: 35px !important;
        height: 35px !important;
    }
    
    .claim-pill {
        font-size: 0.75rem;
        padding: 7px 8px;
        min-width: 55px;
        height: 34px;
    }
    
    .username-modal {
        min-width: 240px;
        padding: 20px 12px;
    }
    
    .username-modal-title {
        font-size: 1.15rem;
    }
    
    .username-modal-sub {
        font-size: 0.8rem;
    }
    
    #generator-modal .modal-content {
        margin: 0 0.25rem;
        padding: 1rem;
    }
    
    #generator-title {
        font-size: 1rem;
    }
    
    #loading-item-img {
        width: 60px;
        height: 60px;
    }
    
    #game-tip {
        font-size: 0.8rem;
    }
    
    #verify-btn {
        font-size: 0.9rem;
        padding: 0.65rem 0;
    }
}

/* Landscape mode for small phones */
@media (max-height: 500px) and (orientation: landscape) {
    #generator-modal .modal-content {
        max-height: 85vh;
        overflow-y: auto;
        padding: 1rem;
    }
    
    #generator-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    #loading-item-img {
        width: 60px;
        height: 60px;
        margin-bottom: 0.5rem;
    }
    
    #game-tip {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .username-modal {
        max-height: 85vh;
        overflow-y: auto;
        padding: 20px 16px;
    }
}



/* Animations */
@keyframes legendary-rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rainbow-banner-anim {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes legendary-float {
    0% { transform: translate(-50%, -50%) scale(1.2) rotate(-8deg); }
    100% { transform: translate(-50%, -52%) scale(1.25) rotate(8deg); }
}

@keyframes rainbow-text {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes rainbow-border {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float1 {
    0% { transform: translate(-100px, 110vh) rotate(0deg); }
    100% { transform: translate(110vw, -100px) rotate(720deg); }
}

@keyframes float2 {
    0% { transform: translate(110vw, 110vh) rotate(0deg); }
    100% { transform: translate(-100px, -100px) rotate(-720deg); }
}

@keyframes float3 {
    0% { transform: translate(50vw, 110vh) rotate(0deg); }
    100% { transform: translate(50vw, -100px) rotate(360deg); }
}

@keyframes rainbow-pulse {
    0%, 100% { 
        box-shadow: 0 6px 20px rgba(255, 0, 255, 0.4);
    }
    50% { 
        box-shadow: 0 8px 30px rgba(255, 0, 255, 0.6), 0 0 20px rgba(255, 255, 255, 0.2);
    }
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4), 0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    50% { 
        box-shadow: 0 12px 35px rgba(255, 107, 53, 0.8), 0 0 20px 5px rgba(255, 107, 53, 0.3);
    }
}

@keyframes button-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

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

@keyframes urgency-blink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
}

@keyframes verify-appear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modal-appear {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes claim-rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Button Styles from Image */
.money-button {
    background: linear-gradient(135deg, #E0E0E0 0%, #C0C0C0 100%);
    border: 2px solid #000000;
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 8px 16px;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.money-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 8px 8px;
    opacity: 0.3;
}

.premium-button {
    background: linear-gradient(135deg, #FF1493 0%, #DC143C 100%);
    border: 2px solid #000000;
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 8px 16px;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.premium-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 8px 8px;
    opacity: 0.3;
}


.gift-button {
    background: linear-gradient(135deg, #00CED1 0%, #008B8B 100%);
    border: 2px solid #000000;
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 8px 16px;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.gift-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 8px 8px;
    opacity: 0.3;
}


/* Button hover effects */
.money-button:hover,
.premium-button:hover,
.gift-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.money-button:hover {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
}

.premium-button:hover {
    background: linear-gradient(135deg, #DC143C 0%, #B22222 100%);
}

.gift-button:hover {
    background: linear-gradient(135deg, #008B8B 0%, #006666 100%);
}

/* Bar title styles */
.bar-title-og, .bar-title-secret {
    position: absolute;
    top: -8px;
    left: -12px;
    font-family: 'Fredoka One', cursive;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 8px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 10;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.bar-title-og {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: 2px solid #FF8C00;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.bar-title-secret {
    background: linear-gradient(135deg, #FF69B4 0%, #8B008B 50%, #4B0082 100%);
    border: 2px solid #FF1493;
    box-shadow: 0 2px 8px rgba(255, 20, 147, 0.4);
}

.bar-title-rare {
    background: linear-gradient(135deg, #00BFFF 0%, #0080FF 100%);
    border: 2px solid #1E90FF;
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.4);
}
