.kg-home,
.kg-header {
    --kg-bg: #fff;
    --kg-ink: #172033;
    --kg-muted: #647084;
    --kg-line: #e5e8ef;
    --kg-soft: #f4f5fa;
    color: var(--kg-ink)
}

.dark .kg-home,
.dark .kg-header {
    --kg-bg: #171d2b;
    --kg-ink: #edf0f8;
    --kg-muted: #a7b1c5;
    --kg-line: #30394b;
    --kg-soft: #222a3a
}

.kg-container {
    width: min(1320px, 100%);
    margin-inline: auto;
    padding-inline: 24px;
    min-width: 0
}

.kg-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--kg-bg);
    border-bottom: 1px solid var(--kg-line)
}

.kg-header-inner {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    align-items: center;
    gap: 28px;
    min-height: 84px
}

.kg-brand {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -1px;
    white-space: nowrap
}

.kg-brand span {
    color: #6366f1
}

.kg-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--kg-soft);
    border: 1px solid var(--kg-line);
    border-radius: 12px;
    padding: 5px 5px 5px 16px;
    min-width: 0
}

.kg-search:focus-within {
    outline: 2px solid #818cf8;
    outline-offset: 2px
}

.kg-search>i {
    color: var(--kg-muted)
}

.kg-search input {
    min-width: 0;
    flex: 1;
    width: 100%;
    background: transparent;
    outline: 0;
    font-size: 14px;
    padding: 8px 0;
    color: var(--kg-ink)
}

.kg-search button,
.kg-primary {
    background: #4f46e5;
    color: white;
    border: 1px solid #4f46e5
}

.kg-search button {
    padding: 10px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    min-height: 44px
}

.kg-header-actions {
    flex-shrink: 0
}

.kg-header-actions>a,
.kg-header-actions>div>a,
.kg-header-actions>div>button,
.kg-chat-button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--kg-line);
    border-radius: 10px;
    color: var(--kg-ink)
}

.kg-account-name {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.kg-chat-button {
    padding: 10px;
    font-size: 19px
}

.kg-home {
    padding-bottom: 48px;
    background: var(--kg-soft)
}

.kg-hero {
    padding-top: 24px
}

.kg-hero-box {
    background: #ececfc;
    border: 1px solid #e0e0f7;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 28px 36px
}

.dark .kg-hero-box {
    background: #22233e;
    border-color: #39385c
}

.kg-eyebrow {
    font-size: 10px;
    letter-spacing: 1.6px;
    font-weight: 800;
    color: #6366f1;
    margin-bottom: 8px
}

.kg-hero h1 {
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px
}

.kg-hero h1 span {
    color: #4f46e5
}

.dark .kg-hero h1 span {
    color: #a5b4fc
}

.kg-hero p:not(.kg-eyebrow) {
    font-size: 14px;
    line-height: 1.7;
    max-width: 560px;
    color: var(--kg-muted);
    margin: 12px 0 18px
}

.kg-primary,
.kg-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: center
}

.kg-secondary {
    border: 1px solid var(--kg-line);
    background: var(--kg-bg);
    color: var(--kg-ink)
}

.kg-primary:hover,
.kg-search button:hover {
    background: #4338ca
}

.kg-secondary:hover {
    border-color: #818cf8
}

.kg-hero-note {
    border-left: 1px solid #cfcff2;
    padding-left: 32px;
    min-width: 250px;
    display: grid;
    gap: 14px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5
}

.kg-hero-note>i {
    font-size: 42px;
    color: #6366f1
}

.kg-hero-note>a {
    font-size: 12px;
    color: #4f46e5
}

.kg-discovery {
    padding-top: 28px
}

.kg-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px
}

.kg-section-heading h2 {
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -.5px
}

.kg-section-heading p:not(.kg-eyebrow) {
    font-size: 12px;
    color: var(--kg-muted);
    margin-top: 5px
}

.kg-text-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 650;
    color: #6366f1;
    min-height: 44px;
    flex-shrink: 0
}

.kg-game-list {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 2px 2px 10px;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin
}

