
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Exo+2:wght@400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Exo 2', sans-serif;
    background: linear-gradient(45deg, #ff0080, #7928ca, #0070f3, #00d4aa);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: auto;
}

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

.game-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 16px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.2),
        0 0 40px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-align: center;
    max-width: min(96vw, 860px);
    width: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* Main content column for consistent width alignment */
.main-content-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(92vw, 520px);
    width: 100%;
    margin: 0 auto;
    gap: 10px;
}

.game-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 6s infinite;
    pointer-events: none;
}



/* Collapsible Settings Accordion */
.settings-accordion {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 255, 0.9));
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(121, 40, 202, 0.2);
    position: relative;
    z-index: 1;
    width: 100%;
    overflow: hidden;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    user-select: none;
}

.settings-header:hover {
    background: rgba(121, 40, 202, 0.05);
}

.settings-title {
    font-family: 'Orbitron', monospace;
    color: #7928ca;
    font-size: 1.1em;
    font-weight: 700;
}

.settings-chevron {
    font-size: 1.2em;
    color: #7928ca;
    transition: transform 0.3s ease;
}

.settings-chevron.expanded {
    transform: rotate(180deg);
}

.settings-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 18px;
}

.settings-content.expanded {
    max-height: 500px;
    padding: 0 18px 18px 18px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
}

.setting-row:last-of-type {
    margin-bottom: 16px;
}

.setting-row label {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    margin: 0;
    flex: 1;
}



