/* ==========================================================================
   QuickPlayHub - Game Player Page Styles (k4.games pixel-perfect)
   ========================================================================== */

:root {
    --k4-bg-dark: #0e0d1f;
    --k4-bg-card: #181734;
    --k4-bg-card-elevated: #1f1d40;
    --k4-border: rgba(255, 255, 255, 0.08);
    --k4-accent: #7b68ee;
    --k4-text-main: #ffffff;
    --k4-text-muted: #a6a1c5;
}

body {
    background-color: var(--k4-bg-dark) !important;
}

.k4-game-page-wrapper {
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 16px 20px 60px;
    box-sizing: border-box;
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--k4-text-main);
}

/* ─── TOP STAGE (LEFT SKYSCRAPER AD + PLAYER + SIDEBAR) ─── */
.k4-stage-layout {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 24px;
}

/* Left Skyscraper Banner (k4.games Game_Top - Slot 3288992132) */
.k4-left-ad-col {
    width: 160px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.k4-skyscraper-ad-card {
    width: 160px;
    height: 100%;
    min-height: 540px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 18px 12px 24px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    text-decoration: none;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.k4-skyscraper-ad-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.k4-ad-badge-top {
    position: absolute;
    top: 6px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
    color: #0070ba;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.k4-ad-body-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
    text-align: center;
    width: 100%;
}

.k4-ad-godaddy-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #111111;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.k4-ad-godaddy-logo svg {
    fill: #111111;
}

.k4-ad-tagline {
    font-size: 13px;
    font-weight: 500;
    color: #333333;
    line-height: 1.4;
    margin-bottom: 16px;
}

.k4-ad-tagline strong {
    display: block;
    font-size: 14px;
    color: #00838c;
    margin-top: 6px;
}

.k4-ad-cta-btn {
    background: #111111;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 6px;
    display: inline-block;
    transition: background 0.15s ease;
    margin-top: auto;
}

.k4-skyscraper-ad-card:hover .k4-ad-cta-btn {
    background: #00838c;
}

/* Center Player Box */
.k4-player-container {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    background: #14132b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--k4-border);
}

.k4-iframe-box {
    position: relative;
    width: 100%;
    height: 540px;
    background: #000000;
    touch-action: auto;
    -webkit-overflow-scrolling: touch;
    overflow: hidden;
}

.k4-iframe-box iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    touch-action: auto;
    pointer-events: all;
    position: relative;
    z-index: 1;
}

/* Player Toolbar */
.k4-player-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #1c1a38;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
    gap: 12px;
}

.k4-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.k4-toolbar-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    background: #252347;
    flex-shrink: 0;
}

.k4-toolbar-meta {
    min-width: 0;
}

.k4-toolbar-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.k4-toolbar-category {
    font-size: 12px;
    color: var(--k4-text-muted);
}

.k4-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.k4-tool-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, color 0.18s ease;
}

.k4-tool-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(167, 139, 250, 0.35);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 10px rgba(123, 104, 238, 0.15);
}

.k4-tool-btn:active {
    transform: scale(0.95);
}

.k4-tool-icon-only {
    padding: 7px 11px;
    font-size: 14px;
}

/* Active Button States & Micro-interactions */
.k4-tool-btn.is-liked,
.k4-tool-btn.liked {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: rgba(245, 158, 11, 0.6) !important;
    color: #fbbf24 !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.28), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.k4-tool-btn.is-disliked,
.k4-tool-btn.disliked {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    color: #f87171 !important;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.28), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.k4-tool-btn.is-favorited,
.k4-tool-btn.favorited {
    background: rgba(236, 72, 153, 0.18) !important;
    border-color: rgba(236, 72, 153, 0.6) !important;
    color: #f472b6 !important;
    box-shadow: 0 0 14px rgba(236, 72, 153, 0.28), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.k4-tool-btn .btn-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

#like-count,
#dislike-count {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: -0.2px;
}

@keyframes icon-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.38) rotate(-8deg); }
    75% { transform: scale(0.92) rotate(4deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.animate-icon-pop {
    animation: icon-pop 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes heart-pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.42); }
    80% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.animate-heart-pop {
    animation: heart-pop 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes spin-pop {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.22); }
    100% { transform: rotate(360deg) scale(1); }
}

.animate-spin-pop {
    animation: spin-pop 0.55s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Right Sidebar: "Games You Might Like" (Matching k4.games) */
.k4-side-recommendations {
    width: 280px;
    flex-shrink: 0;
    background: linear-gradient(145deg, #241c4a, #16142e);
    border-radius: 16px;
    padding: 16px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    height: 590px;
    box-sizing: border-box;
}

.k4-rec-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}

.k4-rec-mascot {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0px 0px 15px #5f3dc4);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.k4-rec-mascot:hover {
    transform: scale(1.08);
}

.k4-rec-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}

