/* ============================================================
           MAX'S GAMES UI — Material Design 3 System
           Premium Dark Theme
           ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,wght@8..144,100..1000&display=swap');

:root {
    /* ---- MD3 Color Palette (Almost Grayscale / Slate Base) ---- */
    --md-sys-color-primary: #C9C5D0;
    --md-sys-color-on-primary: #2F2D35;
    --md-sys-color-primary-container: #46434D;
    --md-sys-color-on-primary-container: #E4E1E9;

    --md-sys-color-secondary: #C8C7CA;
    --md-sys-color-on-secondary: #302F32;
    --md-sys-color-secondary-container: #47454A;
    --md-sys-color-on-secondary-container: #E3E2E5;

    --md-sys-color-tertiary: #CCC4C6;
    --md-sys-color-on-tertiary: #342E2F;
    --md-sys-color-tertiary-container: #4A4345;
    --md-sys-color-on-tertiary-container: #E7E0E2;

    --md-sys-color-error: #F2B8B5;
    --md-sys-color-on-error: #601410;
    --md-sys-color-error-container: #8C1D18;
    --md-sys-color-on-error-container: #F9DEDC;

    --md-sys-color-background: #141218;
    --md-sys-color-on-background: #E6E0E9;
    --md-sys-color-surface: #141218;
    --md-sys-color-on-surface: #E6E0E9;
    --md-sys-color-surface-variant: #49454F;
    --md-sys-color-on-surface-variant: #CAC4D0;

    --md-sys-color-outline: #938F99;
    --md-sys-color-outline-variant: #49454F;

    /* Surface Containers for elevation levels */
    --md-sys-color-surface-container-lowest: #0F0D13;
    --md-sys-color-surface-container-low: #1D1B20;
    --md-sys-color-surface-container: #211F26;
    --md-sys-color-surface-container-high: #2B2930;
    --md-sys-color-surface-container-highest: #36343B;

    /* ---- Semantic Aliases ---- */
    --text-primary: var(--md-sys-color-on-background);
    --text-secondary: var(--md-sys-color-on-surface-variant);
    --text-tertiary: var(--md-sys-color-outline);
    --text-inverse: var(--md-sys-color-on-primary);

    --accent: var(--md-sys-color-primary);
    --accent-hover: #EADDFF;
    --accent-glow: rgba(208, 188, 255, 0.25);

    --danger: var(--md-sys-color-error);

    /* ---- MD3 Elevations (Shadow + Tint) ---- */
    --elevation-0: none;
    --elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
    --elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
    --elevation-3: 0px 1px 3px 0px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
    --elevation-4: 0px 2px 3px 0px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15);
    --elevation-5: 0px 4px 4px 0px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15);

    /* ---- MD3 Border Radius ---- */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* ---- Spacing scale ---- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* ---- MD3 Typography System ---- */
    --font-family: 'Google Sans Flex', Roboto, system-ui, -apple-system, sans-serif;

    /* Display */
    --md-typescale-display-large-size: 57px;
    --md-typescale-display-large-weight: 400;

    /* Headline */
    --md-typescale-headline-large-size: 32px;
    --md-typescale-headline-small-size: 24px;
    --md-typescale-headline-weight: 400;

    /* Title */
    --md-typescale-title-large-size: 22px;
    --md-typescale-title-medium-size: 16px;
    --md-typescale-title-weight: 500;

    /* Body */
    --md-typescale-body-large-size: 16px;
    --md-typescale-body-medium-size: 14px;
    --md-typescale-body-weight: 400;

    /* Label */
    --md-typescale-label-large-size: 14px;
    --md-typescale-label-medium-size: 12px;
    --md-typescale-label-weight: 500;

    /* Standard map */
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-md: 1.125rem;
    --font-lg: 1.375rem;
    --font-xl: 1.5rem;
    --font-2xl: 2rem;
    --font-3xl: 2.5rem;

    --leading-normal: 1.5;

    /* ---- MD3 Motion ---- */
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);
    --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --ease-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
    --duration-short: 150ms;
    --duration-medium: 250ms;
    --duration-long: 400ms;

    /* ---- Layout ---- */
    --content-max-width: 1200px;
}

/* ============================================================
           Reset & Base
           ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    background: var(--md-sys-color-background);
}

body {
    font-family: var(--font-family);
    font-size: var(--md-typescale-body-large-size);
    font-weight: var(--md-typescale-body-weight);
    line-height: var(--leading-normal);
    color: var(--md-sys-color-on-background);
    background: var(--md-sys-color-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.site-title {
    font-family: var(--font-family);
    color: var(--md-sys-color-on-surface);
}

a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color var(--duration-short) var(--ease-standard);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    display: block;
}

::selection {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--md-sys-color-surface-container-lowest);
}

::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--md-sys-color-outline);
}

/* ============================================================
           Utility Classes
           ============================================================ */