.kg-game {
    flex: 0 0 108px;
    min-width: 0;
    text-align: center;
    scroll-snap-align: start;
    border: 1px solid transparent;
    padding: 8px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4
}

.kg-game>span:last-child {
    display: block;
    margin-top: 8px;
    overflow-wrap: anywhere
}

.kg-game-image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 18px;
    overflow: hidden;
    background: var(--kg-bg);
    border: 1px solid var(--kg-line);
    font-size: 26px;
    color: #818cf8
}

.kg-game img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.kg-game:hover,
.kg-game.is-selected {
    border-color: #818cf8;
    background: var(--kg-bg)
}

.kg-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 18px 0 0
}

.kg-category-label {
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px
}

.kg-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--kg-line);
    border-radius: 24px;
    background: var(--kg-bg);
    font-size: 12px;
    padding: 10px 14px;
    min-height: 44px
}

.kg-chip>i {
    color: #818cf8
}

.kg-chip.is-selected {
    color: #4f46e5;
    border-color: #818cf8;
    background: #eef2ff
}

.dark .kg-chip.is-selected {
    background: #30315b;
    color: #c7d2fe
}

.kg-catalog {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 24px;
    padding-top: 32px;
    scroll-margin-top: 105px
}

.kg-filters {
    align-self: start;
    border: 1px solid var(--kg-line);
    border-radius: 16px;
    background: var(--kg-bg);
    min-width: 0
}

.kg-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--kg-line)
}

.kg-filter-header h2 {
    font-size: 15px;
    font-weight: 700
}

.kg-filter-close {
    display: none
}

.kg-filter-body>section {
    border: 0 !important;
    border-bottom: 1px solid var(--kg-line) !important;
    border-radius: 0 !important;
    padding: 16px !important;
    background: transparent !important
}

.kg-filter-body h3 {
    font-size: 13px
}

.kg-filter-body input:not([type=checkbox]),
.kg-filter-body select {
    min-width: 0;
    min-height: 44px;
    color: var(--kg-ink);
    background: var(--kg-bg)
}

.kg-filter-body input[type=checkbox] {
    height: 17px;
    width: 17px;
    accent-color: #4f46e5;
    flex-shrink: 0
}

.kg-filter-body label {
    min-height: 44px
}

.kg-filter-body button {
    min-height: 44px
}

.kg-filter-footer {
    display: grid;
    gap: 8px;
    padding: 16px;
    background: var(--kg-bg);
    border-radius: 0 0 16px 16px
}

.kg-filter-footer>p {
    font-size: 12px;
    color: #dc2626;
    grid-column: 1/-1
}

.kg-results {
    min-width: 0
}

.kg-result-controls {
    display: flex;
    align-items: center;
    gap: 8px
}

.kg-result-controls select,
.kg-pagination select {
    background: var(--kg-bg);
    border: 1px solid var(--kg-line);
    border-radius: 10px;
    min-height: 44px;
    font-size: 12px;
    padding: 10px;
    color: var(--kg-ink);
    max-width: 100%
}

.kg-filter-trigger,
.kg-filter-backdrop {
    display: none
}

.kg-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: var(--kg-bg);
    border: 1px solid var(--kg-line);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
    font-size: 12px;
    overflow-wrap: anywhere
}

.kg-active-filters button {
    margin-left: auto;
    min-height: 36px;
    color: #6366f1;
    font-weight: 600
}

.kg-product-grid {
    display: grid;
    align-items: start;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px
}
.kg-home button:focus-visible,.kg-header a:focus-visible,.kg-header button:focus-visible{
    outline: 3px solid #818cf8;
    outline-offset: 3px
}

.kg-state {
    padding: 40px 24px;
    text-align: center;
    background: var(--kg-bg);
    border: 1px dashed var(--kg-line);
    border-radius: 16px
}

.kg-state>i {
    font-size: 28px;
    color: #818cf8
}

.kg-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-top: 16px
}

.kg-state p {
    font-size: 13px;
    color: var(--kg-muted);
    margin: 10px auto 18px;
    max-width: 420px
}

.kg-error {
    border-color: #fecaca
}

