/**
 * Premium Kids Games Platform CSS
 * vibrant colors, glassmorphism, dynamic animations, modern typography
 */

:root {
    /* Color Palette */
    --primary: #FF6B6B;
    /* Coral/Red */
    --secondary: #4ECDC4;
    /* Teal */
    --accent: #FFE66D;
    /* Yellow */
    --accent-alt: #9D4EDD;
    /* Purple */
    --background: #F7FFF7;
    /* Off-white */
    --text-dark: #2F3542;
    --text-light: #F1F2F6;
    --shadow: rgba(47, 53, 66, 0.15);

    /* Gradients */
    --bg-gradient: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 99%, #FECFEF 100%);
    --card-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
}

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

body {
    font-family: 'Nunito', sans-serif;
    color: var(--text-dark);
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    user-select: none; /* Prevent text selection like a native app */
    -webkit-user-select: none;
}

h1,
h2,
h3 {
    font-family: 'Fredoka One', cursive;
    letter-spacing: 1px;
}

/* Background Shapes */
.bg-shapes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.background-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
    opacity: 0.6;
    animation: floatBg 20s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    top: -50px;
    left: -50px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    bottom: -100px;
    right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-alt);
    top: 40%;
    left: 20%;
    animation-delay: -10s;
}

@keyframes floatBg {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, -50px) scale(1.1);
    }

    100% {
        transform: translate(-30px, 60px) scale(0.9);
    }
}

/* Header */
.main-header {
    text-align: center;
    padding: 3rem 1rem;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 3rem;
    color: var(--primary);
    text-shadow: 2px 2px 0px rgba(255, 107, 107, 0.3);
}

.bounce-icon {
    animation: bounce 2s infinite cubic-bezier(0.28, 0.84, 0.42, 1);
}

@keyframes bounce {

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

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

.main-header h1 {
    font-size: 3.5rem;
    color: var(--text-dark);
    text-shadow: 2px 2px 0px #FFF, 4px 4px 0px rgba(0, 0, 0, 0.1);
}

.time-greeting {
    width: fit-content;
    margin: 0 auto 0.65rem;
    padding: 0.35rem 1.1rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.58);
    color: var(--primary);
    font-family: 'Fredoka One', cursive;
    font-size: 1.35rem;
    text-shadow: 1px 1px 0 #fff;
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.18);
    backdrop-filter: blur(10px);
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    color: #57606f;
    background: rgba(255, 255, 255, 0.5);
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.wallet-hub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    margin: 1rem auto 0;
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50px;
    padding: 8px 24px;
    box-shadow: 0 4px 15px rgba(249, 202, 36, 0.3);
    border: 3px solid rgba(249, 202, 36, 0.6);
    backdrop-filter: blur(10px);
    color: #2F3542;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wallet-coin {
    position: relative;
    display: inline-block;
    width: 1.02em;
    height: 1.12em;
    flex: 0 0 auto;
    border-radius: 50%;
    background:
        linear-gradient(90deg, rgba(255, 220, 92, 0.45) 0 10%, transparent 11% 100%),
        radial-gradient(ellipse at 38% 22%, #ffe66d 0 12%, transparent 13%),
        linear-gradient(90deg, #e88900 0%, #ffd23a 18%, #f6b51d 42%, #df8500 72%, #8f4b00 100%);
    border: 0.07em solid #ffd75a;
    box-shadow:
        inset -0.12em 0 0 rgba(126, 67, 0, 0.5),
        inset 0.12em 0 0 rgba(255, 226, 87, 0.42),
        0 0.08em 0.18em rgba(122, 72, 0, 0.28);
}

.wallet-coin::after {
    content: '';
    position: absolute;
    top: 16%;
    bottom: 16%;
    left: 36%;
    width: 20%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(140, 72, 0, 0.54), rgba(255, 214, 67, 0.72), rgba(126, 65, 0, 0.48));
    box-shadow:
        -0.16em 0 0 rgba(255, 212, 60, 0.18),
        0.18em 0 0 rgba(123, 64, 0, 0.2);
}

.wallet-hub:active {
    transform: scale(0.95);
}

/* Main Gallery Area */
.gallery-container {
    flex-grow: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    justify-items: center;
}

.farm-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    text-decoration: none;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 24px rgba(56, 142, 60, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 110px;
}

