/**
 * modindir.tr visual refinement layer
 * Loaded after the legacy inline styles so existing behavior can stay intact.
 * Revision: narrow-screen footer overflow guard.
 */

.site-shell {
    --accent: #55e6c3;
    --accent-glow: rgba(85, 230, 195, 0.2);
    --ref-bg: #07090d;
    --ref-surface: #0d1219;
    --ref-surface-raised: #111821;
    --ref-border: rgba(255, 255, 255, 0.09);
    --ref-border-strong: rgba(255, 255, 255, 0.16);
    --ref-text: #f4f6f2;
    --ref-muted: #929b9a;
    background:
        radial-gradient(circle at 72% 8%, rgba(85, 230, 195, 0.055), transparent 28rem),
        var(--ref-bg) !important;
    color: var(--ref-muted);
}

.site-shell.noise::before {
    position: fixed;
    opacity: 0.012;
}

.site-shell .glass-card {
    background: rgba(13, 18, 25, 0.96);
    border-color: var(--ref-border);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.site-shell .glass-light {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.075);
}

.site-shell .btn {
    min-height: 44px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.site-shell .btn-primary {
    color: #07120f;
    background: var(--accent);
    box-shadow: none;
}

.site-shell .btn-primary:hover:not(:disabled) {
    color: #07120f;
    background: #72edcf;
    box-shadow: 0 12px 30px rgba(85, 230, 195, 0.16);
    transform: translateY(-1px);
}

.site-shell .btn-secondary {
    color: var(--ref-text);
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--ref-border-strong);
}

.site-shell .btn-secondary:hover:not(:disabled) {
    color: var(--ref-text);
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(255, 255, 255, 0.25);
}

.site-shell :is(a, button, input, select, textarea):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Header */
.site-nav {
    background: rgba(7, 9, 13, 0.9) !important;
    border-color: var(--ref-border) !important;
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025);
}

.site-brand {
    color: var(--ref-text);
    text-decoration: none;
}

.site-brand__mark {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: #07120f;
    background: var(--accent);
    font-family: "JetBrains Mono", monospace;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(85, 230, 195, 0.15);
    transition: transform 180ms ease, background-color 180ms ease;
}

.site-brand:hover .site-brand__mark {
    background: #72edcf;
    transform: translateY(-1px);
}

.site-brand__copy {
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    line-height: 1;
}

.site-brand__wordmark {
    color: var(--ref-text);
    font-family: "JetBrains Mono", monospace;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.045em;
}

.site-brand__wordmark span:last-child {
    color: var(--accent);
}

.site-brand__role {
    color: rgba(244, 246, 242, 0.44);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.site-nav__search input {
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.site-nav__search input:focus {
    background: rgba(255, 255, 255, 0.055) !important;
    border-color: rgba(85, 230, 195, 0.7) !important;
}

.site-nav__search button[type="submit"] {
    color: #07120f !important;
    background: var(--accent) !important;
}

/* Home hero */
.home-hero {
    position: relative;
    isolation: isolate;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.home-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -14rem;
    right: -11rem;
    width: 42rem;
    height: 42rem;
    border-radius: 50%;
    background: rgba(85, 230, 195, 0.045);
    filter: blur(90px);
    pointer-events: none;
}

.home-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(500px, 1.08fr);
    align-items: center;
    gap: clamp(42px, 5vw, 84px);
    width: 100%;
    max-width: 1440px;
    min-height: 675px;
    margin: 0 auto;
    padding: 76px 32px 62px;
}

.home-hero__inner--solo {
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
    min-height: 590px;
}

.home-hero__inner--solo .home-hero__copy {
    text-align: center;
}

.home-hero__inner--solo .home-hero__description {
    margin-inline: auto;
}

.home-hero__inner--solo .home-hero__actions {
    justify-content: center;
}

.home-hero__title {
    max-width: 740px;
    margin: 0;
    color: var(--ref-text);
    font-size: clamp(3.5rem, 5.25vw, 5.25rem);
    font-weight: 900;
    letter-spacing: -0.068em;
    line-height: 0.98;
    text-wrap: balance;
}

.home-hero__title span {
    color: var(--accent);
}

.home-hero__description {
    max-width: 610px;
    margin: 26px 0 0;
    color: rgba(244, 246, 242, 0.62);
    font-size: clamp(1rem, 1.35vw, 1.18rem);
    line-height: 1.68;
}

.home-hero__search {
    display: flex;
    width: 100%;
    max-width: 650px;
    gap: 10px;
    margin-top: 34px;
}

.home-hero__search-field {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 12px;
    height: 58px;
    padding: 0 18px;
    color: rgba(244, 246, 242, 0.36);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 13px;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.home-hero__search-field:focus-within {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(85, 230, 195, 0.75);
}

.home-hero__search-field input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    color: var(--ref-text);
    background: transparent;
    border: 0;
    outline: 0;
}

.home-hero__search-field input::placeholder {
    color: rgba(244, 246, 242, 0.34);
}

.home-hero__search-button {
    min-width: 116px;
    height: 58px;
    padding-inline: 24px !important;
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.home-hero__primary-action,
.home-hero__secondary-action {
    min-height: 48px !important;
    padding-inline: 20px !important;
}

.home-hero__text-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 8px;
    color: rgba(244, 246, 242, 0.62);
    background: transparent;
    border: 0;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: color 180ms ease;
}

.home-hero__text-action:hover {
    color: var(--accent);
}

.home-hero__visual {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    height: clamp(500px, 41vw, 585px);
    max-height: 585px;
}

.home-hero__media-card {
    position: relative;
    display: block;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    background: var(--ref-surface-raised);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
    isolation: isolate;
}

.home-hero__media-card--1 {
    grid-row: 1 / 3;
}

.home-hero__media-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 650ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 300ms ease;
}

