/* ==========================================================================
   QuickPlayHub - Homepage Layout & Carousel Styles (k4.games style)
   ========================================================================== */

.content-container.qph-home {
    max-width: none;
    padding: 22px 16px 60px;
}

.qph-home .qph-home-section {
    margin: 0 0 28px;
}

.qph-home .qph-home-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 0 0 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.qph-home .qph-home-track.is-dragging {
    cursor: grabbing !important;
    scroll-snap-type: none !important;
    scroll-behavior: auto !important;
}

.qph-home .qph-home-track.is-dragging .qph-home-card {
    pointer-events: none;
}

.qph-home .qph-home-track::-webkit-scrollbar {
    display: none;
}

.qph-home .qph-home-card {
    position: relative;
    display: block;
    flex: 0 0 240px;
    width: 240px;
    height: 320px;
    overflow: hidden;
    border-radius: 8px;
    background: #28273e;
    scroll-snap-align: start;
    color: #ffffff;
    text-decoration: none;
}

.qph-home .qph-home-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}

.qph-home .qph-featured-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 28px 8px 9px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.33));
}

.qph-home .qph-play-count {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
}

.qph-home .qph-play-count svg {
    width: 16px;
    height: 16px;
}

.qph-home .qph-trend {
    color: #b4fa87;
}

.qph-home .qph-play-button {
    min-width: 100px;
    padding: 7px 16px;
    border-radius: 9px;
    background: #ffffff;
    color: #252525;
    text-align: center;
    font: 500 11px/1.2 Arial, sans-serif;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

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

.qph-home .qph-home-heading h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
}

.qph-home .qph-history-all {
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.qph-home .qph-history-all svg {
    width: 22px;
    height: 22px;
}

.qph-home .qph-recent-card {
    flex: 0 0 125px;
    width: 125px;
    height: 125px;
    border-radius: 16px;
}

.qph-home .qph-recommend-card {
    flex: 0 0 169px;
    width: 169px;
    height: 260px;
}

.qph-home .qph-home-empty {
    color: #b8b5cd;
    margin: 0;
    padding: 12px 0 24px;
    font-size: 14px;
}

.qph-home .qph-home-card:focus-visible,
.qph-home .qph-history-all:focus-visible {
    outline: 2px solid #d2ccff;
    outline-offset: -3px;
}

@media (max-width: 600px) {
    .content-container.qph-home {
        padding-top: 16px;
    }
    .qph-home .qph-home-heading h2 {
        font-size: 18px;
    }
    .qph-home .qph-history-all {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qph-home .qph-home-track {
        scroll-behavior: auto;
    }
}

.qph-home .qph-collection-rows {
    margin: 0 -16px;
    padding: 0 16px 1px;
    background: linear-gradient(100deg, #14132b 0%, #101010 20%, #101010 75%, #171540 100%);
}

.qph-home .qph-category-row {
    margin: 0 0 24px;
}

.qph-home .qph-category-row .qph-home-heading {
    margin-bottom: 24px;
    min-height: 28px;
}

.qph-home .qph-category-row .qph-home-track {
    padding: 0;
    scroll-behavior: smooth;
}

.qph-home .qph-category-row .qph-home-card:hover img {
    filter: brightness(1.15);
}

.qph-home .qph-category-carousel {
    position: relative;
}

.qph-home .qph-more-games .qph-home-card {
    border-radius: 15px;
    background: transparent;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.13), 0 4px 6px -4px rgba(0, 0, 0, 0.13);
}

.qph-home .qph-more-games .qph-home-card img {
    transition: filter 0.5s;
}

.qph-home .qph-more-games .qph-home-card:hover img {
    filter: brightness(1.25);
}

@media (prefers-reduced-motion: reduce) {
    .qph-home .qph-more-games .qph-home-card img {
        transition: none;
    }
}

.qph-home .qph-row-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, #191735, #101010);
    color: #ffffff;
    font: 30px/1 Arial, sans-serif;
    cursor: pointer;
    opacity: 0;
    border: 0;
}

.qph-home .qph-row-prev {
    left: -12px;
}

.qph-home .qph-row-next {
    right: -12px;
}

.qph-home .qph-category-carousel:hover .qph-row-arrow,
.qph-home .qph-category-carousel:focus-within .qph-row-arrow {
    opacity: 1;
}

.qph-home .qph-row-arrow[hidden] {
    display: none;
}

.qph-home .qph-category-row .qph-history-all:hover {
    text-decoration: underline;
}

@media (max-width: 1023px) {
    .qph-home .qph-category-row .qph-home-heading h2 {
        font-size: 16px;
    }
    .qph-home .qph-row-arrow {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qph-home .qph-category-row .qph-home-track {
        scroll-behavior: auto;
    }
}

/* Info Cards Grid */
.qph-home .qph-info-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 32px 0;
}

.qph-home .qph-info-card {
    min-width: 0;
    padding: 24px;
    border-radius: 12px;
    color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.13);
    transition: filter 0.2s;
}

.qph-home .qph-info-card:hover {
    filter: brightness(1.1);
}

