/* ---------------------------------------------------------------------------
   Drangoht Games — feuille de style unique.
   Pas de framework : la surface est petite, et une dépendance CSS externe
   coûterait plus en poids et en maintenance qu'elle ne rapporterait ici.
   --------------------------------------------------------------------------- */

:root {
    color-scheme: dark;

    --bg: #0d0f14;
    --bg-elevated: #161a22;
    --bg-input: #1d222c;
    --border: #262c38;
    --border-strong: #3a4354;
    --text: #e8ecf3;
    --text-muted: #98a2b6;
    --accent: #fa5c5c;
    --accent-hover: #ff7676;
    --accent-contrast: #12141a;
    --success: #46d39a;
    --warning: #f5c451;

    --radius: 10px;
    --radius-sm: 6px;
    --shell: 72rem;
    --transition: 140ms ease;
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--accent-hover);
    text-decoration: underline;
}

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

h1, h2, h3 {
    line-height: 1.25;
    margin: 0 0 0.5em;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10;
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 600;
}

.skip-link:focus {
    left: 0;
}

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

/* --- En-tête ------------------------------------------------------------- */

.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(13, 15, 20, 0.85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    padding-block: 0.9rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

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

.brand__mark {
    color: var(--accent);
    font-size: 0.85rem;
}

.site-nav {
    display: flex;
    gap: 1.25rem;
    margin-right: auto;
}

.site-nav__link {
    color: var(--text-muted);
    font-weight: 500;
    padding-block: 0.25rem;
    border-bottom: 2px solid transparent;
}

.site-nav__link:hover {
    color: var(--text);
    text-decoration: none;
}

.site-nav__link.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* --- Sélecteur de langue -------------------------------------------------- */

.culture {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.culture__form {
    margin: 0;
}

.culture__button {
    border: 0;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.culture__button:hover {
    color: var(--text);
    background: var(--bg-input);
}

.culture__button--current {
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 600;
}

/* --- Corps ---------------------------------------------------------------- */

.site-main {
    flex: 1;
    padding-block: 2.5rem 4rem;
}

.page-title {
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
    letter-spacing: -0.02em;
}

.page-intro {
    color: var(--text-muted);
    max-width: 60ch;
    margin-top: -0.25rem;
}

.notice {
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.notice--warning {
    border-color: color-mix(in srgb, var(--warning) 45%, var(--border));
    color: var(--warning);
}

.results-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-block: 1.5rem 1rem;
}

/* --- Filtres -------------------------------------------------------------- */

.filters {
    margin-top: 2rem;
}

.filters fieldset {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem;
    margin: 0;
    padding: 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.filters__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 9rem;
}

.filters__field--grow {
    flex: 1 1 16rem;
}

.filters__field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filters input,
.filters select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
}

.filters__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* --- Boutons -------------------------------------------------------------- */

.button {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.button--primary {
    background: var(--accent);
    color: var(--accent-contrast);
}

.button--primary:hover {
    background: var(--accent-hover);
    color: var(--accent-contrast);
    text-decoration: none;
}

.button--ghost {
    border-color: var(--border-strong);
    color: var(--text-muted);
    background: none;
}

.button--ghost:hover {
    color: var(--text);
    text-decoration: none;
}

/* --- Grille de jeux ------------------------------------------------------- */

.grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
}

.card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.card__link {
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card__link:hover {
    text-decoration: none;
    color: inherit;
}

.card__cover {
    aspect-ratio: 63 / 50;
    background: var(--bg-input);
    display: grid;
    place-items: center;
    overflow: hidden;
}

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

.card__cover--placeholder {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--border-strong);
}

.card__body {
    padding: 0.9rem 1rem 0.5rem;
    flex: 1;
}

.card__title {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.card__tagline {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
}

.card__price,
.price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.card__price--free,
.price--free {
    color: var(--success);
}

/* --- Badges et tags ------------------------------------------------------- */

.badges,
.tags,
.shots,
.site-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    color: var(--text-muted);
}

.badge--browser {
    border-color: color-mix(in srgb, var(--success) 50%, var(--border-strong));
    color: var(--success);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tag:hover {
    color: var(--text);
    border-color: var(--accent);
    text-decoration: none;
}

/* --- Fiche jeu ------------------------------------------------------------ */

.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.game__header {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.game__cover {
    width: min(20rem, 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.game__intro {
    flex: 1 1 20rem;
}

.game__tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 55ch;
}

.game__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.game__facts dt {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.game__facts dd {
    margin: 0;
    font-size: 0.95rem;
}

.game__section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.game__section h2 {
    font-size: 1.2rem;
}

.game__section p {
    max-width: 70ch;
}

.shots {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}

.shots img {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.itch-widget {
    border: 0;
    width: 100%;
    max-width: 34.5rem;
    border-radius: var(--radius-sm);
    color-scheme: light;
}

.prose {
    max-width: 65ch;
}

.prose h2 {
    margin-top: 2rem;
    font-size: 1.2rem;
}

/* --- Pied de page --------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 1.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: space-between;
    align-items: center;
}

.site-footer__text {
    margin: 0;
}

.site-footer__links {
    display: flex;
    gap: 1.25rem;
}

/* --- Préférences d'accessibilité ------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .card:hover {
        transform: none;
    }
}
