:root {
    --candy-bg: #f4f8fc;
    --candy-primary: #4d7fb8;
    --candy-primary-dark: #3f6c9f;
    --candy-secondary: #7ea6d8;
    --candy-secondary-dark: #648ec2;
    --candy-accent: #e7c37a;
    --candy-accent-dark: #cda95f;
    --candy-text: #274567;
    --candy-text-light: #6f849d;
    --candy-white: #ffffff;
    --candy-card-bg: #ffffff;
    --candy-shadow: 0 6px 18px rgba(77, 127, 184, 0.08);
    --candy-shadow-hover: 0 14px 34px rgba(77, 127, 184, 0.16);
    --candy-radius: 16px;
    --candy-radius-lg: 24px;
    --candy-radius-xl: 32px;
    --candy-gradient: linear-gradient(135deg, #4d7fb8 0%, #7ea6d8 100%);
    --candy-gradient-warm: linear-gradient(135deg, #4d7fb8 0%, #e7c37a 100%);
    --candy-gradient-cool: linear-gradient(135deg, #7ea6d8 0%, #b7cbe6 100%);
}

/* ========================================
   Base Styles
   ======================================== */

body {
    background-color: var(--candy-bg) !important;
    color: var(--candy-text) !important;
}

/* ========================================
   Page Load Animations
   ======================================== */

@keyframes candyFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes candySlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes candyScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes candyBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.candy-page-animate {
    animation: candyFadeIn 0.6s ease-out forwards;
}

/* ========================================
   Header - Candy Style
   ======================================== */

.candy-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 10px rgba(79, 143, 219, 0.08);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: candySlideDown 0.5s ease-out;
}

.candy-header__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.candy-header__logo {
    font-size: 28px;
    font-weight: 900;
    background: var(--candy-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -1px;
    transition: transform 0.2s ease;
    white-space: nowrap;
}

.candy-header__logo:hover {
    transform: scale(1.05);
}

.candy-header__logo-img {
    height: 48px;
    width: auto;
    border-radius: 8px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.candy-header__logo span {
    display: inline-block;
    animation: candyBounce 2s ease-in-out infinite;
}

.candy-header__logo span:nth-child(2) { animation-delay: 0.1s; }
.candy-header__logo span:nth-child(3) { animation-delay: 0.2s; }

.candy-header__domain {
    font-size: 20px;
    font-weight: 800;
    color: var(--candy-primary);
    -webkit-text-fill-color: var(--candy-primary);
    margin-left: 10px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    letter-spacing: 0.5px;
    animation: none;
    vertical-align: middle;
    box-shadow: none;
}

.candy-search {
    flex: 1;
    max-width: 520px;
    position: relative;
    display: flex;
    align-items: center;
}

.candy-search__input {
    width: 100%;
    height: 50px;
    padding: 0 52px 0 22px;
    border: 1px solid #d3e5f7;
    border-radius: 50px;
    background: #f8fbff;
    font-size: 16px;
    color: var(--candy-text);
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.candy-search__input::placeholder {
    color: #9bb6d1;
}

.candy-search__input:focus {
    background: #ffffff;
    border-color: var(--candy-primary);
    box-shadow: 0 0 0 4px rgba(79, 143, 219, 0.12);
}

.candy-search__button {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--candy-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.candy-search__button svg {
    width: 20px;
    height: 20px;
}

.candy-search__button:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 15px rgba(79, 143, 219, 0.3);
}

.candy-header__nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.candy-nav__link {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(79, 143, 219, 0.08) 0%, rgba(122, 178, 234, 0.08) 100%);
    border: 1px solid rgba(79, 143, 219, 0.12);
    color: var(--candy-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
}

.candy-nav__link:hover {
    background: var(--candy-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 143, 219, 0.2);
}

.candy-nav__link svg {
    width: 22px;
    height: 22px;
}

.candy-nav__link img {
    width: 24px;
    height: 24px;
}

/* ========================================
   Section Headers
   ======================================== */

.candy-section {
    margin: 40px 0;
    animation: candyFadeIn 0.6s ease-out both;
}

.candy-section:nth-child(2) { animation-delay: 0.1s; }
.candy-section:nth-child(3) { animation-delay: 0.2s; }
.candy-section:nth-child(4) { animation-delay: 0.3s; }

.candy-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.candy-section__title {
    font-size: 28px;
    font-weight: 900;
    color: var(--candy-text);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.candy-section__title-icon {
    font-size: 32px;
}

.candy-section__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--candy-bg);
    border-radius: 50px;
    color: var(--candy-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
}

.candy-section__more:hover {
    background: var(--candy-primary);
    color: white;
    transform: translateX(4px);
}

.candy-search-summary {
    margin-bottom: 24px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid rgba(77, 127, 184, 0.12);
    border-radius: var(--candy-radius);
    box-shadow: var(--candy-shadow);
}

.candy-search-summary__title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 900;
    color: var(--candy-text);
}

.candy-search-summary__text {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--candy-text-light);
}

.candy-search-summary__text strong {
    color: var(--candy-primary);
}

/* ========================================
   Category Pills
   ======================================== */

.candy-categories {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    animation: candyFadeIn 0.6s ease-out 0.3s both;
}

.candy-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    background: var(--candy-white);
    color: var(--candy-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    box-shadow: var(--candy-shadow);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid transparent;
}

.candy-category-pill:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--candy-shadow-hover);
}

.candy-category-pill--pink {
    background: linear-gradient(135deg, #e6f1fc 0%, #f5faff 100%);
    color: var(--candy-primary);
}

.candy-category-pill--pink:hover {
    background: var(--candy-primary);
    color: white;
}

.candy-category-pill--blue {
    background: linear-gradient(135deg, #e8f3fd 0%, #f6fbff 100%);
    color: var(--candy-secondary-dark);
}

.candy-category-pill--blue:hover {
    background: var(--candy-secondary);
    color: white;
}

.candy-category-pill--yellow {
    background: linear-gradient(135deg, #fdf6e4 0%, #fffbe8 100%);
    color: #9c7a24;
}

.candy-category-pill--yellow:hover {
    background: var(--candy-accent);
    color: var(--candy-text);
}

.candy-category-pill--purple {
    background: linear-gradient(135deg, #eef2fc 0%, #f7f9ff 100%);
    color: #5c6bc0;
}

.candy-category-pill--purple:hover {
    background: #9db8ef;
    color: white;
}


.candy-games-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 20px;
    overflow: hidden;
}

@media (max-width: 1400px) {
    .candy-games-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 18px;
    }
}

@media (max-width: 1200px) {
    .candy-games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .candy-games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

@media (max-width: 600px) {
    .candy-games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 400px) {
    .candy-games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* ========================================
   Game Card - Simplified Style
   ======================================== */

.candy-card {
    border-radius: var(--candy-radius);
    overflow: hidden;
    box-shadow: var(--candy-shadow);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
    color: inherit;
    display: block;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #e6f1fc 0%, #eef7ff 100%);
}

.candy-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--candy-shadow-hover);
}

.content-games-item-img {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.content-games-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.candy-card:hover .content-games-item-img img {
    transform: scale(1.08);
}

.content-games-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    padding: 30px 12px 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.candy-card:hover .content-games-item-overlay {
    opacity: 1;
}

.content-games-item-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    background: linear-gradient(135deg, #7ab2ea 0%, #a8d0f5 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.candy-card:nth-child(1) { animation-delay: 0.05s; }
.candy-card:nth-child(2) { animation-delay: 0.1s; }
.candy-card:nth-child(3) { animation-delay: 0.15s; }
.candy-card:nth-child(4) { animation-delay: 0.2s; }
.candy-card:nth-child(5) { animation-delay: 0.25s; }
.candy-card:nth-child(6) { animation-delay: 0.3s; }
.candy-card:nth-child(7) { animation-delay: 0.35s; }
.candy-card:nth-child(8) { animation-delay: 0.4s; }
.candy-card:nth-child(9) { animation-delay: 0.45s; }
.candy-card:nth-child(10) { animation-delay: 0.5s; }
.candy-card:nth-child(11) { animation-delay: 0.55s; }
.candy-card:nth-child(12) { animation-delay: 0.6s; }

/* ========================================
   Engagement Sections
   ======================================== */

.candy-hot-games {
    background: linear-gradient(135deg, #ffffff 0%, #f6fbff 100%);
    border-radius: var(--candy-radius-lg);
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(79, 143, 219, 0.12);
}

.candy-related-games {
    background: linear-gradient(135deg, #fbfdff 0%, #f2f8ff 100%);
    border-radius: var(--candy-radius-lg);
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(79, 143, 219, 0.12);
}

.candy-for-you {
    background: linear-gradient(135deg, #fffdf7 0%, #f6fbff 100%);
    border-radius: var(--candy-radius-lg);
    padding: 32px;
    margin: 32px 0;
    border: 1px solid rgba(241, 201, 107, 0.18);
}

/* ========================================
   Game Detail Page
   ======================================== */

.candy-game-detail {
    animation: candyFadeIn 0.6s ease-out forwards;
}

.candy-game-detail__hero {
    display: flex;
    gap: 48px;
    margin-bottom: 40px;
    padding: 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f6fbff 100%);
    border-radius: var(--candy-radius-lg);
    border: 1px solid rgba(79, 143, 219, 0.12);
    animation: candyScaleIn 0.6s ease-out 0.2s both;
}

.candy-game-detail__media {
    position: relative;
    flex-shrink: 0;
}

.candy-game-detail__image-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: var(--candy-radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(79, 143, 219, 0.22);
    background: var(--candy-gradient);
}

.candy-game-detail__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.candy-game-detail__info {
    flex: 1;
    min-width: 0;
}

.candy-breadcrumbs {
    margin-bottom: 16px;
}

.candy-breadcrumbs__list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.candy-breadcrumbs__list li {
    display: flex;
    align-items: center;
}

.candy-breadcrumbs__list li:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: var(--candy-text-light);
}

.candy-breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--candy-text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.candy-breadcrumbs__item:hover {
    color: var(--candy-primary);
}

.candy-breadcrumbs__item--active {
    color: var(--candy-text);
    font-weight: 600;
}

.candy-game-detail__title {
    font-size: 36px;
    font-weight: 900;
    color: var(--candy-text);
    margin-bottom: 16px;
    line-height: 1.2;
}

.candy-game-detail__description {
    color: var(--candy-text-light);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.candy-game-detail__description p {
    margin: 0;
}

.candy-game-detail__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.candy-game-detail__main-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: var(--candy-gradient);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(79, 143, 219, 0.3);
    transition: all 0.25s ease;
}

.candy-game-detail__main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(79, 143, 219, 0.4);
}

/* ========================================
   Static Pages
   ======================================== */

.candy-static-page {
    animation: candyFadeIn 0.6s ease-out forwards;
    max-width: 800px;
    margin: 0 auto;
}

.candy-static-page__content {
    background: var(--candy-white);
    border-radius: var(--candy-radius-lg);
    padding: 40px;
    box-shadow: var(--candy-shadow);
}

.candy-static-page__title {
    font-size: 28px;
    font-weight: 900;
    color: var(--candy-primary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--candy-bg);
}

.candy-static-page__text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--candy-text);
}

.candy-static-page__text p {
    margin-bottom: 16px;
}

/* ========================================
   Footer - Candy Style
   ======================================== */

.candy-footer {
    background: var(--candy-white);
    padding: 28px 0;
    margin-top: 30px;
    box-shadow: 0 -2px 20px rgba(79, 143, 219, 0.06);
}

.candy-footer__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.candy-footer__copy {
    font-size: 14px;
    color: var(--candy-text-light);
}

.candy-footer__links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.candy-footer__link {
    color: var(--candy-text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

.candy-footer__link:hover {
    color: var(--candy-primary);
}

/* ========================================
   Pagination - Candy Style
   ======================================== */

.candy-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.candy-pagination__btn {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: var(--candy-white);
    color: var(--candy-text);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--candy-shadow);
    padding: 0 14px;
}

.candy-pagination__btn:hover {
    background: var(--candy-gradient);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--candy-shadow-hover);
}

.candy-pagination__btn.active {
    background: var(--candy-gradient);
    color: white;
    box-shadow: var(--candy-shadow-hover);
}

.candy-pagination__btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.candy-pagination__info {
    color: var(--candy-text-light);
    font-size: 14px;
    margin: 0 12px;
    font-weight: 600;
}


.candy-ad-container {
    background: var(--candy-white);
    border-radius: var(--candy-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--candy-shadow);
}

.candy-ad-label {
    font-size: 12px;
    color: var(--candy-text-light);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.candy-ad-container .adbox {
    width: 300px;
    min-width: 300px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
}

.candy-ad-container .adbox > * {
    max-width: 100%;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .candy-section__title {
        font-size: 20px;
    }

    .candy-search-summary {
        padding: 18px 20px;
        margin-bottom: 18px;
    }

    .candy-search-summary__title {
        font-size: 22px;
    }

    .candy-search-summary__text {
        font-size: 14px;
        line-height: 1.6;
    }

    .candy-section {
        margin: 24px 0;
    }

    .candy-hot-games,
    .candy-related-games,
    .candy-for-you {
        padding: 12px;
        border-radius: 18px;
        margin: 16px 0;
    }

    .candy-footer__container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .candy-footer__links {
        gap: 16px;
    }

    .candy-game-detail__hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
        padding: 24px;
    }

    .candy-game-detail__image-wrapper {
        width: 160px;
        height: 160px;
    }

    .candy-game-detail__title {
        font-size: 24px;
    }

    .candy-game-detail__description {
        font-size: 15px;
    }

    .candy-game-detail__actions {
        justify-content: center;
    }

    .candy-game-detail__main-btn {
        padding: 14px 28px;
        font-size: 15px;
    }

    .candy-breadcrumbs {
        display: none;
    }

    .candy-static-page__content {
        padding: 24px;
    }

    .candy-static-page__title {
        font-size: 22px;
    }

    .candy-ad-container {
        padding: 12px;
        margin: 16px 0;
        border-radius: 12px;
    }

    .candy-ad-container .adbox {
        min-width: 100%;
        min-height: 250px;
    }

    .candy-pagination {
        margin: 24px 0;
    }
}

@media (max-width: 360px) {
    .candy-ad-container .adbox {
        min-height: 200px;
    }

    .home__text-block {
        padding: 20px;
        border-radius: 18px;
        margin: 24px 0;
    }
}

@media (max-width: 600px) {
    .candy-hot-games,
    .candy-related-games,
    .candy-for-you {
        padding: 10px;
        border-radius: 16px;
    }

    .home__text-block {
        padding: 16px;
    }

    .text-block__content h1 {
        font-size: 20px;
    }

    .text-block__content h2 {
        font-size: 18px;
    }

    .text-block__content p {
        font-size: 14px;
    }

    .candy-card {
        border-radius: 12px;
    }

    .content-games-item-overlay {
        display: none;
    }
}


.candy-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.candy-text-gradient {
    background: var(--candy-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.candy-hidden {
    display: none !important;
}