.farm-banner:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(56, 142, 60, 0.45);
}

.farm-banner.farm-locked {
    filter: saturate(0.82);
    box-shadow: 0 8px 24px rgba(56, 142, 60, 0.2);
}

.farm-banner.farm-locked .farm-banner-btn {
    background: rgba(255, 255, 255, 0.14);
}

.farm-banner.farm-ready-glow {
    border-color: rgba(250, 204, 21, 0.9);
    box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.12), 0 14px 34px rgba(34, 197, 94, 0.28);
    animation: farm-ready-glow 2.6s ease-in-out infinite;
}

.farm-banner.farm-shop-new {
    position: relative;
}

.farm-banner.farm-shop-new::after {
    content: 'NUEVO';
    position: absolute;
    top: -12px;
    right: 18px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #ff4d8d;
    color: #fff;
    border: 2px solid #fff;
    font-family: 'Fredoka One', cursive;
    font-size: 0.75rem;
    box-shadow: 0 8px 18px rgba(255, 77, 141, 0.32);
    animation: farm-new-badge 1.3s ease-in-out infinite;
}

@keyframes farm-ready-glow {
    0%,
    100% {
        box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.1), 0 12px 30px rgba(34, 197, 94, 0.24);
    }

    50% {
        box-shadow: 0 0 0 9px rgba(250, 204, 21, 0.18), 0 16px 38px rgba(34, 197, 94, 0.34);
    }
}

@keyframes farm-new-badge {
    0%,
    100% {
        transform: translateY(0);
    }

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

.farm-banner-plots {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 70px;
}

.farm-banner-plot {
    line-height: 1;
    display: inline-block;
}

.farm-banner-empty {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 700;
    align-self: center;
}

.farm-banner-info {
    text-align: right;
    flex-shrink: 0;
}

.farm-banner-info h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.6rem;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
    margin-bottom: 2px;
}

.farm-banner-info p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 700;
    margin-bottom: 10px;
}

.farm-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.9rem;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
}

/* Card Styling (Glassmorphism & Rich UI) */
.game-card {
    text-decoration: none;
    background: var(--card-gradient);
    border-radius: 24px;
    overflow: hidden;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 30px var(--shadow);
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    backdrop-filter: blur(10px);
}

.game-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.primary-card {
    border: 3px solid #FFF;
}

.secondary-card {
    border: 3px solid rgba(157, 78, 221, 0.6);
}

.secondary-card .pattern-stripes {
    background-color: #7c3aed;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.15) 10px, rgba(255, 255, 255, 0.15) 20px);
}

.secondary-card .card-badge {
    background: var(--accent-alt);
}

.secondary-card .play-btn {
    background: var(--accent-alt);
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.4);
}

.secondary-card:hover .play-btn {
    background: #8b2fc9;
}

.bubble-card-hub {
    border: 3px solid rgba(73, 157, 255, 0.72);
}