.container {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.w-full {
    width: 100%;
}

.text-sm {
    font-size: var(--font-sm);
}

.text-lg {
    font-size: var(--font-lg);
}

.text-xl {
    font-size: var(--font-xl);
}

.text-2xl {
    font-size: var(--font-2xl);
}

.text-3xl {
    font-size: var(--font-3xl);
}

.font-normal {
    font-weight: 400;
}

.font-semibold {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.font-extrabold {
    font-weight: 800;
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

.text-accent {
    color: var(--accent);
}

.text-danger {
    color: var(--danger);
}

.text-center {
    text-align: center;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[x-cloak] {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-fade-in {
    animation: fadeIn var(--duration-medium) var(--ease-emphasized-decelerate) both;
}

.stagger>*:nth-child(1) {
    animation-delay: 0ms;
}

.stagger>*:nth-child(2) {
    animation-delay: 50ms;
}

.stagger>*:nth-child(3) {
    animation-delay: 100ms;
}

.stagger>*:nth-child(4) {
    animation-delay: 150ms;
}

.stagger>*:nth-child(5) {
    animation-delay: 200ms;
}

.stagger>*:nth-child(6) {
    animation-delay: 250ms;
}

/* ============================================================
           MD3 Components
           ============================================================ */

/* Top App Bar */
.header {
    background: rgba(33, 31, 38, 0.85);
    /* surface-container with opacity */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: var(--space-4) 0;
    width: 100%;
    transition: box-shadow var(--duration-medium) var(--ease-standard);
    box-shadow: var(--elevation-2);
}

.site-title {
    font-size: var(--md-typescale-title-large-size);
    font-weight: 700;
    letter-spacing: 0;
    color: var(--md-sys-color-on-surface);
}

/* MD3 Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-6);
    height: 40px;
    /* MD3 standard height */
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: var(--md-typescale-label-large-size);
    font-weight: var(--md-typescale-label-weight);
    cursor: pointer;
    transition: all var(--duration-short) var(--ease-standard);
    border: none;
    gap: var(--space-2);
    position: relative;
    overflow: hidden;
}

/* State Layer for ripple effect */
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity var(--duration-short) var(--ease-standard);
}

.btn:hover::before {
    opacity: 0.08;
}

.btn:active::before {
    opacity: 0.12;
}

/* Filled Button */
.btn-primary {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--elevation-1);
}

.btn-primary:hover {
    box-shadow: var(--elevation-2);
}

.btn-primary:active {
    box-shadow: var(--elevation-0);
}

/* Text Button / Ghost */
.btn-ghost {
    background: transparent;
    color: var(--md-sys-color-primary);
    padding: 0 var(--space-3);
}

.btn-ghost:hover {
    background: rgba(208, 188, 255, 0.08);
    /* Primary color at 8% opacity */
}

/* Icon Button */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--duration-short), color var(--duration-short);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: rgba(230, 224, 233, 0.08);
    /* on-surface at 8% */
    color: var(--md-sys-color-on-surface);
}

/* Inputs */
.input-group {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.input-search {
    width: 100%;
    height: 40px;
    padding: 0 var(--space-4);
    padding-left: var(--space-10);
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    color: var(--md-sys-color-on-surface);
    transition: all var(--duration-medium) var(--ease-standard);
    font-family: var(--font-family);
    font-size: var(--md-typescale-body-large-size);
}

.input-search:focus {
    outline: none;
    background: var(--md-sys-color-surface-container-highest);
    border-color: var(--md-sys-color-primary);
}

.input-search::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.search-icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--md-sys-color-on-surface-variant);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.input-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-family: monospace;
    font-size: 11px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 4px;
    padding: 2px 6px;
    background: var(--md-sys-color-surface);
    pointer-events: none;
}

/* Layout / Spacing */
.main-content {
    flex-grow: 1;
    padding: var(--space-8) 0;
}

.section-mb {
    margin-bottom: var(--space-12);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-8 {
    margin-top: var(--space-8);
}

.px-3 {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
}

.py-12 {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

.my-4 {
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
}

.block {
    display: block;
}

.text-xs {
    font-size: var(--font-xs);
}

/* Typography components */
.section-title {
    font-size: var(--md-typescale-headline-small-size);
    font-weight: 400;
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.section-title svg {
    color: var(--md-sys-color-primary);
    width: 24px;
    height: 24px;
}

/* Game Grid & Cards (MD3 Elevated Card) */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: var(--space-5);
    }
}

.game-card {
    background: var(--md-sys-color-surface-container-low);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/20;
    cursor: pointer;
    transition: transform var(--duration-medium) var(--ease-emphasized), box-shadow var(--duration-medium) var(--ease-emphasized);
    box-shadow: var(--elevation-1);
}

/* Interactive State Layer */
.game-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--md-sys-color-on-surface);
    opacity: 0;
    transition: opacity var(--duration-short) var(--ease-standard);
    z-index: 4;
    pointer-events: none;
}

.game-card:hover::after {
    opacity: 0.08;
    /* MD3 Hover State */
}

.game-card:active::after {
    opacity: 0.12;
    /* MD3 Pressed State */
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--elevation-4);
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: transform var(--duration-long) var(--ease-emphasized);
}

