@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap");

:root {
    --bg-gradient-start: #0f0c29;
    --bg-gradient-mid: #302b63;
    --bg-gradient-end: #24243e;

    --card-bg-color: rgba(30, 30, 40, 0.45);
    --card-blur: 12px;
    --card-border-color: rgba(255, 255, 255, 0.1);

    --primary-text-color: #f0f0f0;
    --secondary-text-color: #a0a0b0;

    --accent-primary: #a855f7;
    --accent-secondary: #00c6ff;

    --red-color: #ef4444;
    --green-color: #22c55e;

    --font-family: "Inter", sans-serif;

    /* Responsive type scale */
    --font-size-base: clamp(14px, 3.6vw, 16px);
    --font-size-sm: clamp(12px, 3.2vw, 14px);
    --font-size-md: clamp(14px, 4vw, 18px);
    --font-size-lg: clamp(16px, 5vw, 22px);
    --font-size-xl: clamp(18px, 6.4vw, 28px);

    /* Safe area insets */
    --safe-top: env(safe-area-inset-top);
    --safe-right: env(safe-area-inset-right);
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-left: env(safe-area-inset-left);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base); /* responsive base text */
    background: linear-gradient(
            -45deg,
            var(--bg-gradient-start),
            var(--bg-gradient-mid),
            var(--bg-gradient-end)
    );
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    color: var(--primary-text-color);
    line-height: 1.6;
    overflow-x: hidden;

    /*!* Sticky footer layout *!*/
    min-height: 100dvh;
    display: flex;
    flex-direction: column;

    /*position: relative;*/
    /*!* Ensure children (like footer) establish stacking above negative z-index backgrounds *!*/
    /*z-index: 0;*/

    /*!* Create an isolated stacking context to prevent external overlaps *!*/
    /*isolation: isolate;*/
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 2s ease-in-out,
    transform 0.1s ease-out;
    transform: translateX(-10%) translateY(-10%);
    filter: blur(1px) brightness(0.4) saturate(1.2);
}

.background-layer.active {
    opacity: 1;
}

.background-layer.parallax {
    will-change: transform;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(
            135deg,
            rgba(15, 12, 41, 0.85) 0%,
            rgba(48, 43, 99, 0.75) 35%,
            rgba(36, 36, 62, 0.85) 100%
    );
    backdrop-filter: blur(0.5px);
}

/* Background Controls */
.background-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    pointer-events: auto;
}

.bg-control-btn {
    width: 44px;
    height: 44px;
    background: var(--card-bg-color);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border: 1px solid var(--card-border-color);
    border-radius: 50%;
    color: var(--secondary-text-color);
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.3s ease,
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0.8;
    z-index: 0; /* keep header controls below raised cards */
}

.bg-control-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-text-color);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.bg-control-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    opacity: 1;
}

.bg-control-btn i {
    font-size: 1rem;
}

/* Background Menu */
.background-menu {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    width: 320px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--card-bg-color);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border-radius: 16px;
    border: 1px solid var(--card-border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.background-menu.visible {
    opacity: 1;
    transform: translateX(0);
}

.bg-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--card-border-color);
}