.bubble-card-hub .pattern-bubbles {
    background:
        radial-gradient(circle at 22% 32%, rgba(255,255,255,0.28) 0 7%, transparent 8%),
        radial-gradient(circle at 72% 62%, rgba(89,216,255,0.28) 0 12%, transparent 13%),
        linear-gradient(145deg, #102a63, #030817 78%);
}

.bubble-card-hub .floating-icons span {
    border-radius: 50%;
    text-shadow: 0 0 12px rgba(125, 222, 255, 0.8);
}

.bubble-card-hub .card-badge,
.bubble-card-hub .play-btn {
    background: #287de0;
}

.bubble-card-hub .play-btn {
    box-shadow: 0 4px 15px rgba(40, 125, 224, 0.42);
}

.bubble-card-hub:hover .play-btn {
    background: #1769c5;
}

.math-card {
    border: 3px solid rgba(72, 219, 251, 0.6);
}

.math-card .card-badge {
    background: #0abde3;
}

.math-card .play-btn {
    background: #0abde3;
    box-shadow: 0 4px 15px rgba(10, 189, 227, 0.4);
}

.math-card:hover .play-btn {
    background: #01a3a4;
}

.subtraction-card {
    border: 3px solid rgba(255, 159, 67, 0.6);
}

.subtraction-card .card-badge {
    background: #ff9f43;
}

.subtraction-card .play-btn {
    background: #ff9f43;
    box-shadow: 0 4px 15px rgba(255, 159, 67, 0.4);
}

.subtraction-card:hover .play-btn {
    background: #ee5253;
}

.memory-card-hub {
    border: 3px solid rgba(124, 58, 237, 0.6);
}

.memory-card-hub .card-badge {
    background: #7c3aed;
}

.memory-card-hub .play-btn {
    background: #7c3aed;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.memory-card-hub:hover .play-btn {
    background: #4f46e5;
}

.order-card-hub {
    border: 3px solid rgba(249, 115, 22, 0.62);
}

.order-card-hub .card-badge {
    background: #f97316;
}

.order-card-hub .play-btn {
    background: #f97316;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.order-card-hub:hover .play-btn {
    background: #0f766e;
}

.shape-card-hub {
    border: 3px solid rgba(99, 102, 241, 0.6);
}

.shape-card-hub .card-badge {
    background: #6366f1;
}

.shape-card-hub .play-btn {
    background: #6366f1;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.shape-card-hub:hover .play-btn {
    background: #0e7490;
}

.trace-card-hub {
    border: 3px solid rgba(15, 118, 110, 0.6);
}

.trace-card-hub .card-badge {
    background: #0f766e;
}

.trace-card-hub .play-btn {
    background: #0f766e;
    box-shadow: 0 4px 15px rgba(15, 118, 110, 0.4);
}

.trace-card-hub:hover .play-btn {
    background: #0891b2;
}

.lowercase-card-hub {
    border: 3px solid rgba(109, 75, 209, 0.66);
}

.lowercase-card-hub .card-badge,
.lowercase-card-hub .play-btn {
    background: #6d4bd1;
}

.lowercase-card-hub .play-btn {
    box-shadow: 0 4px 15px rgba(109, 75, 209, 0.4);
}

.lowercase-card-hub:hover .play-btn {
    background: #5131ae;
}

.lowercase-card-hub .lowercase-icons .icon-a {
    color: #ffe66d;
}

.lowercase-card-hub .lowercase-icons .icon-b {
    color: #fff;
}

.lowercase-card-hub .lowercase-icons .icon-c {
    color: #75e6da;
}

.syllable-build-card-hub {
    border: 3px solid rgba(15, 159, 145, 0.7);
}

.syllable-build-card-hub .card-badge,
.syllable-build-card-hub .play-btn {
    background: #0f9f91;
}

.syllable-build-card-hub .play-btn {
    box-shadow: 0 4px 15px rgba(15, 159, 145, 0.42);
}

.syllable-build-card-hub:hover .play-btn {
    background: #08766e;
}

.syllable-build-card-hub .syllable-build-icons .icon-a {
    color: #c9f6ee;
}

.syllable-build-card-hub .syllable-build-icons .icon-b {
    color: #ffd38f;
}

.syllable-build-card-hub .syllable-build-icons .icon-c {
    color: #fff;
    font-size: 3.2rem;
}

.pattern-subtraction {
    background-color: #ff9f43;
    background-image: radial-gradient(circle at 100% 150%, #feca57 24%, white 24%, white 28%, #feca57 28%, #feca57 36%, white 36%, white 40%, transparent 40%, transparent),
        radial-gradient(circle at 0 150%, #feca57 24%, white 24%, white 28%, #feca57 28%, #feca57 36%, white 36%, white 40%, transparent 40%, transparent),
        radial-gradient(circle at 50% 100%, white 10%, #feca57 10%, #feca57 23%, white 23%, white 30%, #feca57 30%, #feca57 43%, white 43%, white 50%, #feca57 50%, #feca57 63%, white 63%, white 71%, transparent 71%, transparent),
        radial-gradient(circle at 100% 50%, white 5%, #feca57 5%, #feca57 15%, white 15%, white 20%, #feca57 20%, #feca57 29%, white 29%, white 34%, #feca57 34%, #feca57 44%, white 44%, white 49%, transparent 49%, transparent),
        radial-gradient(circle at 0 50%, white 5%, #feca57 5%, #feca57 15%, white 15%, white 20%, #feca57 20%, #feca57 29%, white 29%, white 34%, #feca57 34%, #feca57 44%, white 44%, white 49%, transparent 49%, transparent);
}



.card-image-bg {
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

/* Patterns */
.pattern-dots {
    background-color: var(--secondary);
    background-image: radial-gradient(rgba(255, 255, 255, 0.4) 15%, transparent 16%);
    background-size: 20px 20px;
}

.pattern-stripes {
    background-color: #a4b0be;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.2) 10px, rgba(255, 255, 255, 0.2) 20px);
}

.pattern-waves {
    background-color: var(--accent-alt);
    background-image: radial-gradient(circle at 100% 150%, #b8e994 24%, white 24%, white 28%, #b8e994 28%, #b8e994 36%, white 36%, white 40%, transparent 40%, transparent),
        radial-gradient(circle at 0 150%, #b8e994 24%, white 24%, white 28%, #b8e994 28%, #b8e994 36%, white 36%, white 40%, transparent 40%, transparent),
        radial-gradient(circle at 50% 100%, white 10%, #b8e994 10%, #b8e994 23%, white 23%, white 30%, #b8e994 30%, #b8e994 43%, white 43%, white 50%, #b8e994 50%, #b8e994 63%, white 63%, white 71%, transparent 71%, transparent),
        radial-gradient(circle at 100% 50%, white 5%, #b8e994 5%, #b8e994 15%, white 15%, white 20%, #b8e994 20%, #b8e994 29%, white 29%, white 34%, #b8e994 34%, #b8e994 44%, white 44%, white 49%, transparent 49%, transparent),
        radial-gradient(circle at 0 50%, white 5%, #b8e994 5%, #b8e994 15%, white 15%, white 20%, #b8e994 20%, #b8e994 29%, white 29%, white 34%, #b8e994 34%, #b8e994 44%, white 44%, white 49%, transparent 49%, transparent);
    background-size: 50px 25px;
    opacity: 0.8;
}

.pattern-stars {
    background-color: #5b21b6;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(250, 204, 21, 0.65) 0 2px, transparent 3px),
        radial-gradient(circle at 70% 35%, rgba(255, 255, 255, 0.55) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 48% 78%, rgba(244, 114, 182, 0.55) 0 2px, transparent 3px),
        linear-gradient(135deg, #7c3aed, #4f46e5);
    background-size: 42px 42px, 34px 34px, 48px 48px, 100% 100%;
}

.pattern-order {
    background-color: #f97316;
    background-image:
        linear-gradient(135deg, rgba(20, 184, 166, 0.82), rgba(249, 115, 22, 0.86)),
        repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 255, 255, 0.22) 18px 22px),
        radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.48) 0 4px, transparent 5px),
        radial-gradient(circle at 76% 70%, rgba(255, 255, 255, 0.38) 0 5px, transparent 6px);
}

.pattern-shapes {
    background-color: #6366f1;
    background-image:
        linear-gradient(135deg, rgba(14, 116, 144, 0.85), rgba(99, 102, 241, 0.9)),
        radial-gradient(circle at 24% 30%, rgba(255, 255, 255, 0.45) 0 5px, transparent 6px),
        radial-gradient(circle at 74% 68%, rgba(255, 255, 255, 0.35) 0 6px, transparent 7px),
        repeating-linear-gradient(60deg, transparent 0 20px, rgba(255, 255, 255, 0.12) 20px 23px);
}

.pattern-trace {
    background-color: #0f766e;
    background-image:
        linear-gradient(135deg, rgba(8, 145, 178, 0.85), rgba(15, 118, 110, 0.92)),
        repeating-linear-gradient(90deg, transparent 0 16px, rgba(255, 255, 255, 0.16) 16px 18px),
        repeating-linear-gradient(0deg, transparent 0 16px, rgba(255, 255, 255, 0.10) 16px 18px);
}

.pattern-lowercase {
    background-color: #6d4bd1;
    background-image:
        radial-gradient(circle at 18% 24%, rgba(255, 230, 109, 0.42) 0 7%, transparent 8%),
        radial-gradient(circle at 78% 72%, rgba(117, 230, 218, 0.34) 0 10%, transparent 11%),
        linear-gradient(145deg, #4b2e9d, #8b65df);
}

.pattern-syllable-build {
    background-color: #0f9f91;
    background-image:
        radial-gradient(circle at 16% 26%, rgba(255, 230, 109, 0.3) 0 8%, transparent 9%),
        radial-gradient(circle at 82% 72%, rgba(255, 211, 143, 0.32) 0 11%, transparent 12%),
        linear-gradient(145deg, #08766e, #20bfae);
}

/* Floating Items Animation inside primary card */
.floating-icons {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.float-item {
    font-family: 'Fredoka One', cursive;
    font-size: 4rem;
    color: #FFF;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
    animation: floatItem 3s ease-in-out infinite alternate;
}

.icon-a {
    color: var(--primary);
    animation-delay: 0s;
}

.icon-b {
    color: var(--accent);
    animation-delay: 1s;
}

.icon-c {
    color: var(--accent-alt);
    animation-delay: 2s;
}

@keyframes floatItem {
    0% {
        transform: translateY(0px) rotate(-5deg);
    }

    100% {
        transform: translateY(-15px) rotate(10deg);
    }
}

.static-icon {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.floating-icon {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
    animation: floatItem 3s ease-in-out infinite alternate;
}

.math-menu-icon {
    height: 120px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.25));
    margin-top: -30px; /* Adjusting for SVG padding */
    margin-bottom: -15px; /* Pull it slightly into view */
}

/* Card Content Details */
.card-content {
    padding: 1.5rem;
    text-align: center;
}

.card-badge {
    position: absolute;
    top: 15px;
    right: -35px;
    background: var(--primary);
    color: white;
    padding: 5px 40px;
    font-weight: 800;
    transform: rotate(45deg);
    font-family: 'Fredoka One', cursive;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.card-content h2 {
    color: var(--text-dark);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.card-content p {
    color: #57606f;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-weight: 600;
}

.routine-meter {
    display: grid;
    gap: 7px;
    margin: 0 0 1.15rem;
}

.routine-meter-label {
    font-family: 'Fredoka One', cursive;
    font-size: 0.82rem;
    color: #2F3542;
}

.routine-meter-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(47, 53, 66, 0.12);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(47, 53, 66, 0.12);
}

.routine-meter-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4ade80, #facc15);
    transition: width 0.25s ease;
}

.routine-pending {
    border-color: rgba(250, 204, 21, 0.78);
}

.routine-done .routine-meter-fill {
    background: linear-gradient(90deg, #22c55e, #14b8a6);
}

.routine-done .routine-meter-label {
    color: #15803d;
}

.routine-locked .play-btn {
    background: #94a3b8;
    box-shadow: none;
}

.daily-locked {
    filter: saturate(0.55);
}

.daily-locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(47, 53, 66, 0.08);
    pointer-events: none;
}

.daily-active {
    border-color: rgba(34, 197, 94, 0.92);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12), 0 18px 36px rgba(34, 197, 94, 0.24);
}

.daily-next {
    border-color: rgba(250, 204, 21, 0.82);
}

.daily-lock-badge,
.daily-step-badge,
.favorite-badge {
    position: absolute;
    z-index: 4;
    font-family: 'Fredoka One', cursive;
    pointer-events: none;
}

.daily-lock-badge {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    display: none;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(47, 53, 66, 0.18);
    font-size: 1.35rem;
}

.daily-locked .daily-lock-badge {
    display: grid;
}

.daily-step-badge {
    top: 12px;
    left: 12px;
    min-width: 36px;
    height: 36px;
    display: none;
    place-items: center;
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    border: 2px solid rgba(255, 107, 107, 0.35);
    box-shadow: 0 7px 16px rgba(255, 107, 107, 0.18);
    font-size: 1rem;
}

.daily-active .daily-step-badge,
.daily-next .daily-step-badge,
.routine-done .daily-step-badge {
    display: grid;
}

.favorite-badge {
    left: 50%;
    bottom: 12px;
    display: none;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 999px;
    background: #ff4d8d;
    color: #fff;
    border: 2px solid #fff;
    font-size: 0.72rem;
    box-shadow: 0 8px 18px rgba(255, 77, 141, 0.28);
}

.is-favorite .favorite-badge {
    display: block;
}

.daily-denied {
    animation: daily-denied-shake 0.36s ease;
}

.casino-spotlight {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 0 0 7px rgba(250, 204, 21, 0.18), 0 18px 38px rgba(250, 204, 21, 0.28);
    border-color: rgba(250, 204, 21, 0.95);
}

.casino-winner {
    animation: casino-winner-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.daily-casino {
    width: min(100%, 520px);
    margin: 0 auto 1.2rem;
    display: grid;
    place-items: center;
}

.daily-casino-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 3px solid rgba(250, 204, 21, 0.82);
    box-shadow: 0 10px 24px rgba(47, 53, 66, 0.14);
    color: var(--text-dark);
    font-family: 'Fredoka One', cursive;
    font-size: 1.05rem;
}

.daily-casino-running .games-grid {
    pointer-events: none;
}

.daily-unlock {
    position: fixed;
    left: 50%;
    top: 22px;
    z-index: 1200;
    width: min(92vw, 430px);
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 3px solid rgba(34, 197, 94, 0.8);
    box-shadow: 0 14px 34px rgba(47, 53, 66, 0.22);
    transform: translateX(-50%);
    animation: daily-unlock-in 0.34s ease-out;
}

.daily-unlock strong {
    font-family: 'Fredoka One', cursive;
    font-size: 1.35rem;
    color: #15803d;
}

.daily-unlock span {
    font-weight: 900;
    color: #57606f;
}

.daily-unlocking {
    animation: daily-unlock-card 0.72s ease-out;
}

@keyframes daily-denied-shake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-7px);
    }

    55% {
        transform: translateX(7px);
    }
}

@keyframes casino-winner-pop {
    0% {
        transform: scale(0.96);
    }

    60% {
        transform: translateY(-8px) scale(1.05);
    }

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

@keyframes daily-unlock-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes daily-unlock-card {
    0% {
        transform: translateY(0) scale(1);
    }

    45% {
        transform: translateY(-8px) scale(1.025);
    }

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

.routine-recommended {
    animation: routine-recommended-pulse 0.75s ease-in-out 4;
    border-color: rgba(34, 197, 94, 0.95);
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.22);
}

.routine-pointer {
    position: fixed;
    z-index: 1100;
    transform: translate(-50%, -100%);
    font-size: 3.4rem;
    line-height: 1;
    pointer-events: none;
    animation: routine-pointer-bounce 0.75s ease-in-out infinite;
    filter: drop-shadow(0 8px 10px rgba(47, 53, 66, 0.22));
}

.routine-pointer[hidden] {
    display: none;
}

@keyframes routine-recommended-pulse {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    45% {
        transform: translateY(-5px) scale(1.025);
    }
}

@keyframes routine-pointer-bounce {
    0%,
    100% {
        transform: translate(-50%, -100%) translateY(0);
    }

    50% {
        transform: translate(-50%, -100%) translateY(-12px);
    }
}

.routine-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 1000;
    width: min(92vw, 420px);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 3px solid rgba(250, 204, 21, 0.85);
    box-shadow: 0 14px 34px rgba(47, 53, 66, 0.22);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.routine-toast.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
}

.routine-toast-icon {
    font-size: 2rem;
    line-height: 1;
}

.routine-toast-title,
.routine-toast-sub {
    margin: 0;
    line-height: 1.05;
    text-align: left;
}

.routine-toast-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    color: #2F3542;
}

.routine-toast-sub {
    margin-top: 4px;
    font-weight: 900;
    font-size: 0.86rem;
    color: #64748b;
}

.routine-toast-btn {
    min-width: 58px;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: #22c55e;
    color: #fff;
    font: 900 0.95rem 'Nunito', sans-serif;
    cursor: pointer;
}

.ornament-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 1001;
    width: min(92vw, 420px);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.97);
    border: 3px solid rgba(34, 197, 94, 0.78);
    box-shadow: 0 14px 34px rgba(47, 53, 66, 0.22);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.ornament-toast.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
}

.ornament-toast-emoji {
    font-size: 2.4rem;
    line-height: 1;
    animation: ornament-toast-pop 0.8s ease-in-out infinite alternate;
}

.ornament-toast-title,
.ornament-toast-sub {
    margin: 0;
    line-height: 1.05;
    text-align: left;
}

.ornament-toast-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    color: #2F3542;
}

.ornament-toast-sub {
    margin-top: 4px;
    font-weight: 900;
    font-size: 0.9rem;
    color: #15803d;
}

.ornament-toast-btn {
    min-width: 58px;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: #22c55e;
    color: #fff;
    font: 900 0.95rem 'Nunito', sans-serif;
    cursor: pointer;
}

@keyframes ornament-toast-pop {
    from {
        transform: translateY(0) scale(1);
    }

    to {
        transform: translateY(-4px) scale(1.08);
    }
}

/* Play Button inside card */
.play-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.2rem;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
}

.game-card:hover .play-btn {
    background: #ff5252;
    transform: scale(1.05);
}

.play-btn.disabled {
    background: #ced6e0;
    color: #747d8c;
    box-shadow: none;
}

.locked-card {
    filter: grayscale(20%);
    opacity: 0.9;
}

.locked-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow);
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 2rem;
    font-weight: 800;
    color: #2F3542;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.app-version {
    position: fixed;
    right: 10px;
    bottom: 8px;
    z-index: 20;
    font-family: 'Nunito', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    color: rgba(47, 53, 66, 0.48);
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    cursor: default;
    padding: 6px 12px;
}