.kg-error>button {
    margin: 10px
}

.kg-muted {
    font-size: 13px;
    color: var(--kg-muted)
}

.kg-skeleton {
    background: var(--kg-line);
    animation: kg-pulse 1.8s ease-in-out infinite;
    border-radius: 8px
}

.kg-game-skeleton {
    flex: 0 0 100px;
    height: 118px
}

.kg-product-skeleton {
    border: 1px solid var(--kg-line);
    padding: 10px;
    border-radius: 14px;
    background: var(--kg-bg)
}

.kg-product-skeleton>div {
    aspect-ratio: 1
}

.kg-product-skeleton>span {
    display: block;
    height: 14px;
    margin-top: 12px
}

.kg-product-skeleton>span:last-child {
    width: 60%
}

.kg-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 24px;
    font-size: 12px
}

.kg-pagination>div {
    display: flex;
    align-items: center;
    gap: 12px
}

.kg-pagination button {
    min-height: 44px;
    border: 1px solid var(--kg-line);
    background: var(--kg-bg);
    padding: 10px 12px;
    border-radius: 10px
}

.kg-pagination button:disabled {
    opacity: .4
}

.kg-pagination select {
    margin-left: 6px
}

@keyframes kg-pulse {
    50% {
        opacity: .5
    }
}

@media(prefers-reduced-motion:reduce) {
    .kg-skeleton {
        animation: none
    }
}

@media(max-width:1199px) {
    .kg-header-inner {
        gap: 16px
    }

    .kg-account-name {
        display: none
    }

    .kg-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }
}

@media(max-width:1023px) {
    .kg-catalog {
        grid-template-columns: minmax(0, 1fr)
    }

    .kg-filter-trigger {
        display: inline-flex
    }

    .kg-filter-trigger>span {
        background: #4f46e5;
        border-radius: 20px;
        color: white;
        padding: 1px 6px
    }

    .kg-filters {
        display: none;
        position: fixed;
        inset: 8% 0 0;
        z-index: 71;
        border-radius: 20px 20px 0 0;
        flex-direction: column;
        max-height: 92dvh
    }

    .kg-filters.is-open {
        display: flex
    }

    .kg-filter-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: #0f172a80;
        z-index: 70
    }

    .kg-filter-body {
        overflow-y: auto;
        overscroll-behavior: contain;
        min-height: 0
    }

    .kg-filter-header {
        flex-shrink: 0
    }

    .kg-filter-close {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px
    }

    .kg-filter-footer {
        flex-shrink: 0;
        grid-template-columns: 1fr 1fr;
        border-top: 1px solid var(--kg-line);
        border-radius: 0;
        padding-bottom: max(16px, env(safe-area-inset-bottom))
    }

    .kg-filter-body>section {
        padding: 16px 20px !important
    }

    .kg-hero-note {
        min-width: 200px;
        padding-left: 20px
    }

    .kg-header-inner {
        grid-template-columns: 1fr auto;
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 12px
    }

    .kg-search {
        grid-row: 2;
        grid-column: 1/-1
    }

    .kg-header-actions {
        grid-row: 1;
        grid-column: 2
    }

    .kg-header-actions>a[title=Wishlist] {
        display: none
    }

    .kg-catalog {
        scroll-margin-top: 155px
    }
}