.home-hero__media-card:hover img {
    filter: saturate(1.08);
    transform: scale(1.035);
}

.home-hero__media-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, transparent 36%, rgba(5, 7, 10, 0.22) 56%, rgba(5, 7, 10, 0.96) 100%);
}

.home-hero__media-meta {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 22px;
    color: rgba(244, 246, 242, 0.58);
    font-size: 12px;
}

.home-hero__media-meta strong {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ref-text);
    font-size: clamp(15px, 1.25vw, 21px);
    line-height: 1.22;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-hero__media-game {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Home stats and sections */
.home-stats {
    position: relative;
    background: rgba(255, 255, 255, 0.018);
}

.home-stats__inner,
.home-section__inner {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-inline: 32px;
}

.home-stats__inner {
    padding-block: 22px;
}

.home-stats__grid {
    gap: 0 !important;
}

.home-stats__grid > div {
    padding: 4px 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.home-stats__grid > div:last-child {
    border-right: 0;
}

.home-stats__grid > div > div:first-child {
    margin-bottom: 3px !important;
    color: var(--ref-text) !important;
    font-size: clamp(1.3rem, 2.1vw, 1.8rem) !important;
    letter-spacing: -0.05em;
}

.home-stats__grid > div > div:last-child {
    color: rgba(244, 246, 242, 0.4) !important;
    font-size: 11px !important;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-section {
    padding: 72px 0;
}

.home-section + .home-section {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.home-section__header {
    gap: 24px;
    margin-bottom: 28px;
}

.home-section__header h2 {
    margin-bottom: 6px !important;
    color: var(--ref-text) !important;
    font-size: clamp(1.65rem, 2.6vw, 2.3rem) !important;
    letter-spacing: -0.045em;
}

.home-section__header p {
    color: rgba(244, 246, 242, 0.43) !important;
    font-size: 14px;
}

.home-section__header > div.flex > div:first-child {
    width: 42px !important;
    height: 42px !important;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 13px !important;
    box-shadow: none !important;
}

.home-game-rail {
    display: grid;
    grid-auto-columns: minmax(270px, 330px);
    grid-auto-flow: column;
    gap: 14px;
    overflow-x: auto;
    padding: 2px 2px 12px;
    scroll-snap-type: x proximity;
}

.home-game-card {
    position: relative;
    display: block;
    height: 190px;
    overflow: hidden;
    border: 1px solid var(--ref-border);
    border-radius: 18px;
    background: var(--ref-surface-raised);
    scroll-snap-align: start;
    isolation: isolate;
    transition: border-color 200ms ease, transform 200ms ease;
}

.home-game-card:hover {
    border-color: rgba(85, 230, 195, 0.5);
    transform: translateY(-3px);
}

.home-game-card > img,
.home-game-card__fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 550ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.home-game-card:hover > img {
    transform: scale(1.035);
}

.home-game-card__fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.88);
    font-family: "JetBrains Mono", monospace;
    font-size: 44px;
    font-weight: 900;
}

.home-game-card__shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(5, 7, 10, 0.02) 24%, rgba(5, 7, 10, 0.92) 100%);
}