/* Panel secreto de ajustes para adultos */
.pp-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(20, 25, 32, 0.42); font-family: 'Nunito', sans-serif; overflow: hidden; }
.pp-overlay[hidden] { display: none; }
.pp-panel { width: min(100%, 760px); height: 100%; margin: 0 auto; background: #fff; color: #25303b; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pp-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #dfe4ea; background: #fff; }
.pp-header h2 { margin: 0; font: 800 1.35rem/1.2 'Nunito', sans-serif; }
.pp-close { border: 0; background: transparent; color: #394653; font: 700 0.95rem/1 'Nunito', sans-serif; padding: 10px; cursor: pointer; }
.pp-body { padding: 8px 20px 40px; }
.pp-section { padding: 18px 0; border-bottom: 1px solid #e8ebef; }
.pp-section h3 { margin: 0 0 12px; font: 800 1rem/1.2 'Nunito', sans-serif; color: #25303b; }
.pp-section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.pp-game-count, .pp-balance, .pp-min-note { font-size: 0.84rem; color: #677482; }
.pp-games { border: 1px solid #e2e6ea; border-radius: 10px; overflow: hidden; }
.pp-toggle-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px; border-bottom: 1px solid #edf0f2; font-size: 0.92rem; }
.pp-toggle-row:last-child { border-bottom: 0; }
.pp-toggle-row small { display: block; margin-top: 3px; color: #768390; font-size: 0.78rem; }
.pp-toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.pp-switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #aeb7c0; transition: background 0.15s ease; }
.pp-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: transform 0.15s ease; }
.pp-toggle-row input:checked + .pp-switch { background: #2676d9; }
.pp-toggle-row input:checked + .pp-switch::after { transform: translateX(16px); }
.pp-toggle-row input:disabled + .pp-switch { opacity: .48; }
.pp-min-note { margin: 8px 0 0; color: #a14735; }
.pp-inline, .pp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pp-coins-input { width: 120px; border: 1px solid #b9c2cb; border-radius: 7px; padding: 9px 10px; font: 700 1rem 'Nunito', sans-serif; }
.pp-primary, .pp-secondary { min-height: 38px; border-radius: 7px; padding: 8px 13px; font: 700 .88rem 'Nunito', sans-serif; cursor: pointer; }
.pp-primary { border: 1px solid #1768ca; background: #1768ca; color: #fff; }
.pp-secondary { border: 1px solid #b7c0c9; background: #fff; color: #34414d; }
.pp-routine { margin-bottom: 12px; border: 1px solid #e2e6ea; border-radius: 8px; }
.pp-routine-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-bottom: 1px solid #edf0f2; font-size: .86rem; }
.pp-routine-row:last-child { border-bottom: 0; }
.pp-routine-row strong { color: #596674; }
body.pp-open { overflow: hidden; }

/* Responsive */
@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .main-header h1 {
        font-size: 2rem;
    }
    
    .main-header {
        padding: 2rem 1rem 1rem;
    }
    
    .games-grid {
        padding: 1rem;
        gap: 1.5rem;
    }

    .farm-banner {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        min-height: 90px;
    }

    .farm-banner-info h2 {
        font-size: 1.3rem;
    }

    .farm-banner-info p {
        font-size: 0.8rem;
    }
    
    .card-content h2 {
        font-size: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .casino-spotlight,
    .casino-winner,
    .daily-denied,
    .daily-unlocking,
    .daily-unlock,
    .routine-recommended,
    .routine-pointer {
        animation: none;
    }
}