@media(max-width:599px) {
    .kg-container {
        padding-inline: 16px
    }

    .kg-brand {
        font-size: 21px
    }

    .kg-header-actions {
        gap: 6px
    }

    .kg-header-actions>div>button {
        padding: 8px
    }

    .kg-header-actions>div>button>svg:last-child {
        display: none
    }

    .kg-chat-button {
        display: none
    }

    .kg-hero {
        padding-top: 16px
    }

    .kg-hero-box {
        padding: 20px;
        border-radius: 16px
    }

    .kg-hero h1 {
        font-size: 26px
    }

    .kg-hero p:not(.kg-eyebrow) {
        font-size: 12px;
        margin: 10px 0 14px;
        line-height: 1.6
    }

    .kg-hero-note {
        display: none
    }

    .kg-eyebrow {
        font-size: 9px
    }

    .kg-discovery {
        padding-top: 22px
    }

    .kg-section-heading h2 {
        font-size: 18px
    }

    .kg-section-heading p:not(.kg-eyebrow) {
        font-size: 11px;
        line-height: 1.5
    }

    .kg-section-heading {
        gap: 10px
    }

    .kg-game {
        flex-basis: 84px;
        padding: 5px;
        font-size: 11px
    }

    .kg-game-image {
        border-radius: 16px
    }

    .kg-game-list {
        gap: 8px
    }

    .kg-categories {
        gap: 7px;
        padding-top: 12px
    }

    .kg-category-label {
        width: 100%;
        margin-bottom: 2px
    }

    .kg-chip {
        padding: 8px 12px;
        font-size: 11px
    }

    .kg-catalog {
        padding-top: 26px
    }

    .kg-products-heading {
        flex-wrap: wrap;
        align-items: start
    }

    .kg-result-controls {
        width: 100%
    }

    .kg-result-controls>label {
        flex: 1
    }

    .kg-result-controls select {
        width: 100%
    }

    .kg-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px
    }

    .kg-pagination {
        justify-content: center
    }

    .kg-pagination>label {
        width: 100%;
        text-align: center
    }

    .kg-pagination>div {
        gap: 8px
    }

    .kg-pagination button {
        padding: 10px
    }

    .kg-header-actions .kg-account-name {
        display: none
    }
}

@media(max-width:359px) {
    .kg-container {
        padding-inline: 12px
    }

    .kg-brand {
        font-size: 18px
    }

    .kg-header-actions {
        gap: 4px
    }

    .kg-header-actions>a,
    .kg-header-actions>div>a,
    .kg-header-actions>div>button {
        padding-inline: 8px
    }

    .kg-hero h1 {
        font-size: 24px
    }
}

.kg-game-list {
    align-items: flex-start
}

@media(min-width:1024px) {
    .kg-filters {
        position: sticky;
        top: 100px;
        max-height: calc(100dvh - 116px);
        display: flex;
        flex-direction: column
    }

    .kg-filter-body {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain
    }

    .kg-filter-header,
    .kg-filter-footer {
        flex-shrink: 0
    }

    .kg-filter-footer {
        grid-template-columns: 1fr 1fr;
        padding: 12px
    }

    .kg-filter-footer button {
        padding: 8px;
        font-size: 11px
    }
}

@media(max-width:599px) {
    .kg-categories {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding-bottom: 8px;
        scrollbar-width: thin
    }

    .kg-category-label {
        width: auto;
        white-space: nowrap;
        flex-shrink: 0
    }

    .kg-chip {
        flex-shrink: 0;
        white-space: nowrap
    }
}
.dark .kg-home .kg-eyebrow,.dark .kg-home .kg-text-button,.dark .kg-home .kg-hero-note>a{
    color: #a5b4fc
}



/* Hanya aktif kalau ada gambar */
.kg-hero-box.kg-hero-has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.kg-sponsored { padding-top:24px;padding-bottom:24px; }.kg-sponsored-label {display:inline-block;padding:3px 7px;border-radius:5px;font-size:10px;letter-spacing:.06em;background:#e0e7ff;color:#3730a3;font-weight:700}.dark .kg-sponsored-label{background:#30315b;color:#c7d2fe}

/* Promotion cards stay one row; catalogue grids retain their existing sizing. */
.kg-promotion-track { position:relative; display:flex; align-items:stretch; gap:12px; overflow-x:auto; overflow-y:hidden; padding:4px 2px 12px; scroll-snap-type:x proximity; overscroll-behavior-x:contain; scrollbar-width:thin; }
.kg-promotion-controls { display:flex; gap:8px; flex-shrink:0; }
.kg-promotion-controls button { display:grid; place-items:center; width:34px; height:34px; border:1px solid var(--kg-line); border-radius:50%; background:var(--kg-bg); color:var(--kg-ink); font-size:24px; line-height:1; cursor:pointer; }
.kg-promotion-controls button:disabled { opacity:.35; cursor:default; }