.bg-menu-header h4 {
    color: var(--primary-text-color);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bg-menu-header .close-btn {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.bg-menu-header .close-btn:hover {
    color: var(--primary-text-color);
}

.bg-menu-content {
    padding: 20px;
    max-height: min(60vh, 540px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.bg-menu-section {
    margin-bottom: 24px;
}

.bg-menu-section:last-child {
    margin-bottom: 0;
}

.bg-menu-section h5 {
    color: var(--primary-text-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

/* Background Mode Selector */
.bg-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bg-mode-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.bg-mode-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.bg-mode-option input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--card-border-color);
    border-radius: 50%;
    position: relative;
    transition: border-color 0.3s ease,
    background-color 0.3s ease;
}

.bg-mode-option input[type="radio"]:checked {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
}

.bg-mode-option input[type="radio"]:checked::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.mode-label {
    color: var(--primary-text-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Background preview thumbnails */
.background-selector {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px; /* slightly larger gap on desktop for breathing room */
}

.bg-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease,
    box-shadow 0.3s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

@media (min-width: 1200px) {
    .background-selector {
        gap: 14px;
    }
    .bg-thumbnail {
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    }
}

@media (min-width: 1600px) {
    .background-selector {
        gap: 16px;
    }
    .bg-thumbnail {
        border-width: 2px;
        box-shadow: 0 4px 18px rgba(0,0,0,0.28);
    }
}


html[data-bgset="mobile"] .bg-thumbnail,
html[data-force-mobile="true"] .bg-thumbnail {
    aspect-ratio: 3 / 4;
}

.bg-thumbnail:hover {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .background-menu {
        top: calc(70px + var(--safe-top));
        right: 10px;
        left: 10px;
        width: auto;
        max-height: calc(100vh - (90px + var(--safe-top) + var(--safe-bottom)));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bg-menu-content {
        max-height: none;
        overflow-y: visible;
    }

    .background-selector {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    .bg-thumbnail {
        width: 100%;
        aspect-ratio: 3 / 4;
        border-radius: 6px;
    }

    html[data-bgset="desktop"] .bg-thumbnail,
    html[data-force-mobile="false"] .bg-thumbnail {
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 400px) {
    .background-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
    }
    .bg-thumbnail {
        aspect-ratio: 2 / 3;
        border-radius: 5px;
    }

    html[data-bgset="desktop"] .bg-thumbnail,
    html[data-force-mobile="false"] .bg-thumbnail {
        aspect-ratio: 1 / 1;
    }
}

.bg-thumbnail::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: background 0.3s ease;
}

.bg-thumbnail:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

.bg-thumbnail.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.bg-thumbnail.active::before {
    background: rgba(168, 85, 247, 0.2);
}

.background-layer {
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.1s ease-out;
}

.background-layer.fallback-gradient {
    background: linear-gradient(-45deg, #0f0c29, #24243e, #302b63, #0f0c29);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.bg-thumbnail.fallback-thumbnail {
    position: relative;
}

.bg-thumbnail.fallback-thumbnail::after {
    content: "⚠";
    position: absolute;
    top: 2px;
    right: 2px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
}

.background-controls {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.background-selector {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes headerEntrance {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

header {
    text-align: center;
    padding: 20px 20px 0 20px;
    display: flex;
    justify-content: center;
    position: relative;
    /*animation: headerEntrance 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;*/
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.floating-header {
    background: linear-gradient(
            135deg,
            rgba(30, 30, 40, 0.6) 0%,
            rgba(40, 35, 60, 0.5) 50%,
            rgba(30, 30, 40, 0.6) 100%
    );
    background-color: rgba(24, 24, 32, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 60px;
    transform: none !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(168, 85, 247, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 16px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    position: relative;
    overflow: hidden;
    animation: headerGlow 4s ease-in-out infinite;
}

/* Allow dropdown to escape only during active search; keep shimmer contained otherwise */
.floating-header.search-mode {
    overflow: visible;
    isolation: isolate;
    z-index: 1002; /* above overlay (1000) and menu (1001) */
}


.floating-header::before,
.floating-header::after {
   pointer-events: none;
   will-change: opacity, transform;
}

.floating-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent
    );
    transition: left 0.6s ease;
}

.floating-header:hover::before {
    left: 100%;
}

/* Disable header shimmer while search dropdown is visible to prevent visual artifacts */
.floating-header.search-mode::before {
    display: none !important;
}

.floating-header:hover {
    /*transform: translateY(-3px) scale(1.02);*/
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(168, 85, 247, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Also suppress hover escalation during active search to reduce shimmer/glow */
.floating-header.search-mode:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                0 2px 8px rgba(168, 85, 247, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.header-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(168, 85, 247, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.header-logo::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
            45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 70%
    );
    transform: rotate(-45deg);
    transition: transform 0.6s ease;
}

.floating-header:hover .header-logo {
    transform: rotate(5deg) scale(1.05);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5),
    0 3px 12px rgba(168, 85, 247, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.floating-header:hover .header-logo::before {
    transform: rotate(-45deg) translate(100%, 100%);
}

/* Hide logo shimmer sweep during search mode */
.floating-header.search-mode .header-logo::before {
    display: none !important;
}

.floating-header h1 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 900;
    letter-spacing: -0.02em;
}

.floating-header h1 a {
    text-decoration: none;
    background: linear-gradient(
            135deg,
            var(--accent-primary) 0%,
            var(--accent-secondary) 50%,
            #ff6b9d 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes headerGlow {
    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(168, 85, 247, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(168, 85, 247, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

/* Pause header glow animation in search mode to avoid shimmer while typing */
.floating-header.search-mode {
    animation: none !important;
}

.floating-header h1 a:hover {
    filter: brightness(1.3) saturate(1.2);
    animation-duration: 1s;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    position: relative;
}

.header-search {
    flex: 1;
    max-width: 400px;
    min-width: 200px;
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

/* Suggestion dropdown - Strict neutral (no gradients) */
.search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1002;

    background: rgb(28, 29, 33); /* solid neutral */
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    box-shadow: 0 8px 20px rgba(0,0,0,0.45);

    max-height: 320px;
    overflow-y: auto;
    display: none;

    /* keep within container width */
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
}

.search-suggestions::-webkit-scrollbar {
    width: 6px;
}
.search-suggestions::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    color: var(--primary-text-color);
    font-size: 0.95rem;
    transition: background 0.18s ease, color 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease;
    position: relative;
    border-radius: 10px;
    margin: 2px 6px;

    /* prevent long content from forcing horizontal scroll */
    min-width: 0;
    overflow: hidden;
}

/* subtle hover line */
.suggestion-item::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.suggestion-item:hover::before {
    opacity: 1;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

/* removed animated active gradient sweep for neutral style */

.suggestion-item.active {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    transform: translateX(3px);
    box-shadow: none;
    border-left: 2px solid rgba(255,255,255,0.85);
}

.suggestion-type {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    text-align: center;
    opacity: 1;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset;
    background: rgba(255,255,255,0.04);
}

/* neutralize platform icon styling (no colored glow) */
.suggestion-type.game,
.suggestion-type.caretaker {
    color: rgba(255,255,255,0.85);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset;
}

/* truncate long labels safely */
.suggestion-label,
.suggestion-label span,
.suggestion-label mark {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-label mark {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.85);
    text-decoration-thickness: 1.25px;
    text-underline-offset: 2px;
}

/* Mobile adjustments for suggestion list */
@media (max-width: 768px) {
    .search-suggestions {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        top: calc(100% + 10px);
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .header-search.search-active .search-suggestions {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* On mobile search mode, fully disable header shimmer/hover effects */
    .floating-header.search-mode::before {
        display: none !important;
    }
    .floating-header.search-mode .header-logo::before {
        display: none !important;
    }
}

.header-search #search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: max(16px, 0.9rem); /* prevent iOS zoom */
    background: rgba(0, 0, 0, 0.3);
    color: var(--primary-text-color);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    outline: none;
    font-family: var(--font-family);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-search #search-input::placeholder {
    color: var(--secondary-text-color);
}

.header-search #search-input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
    transform: translateY(-1px);
}

.mobile-header-top {
    display: none;
}

.desktop-logo,
.floating-header .header-content,
.floating-header .header-nav {
    display: flex;
}

.mobile-logo,
.floating-header .hamburger-menu {
    display: none;
}

.floating-header .subtitle {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    font-weight: 600;
    margin: 0;
    opacity: 0.9;
    transition: all 0.3s ease;
    background: linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.7) 0%,
            rgba(160, 160, 176, 0.8) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.floating-header:hover .subtitle {
    opacity: 1;
    transform: translateY(-1px);
}

.header-nav {
    display: flex;
    gap: 6px;
    margin-left: auto;
    padding: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}

.header-nav::before {
    content: "";
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 30px;
    background: linear-gradient(
            to bottom,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent
    );
}

.nav-link {
    padding: 10px 18px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent
    );
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    color: var(--primary-text-color);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(
            135deg,
            var(--accent-primary) 0%,
            var(--accent-secondary) 100%
    );
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.nav-link.active::before {
    display: none;
}

main {
    padding: 40px 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 0;

    /* Take remaining space so footer sits at bottom on short pages */
    /*flex: 1 0 auto;*/

    /* Ensure content doesn't butt against footer or device safe areas */
    /*padding-bottom: max(20px, env(safe-area-inset-bottom));*/
}

.instructions {
    background: var(--card-bg-color);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border-radius: 16px;
    border: 1px solid var(--card-border-color);
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.instructions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.instruction-box {
    flex: 1;
    min-width: 300px;
    padding: 20px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.instruction-box h3 {
    font-size: 1.2rem;
    color: var(--primary-text-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.instruction-box h3 i {
    margin-right: 12px;
}

.instruction-box:first-child h3 i {
    color: var(--green-color);
}

.instruction-box:last-child h3 i {
    color: var(--red-color);
}

.role-green {
    color: #00ffae;
    font-weight: 600;
}

.role-red {
    color: var(--red-color);
    font-weight: 600;
}

.role-section {
    margin-bottom: 40px;
}

.role-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border-color);
    position: relative;
    text-align: center;
}

.role-title::after {
    content: "";
    position: absolute;
    bottom: -1px;
    width: 100px;
    height: 2px;
    background-color: var(--role-color, var(--accent-primary));
    left: 50%;
    transform: translateX(-50%);
}

.caretaker-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.card {
    width: 430px;
    background: var(--card-bg-color);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border-radius: 14px;
    border: 1px solid var(--card-border-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    will-change: transform;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: radial-gradient(
            circle at 50% 0,
            hsla(from var(--role-color) h s l / 0.25),
            transparent 70%
    );
    opacity: 0.5;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px var(--role-color),
    0 0 30px color-mix(in srgb, var(--role-color) 30%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--role-color) 20%, transparent);
    border-color: color-mix(in srgb, var(--role-color) 30%, transparent);
}

.card:hover::before {
    opacity: 0.8;
}

.card-header {
    text-align: center;
    padding: 16px;
    border-bottom: 1px solid var(--card-border-color);
    z-index: 1;
}

.card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 5px;
    object-fit: cover;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.card-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 1px;
}

.description-in-games {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 250px;
    padding: 20px;
    text-align: center;
}

.description-in-games .description-text {
    font-size: 1.1rem;
    color: var(--primary-text-color);
    line-height: 1.6;
    font-style: italic;
    max-width: 280px;
}

.card-body.description-only h4 {
    text-align: center;
}

.card-body {
    padding: 25px;
    flex-grow: 1;
    z-index: 1;
}

.card-body h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-text-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.games-list {
    list-style: none;
    height: 250px;
    overflow-y: auto;
    padding-right: 10px;
}

.games-list::-webkit-scrollbar {
    width: 4px;
}

.games-list::-webkit-scrollbar-track {
    background: transparent;
}

.games-list::-webkit-scrollbar-thumb {
    background: var(--card-border-color);
    border-radius: 4px;
}

.games-list li {
    padding: 8px 0;
    font-size: 1rem;
    color: var(--primary-text-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.3s ease;
}

.games-list li:last-child {
    border-bottom: none;
}

.games-list li:hover {
    color: var(--accent-secondary);
}

/* Platform-based game organization */
.games-by-platform {
    height: 275px;
    overflow-y: auto;
    padding-right: 8px;
    padding-top: 2px;
}

.games-by-platform::-webkit-scrollbar {
    width: 4px;
}

.games-by-platform::-webkit-scrollbar-track {
    background: transparent;
}

.games-by-platform::-webkit-scrollbar-thumb {
    background: var(--card-border-color);
    border-radius: 4px;
}

.platform-group {
    margin-bottom: 12px;
}

.platform-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
}

.platform-new-indicator {
    display: inline-block;
    margin-left: 6px;
    color: #ff8e8e;
    font-size: 0.95rem;
    line-height: 1;
    vertical-align: middle;
    animation: heartbeat 2s ease-in-out infinite;
    text-shadow:
        0 0 6px rgba(255, 107, 157, 0.35),
        0 0 12px rgba(255, 107, 157, 0.25);
}

.platform-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.platform-badge:active {
    transform: translateY(0px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.platform-badge[data-platform="steam"] {
    background: linear-gradient(
            135deg,
            rgba(27, 40, 56, 0.3),
            rgba(255, 255, 255, 0.06)
    );
}

.platform-badge[data-platform="ea"] {
    background: linear-gradient(
            135deg,
            rgba(255, 102, 0, 0.2),
            rgba(255, 255, 255, 0.06)
    );
}

.platform-badge[data-platform="ubisoft"] {
    background: linear-gradient(
            135deg,
            rgba(0, 153, 255, 0.2),
            rgba(255, 255, 255, 0.06)
    );
}

.platform-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.platform-icon svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.platform-badge:hover .platform-icon {
    opacity: 1;
}

.platform-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-text-color);
    flex: 1;
}

.game-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary-text-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px;
    border-radius: 4px;
}

.collapse-btn:hover {
    color: var(--primary-text-color);
    background: rgba(255, 255, 255, 0.1);
}

.collapse-btn i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.platform-content {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: none; /* Default to expanded */
}

.platform-content.collapsed {
    max-height: 0 !important;
}

.platform-games-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.platform-games-list .game-item {
    padding: 6px 16px;
    font-size: 0.9rem;
    color: var(--primary-text-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
    border-left: 2px solid transparent;

    /* Layout to push NEW tag to right end */
    display: flex;
    align-items: center;
    gap: 8px;
}

.platform-games-list .game-item:hover {
    color: var(--accent-secondary);
    background: rgba(255, 255, 255, 0.02);
    border-left-color: var(--accent-secondary);
    transform: translateX(4px);
}

.platform-games-list .game-item:last-child {
    border-bottom: none;
}

/* Ensure name takes available space so NEW badge sticks to right */
.platform-games-list .game-item .game-name {
    flex: 1 1 auto;
    min-width: 0;
}

/* Slightly smaller badge in caretaker list rows */
.platform-games-list .game-item .new-badge {
    margin-left: 10px;
}

.card-footer {
    padding: 25px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
    z-index: 1;
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.support-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(
            135deg,
            rgba(168, 85, 247, 0.8) 0%,
            rgba(0, 198, 255, 0.8) 100%
    );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /*border: 1px solid rgba(255, 255, 255, 0.2);*/
    color: #fff;
    padding: 25px 35px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.support-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent
    );
    transition: left 0.6s ease;
}

.support-button:hover::before {
    left: 100%;
}

.support-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.4),
    0 6px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(
            135deg,
            rgba(168, 85, 247, 0.9) 0%,
            rgba(0, 198, 255, 0.9) 100%
    );
    border-color: rgba(255, 255, 255, 0.3);
}

.support-button:active {
    transform: translateY(-1px) scale(1.02);
}

.support-note {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    line-height: 1.4;
    margin: 0;
    flex-shrink: 0;
    height: 70px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    box-sizing: border-box;
}

footer {
    /* Layout */
    margin-top: auto; /* push to bottom on short pages within flex column */
    position: relative;
    text-align: center;

    /* Spacing and visuals (restore visible padding) */
    padding: 40px 20px;
    color: var(--secondary-text-color);
}

/* Add an animation for the mobile header */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hamburger Menu Styles */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px; /* increase to help reach 44x44 */
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--primary-text-color);
    margin: 2px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Prevent body from scrolling when the mobile menu or overlay is open */
body.menu-open {
    overflow: hidden;
    touch-action: none;
}
.mobile-nav-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(88vw, 280px); /* fluid for tiny screens */
  height: 100vh;
  background: linear-gradient(
          135deg,
          rgba(30, 30, 40, 0.95) 0%,
          rgba(40, 35, 60, 0.95) 50%,
          rgba(30, 30, 40, 0.95) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1001;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 80px 20px 20px;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.mobile-nav-menu.active {
    right: 0;
    /* Contain scrolling inside the panel */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;

    /* allow page to scroll under overlay when background menu is open */
    overscroll-behavior: contain;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.mobile-nav-link {
    padding: 16px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--secondary-text-color);
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-nav-link:hover {
    color: var(--primary-text-color);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.mobile-nav-link.active {
    color: #ffffff;
    background: linear-gradient(
            135deg,
            var(--accent-primary) 0%,
            var(--accent-secondary) 100%
    );
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.mobile-nav-link i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

/* Mobile Background Settings Button */
.mobile-bg-settings-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.mobile-bg-settings-btn:focus {
    outline: none;
}

.mobile-bg-settings-btn:hover {
    color: var(--primary-text-color) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateX(5px) !important;
}

.mobile-bg-settings-btn.active {
    color: #ffffff !important;
    background: linear-gradient(
            135deg,
            var(--accent-primary) 0%,
            var(--accent-secondary) 100%
    ) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4) !important;
  }

  /* Mobile Navigation Footer */
  .mobile-nav-footer {
    margin-top: auto;
    padding: 20px 0 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-nav-footer-section {
    margin-bottom: 15px;
  }

  .mobile-nav-footer-section h4 {
    color: var(--primary-text-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
  }

  .mobile-payment-methods {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .mobile-payment-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 50px;
    height: 36px;
    justify-content: center;
  }

  .mobile-payment-method i {
    font-size: 0.9rem;
  }

  .mobile-payment-method span {
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--secondary-text-color);
    text-align: center;
    line-height: 1;
  }

  .mobile-nav-footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-copyright {
    margin: 8px 0 0;
    font-size: 0.6rem;
    color: var(--secondary-text-color);
    opacity: 0.8;
  }

  .mobile-footer-tagline {
    margin: 0;
    font-size: 0.7rem;
    color: var(--primary-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
  }

  .mobile-footer-tagline i {
    color: #ff6b9d;
    font-size: 0.8rem;
  }

  @media (max-width: 1024px) and (min-width: 769px) {
    .floating-header {
        gap: 15px;
        padding: 14px 25px;
    }

    .header-search {
        max-width: 300px;
        min-width: 180px;
    }

    .header-search #search-input {
        font-size: 0.85rem;
        padding: 10px 14px;
    }

    .floating-header h1 {
        font-size: 1.3rem;
    }

    .mobile-header-top {
        display: none;
    }

    /* Hide only mobile search button on tablet, keep desktop search */
    .mobile-search-btn {
        display: none !important;
    }
}
.mobile-search-btn {
    display: none;
 }

@media (max-width: 768px) {
    header {
        padding: calc(10px + var(--safe-top)) 20px 0 20px; /* respect notch */
        margin-bottom: 20px;
        animation: headerEntrance 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .floating-header {
        flex-direction: row;
        gap: 12px;
        padding: 12px 16px;
        border-radius: 25px;
        width: 100%;
        animation: none; /* Remove the glow animation on mobile */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        align-items: center;
        position: relative;
        overflow: hidden;
    }

    .mobile-header-top {
        display: none !important;
    }

    .header-logo.mobile-logo {
        display: none !important;
    }

    .header-logo.desktop-logo {
        display: none !important;
    }

    .floating-header .header-content {
        display: flex !important;
        order: 2;
        flex: 1 1 auto;
        justify-content: center;
        align-items: center;
        min-width: 0;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        pointer-events: none;
        /*max-width: calc(100% - 120px); !* keep space for search + hamburger *!*/
    }

    .floating-header .header-content h1 a {
        pointer-events: all;
        /*max-width: 100%;*/
        /*display: inline-block;*/
    }

    .floating-header .header-nav {
        display: none;
    }

    .floating-header .header-content h1 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 800;
        line-height: 1.2;
        text-align: center;
    }

    .floating-header .header-content h1 a {
        white-space: nowrap;
        display: block;
        text-align: center;
        transform-origin: center;
        transition: font-size 0.25s ease;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Scale text to fit available space using clamp for both pages */
    .floating-header .header-content h1 a {
        font-size: clamp(0.95rem, 5.5vw, var(--font-size-lg));
    }

    @media (max-width: 400px) {
        .floating-header .header-content h1 a {
            font-size: clamp(0.9rem, 5.8vw, var(--font-size-lg));
        }
    }

    @media (max-width: 350px) {
        .floating-header .header-content h1 a {
            font-size: clamp(0.85rem, 6.2vw, var(--font-size-lg));
        }
    }

    @media (max-width: 320px) {
        .floating-header .header-content h1 a {
            font-size: clamp(0.8rem, 6.6vw, var(--font-size-lg));
        }
    }

    /* Mobile Search System */
    .floating-header .header-search {
        order: 1;
        flex-shrink: 0;
        width: 40px;
        margin: 0;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: none;
    }

    .floating-header .header-search:not(.search-active) {
        position: relative;
        transition: none;
    }

    .mobile-search-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px; /* touch target min */
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        color: var(--secondary-text-color);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        font-size: 1rem;
        position: relative;
        overflow: hidden;
        flex-shrink: 0;
    }

    .mobile-search-btn::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(168, 85, 247, 0.2);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: all 0.3s ease;
    }

    .mobile-search-btn:hover::before {
        width: 100%;
        height: 100%;
    }

    .mobile-search-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: var(--accent-primary);
        color: var(--primary-text-color);
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
    }

    .mobile-search-btn.active {
        background: var(--accent-primary);
        border-color: var(--accent-primary);
        color: white;
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    }

    .mobile-search-btn i {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-search-btn.active i {
        transform: rotate(90deg);
    }

    .header-search.search-active {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 1003; /* ensure above overlay/menu and header */
        margin: 0 !important;
        width: clamp(260px, calc(100vw - 24px), 480px) !important; /* scale with viewport */
        max-width: calc(100vw - 24px);
        transition: none !important;
        animation: none !important;

        /* prevent horizontal overflow on tiny screens */
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .floating-header.search-mode {
        background: linear-gradient(
            135deg,
            rgba(30, 30, 40, 0.85) 0%,
            rgba(40, 35, 60, 0.8) 50%,
            rgba(30, 30, 40, 0.85) 100%
        );
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-color: rgba(168, 85, 247, 0.4);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
                    0 2px 8px rgba(168, 85, 247, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.1);
        transform: scale(1.01);
        animation: searchModeGlow 2s ease-in-out infinite;
    }

    @keyframes searchModeGlow {
        0%, 100% {
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
                        0 2px 8px rgba(168, 85, 247, 0.3),
                        inset 0 1px 0 rgba(255, 255, 255, 0.1);
        }
        50% {
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
                        0 2px 8px rgba(168, 85, 247, 0.4),
                        inset 0 1px 0 rgba(255, 255, 255, 0.15);
        }
    }

    /* Hide elements when search is active for cleaner look */
    .floating-header.search-mode .header-content,
    .floating-header.search-mode .hamburger-menu {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* contain any overflow while search overlay is active */
    .floating-header.search-mode,
    .floating-header.search-mode .header-search {
        overflow-x: hidden;
    }

    /* Smooth transitions for header elements */
    .floating-header .header-content,
    .floating-header .hamburger-menu {
        transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    visibility 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .header-search.search-active .mobile-search-btn {
        display: none;
    }

    .header-search #search-input {
        width: 100%;
        padding: 14px 20px;
        font-size: max(16px, 1rem); /* avoid input zoom */
        background: rgba(0, 0, 0, 0.5);
        color: var(--primary-text-color);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 25px;
        outline: none;
        font-family: var(--font-family);
        /*transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);*/
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        opacity: 0;
        pointer-events: none;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    .header-search.search-active #search-input {
        opacity: 1;
        pointer-events: all;
        transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        transition-delay: 0.15s;
    }



    .header-search #search-input::placeholder {
        color: var(--secondary-text-color);
    }

    .header-search #search-input:focus {
        background: rgba(0, 0, 0, 0.5);
        border-color: var(--accent-secondary);
        box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2),
                    0 4px 20px rgba(168, 85, 247, 0.1);
        transform: scale(1.02);
    }



    .floating-header * {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .floating-header .hamburger-menu {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
        padding: 10px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .floating-header .hamburger-menu:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    @media (max-width: 768px) {
        .floating-header {
            /* on mobile we still want to hide the shimmer by default */
            overflow: hidden;
        }
    }

    .hamburger-line {
        width: 20px;
        height: 2px;
        background: var(--primary-text-color);
        margin: 3px 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 2px;
    }

    .floating-header .hamburger-menu {
        display: flex !important;
        order: 3;
        flex-shrink: 0;
        z-index: 5;
        margin-left: auto;
    }

    /* Hide desktop background controls on mobile */
    .background-controls {
        display: none !important;
    }

    /* Mobile-friendly background menu */
    /*.background-menu {*/
    /*    top: 110px;*/
    /*    right: 10px;*/
    /*    left: 10px;*/
    /*    width: auto;*/
    /*    max-width: none;*/
    /*    border-radius: 12px;*/
    /*}*/

    .bg-menu-header {
        padding: 16px;
    }

    .bg-menu-content {
        padding: 16px;
    }

    .bg-menu-header h4 {
        font-size: 0.9rem;
    }


    .floating-header:hover {
        transform: none;
    }

    .floating-header::before {
        display: none;
    }



    .header-logo::before {
        display: none;
    }

    .header-content {
        align-items: flex-start;
        flex: 1;
        min-width: 0;
    }

    .floating-header h1 {
        font-size: 1.2rem;
        font-weight: 800;
        line-height: 1.2;
        margin: 0;
    }

    .floating-header h1 a {
        white-space: nowrap;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .floating-header .subtitle {
        font-size: 0.8rem;
        opacity: 0.8;
    }

    /* Hide desktop navigation */
    .header-nav {
        display: none;
    }

    .header-nav::before {
        display: none;
    }


    .header-search #search-input {
        font-size: 1rem;
        padding: 14px 18px;
    }

    .floating-header .subtitle {
        display: none;
    }

    .header-nav {
        display: none;
    }

    .header-nav::before {
        display: none;
    }

   main {
        padding: 0 15px 20px;
    }

    .instructions {
        flex-direction: column;
        padding: 0;
        background: none;
        backdrop-filter: none;
        border: none;
        box-shadow: none;
        gap: 20px;
    }

    .instruction-box {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
        padding: 25px;
        border-radius: 16px;
        background: var(--card-bg-color);
        backdrop-filter: blur(var(--card-blur));
        border: 1px solid var(--card-border-color);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }


    .role-title {
        font-size: 1.8rem;
    }

    .caretaker-grid {
        gap: 25px;
    }

    .card {
        width: 100%;
    }

    .background-controls {
        top: 15px;
        right: 15px;
    }

    .bg-control-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .background-menu {
        top: 110px;
        right: 15px;
        left: 15px;
        width: auto;
    }

    .bg-thumbnail {
        width: 100%;
        height: auto;
    }
        footer::before {
        display: none;
    }
}

@media screen and (max-height: 1080px) and (min-width: 1200px) {
    .background-controls {
        top: 20px;
    }

    .background-menu {
        top: 134px;
    }
}

@media screen and (max-height: 1080px) and (min-width: 1800px) {
    :root {
        --card-blur: 10px;
    }

    .floating-header {
        padding: 10px 20px;
    }

    .header-logo {
        width: 35px;
        height: 35px;
    }

    .floating-header h1 {
        font-size: 1.2rem;
    }

    .floating-header .subtitle {
        font-size: 0.75rem;
    }

    .instructions,
    .search-container {
        padding: 20px;
        margin-bottom: 30px;
        border-radius: 12px;
    }

    .instruction-box {
        padding: 16px;
        border-radius: 10px;
    }

    .instruction-box h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .role-title {
        font-size: 1.7rem;
        margin-bottom: 16px;
        padding-bottom: 10px;
    }

    .role-title::after {
        width: 80px;
    }

    .role-section {
        margin-bottom: 30px;
    }

    .caretaker-grid {
        gap: 24px;
    }

    .card {
        border-radius: 12px;
    }

    .card-header {
        padding: 18px 20px;
    }

    .card-header h3 {
        font-size: 1.15rem;
    }

    .role-tag {
        padding: 4px 10px;
        font-size: 0.7rem;
        border-radius: 10px;
    }

    .card-stats {
        padding: 16px 20px;
    }

    .stat-item {
        font-size: 0.8rem;
    }

    .stat-item strong {
        font-size: 0.9rem;
    }

    #search-input {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    .search-container {
        top: 16px;
        margin-bottom: 30px;
    }

    .background-controls {
        top: 20px;
        right: 16px;
    }

    .bg-control-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .background-menu {
        top: 115px;
        right: 16px;
        width: 300px;
    }

    .bg-menu-header {
        padding: 16px;
    }

    .bg-menu-content {
        padding: 16px;
    }

    .bg-menu-section {
        margin-bottom: 20px;
    }
}

/* Shared NEW badge styling (used in caretakers list and games page) */
.new-badge {
   background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
   color: #ffffff;
   padding: 2px 6px;
   border-radius: 10px;
   font-size: 0.66rem;
   font-weight: 700;
   text-transform: uppercase;
   letter-spacing: 0.4px;
   margin-left: 6px;
   line-height: 1;
   display: inline-block;
   vertical-align: middle;

   /* Heartbeat pulse animation to mirror games page effect */
   will-change: transform, box-shadow;
   animation: newBadgePulse 2.2s ease-in-out infinite;
   box-shadow: 0 0 0 rgba(255, 107, 107, 0); /* base for animated glow */
}

/* Slightly stronger state when filter is active on games page */
.new-badge.filter-active {
   animation-duration: 1.6s;
}

/* Keyframes for subtle heartbeat without layout shift */
@keyframes newBadgePulse {
   0%, 100% {
      transform: scale(1);
      box-shadow: 0 0 0 rgba(255, 107, 107, 0);
   }
   40% {
      transform: scale(1.06);
      box-shadow:
        0 0 10px rgba(255, 107, 107, 0.35),
        0 0 18px rgba(255, 142, 142, 0.25);
   }
   60% {
      transform: scale(1.02);
      box-shadow:
        0 0 6px rgba(255, 107, 107, 0.25),
        0 0 12px rgba(255, 142, 142, 0.18);
   }
}

/* =========================================================================================
   PLAUSIBLE ANALYTICS EVENT TRACKING CLASSES
   ========================================================================================= */

/* Navigation Events */
.plausible-event-name\=Mobile\+Menu\+Toggle {
}

.plausible-event-name\=Mobile\+Menu\+Close {
}

.plausible-event-name\=Page\+Navigation\+Caretakers {
}

.plausible-event-name\=Page\+Navigation\+Games {
}

.plausible-event-name\=Discord\+Link\+Click {
}

/* Game Events */
.plausible-event-name\=Game\+Card\+Click {
}

.plausible-event-name\=Platform\+Toggle\+STEAM {
}

.plausible-event-name\=Platform\+Toggle\+EA {
}

.plausible-event-name\=Platform\+Toggle\+UBISOFT {
}

/* Caretaker Events */
.plausible-event-name\=Caretaker\+Card\+Click {
}

.plausible-event-name\=Support\+Link\+Click {
}


.plausible-event-name\=Background\+Menu\+Open {
}

.plausible-event-name\=Background\+Menu\+Close {
}

.plausible-event-name\=Background\+Mode\+Gradient {
}

.plausible-event-name\=Background\+Mode\+Static {
}

.plausible-event-name\=Background\+Mode\+Auto {
}


footer {
    position: relative !important;
    margin-top: auto; /* ensure sticky footer behavior */
    background: var(--card-bg-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    text-align: center !important;
    padding: 0 !important;
    color: var(--secondary-text-color) !important;

    /* Ensure footer renders above negative z-index backgrounds */
    z-index: 1;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
            45deg,
            transparent 30%,
            rgba(168, 85, 247, 0.05) 50%,
            transparent 70%
    );
    animation: footerShimmer 8s ease-in-out infinite;
}

@keyframes footerShimmer {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

.footer-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.footer-main {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.footer-logo img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 12px rgba(168, 85, 247, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: footerLogoFloat 6s ease-in-out infinite;
}

@keyframes footerLogoFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(2deg);
    }
}

.footer-logo img:hover {
    transform: scale(1.1) rotate(5deg);
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(168, 85, 247, 0.5);
}

.footer-logo h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(
            135deg,
            var(--accent-primary) 0%,
            var(--accent-secondary) 50%,
            #ff6b9d 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.footer-description {
    font-size: 0.95rem;
    color: var(--secondary-text-color);
    line-height: 1.5;
    max-width: 500px;
    margin: 0;
    opacity: 0.9;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.footer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.footer-section h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.footer-section h4::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 1px;
}

.footer-section a {
    color: var(--secondary-text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.footer-section a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(168, 85, 247, 0.2),
            transparent
    );
    transition: left 0.6s ease;
}

.footer-section a:hover::before {
    left: 100%;
}

.footer-section a:hover {
    color: var(--primary-text-color);
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--accent-primary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(168, 85, 247, 0.4);
}

.footer-section a i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.footer-section a:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* Payment Methods within Footer Section */
.payment-methods {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    /*margin-top: 10px;*/
}

.payment-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
    min-width: 60px;
    height: 44px;
    justify-content: center;
}

.payment-method::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(168, 85, 247, 0.2),
            transparent
    );
    transition: left 0.6s ease;
}

.payment-method:hover::before {
    left: 100%;
}

.payment-method:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--accent-primary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(168, 85, 247, 0.3);
}

.payment-method i {
    font-size: 1.1rem;
    /*color: var(--accent-primary);*/
    transition: all 0.3s ease;
}

.payment-method:hover i {
    transform: scale(1.15) rotate(3deg);
    color: var(--primary-text-color);
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--accent-primary);
}

.payment-method span {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--secondary-text-color);
    transition: color 0.3s ease;
    text-align: center;
    line-height: 1;
    letter-spacing: 0.2px;
}

.payment-method:hover span {
    color: var(--primary-text-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.copyright {
    margin: 0;
    font-size: 0.95rem;
    color: var(--secondary-text-color);
    opacity: 0.8;
}

.footer-tagline {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-tagline i {
    color: #ff6b9d;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .footer-content {
        padding: 40px 20px 30px;
        gap: 30px;
    }

    .footer-links {
        gap: 40px;
    }

    .footer-logo h3 {
        font-size: 1.5rem;
    }

    .footer-description {
        font-size: 1rem;
    }

    .footer-section a {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .payment-methods {
        gap: 6px;
    }

    .payment-method {
        padding: 6px 8px;
        min-width: 55px;
        height: 40px;
    }

    .payment-method i {
        font-size: 1rem;
    }

    .payment-method span {
        font-size: 0.55rem;
    }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .floating-header {
        /* readable fallback when blur isn't supported */
        background-color: rgba(24, 24, 32, 0.8);
    }
}

@media (max-width: 480px) {
    /* Keep footer links in a single horizontal row (no vertical stacking) */
    .footer-links {
        flex-direction: column;
        gap: 30px;
    }
    .header-search.search-active #search-input {
        padding: clamp(12px, 4vw, 16px) clamp(14px, 5vw, 18px);
        font-size: clamp(16px, 5vw, 18px);
        max-width: 90%;
    }
}

    /* Ensure shimmer/backdrop effects don't cause overflow */
    /*.floating-header,*/
    /*.header-content,*/
    /*.header-search,*/
    /*.search-suggestions,*/
    /*.instructions,*/
    /*.caretaker-grid,*/
    /*.footer-content {*/
    /*    max-width: 100%;*/
    /*    !*overflow-x: hidden;*!*/
    /*}*/

    .footer-logo img {
        width: 56px;
        height: 56px;
    }

    .footer-logo h3 {
        font-size: 1.3rem;
    }


    footer::before {
        display: none;
    }


@media (max-width: 400px) {
    .floating-header {
        padding: 10px 12px;
        border-radius: 18px;
        gap: 8px;
    }
    .header-search.search-active {
        width: calc(100% - 24px) !important;
        max-width: none;
    }
    .mobile-nav-menu {
        padding-top: calc(70px + var(--safe-top));
        width: min(92vw, 280px);
    }
    .instruction-box {
        padding: 18px;
    }
}

@media (max-width: 360px) {
    .mobile-nav-link {
        padding: 14px 16px;
        font-size: 1rem;
    }
    .footer-description { font-size: 0.9rem; }
    .nav-link { padding: 8px 14px; }
    .support-button { padding: 18px 20px; min-height: 44px; }
    .card-footer { padding: 18px; }
}

@media (max-width: 340px) {
    .floating-header h1 { font-size: clamp(14px, 5.4vw, 18px); }
    .mobile-search-btn { width: 44px; height: 44px; }
    .header-logo { width: 36px; height: 36px; }
}

@media (max-width: 320px) {
    .floating-header {
        padding: 8px 10px;
        gap: 6px;
    }
    .header-search.search-active {
        width: calc(100% - 20px) !important;
    }
    .mobile-nav-menu {
        width: 92vw;
    }
}



/* Images responsive */
img, svg, video {
    max-width: 100%;
    height: auto;
}

/* Long strings handling */
a, button, .game-title span:first-child, .platform-label, .card-name {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Reduce motion for users pref */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Touch target minimums */
button, .bg-control-btn, .mobile-nav-link, .payment-method, .mobile-payment-method {
    min-height: 44px;
}