/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap');

/* Base Settings */
body {
    font-family: 'Fredoka', sans-serif;
    background-color: transparent;
    /* Allows embedding */
    margin: 0;
    padding: 20px;
    overflow-y: auto;
    /* Allow specific vertical scroll if needed */
    user-select: none;
    -webkit-user-select: none;
}

/* Premium Game Card */
.game-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    border: 8px solid #3b82f6;
    /* Tailwind blue-500 */
    border-radius: 2.5rem;
    box-shadow:
        0 20px 50px -12px rgba(0, 0, 0, 0.25),
        inset 0 0 0 4px rgba(255, 255, 255, 0.5);
    /* Inner highlight */
    position: relative;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    /* aspect-ratio: 16/9; Removed to allow content to dictate height if needed, or prevent excessive height on mobile */
    min-height: 600px;
}

/* Background Decoration */
.bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(#94a3b8 2px, transparent 2px),
        radial-gradient(#94a3b8 2px, transparent 2px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    opacity: 0.15;
    pointer-events: none;
}

/* Glassmorphism HUD */
.hud-panel {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-radius: 1.5rem;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Game Board */
#game-board {
    height: 500px;
    position: relative;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    border: 4px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
}

/* Blobs */
.num-blob {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    cursor: pointer;
    border: 4px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.2),
        inset 0 4px 6px rgba(255, 255, 255, 0.4),
        inset 0 -4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s, border-color 0.2s;
    will-change: transform;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

.num-blob:hover {
    z-index: 50;
    transform: scale(1.1);
    border-color: #fff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.num-blob:active {
    transform: scale(0.95);
}

/* Animations */
@keyframes wander {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(30px, -20px) rotate(4deg);
    }

    50% {
        transform: translate(-10px, 30px) rotate(-4deg);
    }

    75% {
        transform: translate(-30px, -10px) rotate(2deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.floating {
    animation: wander 4s ease-in-out infinite alternate;
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Theme Text Overrides */
body.theme-dark .text-slate-800,
body.theme-space .text-slate-800 {
    color: #f8fafc;
}

body.theme-dark .text-slate-700,
body.theme-space .text-slate-700 {
    color: #e2e8f0;
}

body.theme-dark .text-slate-600,
body.theme-space .text-slate-600 {
    color: #cbd5e1;
}

body.theme-dark .text-slate-500,
body.theme-space .text-slate-500 {
    color: #94a3b8;
}

body.theme-dark .bg-white,
body.theme-space .bg-white {
    background-color: rgba(30, 41, 59, 0.9);
    border-color: #475569;
}

body.theme-dark .bg-slate-100,
body.theme-space .bg-slate-100 {
    background-color: #334155;
    border-color: #475569;
}

/* Splat Effect */
.splatted {
    pointer-events: none;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23FFD700' d='M44.7,-76.4C58.9,-69.2,71.8,-59.1,79.6,-46.9C87.4,-34.7,90.1,-20.4,88.4,-6.6C86.7,7.2,80.6,20.5,73.1,33.2C65.6,45.9,56.7,58,45.6,67.6C34.5,77.2,21.1,84.3,6.8,85.5C-7.5,86.7,-22.8,82,-35.1,73.4C-47.4,64.8,-56.7,52.3,-64.6,39.4C-72.5,26.5,-79,13.2,-79.6,-0.4C-80.1,-13.9,-74.7,-27.8,-66.1,-39.8C-57.5,-51.8,-45.7,-61.9,-32.9,-69.8C-20.1,-77.7,-6.3,-83.4,5.4,-84.3C17.1,-85.2,30.5,-83.6,44.7,-76.4Z' transform='translate(100 100)' /%3E%3C/svg%3E") !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    transform: scale(1.4) rotate(15deg) !important;
    opacity: 0.9;
    animation: none !important;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Utility / Text */
.text-shadow {
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(to right, #3b82f6, #f43f5e);
}

/* Buttons */
.btn-primary {
    /* Default yellow if no classes provided, but allow overrides */
    background: linear-gradient(to bottom, var(--tw-gradient-stops, #facc15, #eab308));
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    padding: 1rem 2rem;
    border-radius: 9999px;
    border-bottom-width: 6px;
    border-style: solid;
    /* Border color handled by utility or default */
    transition: all 0.1s;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    width: 100%;
    /* Full width in container */
}

.btn-primary:active {
    transform: translateY(4px);
    border-bottom-width: 0px;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(to bottom, #22c55e, #16a34a);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 1rem;
    border-bottom: 4px solid #15803d;
    transition: all 0.1s;
}

.btn-secondary:active {
    transform: translateY(3px);
    border-bottom-width: 0px;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    #game-board {
        height: 400px;
    }

    .game-card {
        border-width: 4px;
        border-radius: 1.5rem;
    }
}/* High-quality claymation background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('clay_background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -1;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
