:root {
    --ink: #0a0710;
    --ink-soft: #171021;
    --surface: #f7f5fa;
    --surface-strong: #ffffff;
    --purple-950: #210061;
    --purple-900: #2f008f;
    --purple-800: #3b0aa5;
    --purple-700: #5420cf;
    --purple-600: #6c3bff;
    --purple-400: #a68aff;
    --lavender: #ded4ff;
    --brand-blue: #2a008a;
    --acid: #36a31b;
    --text: #16121e;
    --muted: #706a7c;
    --line: #e8e3ed;
    --success: #1fa36c;
    --danger: #d9495f;
    --shadow: 0 24px 70px rgba(27, 4, 68, 0.16);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;
    --content: min(1440px, calc(100vw - 80px));
    font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--surface);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--surface);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

body,
button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    border: 0;
}

button,
select {
    cursor: pointer;
}

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

[hidden] {
    display: none !important;
}

::selection {
    color: white;
    background: var(--purple-700);
}

:focus-visible {
    outline: 3px solid var(--acid);
    outline-offset: 3px;
}

.site-header {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    width: 100%;
    height: 88px;
    padding: 0 max(40px, calc((100vw - 1440px) / 2));
    color: white;
    background: var(--purple-900);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    transition: height 220ms ease, background 220ms ease, backdrop-filter 220ms ease;
}

.site-header.is-scrolled {
    height: 72px;
    background: rgba(47, 0, 143, 0.96);
    border-color: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(18px);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    width: max-content;
}

.brand-crop {
    position: relative;
    display: block;
    overflow: hidden;
    width: 178px;
    height: 47px;
    border-radius: 7px;
    background: var(--purple-900);
}

.brand-crop img {
    position: absolute;
    top: -64px;
    left: 0;
    width: 178px;
    max-width: none;
}

.brand-product {
    margin-left: 10px;
    padding: 5px 7px;
    color: var(--acid);
    border: 1px solid rgba(206, 255, 69, 0.42);
    border-radius: 6px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 38px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.site-nav a {
    position: relative;
    padding: 12px 0;
    opacity: 0.72;
    transition: opacity 160ms ease;
}

.site-nav a::after {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 0;
    height: 2px;
    content: "";
    background: var(--acid);
    transition: width 180ms ease;
}

.site-nav a:hover {
    opacity: 1;
}

.site-nav a:hover::after {
    width: 100%;
}

.header-cta {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 16px;
    padding: 11px 11px 11px 19px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
    transition: color 180ms ease, background 180ms ease;
}

.header-cta span {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    color: var(--ink);
    border-radius: 50%;
    background: var(--acid);
    font-size: 16px;
}

.header-cta:hover {
    color: var(--ink);
    background: white;
}

.hero {
    position: relative;
    display: grid;
    overflow: hidden;
    min-height: 230px;
    height: 230px;
    padding: 88px max(40px, calc((100vw - 1440px) / 2)) 0;
    color: white;
    background:
        radial-gradient(circle at 12% 4%, rgba(116, 57, 255, 0.32), transparent 34%),
        radial-gradient(circle at 86% 72%, rgba(89, 23, 210, 0.25), transparent 32%),
        linear-gradient(125deg, #08060e 5%, #140a25 48%, #1c083d 100%);
    isolation: isolate;
}

.hero::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    opacity: 0.16;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 88px 88px;
    mask-image: linear-gradient(to right, black, transparent 70%);
}

.hero::after {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 64px;
    content: "";
    background: linear-gradient(to bottom, transparent, rgba(10, 7, 16, 0.78) 58%, var(--surface) 60%);
    clip-path: polygon(0 0, 100% 34%, 100% 100%, 0 100%);
}

.hero-glow {
    position: absolute;
    z-index: -1;
    top: 18%;
    left: -15%;
    width: 660px;
    height: 660px;
    border-radius: 50%;
    opacity: 0.15;
    background: var(--purple-600);
    filter: blur(110px);
}

.hero-content {
    z-index: 4;
    align-self: center;
    max-width: 760px;
    padding-bottom: 72px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--purple-400);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.18em;
}

.eyebrow i {
    width: 20px;
    height: 2px;
    background: var(--acid);
}

.eyebrow--dark {
    color: var(--purple-700);
}

