:root {
    --pink: #FFB7C5;
    --blue: #A2D2FF;
    --yellow: #FFFFE0;
    --green: #D4F1BE;
    --lavender: #E0BBE4;
    --dark-text: #5D5D5D;
    --white: #FFFFFF;
    --shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 20%, #ffd3b6 40%, #ffaaa5 60%, #ff8b94 80%, #a2d2ff 100%);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
    color: var(--dark-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

body::before,
body::after {
    content: '☁️';
    position: absolute;
    font-size: 5rem;
    opacity: 0.3;
    animation: float 20s infinite linear;
    z-index: -1;
}

body::before {
    top: 10%;
    left: -10%;
}

body::after {
    top: 40%;
    left: -15%;
    animation-delay: -10s;
}

@keyframes float {
    from {
        transform: translateX(-100px);
    }

    to {
        transform: translateX(calc(100vw + 100px));
    }
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.2) 1px, transparent 0);
    background-size: 40px 40px;
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 4px solid var(--pink);
    flex-shrink: 0;
    width: 100%;
    max-height: 120px;
    display: flex;
    align-items: center;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.main-nav {
    display: flex;
    gap: 15px;
    margin: 0 20px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 600;
    /* Match blog */
    font-size: 1.2rem;
    /* Match blog */
    padding: 8px 16px;
    /* Match blog */
    border-radius: 20px;
    transition: var(--transition);
    border: none;
    /* Remove border to match blog */
    background: rgba(255, 255, 255, 0.5);
    /* Match blog */
}

.nav-link:hover,
.nav-link.active {
    background: var(--white);
    color: #4A90E2;
    /* Blue instead of pink */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border: none;
}

.logo-container {
    cursor: pointer;
}

.kawaii-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-logo {
    height: 70px;
    width: auto;
    min-width: 70px;
    object-fit: contain;
    transition: var(--transition);
    display: block;
}

.logo-container:hover .main-logo {
    transform: scale(1.1) rotate(-5deg);
}

.kawaii-logo h1 {
    font-size: 2.5rem;
    color: var(--dark-text);
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
}

.kawaii-logo h1 span {
    position: relative;
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.control-btn {
    background: var(--white);
    border: 3px solid var(--pink);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    transform: scale(1.1);
    background: var(--pink);
    color: white;
}

.language-selector {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: none;
    border: 3px solid transparent;
    border-radius: 12px;
    padding: 5px;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.6;
}

.lang-btn.active {
    opacity: 1;
    border-color: var(--pink);
    background: white;
    transform: scale(1.1);
}

.flag-icon {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 6px;
}

#kofi-container {
    transition: var(--transition);
    display: flex;
    align-items: center;
}

#kofi-container:hover {
    transform: scale(1.05);
}

.kofi-button {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Main Content */
main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.hero-container {
    display: flex;
    gap: 20px;
    margin-bottom: 4rem;
    align-items: stretch;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow);
    padding: 3rem 1rem;
    text-align: center;
}

#hero {
    flex: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.kawaii-char {
    position: absolute;
    font-size: 4rem;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.15));
    animation: float-kawaii 4s ease-in-out infinite;
    opacity: 0.8;
}

.char-1 {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.char-2 {
    top: 15%;
    right: 5%;
    animation-delay: -1s;
}

.char-3 {
    bottom: 15%;
    left: 8%;
    animation-delay: -2s;
    font-size: 3.5rem;
}

.char-4 {
    bottom: 10%;
    right: 8%;
    animation-delay: -3s;
    font-size: 3.5rem;
}

@keyframes float-kawaii {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-15px) rotate(8deg);
    }
}

.hero-body,
.hero-stats,
.kofi-hero {
    position: relative;
    z-index: 5;
}

.news-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.news-panel h3 {
    margin-bottom: 1rem;
    color: var(--dark-text);
    font-size: 1.8rem;
    font-weight: 800;
    text-shadow: 2px 2px 0px white;
}

.news-list {
    list-style: none;
    text-align: left;
    width: 100%;
    padding: 0 1rem;
}

.news-list li {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
    padding-bottom: 0.5rem;
}

