:root {
    --lx-games-bg: #050814;
    --lx-games-bg-2: #0f172a;
    --lx-games-panel: rgba(17, 24, 39, 0.78);
    --lx-games-panel-strong: rgba(15, 23, 42, 0.94);
    --lx-games-panel-border: rgba(148, 163, 184, 0.22);
    --lx-games-panel-border-strong: rgba(125, 211, 252, 0.34);
    --lx-games-text: #f8fafc;
    --lx-games-muted: #cbd5e1;
    --lx-games-soft: #94a3b8;
    --lx-games-accent: #38bdf8;
    --lx-games-accent-2: #2563eb;
    --lx-games-accent-3: #8b5cf6;
    --lx-games-good: #22c55e;
    --lx-games-shadow: rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

html {
    background: var(--lx-games-bg);
}

body {
    margin: 0;
    font-family: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
    color: var(--lx-games-text);
    background:
        radial-gradient(circle at 12% 8%, rgba(37, 99, 235, 0.34), transparent 32rem),
        radial-gradient(circle at 88% 12%, rgba(56, 189, 248, 0.22), transparent 30rem),
        radial-gradient(circle at 50% 100%, rgba(139, 92, 246, 0.16), transparent 34rem),
        linear-gradient(135deg, #050814 0%, #0f172a 55%, #020617 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.38) 100%);
}

.lx-games-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(44px, 7vw, 84px) 0;
}

.lx-games-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: center;
    margin-bottom: clamp(28px, 5vw, 52px);
}

.lx-games-hero__copy {
    max-width: 820px;
}

.lx-games-eyebrow,
.lx-game-status {
    margin: 0 0 12px;
    color: var(--lx-games-accent);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.lx-games-hero h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(3.4rem, 9vw, 7.6rem);
    line-height: 0.88;
    letter-spacing: -0.085em;
    text-wrap: balance;
}

.lx-games-subtitle {
    max-width: 680px;
    margin: 26px 0 0;
    color: var(--lx-games-muted);
    font-size: clamp(1.1rem, 2vw, 1.42rem);
    line-height: 1.45;
}

.lx-games-hero__panel {
    position: relative;
    min-height: 340px;
    border: 1px solid var(--lx-games-panel-border);
    border-radius: 32px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent),
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.62));
    box-shadow:
        0 34px 100px var(--lx-games-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.lx-games-hero__panel::before {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 24px;
}

.lx-games-orbit {
    position: absolute;
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-radius: 999px;
    transform: rotate(-18deg);
}

.lx-games-orbit--one {
    width: 290px;
    height: 120px;
    top: 82px;
    right: -44px;
}

.lx-games-orbit--two {
    width: 240px;
    height: 240px;
    left: -72px;
    bottom: -88px;
    border-color: rgba(139, 92, 246, 0.26);
}

.lx-games-console {
    position: absolute;
    left: 32px;
    right: 32px;
    bottom: 34px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 0.7fr;
    gap: 12px;
}

.lx-games-console span {
    display: block;
    height: 54px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(56, 189, 248, 0.22), rgba(37, 99, 235, 0.08)),
        rgba(15, 23, 42, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lx-games-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.lx-game-card {
    position: relative;
    min-height: 324px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--lx-games-panel-border);
    border-radius: 28px;
    background:
        radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.12), transparent 16rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
        var(--lx-games-panel);
    box-shadow:
        0 24px 80px var(--lx-games-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    overflow: hidden;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        background 180ms ease;
}

.lx-game-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -35% -20%;
    height: 52%;
    background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.16), transparent 70%);
    pointer-events: none;
}

.lx-games-ready .lx-game-card:hover {
    transform: translateY(-5px);
    border-color: var(--lx-games-panel-border-strong);
    box-shadow:
        0 34px 95px rgba(0, 0, 0, 0.52),
        0 0 0 1px rgba(56, 189, 248, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lx-game-card--playable {
    border-color: rgba(34, 197, 94, 0.34);
    background:
        radial-gradient(circle at 0% 0%, rgba(34, 197, 94, 0.16), transparent 16rem),
        radial-gradient(circle at 100% 10%, rgba(56, 189, 248, 0.16), transparent 14rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent),
        var(--lx-games-panel-strong);
}

.lx-game-card__top {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.lx-game-status {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    margin: 0;
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 999px;
    background: rgba(8, 47, 73, 0.48);
    color: #bae6fd;
    letter-spacing: 0.12em;
}

.lx-game-card--playable .lx-game-status {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(20, 83, 45, 0.48);
    color: #bbf7d0;
}

.lx-game-card__glyph {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(37, 99, 235, 0.65)),
        #0f172a;
    box-shadow: 0 12px 34px rgba(37, 99, 235, 0.34);
}

.lx-game-card[data-game="lexibattle"] .lx-game-card__glyph {
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(56, 189, 248, 0.72)),
        #0f172a;
}

.lx-game-card[data-game="wordforge"] .lx-game-card__glyph {
    background:
        linear-gradient(135deg, rgba(96, 165, 250, 0.95), rgba(139, 92, 246, 0.72)),
        #0f172a;
}

.lx-game-card[data-game="sentence-solitaire"] .lx-game-card__glyph {
    background:
        linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(249, 115, 22, 0.68)),
        #0f172a;
}

.lx-game-card[data-game="script-hero"] .lx-game-card__glyph {
    background:
        linear-gradient(135deg, rgba(45, 212, 191, 0.95), rgba(14, 165, 233, 0.7)),
        #0f172a;
}

.lx-game-card__body {
    position: relative;
    z-index: 1;
}

.lx-game-card h2 {
    margin: 0;
    font-size: clamp(1.7rem, 2.6vw, 2.25rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
    text-wrap: balance;
}

.lx-game-card p:not(.lx-game-status) {
    max-width: 22rem;
    margin: 16px 0 0;
    color: var(--lx-games-muted);
    line-height: 1.45;
}

.lx-game-card__action {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 999px;
    color: #04111d;
    background: linear-gradient(180deg, #e0f2fe, #38bdf8);
    box-shadow: 0 14px 34px rgba(56, 189, 248, 0.24);
    font-weight: 900;
    text-decoration: none;
}

.lx-game-card__action:hover,
.lx-game-card__action:focus {
    filter: brightness(1.06);
    outline: none;
}

.lx-game-card__action:focus-visible {
    box-shadow:
        0 0 0 4px rgba(56, 189, 248, 0.26),
        0 14px 34px rgba(56, 189, 248, 0.24);
}

.lx-game-card__action--muted {
    color: var(--lx-games-muted);
    background: rgba(15, 23, 42, 0.76);
    box-shadow: none;
}

@media (max-width: 1080px) {
    .lx-games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .lx-games-hero {
        grid-template-columns: 1fr;
    }

    .lx-games-hero__panel {
        min-height: 220px;
    }
}

@media (max-width: 560px) {
    .lx-games-shell {
        width: min(100% - 24px, 1180px);
        padding: 38px 0;
    }

    .lx-games-grid {
        grid-template-columns: 1fr;
    }

    .lx-game-card {
        min-height: 280px;
        padding: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lx-game-card {
        transition: none;
    }

    .lx-games-ready .lx-game-card:hover {
        transform: none;
    }
}