.home-game-card__content {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 18px;
}

.home-game-card__content strong {
    color: var(--ref-text);
    font-size: 17px;
}

.home-game-card__content span {
    color: rgba(244, 246, 242, 0.52);
    font-size: 12px;
}

.home-mod-grid {
    display: grid;
    gap: 16px;
}

.home-mod-grid--landscape {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Mod cards: semantic refinements while keeping every existing action intact. */
.mod-card {
    border-radius: 18px !important;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.mod-card:hover {
    border-color: rgba(85, 230, 195, 0.34) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26) !important;
    transform: translateY(-3px);
}

.mod-card--landscape {
    display: grid !important;
    grid-template-columns: minmax(190px, 0.9fr) minmax(0, 1.1fr);
    min-height: 250px;
}

.mod-card--landscape .mod-card__media {
    width: 100%;
    height: 100% !important;
    min-height: 250px;
}

.mod-card--landscape .mod-card__media > img {
    transform: none;
}

.mod-card--landscape:hover .mod-card__media > img {
    transform: scale(1.035);
}

.mod-card--landscape .mod-card__content {
    min-width: 0;
    padding: 20px !important;
}

.mod-card--landscape .mod-card__title {
    font-family: "Inter", system-ui, sans-serif;
    font-size: 18px !important;
    letter-spacing: -0.025em;
}

.mod-card--landscape .mod-card__description {
    font-size: 12px !important;
}

.mod-card--landscape .mod-card__quick-actions {
    top: 12px;
    right: auto;
    left: 12px;
}

.mod-card__footer button {
    color: #07120f !important;
    background: var(--accent) !important;
    box-shadow: none !important;
}

/* Footer */
.site-footer {
    background: #080b10;
    border-color: var(--ref-border) !important;
}

.site-footer > .hero-gradient {
    opacity: 0.12 !important;
}

.site-brand__mark--footer {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 13px;
    font-size: 19px;
}

.site-footer__brand {
    width: fit-content;
}

@media (max-width: 1180px) {
    .home-hero__inner {
        grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr);
        gap: 38px;
        padding-top: 62px;
    }

    .home-hero__title {
        font-size: clamp(3.25rem, 5.4vw, 4.35rem);
    }

    .home-hero__visual {
        height: 500px;
    }

    .mod-card--landscape {
        grid-template-columns: minmax(170px, 0.82fr) minmax(0, 1.18fr);
    }
}

