:root {
    --color-primary: #8e44ad;
    --color-secondary: #9b59b6;
    --color-accent: #e91e63;
    --color-bg: #faf8fd;
    --color-ink: #2a1833;
    --color-muted: #5c4a66;
    --color-line: #e4d7ee;
    --color-deep: #4a235a;
    --color-header: #faf8fd;
    --tgs-header-h: 76px;
    --tgs-page-w: 1120px;
    --font-head: "Red Hat Display", "Helvetica Neue", sans-serif;
    --font-body: "Red Hat Text", Georgia, serif;
}

@media (max-width: 1100px) {
    :root { --tgs-header-h: 64px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: var(--tgs-header-h); }

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.65;
    padding-top: var(--tgs-header-h);
    overflow-x: hidden;
}

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

a { color: var(--color-primary); }

a:visited { color: var(--color-deep); }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.2;
    font-weight: 700;
    color: var(--color-deep);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin: 0 0 0.6rem; }

h2 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); margin: 0 0 0.8rem; }

p { margin: 0 0 0.9rem; }

[hidden] { display: none !important; }

.tgs-wrap {
    max-width: var(--tgs-page-w);
    margin: 0 auto;
    padding: 0 20px;
}

.tgs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    min-height: var(--tgs-header-h);
    background: var(--color-header);
    border-bottom: 1px solid var(--color-line);
}

.tgs-header--row {
    min-height: var(--tgs-header-h);
    display: flex;
    align-items: center;
    gap: 18px;
}

.tgs-header--logo { flex: 0 0 auto; }

.tgs-header--logo img {
    width: 180px;
    height: auto;
    display: block;
}

.tgs-header--nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    flex-wrap: nowrap;
}

.tgs-header--nav a {
    color: var(--color-deep);
    text-decoration: none;
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
}

.tgs-header--nav a:visited { color: var(--color-deep); }

.tgs-header a.tgs-btn,
.tgs-header a.tgs-btn:visited { color: var(--color-primary); }

.tgs-header--burger,
.tgs-overlay,
.tgs-drawer { display: none; }

.tgs-btn {
    position: relative;
    display: inline-block;
    padding: 0.35rem 0;
    background: transparent;
    border: 0;
    color: var(--color-primary);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
}

.tgs-btn::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.25s ease;
}

.tgs-btn:hover::after,
.tgs-btn:focus-visible::after { width: 100%; }

.tgs-btn--primary { color: var(--color-deep); }

a.tgs-btn:visited,
a.tgs-btn--primary:visited { color: var(--color-deep); }

.tgs-hero {
    background: var(--color-deep);
    color: #fff;
    padding: 48px 0 40px;
}

.tgs-hero h1,
.tgs-hero p { color: #fff; }

.tgs-hero a.tgs-btn,
.tgs-hero a.tgs-btn:visited,
.tgs-hero a.tgs-btn--primary,
.tgs-hero a.tgs-btn--primary:visited { color: #fff; }

.tgs-hero--actions { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 8px; }

.tgs-hero--grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 28px;
    align-items: center;
}

.tgs-hero--figures {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 18px 0;
}

.tgs-hero--figure {
    border-top: 2px solid #e91e63;
    padding-top: 8px;
}

.tgs-hero--figure strong {
    display: block;
    font-family: var(--font-head);
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.1;
}

.tgs-hero--figure span { display: block; font-size: 0.86rem; color: #f3e6f8; }

.tgs-hero--still {
    border-radius: 24px 4px 24px 4px;
    overflow: hidden;
    background: #2a1833;
}

.tgs-hero--still img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    margin: 0 auto;
}

.tgs-strip {
    background: #fff;
    border-bottom: 1px solid var(--color-line);
    font-size: 0.92rem;
    color: var(--color-muted);
}

.tgs-strip p { margin: 0; padding: 8px 0; }

.tgs-section { padding: 42px 0; }

.tgs-tabs--list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.tgs-tabs--list button {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--color-deep);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    padding: 8px 0;
    cursor: pointer;
}

.tgs-tabs--list button[aria-selected="true"] { border-bottom-color: var(--color-accent); }

.tgs-card {
    background: transparent;
    border: 1.5px solid var(--color-line);
    border-radius: 24px 4px 24px 4px;
    padding: 18px;
}

.tgs-rank { display: grid; gap: 18px; }

.tgs-rank--item {
    display: grid;
    grid-template-columns: 96px 1fr;
    grid-template-areas:
        "pos pos"
        "icon name"
        "icon dev"
        "desc desc"
        "facts facts"
        "still still"
        "actions actions";
    gap: 8px 16px;
    align-items: start;
    background: #fff;
    border: 1.5px solid var(--color-line);
    border-radius: 24px 4px 24px 4px;
    padding: 18px;
}

.tgs-rank--item .tgs-rank--pos { grid-area: pos; margin: 0; font-family: var(--font-head); letter-spacing: 0.08em; color: var(--color-accent); font-weight: 700; }
.tgs-rank--item .tgs-app--icon { grid-area: icon; width: 96px; height: 96px; border-radius: 22%; object-fit: cover; }
.tgs-rank--item .tgs-rank--name { grid-area: name; margin: 0; align-self: end; }
.tgs-rank--item .tgs-rank--dev { grid-area: dev; margin: 0; color: var(--color-muted); }
.tgs-rank--item .tgs-rank--desc { grid-area: desc; margin: 0; }
.tgs-rank--item .tgs-rank--facts { grid-area: facts; margin: 0; color: var(--color-muted); }
.tgs-rank--item .tgs-app--preview { grid-area: still; width: 100%; max-height: 460px; object-fit: contain; background: #f4eef8; border-radius: 12px; }
.tgs-rank--item .tgs-rank--actions { grid-area: actions; display: flex; gap: 20px; flex-wrap: wrap; }

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

.tgs-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    font-size: 0.95rem;
}