.news-list li:last-child {
    border-bottom: none;
}

#hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--dark-text);
    text-shadow: 2px 2px 0px white;
}

#hero-subtitle {
    font-size: 1.5rem;
    color: var(--dark-text);
    font-weight: 500;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--pink);
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    opacity: 0.7;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding-bottom: 4rem;
}

.game-card {
    background: var(--white);
    border-radius: 35px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border: 6px solid white;
    position: relative;
}

.game-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 30px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

.game-card:hover {
    transform: translateY(-15px) rotate(1deg);
    box-shadow: 0 25px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--pink);
}

.game-image {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--yellow);
    border-bottom: 6px solid var(--pink);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.game-image::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 20%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.3) 0%, transparent 20%);
    animation: rotatePattern 10s linear infinite;
}

@keyframes rotatePattern {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.game-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    z-index: 2;
}

.game-card:hover .game-thumbnail {
    transform: scale(1.1);
}

.game-emoji {
    font-size: 5rem;
    transition: var(--transition);
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.2));
    z-index: 2;
    max-width: 90%;
    overflow-wrap: break-word;
}

.game-card:hover .game-emoji {
    transform: scale(1.1) rotate(-5deg);
}

.game-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--dark-text);
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
}

.game-info {
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: linear-gradient(to bottom, white, #f9f9f9);
}

.game-info h3 {
    font-size: 1.8rem;
    color: var(--dark-text);
    font-weight: 800;
}

.game-info p {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 15px;
    line-height: 1.4;
}

.play-btn-mini {
    background: var(--pink);
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 0 #e6a4b1;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-card:hover .play-btn-mini {
    transform: scale(1.1) translateY(-3px);
    background: var(--blue);
    box-shadow: 0 9px 0 #8dbbe6;
}

/* Game Card Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.info-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    text-decoration: none;
    font-size: 1.2rem;
    transition: var(--transition);
    border: 2px solid #ddd;
    box-shadow: 0 4px 0 #ccc;
}

.info-icon-link:hover {
    transform: translateY(-2px);
    background: var(--blue);
    border-color: var(--blue);
    color: white;
    box-shadow: 0 6px 0 #8dbbe6;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    text-align: center;
    border-top: 4px solid var(--blue);
}

.footer-links {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: var(--dark-text);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--pink);
    transform: scale(1.1);
}

.social-media {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

#social-label {
    font-weight: 700;
    color: var(--dark-text);
}

.social-icon {
    color: var(--dark-text);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.social-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

.social-icon.instagram:hover {
    color: #E1306C;
    /* Instagram Color */
    box-shadow: 0 6px 15px rgba(225, 48, 108, 0.3);
}

.social-icon.tiktok:hover {
    color: #000000;
    /* TikTok Black */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.social-icon.linktree:hover {
    color: #43E660;
    /* Linktree Green */
    box-shadow: 0 6px 15px rgba(67, 230, 96, 0.3);
}

.social-icon svg {
    width: 24px;
    height: 24px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 30px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow);
    border: 8px solid var(--blue);
}

.legal-scroll-area::-webkit-scrollbar {
    width: 8px;
}

.legal-scroll-area::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.legal-scroll-area::-webkit-scrollbar-thumb {
    background: var(--blue);
    border-radius: 10px;
}

.legal-scroll-area::-webkit-scrollbar-thumb:hover {
    background: var(--pink);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-text);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Category Filters */
.category-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