.k4-rec-separator {
    width: 100%;
    height: 2px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.k4-rec-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.k4-rec-list::-webkit-scrollbar {
    width: 5px;
}

.k4-rec-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.k4-rec-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s, transform 0.15s;
}

.k4-rec-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

.k4-rec-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #252347;
    flex-shrink: 0;
}

.k4-rec-title {
    font-size: 13px;
    font-weight: 600;
    color: #e5e2f7;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ─── GOOGLE GEMINI AD BANNER ─── */
.k4-ad-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #1b203a 0%, #15182d 100%);
    border: 1px solid #2f3b6d;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 28px;
    text-decoration: none;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.k4-ad-banner:hover {
    border-color: #4f64b4;
    box-shadow: 0 6px 20px rgba(47, 59, 109, 0.4);
}

.k4-ad-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.k4-ad-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.k4-ad-desc {
    margin: 0;
    font-size: 12.5px;
    color: #aeb4d4;
}

.k4-ad-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.k4-ad-tag {
    font-size: 11px;
    color: #8c94be;
    font-weight: 600;
}

.k4-ad-cta {
    background: #1a73e8;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 700;
}

.k4-ad-info-icon {
    position: absolute;
    top: 6px;
    right: 8px;
    color: #656d94;
    font-size: 11px;
}

/* ─── 40-GAME GRID (4 ROWS x 10 COLUMNS) ─── */
.k4-more-games-card {
    background: var(--k4-bg-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--k4-border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    margin-bottom: 28px;
}

.k4-games-grid-40 {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 14px;
}

.k4-grid-game-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.k4-grid-game-item:hover {
    transform: translateY(-4px) scale(1.04);
}

.k4-grid-game-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #232047;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 6px;
}

.k4-grid-game-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.k4-grid-game-title {
    font-size: 12px;
    font-weight: 600;
    color: #e5e2f7;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* ─── "DISCOVER MORE" WHITE ACCORDION BOX ─── */
.k4-discover-box {
    background: #ffffff;
    color: #202124;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 28px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.k4-discover-title {
    font-size: 16px;
    font-weight: 800;
    color: #202124;
    margin-bottom: 12px;
}

.k4-discover-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 6px;
    border-bottom: 1px solid #e8eaed;
    text-decoration: none;
    color: #1a73e8;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, padding-left 0.15s;
    border-radius: 6px;
}

.k4-discover-row:last-child {
    border-bottom: none;
}

.k4-discover-row:hover {
    background: #f1f3f4;
    padding-left: 14px;
}

.k4-discover-chevron {
    color: #70757a;
    font-size: 18px;
    font-weight: 400;
}

/* ─── BREADCRUMB BAR (k4.games pill style) ─── */
.k4-breadcrumb-bar {
    background: var(--k4-bg-card);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--k4-border);
}

.k4-breadcrumb-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.k4-breadcrumb-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 4px 10px;
    font-size: 13px;
    color: #a6a1c5;
    transition: border-color 0.2s, color 0.2s;
}

.k4-breadcrumb-pill a {
    color: #a6a1c5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.k4-breadcrumb-pill:hover a {
    color: #ffffff;
}

.k4-breadcrumb-pill:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.k4-breadcrumb-pill--active {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

.k4-breadcrumb-pill--active span {
    font-weight: 600;
    color: #ffffff;
}

.k4-breadcrumb-pill-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    color: #a6a1c5;
}

.k4-breadcrumb-pill-icon--rounded {
    border-radius: 4px;
}

.k4-breadcrumb-game-thumb {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--k4-border);
    transition: transform 0.3s ease;
}

.k4-breadcrumb-game-thumb:hover {
    transform: scale(1.08);
}