.hero h1 {
    max-width: 750px;
    margin: 22px 0 24px;
    font-size: clamp(56px, 6.2vw, 96px);
    font-weight: 780;
    letter-spacing: -0.065em;
    line-height: 0.93;
}

.hero h1 em {
    color: var(--acid);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
}

.hero-content > p {
    max-width: 590px;
    margin: 0 0 32px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 17px;
    line-height: 1.65;
}

.featured-game {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    width: max-content;
    max-width: 100%;
    margin-bottom: 30px;
    padding-left: 15px;
    border-left: 3px solid var(--acid);
}

.featured-label {
    grid-row: span 2;
    margin-right: 18px;
    color: rgba(255, 255, 255, 0.38);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.14em;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.featured-game strong {
    overflow: hidden;
    max-width: 470px;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.featured-game strong i {
    margin: 0 7px;
    color: var(--purple-400);
    font-style: normal;
}

.featured-game > span:last-child {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.46);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-actions,
.setup-actions {
    display: flex;
    align-items: center;
    gap: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 24px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    transition: transform 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button--light {
    gap: 12px;
    color: var(--ink);
    background: white;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.button--primary {
    color: white;
    background: linear-gradient(135deg, var(--purple-600), var(--purple-800));
    box-shadow: 0 12px 30px rgba(84, 32, 207, 0.24);
}

.button--primary:hover {
    box-shadow: 0 16px 38px rgba(84, 32, 207, 0.35);
}

.button--ghost {
    color: var(--purple-700);
    border: 1px solid var(--line);
    background: white;
}

.button--danger {
    color: var(--danger);
    border: 1px solid rgba(217, 73, 95, 0.22);
    background: rgba(217, 73, 95, 0.07);
}

.button--danger:hover {
    color: white;
    border-color: var(--danger);
    background: var(--danger);
}

.button--full {
    width: 100%;
}

.button--small {
    min-height: 38px;
    padding: 0 16px;
    font-size: 11px;
}

.play-icon {
    display: grid;
    width: 25px;
    height: 25px;
    padding-left: 2px;
    place-items: center;
    color: white;
    border-radius: 50%;
    background: var(--purple-700);
    font-size: 9px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 750;
}

.text-link span {
    color: var(--acid);
    font-size: 17px;
}

.hero-stats {
    position: absolute;
    z-index: 4;
    right: max(40px, calc((100vw - 1440px) / 2));
    top: 112px;
    bottom: auto;
    display: flex;
    gap: 52px;
}

.hero-stats div {
    display: grid;
}

.hero-stats strong {
    color: white;
    font-size: 31px;
    font-weight: 750;
    letter-spacing: -0.04em;
}

.hero-stats span {
    color: rgba(255, 255, 255, 0.42);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.scroll-cue {
    position: absolute;
    z-index: 4;
    bottom: 49px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.28);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.18em;
    transform: rotate(-90deg);
}

.scroll-cue span {
    width: 35px;
    height: 1px;
    background: rgba(255, 255, 255, 0.28);
}

.catalog-section {
    width: var(--content);
    margin: 0 auto;
    padding: 112px 0 60px;
}

.section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.55fr);
    gap: 80px;
    align-items: end;
    margin-bottom: 48px;
}

.section-heading h2 {
    max-width: 750px;
    margin: 14px 0 0;
    font-size: clamp(39px, 4.5vw, 68px);
    font-weight: 760;
    letter-spacing: -0.055em;
    line-height: 1;
}

.section-heading > p {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.catalog-tools {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 300px;
    gap: 14px;
    margin-bottom: 20px;
}

.search-box,
.client-filter {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 62px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-strong);
}

.search-box > span {
    position: relative;
    width: 18px;
    height: 18px;
    margin-left: 22px;
    border: 2px solid var(--purple-700);
    border-radius: 50%;
}

.search-box > span::after {
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 7px;
    height: 2px;
    content: "";
    background: var(--purple-700);
    transform: rotate(45deg);
}

.search-box input {
    width: 100%;
    height: 60px;
    padding: 0 20px;
    color: var(--text);
    outline: 0;
    background: transparent;
    font-size: 14px;
}

.search-box kbd {
    margin-right: 14px;
    padding: 6px 8px;
    color: #aaa3b3;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 7px;
    background: #faf9fb;
    font-family: inherit;
    font-size: 10px;
    white-space: nowrap;
}

.client-filter {
    display: grid;
    grid-template-columns: auto 1fr;
    padding: 0 16px 0 20px;
}

.client-filter > span {
    color: #aaa3b3;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.client-filter select {
    width: 100%;
    height: 60px;
    padding: 0 30px 0 16px;
    color: var(--text);
    outline: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
}

.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 16px;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex: 0 0 auto;
    padding: 10px 14px;
    color: #77717f;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    font-size: 11px;
    font-weight: 750;
}

.filter-chip b {
    margin-left: 5px;
    color: #b1abb8;
    font-size: 9px;
}

.filter-chip:hover,
.filter-chip.is-active {
    color: white;
    border-color: var(--purple-700);
    background: var(--purple-700);
}

.filter-chip.is-active b {
    color: var(--acid);
}

.catalog-row {
    margin: 0;
}

.row-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 18px;
}