.setting-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.setting-control input[type="range"] {
    width: 120px;
    height: 6px;
    background: linear-gradient(to right, #e0e0e0, #f0f0f0);
    border-radius: 10px;
    outline: none;
    appearance: none;
}

.setting-value {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1em;
    min-width: 28px;
    text-align: center;
    color: #7928ca;
    text-shadow: 0 0 8px rgba(121, 40, 202, 0.3);
}

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

h1 {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    color: transparent;
    background: linear-gradient(45deg, #ff0080, #7928ca, #0070f3);
    background-clip: text;
    -webkit-background-clip: text;
    margin-bottom: 20px;
    font-size: 3em;
    text-shadow: 0 0 30px rgba(255, 0, 128, 0.5);
    animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from { text-shadow: 0 0 30px rgba(255, 0, 128, 0.5); }
    to { text-shadow: 0 0 50px rgba(121, 40, 202, 0.8); }
}

/* Secondary Buttons */

/* Luck Circle Pulse Animation */
.luck-circle-pulse {
    animation: luckPulse 1.2s ease-in-out infinite;
}

@keyframes luckPulse {
    0%, 100% { transform: scale(1.00); }
    50% { transform: scale(1.06); }
}

@keyframes primaryPulse {
    0%, 100% { 
        transform: scale(1.0);
        box-shadow: 
            0 12px 35px rgba(0, 212, 170, 0.4),
            0 0 30px rgba(0, 212, 170, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 
            0 16px 45px rgba(0, 212, 170, 0.6),
            0 0 40px rgba(0, 212, 170, 0.5);
    }
}

@keyframes restartBounce {
    0% { 
        transform: scale(0.9);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.1);
        opacity: 1;
    }
    100% { 
        transform: scale(1.0);
        opacity: 1;
    }
}

@keyframes restartPulse {
    0%, 100% { 
        transform: scale(1.0);
        box-shadow: 
            0 12px 35px rgba(255, 71, 87, 0.4),
            0 0 30px rgba(255, 71, 87, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 
            0 16px 45px rgba(255, 71, 87, 0.6),
            0 0 40px rgba(255, 71, 87, 0.5);
    }
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.action-btn {
    padding: 10px 12px;
    font-size: 0.85em;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 255, 0.8));
    color: #7928ca;
    border: 2px solid rgba(121, 40, 202, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-family: 'Exo 2', sans-serif;
    min-height: 44px;
    box-shadow: 0 2px 8px rgba(121, 40, 202, 0.15);
}

.action-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7928ca, #5a1a9b);
    color: white;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(121, 40, 202, 0.4);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Primary Action */
.primary-action {
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
}

.primary-cta {
    padding: 16px 24px;
    font-size: 1.2em;
    font-weight: 700;
    background: linear-gradient(45deg, #00d4aa, #00b894);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'Exo 2', sans-serif;
    width: 100%;
    min-height: 56px;
    min-width: 44px;
    margin: 8px 0;
    box-shadow: 
        0 6px 20px rgba(0, 212, 170, 0.3),
        0 0 15px rgba(0, 212, 170, 0.2);
    position: relative;
    overflow: hidden;
    animation: primaryPulse 1.2s ease-in-out infinite;
}

.primary-cta.restart-state {
    background: linear-gradient(45deg, #ff4757, #ff3742);
    box-shadow: 
        0 6px 20px rgba(255, 71, 87, 0.4),
        0 0 15px rgba(255, 71, 87, 0.3);
    animation: restartBounce 0.4s ease-out, restartPulse 1.5s ease-in-out infinite;
}

.primary-cta.restart-state:hover:not(:disabled) {
    background: linear-gradient(45deg, #ff3742, #ff2f3a);
    box-shadow: 0 16px 45px rgba(255, 71, 87, 0.6);
}

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

.primary-cta:hover:not(:disabled)::before {
    left: 100%;
}

.primary-cta:hover:not(:disabled) {
    background: linear-gradient(45deg, #00b894, #00a085);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 16px 45px rgba(0, 212, 170, 0.6);
}

.primary-cta:disabled {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

button {
    padding: 15px 30px;
    font-size: 1.2em;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Exo 2', sans-serif;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

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

button:hover::before {
    left: 100%;
}

#place-dot-btn {
    background: linear-gradient(45deg, #00d4aa, #00b894);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.4);
}

#place-dot-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #00b894, #00a085);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 212, 170, 0.6);
}

#place-dot-btn:disabled {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

#restart-btn {
    background: linear-gradient(45deg, #0070f3, #0051cc);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 112, 243, 0.4);
}

#restart-btn:hover {
    background: linear-gradient(45deg, #0051cc, #003d99);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 112, 243, 0.6);
}

#randomize-btn {
    background: linear-gradient(45deg, #7928ca, #5a1a9b);
    color: white;
    box-shadow: 0 8px 25px rgba(121, 40, 202, 0.4);
}

#randomize-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #5a1a9b, #4a1580);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(121, 40, 202, 0.6);
}

#randomize-btn:disabled {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

#game-canvas {
    border: 2px solid transparent;
    border-radius: 15px;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(45deg, #ff0080, #7928ca, #0070f3, #00d4aa) border-box;
    width: 100% !important;
    height: clamp(60vh, 72vh, 80vh) !important;
    max-height: 80vh;
    min-height: 60vh;
    aspect-ratio: 3/4; /* Maintain vertical rectangle proportions */
    margin: 0;
    display: block !important;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 0 20px rgba(255, 255, 255, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 0 20px var(--dynamic-glow-color, rgba(255, 0, 128, 0.3));
    transition: all 0.3s ease;
    position: relative;
    animation: dynamicGlow 6s ease-in-out infinite;
    z-index: 1;
}

@keyframes dynamicGlow {
    0% { 
        --dynamic-glow-color: rgba(255, 0, 128, 0.3);
        box-shadow: 
            0 15px 35px rgba(0, 0, 0, 0.2),
            inset 0 0 25px rgba(255, 255, 255, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            0 0 25px rgba(255, 0, 128, 0.3);
    }
    25% { 
        box-shadow: 
            0 15px 35px rgba(0, 0, 0, 0.2),
            inset 0 0 25px rgba(255, 255, 255, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            0 0 25px rgba(121, 40, 202, 0.3);
    }
    50% { 
        box-shadow: 
            0 15px 35px rgba(0, 0, 0, 0.2),
            inset 0 0 25px rgba(255, 255, 255, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            0 0 25px rgba(0, 112, 243, 0.3);
    }
    75% { 
        box-shadow: 
            0 15px 35px rgba(0, 0, 0, 0.2),
            inset 0 0 25px rgba(255, 255, 255, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            0 0 25px rgba(0, 212, 170, 0.3);
    }
    100% { 
        box-shadow: 
            0 15px 35px rgba(0, 0, 0, 0.2),
            inset 0 0 25px rgba(255, 255, 255, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            0 0 25px rgba(255, 0, 128, 0.3);
    }
}

#game-canvas:hover {
    transform: scale(1.01);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.3),
        inset 0 0 40px rgba(255, 255, 255, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Canvas feedback states */
#game-canvas.flash-safe {
    border-color: #00d4aa !important;
    box-shadow: 
        0 25px 50px rgba(0, 212, 170, 0.4),
        inset 0 0 30px rgba(0, 212, 170, 0.2),
        0 0 40px rgba(0, 212, 170, 0.6);
    animation: flashSafe 0.3s ease;
}

#game-canvas.flash-hit {
    border-color: #ff0080 !important;
    box-shadow: 
        0 25px 50px rgba(255, 0, 128, 0.4),
        inset 0 0 30px rgba(255, 0, 128, 0.2),
        0 0 40px rgba(255, 0, 128, 0.6);
    animation: flashHit 0.3s ease, shake 0.3s ease;
}

@keyframes flashSafe {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Floating Action Labels */
#floating-labels {
    position: absolute;
    pointer-events: none;
    z-index: 100;
}

.floating-label {
    position: absolute;
    font-weight: 700;
    font-size: 1.2em;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: floatUp 1s ease-out forwards;
    pointer-events: none;
}

.floating-label.safe {
    color: #00d4aa;
}

.floating-label.hit {
    color: #ff0080;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(1.2);
    }
}

.game-message {
    padding: 20px;
    border-radius: 15px;
    font-size: 1.4em;
    font-weight: 700;
    margin-top: 20px;
    animation: messageSlide 0.5s ease;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

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

.game-message.success {
    background: linear-gradient(45deg, #00d4aa, #00b894);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: messageSlide 0.5s ease, successPulse 2s ease infinite;
}

@keyframes successPulse {
    0%, 100% { box-shadow: 0 15px 35px rgba(0, 212, 170, 0.4); }
    50% { box-shadow: 0 15px 35px rgba(0, 212, 170, 0.8), 0 0 40px rgba(0, 212, 170, 0.5); }
}

.game-message.lose {
    background: linear-gradient(45deg, #ff0080, #e91e63);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: messageSlide 0.5s ease, losePulse 2s ease infinite;
}

@keyframes losePulse {
    0%, 100% { box-shadow: 0 15px 35px rgba(255, 0, 128, 0.4); }
    50% { box-shadow: 0 15px 35px rgba(255, 0, 128, 0.8), 0 0 40px rgba(255, 0, 128, 0.5); }
}

.hidden {
    display: none !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 255, 0.9));
    backdrop-filter: blur(20px);
    border-radius: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: modalSlideIn 0.4s ease;
    display: flex;
    flex-direction: column;
}

/* Ensure pet modal content doesn't scroll */
#rock-pets-modal .modal-content {
    overflow: hidden;
}

#rock-pets-modal .modal-body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 25px 35px;
    border-bottom: 2px solid rgba(121, 40, 202, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #7928ca, #5a1a9b);
    color: white;
    border-radius: 25px 25px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-family: 'Orbitron', monospace;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 2em;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 35px;
    line-height: 1.8;
    font-size: 1.1em;
}

.section {
    margin-bottom: 30px;
}

.section h3 {
    color: #7928ca;
    margin-bottom: 15px;
    font-size: 1.4em;
    font-family: 'Orbitron', monospace;
}

.section p {
    color: #444;
    margin-bottom: 20px;
}

.section ul {
    color: #444;
    padding-left: 25px;
}

.section li {
    margin-bottom: 10px;
}

.lucky-message {
    text-align: center;
    font-size: 1.3em;
    color: #7928ca;
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(121, 40, 202, 0.1), rgba(255, 0, 128, 0.05));
    border-radius: 15px;
    border: 2px solid rgba(121, 40, 202, 0.2);
    font-family: 'Orbitron', monospace;
}

.modal-footer {
    padding: 25px 35px;
    border-top: 2px solid rgba(121, 40, 202, 0.1);
    text-align: center;
}

#how-to-play-btn {
    background: linear-gradient(45deg, #7928ca, #5a1a9b);
    color: white;
    box-shadow: 0 8px 25px rgba(121, 40, 202, 0.4);
}

#how-to-play-btn:hover {
    background: linear-gradient(45deg, #5a1a9b, #4a1580);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(121, 40, 202, 0.6);
}

#rock-pets-btn {
    background: linear-gradient(45deg, #e91e63, #c2185b);
    color: white;
    box-shadow: 0 8px 25px rgba(233, 30, 99, 0.4);
}

#rock-pets-btn:hover {
    background: linear-gradient(45deg, #c2185b, #ad1457);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(233, 30, 99, 0.6);
}

#back-to-game-btn, #back-to-game-from-pets-btn {
    background: linear-gradient(45deg, #00d4aa, #00b894);
    color: white;
    padding: 15px 35px;
    font-size: 1.2em;
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.4);
}

#back-to-game-btn:hover, #back-to-game-from-pets-btn:hover {
    background: linear-gradient(45deg, #00b894, #00a085);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 212, 170, 0.6);
}

/* Pet Gallery Styles */
.pets-stats {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.2em;
    color: #333;
    font-weight: 600;
}

.pets-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: min(2vw, 8px);
    margin-bottom: 20px;
    padding: min(3vw, 12px);
    border: 2px solid rgba(121, 40, 202, 0.2);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(121, 40, 202, 0.05), rgba(255, 0, 128, 0.02));
    aspect-ratio: 6/7;
    width: 100%;
    height: auto;
    max-height: calc(80vh - 200px);
    overflow: hidden;
}

.pet-slot {
    aspect-ratio: 1;
    width: 100%;
    height: 100%;
    border: 2px solid #ddd;
    border-radius: min(2vw, 8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 0;
    min-height: 0;
}

.pet-slot.unlocked {
    border-color: #00d4aa;
    background: linear-gradient(135deg, #d4f7ed, #a7f3d0);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.3);
}

.pet-slot.unlocked:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 212, 170, 0.5);
}

.pet-slot.locked {
    border-color: #6c757d;
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    opacity: 0.7;
}

.pet-icon {
    font-size: min(3.5vw, 1.8em);
    margin-bottom: min(1vw, 3px);
    line-height: 1;
    width: min(8vw, 40px);
    height: min(8vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.pet-name {
    font-size: min(2.2vw, 0.65em);
    font-weight: 700;
    text-align: center;
    color: #333;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: 0 2px;
}

.pet-slot.locked .pet-name {
    color: #6c757d;
}

.pets-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 1em;
    color: #666;
}

.pets-footer a {
    color: #7928ca;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.pets-footer a:hover {
    color: #5a1a9b;
    text-decoration: underline;
}

#gameFooter {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid rgba(121, 40, 202, 0.1);
    text-align: center;
    font-size: 1em;
    color: #666;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

#gameFooter a {
    color: #7928ca;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

#gameFooter a:hover {
    color: #5a1a9b;
    text-decoration: underline;
}

/* Responsive Design for Mobile Cleanup */
@media (max-width: 650px) {
    .game-container {
        padding: 14px;
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
        padding-top: max(14px, env(safe-area-inset-top));
        padding-bottom: max(14px, env(safe-area-inset-bottom));
        border-radius: 15px;
        max-width: min(96vw, 860px);
    }
    
    .main-content-column {
        max-width: min(92vw, 520px);
        gap: 10px;
        margin: 0 auto;
    }
    
    #game-canvas {
        height: clamp(60vh, 72vh, 80vh);
        min-height: 60vh;
        max-height: 80vh;
        width: 100%;
        margin: 0;
    }
    
    h1 {
        font-size: 2.2em;
        margin-bottom: 10px;
    }
    
    .primary-cta {
        font-size: 1.1em;
        min-height: 58px;
        max-height: 60px;
        margin: 8px 0;
        padding: 16px 20px;
    }
    
    .settings-header {
        padding: 14px 18px;
        min-height: 50px;
    }
    
    .settings-title {
        font-size: 1em;
    }
    
    .settings-content.expanded {
        padding: 0 18px 18px 18px;
    }
    
    .setting-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .setting-row label {
        text-align: center;
        font-size: 0.9em;
        font-weight: 600;
    }
    
    .setting-control {
        justify-content: center;
        gap: 10px;
    }
    
    .setting-control input[type="range"] {
        width: min(220px, 80vw);
    }
    
    .action-buttons {
        margin-top: 12px;
        gap: 8px;
    }
    
    .action-btn {
        font-size: 0.85em;
        padding: 11px 10px;
        min-height: 44px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 18px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.4em;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .pets-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: repeat(7, 1fr);
        gap: min(1.5vw, 6px);
        padding: min(2.5vw, 10px);
        margin-bottom: 15px;
    }
    
    .pet-slot {
        border-radius: min(1.5vw, 6px);
        border-width: 1px;
    }
    
    .pet-icon {
        font-size: min(4vw, 1.4em);
        margin-bottom: min(0.8vw, 2px);
        width: min(10vw, 32px);
        height: min(10vw, 32px);
    }
    
    .pet-name {
        font-size: min(2.8vw, 0.55em);
        letter-spacing: 0.2px;
    }

    #rock-pets-modal .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    #rock-pets-modal .modal-body {
        padding: 15px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .game-container {
        padding: 12px;
    }
    
    .main-content-column {
        gap: 8px;
    }
    
    #game-canvas {
        height: clamp(60vh, 70vh, 80vh);
        min-height: 300px;
    }
    
    h1 {
        font-size: 1.6em;
        margin-bottom: 6px;
    }
    
    .primary-cta {
        font-size: 1em;
        padding: 14px 20px;
        min-height: 56px;
    }
    
    .settings-header {
        padding: 10px 14px;
    }
    
    .settings-title {
        font-size: 0.9em;
    }

    .pets-grid {
        gap: min(1.2vw, 4px);
        padding: min(2vw, 8px);
    }
    
    .pet-icon {
        font-size: min(4.5vw, 1.2em);
        width: min(12vw, 28px);
        height: min(12vw, 28px);
    }
    
    .pet-name {
        font-size: min(3.2vw, 0.5em);
    }

    #rock-pets-modal .modal-header {
        padding: 12px 15px;
    }

    #rock-pets-modal .modal-header h2 {
        font-size: 1.2em;
    }
}

/* Very short screens */
@media (max-height: 600px) and (orientation: portrait) {
    #game-canvas {
        height: calc(45vh - 60px);
        min-height: 250px;
    }
    
    .main-content-column {
        gap: 10px;
    }
    
    h1 {
        font-size: 1.6em;
        margin-bottom: 8px;
    }
}

/* Tablet optimization */
@media (min-width: 651px) and (max-width: 1024px) {
    .main-content-column {
        max-width: min(88vw, 820px);
    }
    
    #game-canvas {
        height: clamp(60vh, 75vh, 82vh);
        min-height: 60vh;
        max-height: 82vh;
    }
    
    .game-settings-card {
        max-height: 30vh;
        padding: 22px;
    }
}

/* Animations for enhanced visual appeal */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.difficulty-control, .dots-per-turn-control, .luck-circles-control {
    animation: float 6s ease-in-out infinite;
}

.difficulty-control { animation-delay: 0s; }
.dots-per-turn-control { animation-delay: 2s; }
.luck-circles-control { animation-delay: 4s; }