/* ─── GAME DETAILS & METADATA SECTION (k4.games style) ─── */
.k4-details-card {
    background: linear-gradient(135deg, #1f1d40 0%, #1a1836 40%, #15132b 100%);
    border-radius: 16px;
    border: 1px solid var(--k4-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    overflow: hidden;
}

.k4-details-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2px minmax(0, 280px);
    gap: 0;
    padding: 32px;
    align-items: start;
}

.k4-details-left {
    padding-right: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.k4-details-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.k4-details-vsep {
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
    align-self: stretch;
    border-radius: 2px;
    flex-shrink: 0;
}

.k4-right-meta-group {
    padding-left: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.k4-details-title {
    font-size: clamp(22px, 3.5vw, 36px);
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.k4-details-desc {
    font-size: 14.5px;
    line-height: 1.75;
    color: #b9b5d8;
    margin: 0;
}

.k4-details-instructions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.k4-details-subtitle {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.k4-details-instruct-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.k4-instruct-line {
    font-size: 14px;
    line-height: 1.7;
    color: #b9b5d8;
    margin: 0;
}

/* ─── DETAILS CARD: RIGHT META COLUMN ─── */
.k4-meta-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.k4-meta-heading {
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.3px;
}

.k4-platforms-heading {
    font-size: clamp(18px, 2.5vw, 26px);
}

/* Category pills with gradient (matching k4.games) */
.k4-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.k4-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #5f3dc4, #40397e, #2c2c4a);
    border: 1px solid #5f3dc4;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.k4-cat-pill:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(95, 61, 196, 0.4);
}

.k4-cat-pill-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Platform simple list (k4.games style — emoji + text) */
.k4-platforms-section {
    margin-top: 8px;
}

.k4-platform-list-simple {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.k4-platform-list-item {
    font-size: clamp(14px, 1.8vw, 18px);
    color: #d2ceff;
    font-weight: 500;
    line-height: 1.4;
}

.k4-platform-android-link {
    color: #d2ceff;
    text-decoration: none;
    font-size: clamp(14px, 1.8vw, 18px);
    font-weight: 500;
    transition: color 0.2s;
}

.k4-platform-android-link:hover {
    color: #4f8ef7;
}

/* Responsive */
@media (max-width: 900px) {
    .k4-details-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .k4-details-left { padding-right: 0; }
    .k4-details-vsep { display: none; }
    .k4-right-meta-group { padding-left: 0; }
}

/* ─── DETAILS CARD: RIGHT META COLUMN ─── */
.k4-right-meta-group {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.k4-meta-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.k4-meta-heading {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.2px;
}

/* Category pills */
.k4-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.k4-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(123, 104, 238, 0.15);
    border: 1px solid rgba(123, 104, 238, 0.35);
    color: #c5beff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
    white-space: nowrap;
}

.k4-cat-pill:hover {
    background: rgba(123, 104, 238, 0.3);
    border-color: #7b68ee;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Platform items */
.k4-platform-list {
    display: flex;
    gap: 20px;
}

.k4-platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.k4-platform-icon-wrap {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 100%;
    padding: 16px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.k4-platform-icon-wrap svg {
    width: 72px;
    height: auto;
    color: #d2ceff;
    display: block;
}

.k4-platform-label {
    font-size: 12px;
    font-weight: 600;
    color: #a6a1c5;
    text-align: center;
    line-height: 1.4;
}

.k4-meta-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.k4-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.k4-meta-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.k4-meta-label {
    color: var(--k4-text-muted);
}

.k4-meta-val {
    color: #ffffff;
    font-weight: 600;
    text-align: right;
}

/* ─── THEATER MODE ─── */
.k4-theater-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    background: #000000 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.k4-theater-active .k4-iframe-box {
    height: calc(100vh - 60px) !important;
}

/* ─── ENHANCED RIPPLE EFFECT & BUTTON INTERACTIONS ─── */
.ripple-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.2s ease,
                background 0.2s ease,
                border-color 0.2s ease;
}

.ripple-btn:active {
    transform: scale(0.94);
}

.ripple-btn > * {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

/* Luminous Ripple Wave */
.ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(167, 139, 250, 0.6) 28%,
        rgba(123, 104, 238, 0.3) 55%,
        rgba(123, 104, 238, 0) 75%
    );
    box-shadow: 0 0 16px rgba(167, 139, 250, 0.5);
    animation: ripple-bloom 650ms cubic-bezier(0.12, 0.8, 0.25, 1) forwards;
}

/* Dynamic Ripple Color Themes */
.ripple.ripple-gold {
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(251, 191, 36, 0.8) 28%,
        rgba(245, 158, 11, 0.35) 55%,
        rgba(245, 158, 11, 0) 75%
    );
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
}

.ripple.ripple-pink {
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(244, 114, 182, 0.8) 28%,
        rgba(236, 72, 153, 0.35) 55%,
        rgba(236, 72, 153, 0) 75%
    );
    box-shadow: 0 0 18px rgba(236, 72, 153, 0.6);
}

.ripple.ripple-red {
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(251, 113, 133, 0.75) 28%,
        rgba(225, 29, 72, 0.3) 55%,
        rgba(225, 29, 72, 0) 75%
    );
    box-shadow: 0 0 18px rgba(225, 29, 72, 0.5);
}

.ripple.ripple-cyan {
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(56, 189, 248, 0.8) 28%,
        rgba(99, 102, 241, 0.35) 55%,
        rgba(99, 102, 241, 0) 75%
    );
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.55);
}

@keyframes ripple-bloom {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.95;
    }
    40% {
        opacity: 0.75;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Micro-animations for buttons */
@keyframes icon-pop {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.38) rotate(-14deg); }
    70% { transform: scale(0.92) rotate(4deg); }
}