.row-heading > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 13px;
}

.row-heading h3 {
    margin: 0;
    font-size: 23px;
    font-weight: 760;
    letter-spacing: -0.035em;
}

.row-heading span {
    color: #9a94a3;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.row-controls {
    display: flex;
    gap: 7px;
}

.row-controls button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--purple-700);
    border: 1px solid var(--line);
    border-radius: 50%;
    background: white;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.row-controls button:hover {
    color: white;
    background: var(--purple-700);
    transform: translateY(-2px);
}

.game-track {
    display: flex;
    align-items: start;
    gap: 17px;
    overflow-x: auto;
    padding: 8px 3px 28px;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-color: #d8d1df transparent;
    scrollbar-width: thin;
}

.game-card {
    flex: 0 0 auto;
    max-width: none;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: 0 9px 30px rgba(30, 16, 50, 0.05);
    scroll-snap-align: start;
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.game-card--portrait {
    width: 200px;
}

.game-card--landscape {
    width: 632px;
}

.game-card:hover {
    z-index: 2;
    box-shadow: 0 23px 60px rgba(40, 10, 83, 0.18);
    transform: translateY(-7px);
}

.game-card a {
    display: block;
    overflow: hidden;
    border-radius: inherit;
}

.game-card__visual {
    position: relative;
    overflow: hidden;
    height: 355.5px;
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,.22), transparent 18%),
        linear-gradient(135deg, var(--game-accent), #160527);
}

.game-card--portrait .game-card__visual {
    height: 355.5px;
}

.game-card__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(.2,.7,.2,1), filter 300ms ease;
}

.game-card:hover .game-card__visual img {
    filter: saturate(1.1);
    transform: scale(1.055);
}

.game-card__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(9, 5, 16, 0.68), transparent 52%);
}

.game-card__placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.76);
    font-size: 74px;
    font-weight: 850;
}