/* Desktop: show buttons, hide mobile select */
.category-filters-desktop {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.category-filters-mobile {
    display: none;
    width: 100%;
    justify-content: center;
    padding: 0 1rem;
}

.category-select {
    display: none;
}

.category-btn {
    background: var(--white);
    border: 2px solid transparent;
    border-radius: 50px;
    padding: 8px 25px 8px 10px;
    /* More padding right, less left for icon */
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: var(--dark-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    /* Space between icon and text */
}

.cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f0f8ff;
    border-radius: 50%;
    font-size: 1.4rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.category-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    background: var(--yellow);
    border-color: var(--yellow);
}

.category-btn:hover .cat-icon {
    transform: scale(1.1) rotate(10deg);
    background: white;
}

.category-btn.active {
    background: var(--pink);
    color: white;
    box-shadow: 0 4px 0 #e6a4b1;
    transform: translateY(0);
}

.category-btn.active .cat-icon {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.category-btn.active:hover {
    background: var(--blue);
    box-shadow: 0 4px 0 #8dbbe6;
    transform: translateY(-2px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header {
        padding: 0.5rem 1rem;
        max-height: none;
        /* Allow growth for wrapped content */
        height: auto;
    }

    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .logo-container {
        display: flex;
        align-items: center;
        flex: 1;
        order: 1;
    }

    .kawaii-logo h1 {
        font-size: 1.4rem;
        letter-spacing: -0.5px;
    }

    .main-logo {
        height: 35px;
        min-width: 35px;
    }

    .kawaii-logo {
        gap: 8px;
    }

    .controls {
        display: flex;
        align-items: center;
        gap: 5px;
        margin: 0;
        order: 2;
    }

    .main-nav {
        width: 100%;
        margin: 10px 0 5px 0;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        background: transparent;
        order: 3;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 6px 12px;
        text-align: center;
        white-space: nowrap;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 15px;
        flex: 0 1 auto;
    }

    .control-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .lang-btn {
        padding: 2px;
    }

    .flag-icon {
        width: 28px;
        height: 28px;
    }

    #kofi-container img,
    #kofi-container .kofi-button {
        height: 32px !important;
        padding: 0 10px !important;
        font-size: 12px !important;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-container {
        flex-direction: column;
    }

    .kawaii-char {
        font-size: 2.5rem;
        opacity: 0.6;
    }

    .char-1 {
        top: 5%;
        left: 5%;
    }

    .char-2 {
        top: 5%;
        right: 5%;
    }

    .char-3 {
        bottom: 5%;
        left: 5%;
    }

    .char-4 {
        bottom: 5%;
        right: 5%;
    }

    /* Featured Section - Mobile Fix */
    .featured-section {
        flex-direction: column !important;
    }

    .featured-image {
        padding: 20px !important;
        min-width: unset !important;
    }

    .featured-content {
        padding: 20px 20px 30px !important;
        min-width: unset !important;
        text-align: center !important;
    }

    .featured-content h2 {
        font-size: 1.6rem !important;
        margin: 10px 0 !important;
        word-break: break-word;
    }

    /* Optimized Category Filters for Mobile */
    .category-filters {
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }

    /* Hide desktop buttons on mobile */
    .category-filters-desktop {
        display: none !important;
    }

    /* Show mobile select on mobile */
    .category-filters-mobile {
        display: flex;
    }

    .category-select {
        display: block;
        width: 100%;
        max-width: 380px;
        padding: 14px 20px;
        font-family: 'Fredoka', sans-serif;
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--dark-text);
        background: rgba(255, 255, 255, 0.95);
        border: 3px solid var(--pink);
        border-radius: 50px;
        box-shadow: 0 6px 0 #e6a4b1, 0 8px 20px rgba(0, 0, 0, 0.12);
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23FFB7C5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 18px center;
        padding-right: 50px;
        transition: var(--transition);
        letter-spacing: 0.5px;
        text-transform: uppercase;
        outline: none;
    }

    .category-select:focus {
        border-color: var(--blue);
        box-shadow: 0 6px 0 #8dbbe6, 0 8px 20px rgba(162, 210, 255, 0.3);
        transform: translateY(-2px);
    }

    .category-select:active {
        transform: translateY(2px);
        box-shadow: 0 3px 0 #e6a4b1;
    }
}

/* Ranking Ribbon */
.ranking-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    z-index: 20;
    overflow: hidden;
    pointer-events: none;
}

.ranking-ribbon span {
    position: absolute;
    display: block;
    width: 120px;
    padding: 5px 0;
    background-color: #000080;
    color: #fff;
    font-weight: 800;
    font-size: 0.7rem;
    text-align: center;
    transform: rotate(-45deg);
    top: 15px;
    left: -30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}