@media (max-width: 960px) {
    .home-hero__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 44px;
        padding-top: 64px;
    }

    .home-hero__copy {
        max-width: 760px;
    }

    .home-hero__title {
        font-size: clamp(3.45rem, 8.4vw, 5rem);
    }

    .home-hero__visual {
        height: min(620px, 72vw);
        max-height: 620px;
    }

    .home-mod-grid--landscape {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .site-shell {
        background:
            radial-gradient(circle at 80% 3%, rgba(85, 230, 195, 0.05), transparent 19rem),
            var(--ref-bg) !important;
    }

    .site-nav > div {
        padding-inline: 14px !important;
    }

    .site-brand__copy.hidden {
        display: flex !important;
    }

    .site-brand__wordmark {
        font-size: 15px;
    }

    .site-brand__role {
        display: none;
    }

    .home-hero__inner {
        min-height: auto;
        gap: 34px;
        padding: 50px 20px 38px;
    }

    .home-hero__title {
        font-size: clamp(2.75rem, 13vw, 4rem);
        letter-spacing: -0.062em;
        line-height: 0.99;
    }

    .home-hero__description {
        margin-top: 20px;
        font-size: 15px;
        line-height: 1.62;
    }

    .home-hero__search {
        margin-top: 27px;
    }

    .home-hero__search-field,
    .home-hero__search-button {
        height: 54px;
    }

    .home-hero__search-button {
        min-width: 100px;
        padding-inline: 17px !important;
    }

    .home-hero__actions {
        margin-top: 14px;
    }

    .home-hero__visual {
        height: 410px;
        gap: 9px;
    }

    .home-hero__media-card {
        border-radius: 16px;
    }

    .home-hero__media-meta {
        gap: 3px;
        padding: 14px;
        font-size: 10px;
    }

    .home-hero__media-meta strong {
        font-size: 14px;
    }

    .home-hero__media-game {
        font-size: 8px;
    }

    .home-stats__inner,
    .home-section__inner {
        padding-inline: 20px;
    }

    .home-stats__inner {
        overflow-x: auto;
        padding-block: 17px;
    }

    .home-stats__grid {
        grid-template-columns: repeat(5, minmax(94px, 1fr)) !important;
        min-width: 520px;
    }

    .home-stats__grid > div {
        padding-inline: 10px;
    }

    .home-section {
        padding-block: 54px;
    }

    .home-section__header {
        margin-bottom: 22px;
    }

    .home-section__header h2 {
        font-size: 1.65rem !important;
    }

    .home-section__header > div.flex > div:first-child {
        display: none;
    }

    .home-game-rail {
        grid-auto-columns: minmax(235px, 78vw);
    }

    .home-game-card {
        height: 168px;
    }

    .mod-card--landscape {
        grid-template-columns: minmax(135px, 0.74fr) minmax(0, 1.26fr);
        min-height: 196px;
    }

    .mod-card--landscape .mod-card__media {
        min-height: 196px;
    }

    .mod-card--landscape .mod-card__content {
        padding: 15px !important;
    }

    .mod-card--landscape .mod-card__title {
        font-size: 16px !important;
    }

    .mod-card--landscape .mod-card__tags {
        display: none;
    }

    .mod-card--landscape .mod-card__description {
        margin-bottom: 10px !important;
        -webkit-line-clamp: 2;
    }

    .mod-card--landscape .mod-card__footer {
        gap: 8px;
        padding-top: 10px !important;
    }

    .mod-card--landscape .mod-card__footer > div span:nth-child(2) {
        display: none;
    }

    .mod-card--landscape .mod-card__footer button {
        padding: 7px 10px !important;
    }
}

@media (max-width: 520px) {
    .site-nav__actions {
        gap: 5px !important;
    }

    .site-footer form[onsubmit*="subscribeNewsletter"] {
        flex-direction: column;
    }

    .site-footer form[onsubmit*="subscribeNewsletter"] input,
    .site-footer form[onsubmit*="subscribeNewsletter"] button {
        width: 100%;
        min-width: 0;
    }

    .home-hero__inner {
        padding-top: 42px;
    }

    .home-hero__title {
        font-size: clamp(2.5rem, 11.7vw, 3rem);
    }

    .home-hero__search {
        flex-direction: row;
    }

    .home-hero__search-button {
        width: auto;
        min-width: 96px;
        padding-inline: 14px !important;
    }

    .home-hero__search-field {
        gap: 8px;
        padding-inline: 14px;
    }

    .home-hero__actions {
        align-items: stretch;
    }

    .home-hero__primary-action,
    .home-hero__secondary-action {
        flex: 1 1 calc(50% - 5px);
        padding-inline: 13px !important;
        font-size: 13px;
    }

    .home-hero__text-action {
        flex-basis: 100%;
        justify-content: center;
    }

    .home-hero__visual {
        grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
        height: 355px;
    }

    .home-hero__media-card--2 .home-hero__media-meta > span:last-child,
    .home-hero__media-card--3 .home-hero__media-meta > span:last-child {
        display: none;
    }

    .home-section__header p {
        max-width: 240px;
    }

    .mod-card--landscape {
        grid-template-columns: minmax(118px, 0.7fr) minmax(0, 1.3fr);
        min-height: 188px;
    }

    .mod-card--landscape .mod-card__media {
        min-height: 188px;
    }

    .mod-card--landscape .mod-card__content {
        padding: 13px !important;
    }

    .mod-card--landscape .mod-card__heading {
        margin-bottom: 8px !important;
    }

    .mod-card--landscape .mod-card__description {
        font-size: 11px !important;
        line-height: 1.45;
    }

    .mod-card--landscape .mod-card__footer > div {
        display: none;
    }

    .mod-card--landscape .mod-card__footer button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 360px) {
    .site-brand__copy.hidden {
        display: none !important;
    }

    .home-hero__search {
        flex-direction: column;
    }

    .home-hero__search-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-shell *,
    .site-shell *::before,
    .site-shell *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