.game-card__open {
    position: absolute;
    top: 13px;
    right: 13px;
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    color: var(--ink);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.game-card:hover .game-card__open {
    opacity: 1;
    transform: none;
}

.game-card__type {
    position: absolute;
    bottom: 13px;
    left: 13px;
    max-width: calc(100% - 26px);
    overflow: hidden;
    padding: 7px 9px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 7px;
    background: rgba(15, 8, 25, 0.52);
    backdrop-filter: blur(10px);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.game-card__body {
    min-height: 127px;
    padding: 17px 18px 19px;
}

.game-card__client {
    display: block;
    overflow: hidden;
    margin-bottom: 6px;
    color: var(--purple-700);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.game-card h4 {
    overflow: hidden;
    margin: 0 0 15px;
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-card__meta {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #9a94a3;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.game-card__meta i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(31, 163, 108, 0.12);
}

.catalog-empty {
    padding: 80px 30px;
    text-align: center;
    border: 1px dashed #d8d0df;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.5);
}

.catalog-empty > span {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 17px;
    place-items: center;
    color: var(--purple-700);
    border-radius: 50%;
    background: var(--lavender);
    font-size: 22px;
    font-weight: 850;
}

.catalog-empty h3 {
    margin: 0 0 8px;
}

.catalog-empty p {
    margin: 0 0 22px;
    color: var(--muted);
}

.catalog-empty--static {
    margin-top: 30px;
}

.site-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 144px;
    padding: 30px max(40px, calc((100vw - 1440px) / 2));
    color: rgba(255, 255, 255, 0.5);
    background: var(--brand-blue);
    font-size: 11px;
}

.site-footer p {
    font-weight: 650;
}

.site-footer > span:last-child {
    justify-self: end;
}

.brand-link--footer .brand-crop {
    opacity: 0.85;
}

/* Setup */
.setup-page {
    min-height: 100vh;
    color: white;
    background:
        radial-gradient(circle at 10% 20%, rgba(108, 59, 255, 0.3), transparent 32%),
        linear-gradient(125deg, #090611, #18082f 70%, #2b0870);
}

.setup-shell {
    display: grid;
    grid-template-columns: minmax(340px, 0.8fr) minmax(560px, 1.2fr);
    width: min(1220px, calc(100% - 48px));
    min-height: 100vh;
    margin: 0 auto;
    align-items: center;
    gap: 90px;
    padding: 60px 0;
}

.setup-brand > img {
    width: 240px;
    margin: -82px 0 -56px -15px;
}

.setup-brand h1 {
    margin: 22px 0;
    font-size: clamp(43px, 5vw, 70px);
    font-weight: 760;
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.setup-brand > p {
    max-width: 520px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 15px;
    line-height: 1.65;
}

.setup-benefits {
    display: grid;
    gap: 15px;
    margin: 38px 0 0;
    padding: 0;
    list-style: none;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 700;
}

.setup-benefits li {
    display: flex;
    align-items: center;
    gap: 13px;
}

.setup-benefits span {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    color: var(--acid);
    border: 1px solid rgba(206,255,69,.25);
    border-radius: 50%;
    font-size: 8px;
}

.setup-card {
    padding: clamp(30px, 4vw, 54px);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.32);
}

.setup-card h2 {
    margin: 8px 0 7px;
    font-size: 31px;
    letter-spacing: -0.04em;
}

.step-label {
    color: var(--purple-700);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.form-intro {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 13px;
}

.setup-form {
    display: grid;
    gap: 24px;
}

.setup-form fieldset,
.admin-form fieldset {
    display: grid;
    gap: 15px;
    margin: 0;
    padding: 0;
    border: 0;
}

.setup-form legend,
.admin-form legend {
    width: 100%;
    margin-bottom: 12px;
    padding-bottom: 9px;
    color: #8f8898;
    border-bottom: 1px solid var(--line);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.form-grid--three {
    grid-template-columns: 1fr 0.6fr 1.2fr;
}

.setup-form label,
.admin-form label {
    display: grid;
    gap: 7px;
    color: #554f5d;
    font-size: 11px;
    font-weight: 750;
}

.setup-form label > span,
.admin-form label > span {
    display: flex;
    justify-content: space-between;
}

.setup-form label small,
.admin-form label small {
    color: #aaa3b3;
    font-size: 9px;
    font-weight: 600;
}

.setup-form input,
.admin-form input,
.admin-form select,
.admin-form textarea,
.login-form input,
.admin-search input {
    width: 100%;
    min-height: 47px;
    padding: 0 14px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: 0;
    background: #fbfafc;
    font-size: 13px;
    transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.setup-form input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.login-form input:focus,
.admin-search input:focus {
    border-color: var(--purple-600);
    background: white;
    box-shadow: 0 0 0 4px rgba(108, 59, 255, 0.1);
}

.admin-form textarea {
    min-height: 120px;
    padding-block: 12px;
    resize: vertical;
}

.privacy-note {
    margin: -12px 0 0;
    color: #aaa3b3;
    font-size: 9px;
    text-align: center;
}

.alert {
    padding: 14px 16px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.5;
}

.alert ul {
    margin: 5px 0 0;
    padding-left: 18px;
}

.alert--error {
    color: #a92b42;
    border: 1px solid rgba(217, 73, 95, 0.18);
    background: rgba(217, 73, 95, 0.08);
}

.alert--success {
    color: #14744d;
    border: 1px solid rgba(31, 163, 108, 0.2);
    background: rgba(31, 163, 108, 0.08);
}

.status-pill {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.status-pill--success {
    color: #14744d;
    background: rgba(31, 163, 108, 0.1);
}

.database-ready {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid rgba(31, 163, 108, 0.18);
    border-radius: 11px;
    background: rgba(31, 163, 108, 0.06);
}

.database-ready > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: white;
    border-radius: 50%;
    background: var(--success);
}

.database-ready div {
    display: grid;
}

.database-ready strong {
    font-size: 12px;
}

.database-ready small {
    margin-top: 2px;
    color: #77717f;
    font-size: 10px;
}

/* Admin */
.admin-body {
    min-height: 100vh;
    background: #f5f3f7;
}

.admin-layout {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 27px 18px 18px;
    color: white;
    background: var(--brand-blue);
}

.admin-sidebar .brand-link {
    margin: 0 auto 38px;
}

.admin-sidebar .brand-crop {
    width: 150px;
    height: 42px;
}

.admin-sidebar .brand-crop img {
    top: -55px;
    width: 150px;
}

.admin-nav-label {
    margin: 0 12px 9px;
    color: rgba(255, 255, 255, 0.28);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .16em;
}

.admin-nav {
    display: grid;
    gap: 5px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 13px;
    color: rgba(255, 255, 255, 0.58);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.admin-nav a span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    color: rgba(255,255,255,.8);
    border-radius: 7px;
    background: rgba(255,255,255,.06);
}

.admin-nav a:hover,
.admin-nav a.is-active {
    color: var(--brand-blue);
    background: white;
}

.admin-nav a:hover span,
.admin-nav a.is-active span {
    color: var(--brand-blue);
    background: rgba(42, 0, 138, .08);
}

.admin-sidebar-bottom {
    margin-top: auto;
}

.admin-user {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.admin-user__avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: white;
    border-radius: 9px;
    background: var(--acid);
    font-size: 12px;
    font-weight: 850;
}

.admin-user div {
    display: grid;
    min-width: 0;
}

.admin-user strong,
.admin-user small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user strong {
    font-size: 10px;
}

.admin-user small {
    margin-top: 2px;
    color: rgba(255,255,255,.35);
    font-size: 8px;
}

.logout-button {
    padding: 5px;
    color: rgba(255,255,255,.45);
    background: transparent;
}

.admin-main {
    min-width: 0;
    padding: 34px clamp(28px, 4.5vw, 68px) 60px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 35px;
}

.admin-topbar h1 {
    margin: 4px 0 0;
    font-size: 31px;
    letter-spacing: -.045em;
}

.admin-kicker {
    color: var(--purple-700);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.admin-topbar-actions {
    display: flex;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 28px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 136px;
    padding: 22px;
    border: 1px solid #ebe6ef;
    border-radius: 16px;
    background: white;
}

.stat-card::after {
    position: absolute;
    right: -24px;
    bottom: -42px;
    width: 100px;
    height: 100px;
    content: "";
    border-radius: 50%;
    opacity: .08;
    background: var(--purple-700);
}

.stat-card span {
    color: #938b9d;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    margin-top: 15px;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.04em;
}

.stat-card small {
    display: block;
    margin-top: 8px;
    color: #aaa3b3;
    font-size: 9px;
}

.admin-panel {
    overflow: hidden;
    border: 1px solid #e9e4ed;
    border-radius: 18px;
    background: white;
    box-shadow: 0 14px 45px rgba(37, 14, 55, .04);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -.025em;
}

.panel-heading p {
    margin: 4px 0 0;
    color: #948d9c;
    font-size: 10px;
}

.admin-search {
    position: relative;
    width: min(300px, 40vw);
}

.admin-search input {
    min-height: 40px;
    padding-left: 36px;
    font-size: 11px;
}

.admin-search::before {
    position: absolute;
    z-index: 1;
    top: 13px;
    left: 14px;
    width: 10px;
    height: 10px;
    content: "";
    border: 1.5px solid #8b8494;
    border-radius: 50%;
}

.admin-search::after {
    position: absolute;
    z-index: 1;
    top: 23px;
    left: 23px;
    width: 5px;
    height: 1.5px;
    content: "";
    background: #8b8494;
    transform: rotate(45deg);
}

.table-scroll {
    overflow-x: auto;
}

.games-table {
    width: 100%;
    border-collapse: collapse;
}

.games-table th {
    padding: 12px 15px;
    color: #9b94a3;
    background: #faf9fb;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .1em;
    text-align: left;
    text-transform: uppercase;
}

.games-table td {
    padding: 13px 15px;
    border-top: 1px solid #f0edf2;
    font-size: 11px;
    vertical-align: middle;
}

.game-cell {
    display: grid;
    grid-template-columns: 64px minmax(130px, 1fr);
    align-items: center;
    gap: 12px;
}

.game-cell__cover {
    position: relative;
    display: grid;
    overflow: hidden;
    width: 64px;
    aspect-ratio: 16 / 9;
    place-items: center;
    color: white;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--game-accent), #1a082b);
    font-weight: 850;
}

.game-cell__cover--portrait {
    width: 38px;
    aspect-ratio: 9 / 16;
    justify-self: center;
}

.game-cell__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-cell div:last-child {
    display: grid;
    gap: 4px;
}

.game-cell strong {
    overflow: hidden;
    max-width: 250px;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-cell small,
.table-muted {
    color: #9992a0;
    font-size: 9px;
}

.type-badge,
.version-badge {
    display: inline-flex;
    width: max-content;
    padding: 6px 8px;
    border-radius: 7px;
    font-size: 8px;
    font-weight: 800;
}

.type-badge {
    color: var(--purple-700);
    background: rgba(108, 59, 255, .08);
}

.version-badge {
    color: #5e5867;
    background: #f1eef3;
}

.cover-ratio-badge {
    display: inline-grid;
    gap: 2px;
    min-width: 72px;
    padding: 6px 8px;
    color: #5e5867;
    border-radius: 7px;
    background: #f1eef3;
    font-size: 9px;
    font-weight: 850;
}

.cover-ratio-badge small {
    color: #9b94a3;
    font-size: 7px;
    font-weight: 700;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    font-weight: 750;
}

.status-dot::before {
    width: 7px;
    height: 7px;
    content: "";
    border-radius: 50%;
    background: var(--danger);
}

.status-dot.is-active {
    color: #14744d;
}

.status-dot.is-active::before {
    background: var(--success);
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.icon-button {
    display: grid;
    width: 33px;
    height: 33px;
    place-items: center;
    color: #756e7e;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.icon-button:hover {
    color: white;
    border-color: var(--purple-700);
    background: var(--purple-700);
}

.flash-message {
    margin: -18px 0 24px;
}

.admin-form-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
}

.admin-form {
    display: grid;
    gap: 28px;
    padding: 28px;
}

.admin-form-side {
    display: grid;
    align-content: start;
    gap: 18px;
}

.side-card {
    padding: 20px;
    border: 1px solid #e9e4ed;
    border-radius: 16px;
    background: white;
}

.side-card h3 {
    margin: 0 0 6px;
    font-size: 13px;
}

.side-card > p {
    margin: 0 0 15px;
    color: #948d9c;
    font-size: 10px;
    line-height: 1.5;
}

.cover-format-options {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.cover-format-option {
    display: grid !important;
    grid-template-columns: auto 46px minmax(0, 1fr) !important;
    align-items: center;
    gap: 10px !important;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease;
}

.cover-format-option:has(input:checked) {
    border-color: var(--purple-700);
    background: rgba(108, 59, 255, .06);
}

.cover-format-option input {
    margin: 0;
    accent-color: var(--purple-700);
}

.cover-format-option > span:last-child {
    display: grid;
    gap: 2px;
}

.cover-format-option strong {
    font-size: 9px;
}

.cover-format-option small {
    color: #948d9c;
    font-size: 8px;
}

.cover-format-icon {
    display: block;
    justify-self: center;
    border: 2px solid var(--purple-700);
    border-radius: 4px;
    background: rgba(108, 59, 255, .12);
}

.cover-format-icon--landscape {
    width: 42px;
    aspect-ratio: 16 / 9;
}

.cover-format-icon--portrait {
    width: 22px;
    aspect-ratio: 9 / 16;
}

.cover-uploader {
    position: relative;
    display: grid;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    place-items: center;
    border: 1px dashed #cabfd5;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(108,59,255,.06), transparent),
        #faf9fb;
}

.cover-uploader[data-cover-format="portrait"] {
    width: 160px;
    aspect-ratio: 9 / 16;
    margin-inline: auto;
}

.cover-uploader img {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-uploader label {
    z-index: 2;
    display: grid;
    gap: 5px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
}

.cover-uploader.has-preview label {
    color: white;
    background: rgba(12, 7, 20, .65);
    backdrop-filter: blur(8px);
}

.cover-uploader input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.cover-uploader strong {
    font-size: 11px;
}

.cover-uploader small {
    color: #948d9c;
    font-size: 8px;
}

.cover-uploader.has-preview small {
    color: rgba(255,255,255,.7);
}

.cover-upload-status {
    min-height: 15px;
    margin: 9px 0 0 !important;
    color: #948d9c;
    text-align: center;
}

.cover-upload-status.is-error {
    color: var(--danger);
}

.cover-upload-status.is-success {
    color: var(--success);
}

.checkbox-card {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
    gap: 11px !important;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    cursor: pointer;
}

.checkbox-card input {
    flex: 0 0 auto;
    width: 17px !important;
    min-height: 17px !important;
    margin-top: 1px;
    accent-color: var(--purple-700);
}

.checkbox-card div {
    display: grid;
    gap: 3px;
}

.checkbox-card strong {
    font-size: 10px;
}

.checkbox-card small {
    color: #948d9c;
    font-size: 8px;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.form-actions > .button--danger:first-child {
    margin-right: auto;
}

.confirm-modal {
    width: min(470px, calc(100% - 32px));
    max-width: none;
    padding: 0;
    color: var(--text);
    border: 0;
    border-radius: 20px;
    background: white;
    box-shadow: 0 30px 90px rgba(15, 3, 38, .35);
}

.confirm-modal::backdrop {
    background: rgba(10, 4, 20, .7);
    backdrop-filter: blur(4px);
}

.confirm-modal__content {
    padding: 30px;
}

.confirm-modal__icon {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: 20px;
    place-items: center;
    color: white;
    border-radius: 12px;
    background: var(--danger);
    font-size: 20px;
    font-weight: 900;
}

.confirm-modal h2 {
    margin: 8px 0 10px;
    font-size: 25px;
    letter-spacing: -.035em;
}

.confirm-modal p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.confirm-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.color-input {
    grid-template-columns: 1fr !important;
}

.color-input input[type="color"] {
    min-height: 47px;
    padding: 5px;
}

/* Login */
.login-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, 0.85fr) minmax(480px, 1.15fr);
    background: white;
}

.login-visual {
    position: relative;
    display: grid;
    overflow: hidden;
    place-items: center;
    padding: 55px;
    color: white;
    background: var(--brand-blue);
}

.login-logo-link {
    position: relative;
    display: block;
    overflow: hidden;
    width: min(72%, 520px);
    aspect-ratio: 3.2 / 1;
}

.login-logo-link img {
    position: absolute;
    top: 50%;
    width: 100%;
    max-width: none;
    transform: translateY(-50%);
}

.user-editor {
    max-width: 900px;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
}

.user-cell__avatar {
    display: grid;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    place-items: center;
    color: white;
    border-radius: 9px;
    background: var(--brand-blue);
    font-size: 11px;
    font-weight: 850;
}

.user-cell strong {
    font-size: 11px;
}

.user-cell small {
    padding: 4px 6px;
    color: #247416;
    border-radius: 999px;
    background: rgba(54, 163, 27, .12);
    font-size: 7px;
    font-weight: 850;
    text-transform: uppercase;
}

.login-main {
    display: grid;
    place-items: center;
    padding: 45px;
}

.login-card {
    width: min(420px, 100%);
}

.login-card h2 {
    margin: 9px 0 8px;
    font-size: 34px;
    letter-spacing: -.045em;
}

.login-card > p {
    margin: 0 0 30px;
    color: var(--muted);
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 17px;
}

.login-form label {
    display: grid;
    gap: 7px;
    color: #554f5d;
    font-size: 11px;
    font-weight: 750;
}

.login-form input {
    min-height: 52px;
}

.login-help {
    margin-top: 23px;
    color: #aaa3b3;
    font-size: 9px;
    text-align: center;
}

@media (max-width: 1120px) {
    :root {
        --content: min(100% - 48px, 1060px);
    }

    .hero-stats {
        gap: 28px;
    }

    .setup-shell {
        grid-template-columns: .72fr 1.28fr;
        gap: 45px;
    }

    .admin-form-shell {
        grid-template-columns: 1fr 270px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 850px) {
    :root {
        --content: calc(100% - 32px);
    }

    .site-header {
        grid-template-columns: 1fr auto;
        height: 72px;
        padding-inline: 20px;
    }

    .site-nav {
        gap: 20px;
        font-size: 11px;
    }

    .hero {
        min-height: 210px;
        height: 210px;
        padding: 72px 24px 0;
    }

    .hero::before {
        mask-image: linear-gradient(to right, black, transparent 88%);
    }

    .hero-stats {
        right: 24px;
        top: 101px;
        bottom: auto;
        left: 24px;
        justify-content: space-between;
    }

    .scroll-cue {
        display: none;
    }

    .section-heading {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .catalog-tools {
        grid-template-columns: 1fr;
    }

    .site-footer {
        grid-template-columns: 1fr;
        gap: 18px;
        justify-items: center;
        text-align: center;
    }

    .site-footer > span:last-child,
    .site-footer .brand-link {
        justify-self: center;
    }

    .setup-shell {
        grid-template-columns: 1fr;
        width: min(700px, calc(100% - 30px));
        gap: 35px;
        padding: 45px 0;
    }

    .setup-brand {
        padding: 15px;
    }

    .setup-brand h1 {
        max-width: 630px;
    }

    .admin-layout {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .admin-sidebar {
        padding-inline: 12px;
    }

    .admin-sidebar .brand-crop {
        width: 48px;
        height: 48px;
    }

    .admin-sidebar .brand-crop img {
        top: 0;
        width: 48px;
    }

    .admin-sidebar .brand-product,
    .admin-nav-label,
    .admin-nav .nav-text,
    .admin-user div,
    .logout-button {
        display: none;
    }

    .admin-nav a {
        justify-content: center;
        padding: 0;
    }

    .admin-user {
        grid-template-columns: 1fr;
        padding-inline: 8px;
    }

    .admin-user__avatar {
        margin: auto;
    }

    .admin-form-shell {
        grid-template-columns: 1fr;
    }

    .login-page {
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 300px;
        padding: 34px;
    }

    .login-visual h1 {
        font-size: 48px;
    }
}

@media (max-width: 580px) {
    .brand-crop {
        width: 145px;
        height: 42px;
    }

    .brand-crop img {
        top: -53px;
        width: 145px;
    }

    .brand-product {
        display: none;
    }

    .hero {
        min-height: 190px;
        height: 190px;
        padding-inline: 19px;
    }

    .site-nav {
        gap: 14px;
        font-size: 10px;
    }

    .hero-stats {
        top: 94px;
        gap: 12px;
    }

    .hero-stats strong {
        font-size: 24px;
    }

    .hero-stats span {
        font-size: 7px;
    }

    .catalog-section {
        padding-top: 78px;
    }

    .section-heading h2 {
        font-size: 41px;
    }

    .row-controls {
        display: none;
    }

    .row-heading > div:first-child {
        display: grid;
        gap: 4px;
    }

    .form-grid,
    .form-grid--three {
        grid-template-columns: 1fr;
    }

    .setup-card {
        padding: 26px 20px;
    }

    .setup-brand h1 {
        font-size: 45px;
    }

    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        position: static;
        display: grid;
        grid-template-columns: auto 1fr;
        height: auto;
        padding: 12px 15px;
    }

    .admin-sidebar .brand-link {
        margin: 0 15px 0 0;
    }

    .admin-nav {
        display: flex;
    }

    .admin-nav a {
        flex: 1;
    }

    .admin-sidebar-bottom {
        display: none;
    }

    .admin-main {
        padding: 24px 15px 45px;
    }

    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .admin-topbar-actions {
        width: 100%;
    }

    .admin-topbar-actions .button {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .stat-card {
        min-height: 118px;
        padding: 17px;
    }

    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-search {
        width: 100%;
    }

    .admin-form {
        padding: 20px;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .login-main {
        padding: 38px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