.tgs-table th,
.tgs-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-line);
    vertical-align: top;
}

.tgs-table th { font-family: var(--font-head); color: var(--color-deep); }

.tgs-bars { display: grid; gap: 14px; }

.tgs-bars--row { display: grid; grid-template-columns: 9rem 1fr 4rem; gap: 10px; align-items: center; }

.tgs-bars--track { background: #efe6f5; height: 12px; border-radius: 24px 4px 24px 4px; }

.tgs-bars--fill { display: block; height: 12px; background: var(--color-primary); border-radius: 24px 4px 24px 4px; }

.tgs-faq details {
    border-bottom: 1px solid var(--color-line);
    padding: 10px 0;
}

.tgs-faq summary {
    cursor: pointer;
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--color-deep);
}

.tgs-cta {
    background: #fff;
    border-top: 1px solid var(--color-line);
}

.tgs-prose { max-width: 760px; }

.tgs-prose--wide { max-width: var(--tgs-page-w); }

.tgs-article {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.tgs-crumbs { font-size: 0.88rem; color: var(--color-muted); margin: 0 0 18px; }

.tgs-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 8px 0 0; padding: 0; }

.tgs-crumbs li::before { content: "/"; margin-right: 6px; color: var(--color-secondary); }

.tgs-crumbs li:first-child::before { content: ""; margin: 0; }

.tgs-note {
    background: #fff;
    border: 1.5px solid var(--color-line);
    border-radius: 24px 4px 24px 4px;
    padding: 16px 18px;
}

.tgs-tips { padding-left: 1.2rem; }

.tgs-tips li { margin: 0 0 0.8rem; }

.tgs-footer {
    background: var(--color-deep);
    color: #f6eef9;
    padding: 36px 0 28px;
}

.tgs-footer a,
.tgs-footer a:visited { color: #fff; }

.tgs-footer--grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 28px;
}

.tgs-footer h2 { color: #fff; font-size: 1.15rem; }

.tgs-footer details { margin: 0 0 8px; }

.tgs-footer summary { cursor: pointer; font-weight: 700; }

.tgs-footer--links { display: flex; flex-direction: column; gap: 8px; }

.tgs-footer--legal { margin-top: 22px; font-size: 0.88rem; color: #eadff0; }

.tgs-footer--legal a,
.tgs-footer--legal a:visited { color: #fff; }

.tgs-cookie {
    z-index: 110;
    left: 0;
    right: 0;
    bottom: 0;
    background: #2a1833;
    color: #fff;
    padding: 14px 0;
}

.tgs-cookie:not([hidden]) {
    display: block;
    position: fixed;
}

.tgs-cookie p { margin: 0; color: #fff; }

.tgs-cookie--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tgs-cookie a.tgs-btn,
.tgs-cookie a.tgs-btn:visited,
.tgs-cookie button.tgs-btn { color: #fff; }

body.tgs-cookie-open { padding-bottom: 88px; }

.tgs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 8, 28, 0.45);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
}

.tgs-drawer {
    position: fixed;
    z-index: 210;
    background: var(--color-header);
    visibility: hidden;
    overflow: auto;
}

.tgs-drawer a { display: block; padding: 14px 20px; color: var(--color-deep); text-decoration: none; font-family: var(--font-head); font-weight: 700; }

.tgs-drawer--close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-deep);
}

.tgs-drawer--top {
    top: var(--tgs-header-h);
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--tgs-header-h));
    padding: 52px 0 16px;
    transform: translateY(-16px);
    opacity: 0;
}

body.tgs-nav-open { overflow: hidden; }

body.tgs-nav-open .tgs-overlay { opacity: 1; visibility: visible; }

body.tgs-nav-open .tgs-drawer--top { visibility: visible; transform: translateY(0); opacity: 1; }

.tgs-is-in { animation: tgs-k-tilt 0.5s ease both; }

@keyframes tgs-k-tilt {
    from { opacity: 0; transform: rotate(-1.2deg) translateY(10px); }
}

@media (max-width: 1100px) {
    .tgs-header--nav { display: none; }

    .tgs-header--logo img { width: 120px; }

    .tgs-header--burger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-left: auto;
        border: 0;
        background: transparent;
        cursor: pointer;
        padding: 0;
    }

    .tgs-header--bars,
    .tgs-header--bars::before,
    .tgs-header--bars::after {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--color-deep);
        content: "";
    }

    .tgs-header--bars { position: relative; }

    .tgs-header--bars::before,
    .tgs-header--bars::after {
        position: absolute;
        left: 0;
    }

    .tgs-header--bars::before { top: -7px; }

    .tgs-header--bars::after { top: 7px; }

    .tgs-overlay { display: block; }

    .tgs-drawer { display: block; }

    .tgs-hero--grid,
    .tgs-hero--figures,
    .tgs-footer--grid,
    .tgs-bars--row { grid-template-columns: 1fr; }

    .tgs-hero--actions .tgs-btn { display: block; width: 100%; }
}

@media (max-width: 640px) {
    .tgs-rank--item {
        grid-template-columns: 72px 1fr;
    }

    .tgs-rank--item .tgs-app--icon { width: 72px; height: 72px; }

    .tgs-cookie--row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .tgs-is-in { animation: none; }
    .tgs-btn::after { transition: none; }
}