.game-card:hover img {
    transform: scale(1.08);
}

.game-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0) 100%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-3);
    pointer-events: none;
}

.game-title {
    color: #FFFFFF;
    /* Forced white on dark overlay for contrast */
    font-size: var(--md-typescale-title-medium-size);
    font-weight: var(--md-typescale-title-weight);
    width: 100%;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    transition: transform var(--duration-short) var(--ease-standard);
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 56px;
    height: 56px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--duration-medium) var(--ease-emphasized);
    box-shadow: var(--elevation-3);
    z-index: 3;
}

.game-card:hover .play-icon-overlay {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.play-icon-overlay svg {
    width: 28px;
    height: 28px;
    margin-left: 4px;
    /* Optical optical alignment for play triangle */
}

/* Loading Skeleton */
.skeleton {
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--radius-md);
    aspect-ratio: 16/20;
    animation: pulse 1.5s infinite var(--ease-standard);
}

/* Modals (MD3 Dialog) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    /* Scrim */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal {
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--radius-xl);
    /* MD3 uses 24px for dialogs */
    box-shadow: var(--elevation-3);
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: scale(0.9) translateY(20px);
    animation: dialogPopIn var(--duration-medium) var(--ease-emphasized-decelerate) forwards;
}

@keyframes dialogPopIn {
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-large {
    max-width: 1100px;
    height: 85vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6) var(--space-6) var(--space-4) var(--space-6);
}

.modal-body {
    padding: 0 var(--space-6) var(--space-6) var(--space-6);
    overflow-y: auto;
}

.premium-banner {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Soft gradient background for depth instead of a flat color */
    background: linear-gradient(145deg, var(--md-sys-color-secondary-container), var(--md-sys-color-primary-container));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px 32px;
    gap: 24px;
    /* Drop shadow to lift it off the background */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    /* Keeps the shine animation inside */
}

/* Subtle looping shine animation to catch the eye */
.premium-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.04), transparent);
    transform: skewX(-20deg);
    animation: premium-shine 6s infinite;
    pointer-events: none;
}

@keyframes premium-shine {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.premium-banner-content {
    position: relative;
    z-index: 1;
    /* Keeps text above the shine */
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--md-sys-color-on-primary-container);
    /* Darker, sleeker pill with a crisp border */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 30px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.premium-banner h3 {
    margin: 0 0 8px 0;
    color: var(--md-sys-color-on-primary-container);
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.premium-banner p {
    margin: 0;
    color: var(--md-sys-color-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 600px;
    /* Prevents text from stretching too far on wide screens */
}

.premium-banner-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Gives the button a 3D, tactile feel */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-premium:hover {
    filter: brightness(1.15);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Makes the button feel "pressed" when clicked */
.btn-premium:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banner-microcopy {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-primary-container);
    opacity: 0.6;
    font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .premium-banner {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }

    .premium-banner-actions {
        width: 100%;
    }

    .btn-premium {
        width: 100%;
    }
}

/* Subscription Modal Redesign (App-like) */
.split-modal {
    display: flex;
    flex-direction: column;
}

@media (min-width: 800px) {
    .split-modal {
        flex-direction: row;
    }
}

.premium-sidebar {
    background: var(--md-sys-color-surface-container-low);
    padding: var(--space-8);
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.premium-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at top right, rgba(208, 188, 255, 0.1), transparent 70%);
    pointer-events: none;
}

.premium-form-area {
    padding: var(--space-8);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--md-sys-color-surface-container-highest);
    position: relative;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--space-5);
    background: var(--md-sys-color-surface-container);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--md-sys-color-outline-variant);
    transition: transform var(--duration-short) var(--ease-standard);
}

.feature-item:hover {
    transform: translateX(4px);
    border-color: var(--md-sys-color-primary);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border-radius: var(--radius-full);
    margin-right: var(--space-4);
    flex-shrink: 0;
}

.qr-box {
    background: #FFFFFF;
    /* Needs to be white for QR code scanability */
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin: var(--space-4) 0;
    box-shadow: var(--elevation-2);
}

.qr-box img {
    width: 140px;
    height: 140px;
}

/* Ads Styles (Native Feel) */
.ad-container {
    background: var(--md-sys-color-surface-container-low);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-md);
    margin: var(--space-8) auto;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    padding: var(--space-4);
}

.ad-container::before {
    content: 'Sponsored';
    position: absolute;
    top: 0;
    right: 0;
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 10px;
    padding: 2px 8px;
    border-bottom-left-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Game Player */
.game-iframe-container {
    flex-grow: 1;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.game-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    inset: 0;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--md-sys-color-surface-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Footer */
.footer {
    border-top: 1px solid var(--md-sys-color-surface-variant);
    padding: var(--space-8) 0;
    margin-top: auto;
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-typescale-body-medium-size);
    background: var(--md-sys-color-surface-container-lowest);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-6);
    margin-bottom: var(--space-4);
}

/* Hide specific elements on mobile */
@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
}