@keyframes heart-pop {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.45); }
    60% { transform: scale(0.88); }
    80% { transform: scale(1.18); }
}

@keyframes spin-pop {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-icon-pop {
    display: inline-block;
    animation: icon-pop 450ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-heart-pop {
    display: inline-block;
    animation: heart-pop 450ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-spin-pop {
    display: inline-block;
    animation: spin-pop 550ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Active Button State Themes */
.k4-tool-btn.is-liked {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    color: #fbbf24 !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25) !important;
}

.k4-tool-btn.is-favorited {
    background: rgba(236, 72, 153, 0.16) !important;
    border-color: rgba(236, 72, 153, 0.5) !important;
    color: #f472b6 !important;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.25) !important;
}

.k4-tool-btn.is-disliked {
    background: rgba(239, 68, 68, 0.16) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #f87171 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.25) !important;
}

.k4-tool-btn.is-theater-active {
    background: #7b68ee !important;
    border-color: #9d8df8 !important;
    box-shadow: 0 0 14px rgba(123, 104, 238, 0.5) !important;
    color: #ffffff !important;
}


/* ─── FOOTER AD BANNER (k4.games Game_Footer) ─── */
.k4-footer-ad-container {
    margin: 28px 0 10px;
    width: 100%;
}

.k4-ad-leaderboard-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1b193d, #14132b);
    border: 1px solid rgba(123, 104, 238, 0.25);
    border-radius: 12px;
    padding: 16px 24px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    gap: 16px;
}

.k4-ad-leaderboard-card:hover {
    border-color: #7b68ee;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(123, 104, 238, 0.2);
}

.k4-ad-tag-badge {
    background: #25d366;
    color: #0b1f13;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.k4-ad-leaderboard-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.k4-ad-sponsor-label {
    font-size: 11px;
    color: #a6a1c5;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.k4-ad-sponsor-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
}

.k4-ad-cta-pill {
    background: #7b68ee;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

.k4-ad-leaderboard-card:hover .k4-ad-cta-pill {
    background: #6c5ce7;
}

.k4-ad-info-badge {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* ─── RESPONSIVE BREAKPOINTS ─── */
@media (max-width: 1200px) {
    .k4-games-grid-40 {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

    .k4-details-card {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 1100px) {
    .k4-left-ad-col {
        display: none;
    }
}

@media (max-width: 992px) {
    .k4-stage-layout {
        flex-direction: column;
        gap: 16px;
    }

    .k4-player-container {
        width: 100%;
        flex: none;
        order: 1;
    }

    .k4-side-recommendations {
        width: 100%;
        height: auto;
        max-height: none;
        order: 2;
    }

    .k4-rec-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-height: none;
        overflow-y: visible;
    }

    .k4-games-grid-40 {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .k4-game-page-wrapper {
        margin-left: 0;
        padding: 10px 10px 40px;
    }

    .k4-stage-layout {
        gap: 14px;
        margin-bottom: 16px;
    }

    .k4-player-container {
        width: 100%;
        border-radius: 10px;
        order: 1;
    }

    .k4-iframe-box {
        height: clamp(340px, 52vh, 480px);
        width: 100%;
        touch-action: auto;
        -webkit-overflow-scrolling: touch;
    }

    .k4-iframe-box iframe {
        width: 100%;
        height: 100%;
        border: none;
        display: block;
        touch-action: auto;
        pointer-events: all;
        -webkit-overflow-scrolling: touch;
    }

    .k4-player-toolbar {
        padding: 8px 10px;
        gap: 8px;
    }

    .k4-toolbar-left {
        gap: 8px;
    }

    .k4-toolbar-thumb {
        width: 36px;
        height: 36px;
    }

    .k4-toolbar-title {
        font-size: 14px;
        max-width: 140px;
    }

    .k4-toolbar-actions {
        gap: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .k4-toolbar-actions::-webkit-scrollbar {
        display: none;
    }

    .k4-tool-btn {
        padding: 6px 9px;
        font-size: 12px;
    }

    .k4-side-recommendations {
        padding: 12px 10px;
        border-radius: 12px;
        order: 2;
    }

    .k4-rec-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-height: none;
        overflow-y: visible;
    }

    .k4-games-grid-40 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .k4-ad-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .k4-ad-right {
        align-items: flex-start;
        margin-top: 8px;
    }

    .k4-ad-leaderboard-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .k4-game-page-wrapper {
        padding: 6px 6px 36px;
    }

    .k4-iframe-box {
        height: clamp(320px, 50vh, 440px);
        touch-action: auto;
    }

    .k4-toolbar-title {
        font-size: 13px;
        max-width: 110px;
    }

    .k4-rec-list {
        grid-template-columns: 1fr;
    }

    .k4-games-grid-40 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
}