.qph-home .qph-info-blue {
    background: linear-gradient(135deg, #0f3443, #1a1a2e);
    --stroke: #53ddff;
}

.qph-home .qph-info-red {
    background: linear-gradient(135deg, #3c1a1a, #1a0a0a);
    --stroke: #ff7865;
}

.qph-home .qph-info-purple {
    background: linear-gradient(135deg, #2a163c, #0f0f2d);
    --stroke: #d688ff;
}

.qph-home .qph-info-green {
    background: linear-gradient(135deg, #0d2c0a, #162c1a);
    --stroke: #8fff4d;
}

.qph-home .qph-info-icon {
    display: block;
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 12px;
}

.qph-home .qph-info-card h2 {
    display: table;
    position: relative;
    margin: 0 0 16px;
    padding-bottom: 4px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    line-height: 28px;
}

.qph-home .qph-info-card h2::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 50%;
    background: var(--stroke);
    transform: rotate(0.6deg);
}

.qph-home .qph-info-card p {
    margin: 0;
    font-size: 16px;
    line-height: 24px;
    color: #ffffff;
}

.qph-home .qph-info-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    margin-top: 16px;
}

.qph-home .qph-info-links a {
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    line-height: 20px;
    color: #ffffff;
    text-decoration: none;
}

.qph-home .qph-info-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.qph-home .qph-info-links a:focus-visible {
    outline: 2px solid #d688ff;
    outline-offset: 3px;
}

@media (min-width: 1024px) {
    .qph-home .qph-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .qph-home .qph-info-card {
        transition: none;
    }
}

/* Play with Friends Banner */
.qph-home .qph-friends {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 16px 0;
    margin-bottom: 16px;
}

.qph-home .qph-friends-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    border-radius: 12px;
    background: linear-gradient(to bottom right, #3e1e68, #302b63, #1f1f39);
    min-width: 0;
}

.qph-home .qph-friends-banner h2 {
    flex-shrink: 0;
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
}

.qph-home .qph-friends-banner img {
    width: 200px;
    height: 156px;
    object-fit: contain;
    min-width: 0;
}

.qph-home .qph-friends-categories {
    position: relative;
    min-width: 0;
}

.qph-home .qph-friends-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    grid-template-rows: repeat(2, 100px);
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.qph-home .qph-friends-track.is-dragging {
    cursor: grabbing !important;
    scroll-behavior: auto !important;
}

.qph-home .qph-friends-track.is-dragging .qph-friends-tile {
    pointer-events: none;
}

.qph-home .qph-friends-track::-webkit-scrollbar {
    display: none;
}

.qph-home .qph-friends-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 170px;
    height: 100px;
    padding: 8px;
    border-radius: 12px;
    background: linear-gradient(to bottom right, #3e1e68, #302b63, #1f1f39);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.13);
    transition: filter 0.3s, transform 0.3s;
}

.qph-home .qph-friends-tile img {
    display: block;
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    object-fit: contain;
}

.qph-home .qph-friends-tile span {
    font-size: 16px;
    line-height: 24px;
    font-weight: 700;
    text-align: center;
}

.qph-home .qph-friends-tile:hover {
    background: linear-gradient(to top right, #5f3dc4, #40397e, #2c2c4a);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.13);
}

.qph-home .qph-friends-tile:active {
    filter: brightness(1.25);
    transform: scale(0.95);
}

.qph-home .qph-friends-tile:focus-visible,
.qph-home .qph-friends-track:focus-visible {
    outline: 2px solid #d2ccff;
    outline-offset: -3px;
}

.qph-home .qph-friends-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    padding: 8px;
    color: #ffffff;
    background: #1a1a2e;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.qph-home .qph-friends-arrow svg {
    width: 20px;
    height: 20px;
}

.qph-home .qph-friends-prev {
    left: 0;
}

.qph-home .qph-friends-next {
    right: 0;
}

.qph-home .qph-friends-categories:hover .qph-friends-arrow:not([hidden]),
.qph-home .qph-friends-categories:focus-within .qph-friends-arrow:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

.qph-home .qph-friends-arrow[hidden] {
    display: none;
}

@media (min-width: 640px) {
    .qph-home .qph-friends-banner img {
        width: 216px;
        height: 172px;
    }
    .qph-home .qph-friends-track {
        grid-template-rows: repeat(2, 110px);
    }
    .qph-home .qph-friends-tile {
        width: 180px;
        height: 110px;
    }
}

@media (min-width: 768px) {
    .qph-home .qph-friends-arrow {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .qph-home .qph-friends {
        flex-direction: row;
    }
    .qph-home .qph-friends-banner {
        flex: 1 1 0;
    }
    .qph-home .qph-friends-categories {
        flex: 2 1 0;
    }
    .qph-home .qph-friends-banner h2 {
        font-size: 20px;
    }
}

@media (min-width: 1280px) {
    .qph-home .qph-friends-banner h2 {
        font-size: 24px;
    }
}

@media (min-width: 1536px) {
    .qph-home .qph-friends-banner h2 {
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qph-home .qph-friends-track {
        scroll-behavior: auto;
    }
    .qph-home .qph-friends-tile,
    .qph-home .qph-friends-arrow {
        transition: none;
    }
}

