/* ==========================================================================
   Sea Sex and Sun — design system commun (vitrine + jeu)
   Direction : "Vice-City noir". Nuit d'encre, coucher de soleil néon,
   typographie condensée grasse en italique avec contour noir et ombre dure.
   Règle maison : jamais de letter-spacing.
   Polices : @font-face générés par font_faces() (URL versionnées ?v=filemtime).
   ========================================================================== */


:root {
    /* Encre */
    --ink: #0a0610;
    --ink-2: #130c1c;
    --ink-3: #1f1430;
    --line: rgba(255, 246, 236, .12);

    /* Papier */
    --paper: #fff6ec;
    --muted: #b8a7c6;
    --dim: #7d6c8c;

    /* Néons */
    --pink: #ff2e88;
    --orange: #ff7a1a;
    --sun: #ffc531;
    --teal: #19e3cb;
    --violet: #7b2cff;
    --cash: #8df27c;
    --danger: #ff4141;

    --sunset: linear-gradient(180deg, #24093a 0%, #6b1657 30%, #e4246f 55%, #ff7a1a 78%, #ffc531 100%);
    --sunset-x: linear-gradient(100deg, var(--pink) 0%, var(--orange) 55%, var(--sun) 100%);

    --font: 'Walsheim', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-snap: cubic-bezier(.7, 0, .2, 1);

    --gutter: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--pink); color: #fff; }

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

/* ---- Typographie "GTA" -------------------------------------------------- */
.gta {
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    line-height: .86;
    text-wrap: balance; /* lignes de longueur équilibrée */
    color: #fff;
    -webkit-text-stroke: .07em #000;
    paint-order: stroke fill;
    text-shadow: .06em .07em 0 #000;
}
/* ---- Pictos (sprite icons.svg) ------------------------------------------ */
.ico {
    display: inline-block;
    flex: none;
    width: 1em;
    height: 1em;
    vertical-align: -.14em;
    fill: currentColor;
    overflow: visible;
}

/* ---- Logo typographique ------------------------------------------------- */
.logo {
    display: inline-grid;
    font-size: 22px; /* taille de base, ajustée par variante */
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    line-height: .82;
    color: #fff;
    -webkit-text-stroke: .08em #000;
    paint-order: stroke fill;
    text-shadow: .07em .08em 0 #000;
    white-space: nowrap;
}
.logo i { color: var(--pink); font-style: italic; }
.logo > span { display: block; }
.logo-sun {
    justify-self: start;
    background: linear-gradient(180deg, #fff3a8 0%, var(--sun) 35%, var(--orange) 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    -webkit-text-stroke: 0;
    text-shadow: none;
    filter: drop-shadow(.04em 0 0 #000) drop-shadow(-.04em 0 0 #000) drop-shadow(0 .04em 0 #000) drop-shadow(0 -.04em 0 #000) drop-shadow(.07em .08em 0 #000);
}
.logo--intro { font-size: clamp(56px, 12vw, 140px); }
.logo--footer { font-size: 40px; }
.logo--ls { font-size: clamp(34px, 4.6vw, 56px); }

.kicker {
    display: inline-flex;
    align-items: center;
    gap: .6em;
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    color: var(--sun);
}
.kicker::before {
    content: '';
    width: 2.2em;
    height: 3px;
    background: var(--sunset-x);
}

/* ---- Boutons ------------------------------------------------------------ */
.btn {
    --bg: var(--paper);
    --fg: var(--ink);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6em;
    min-height: 52px;
    padding: .55em 1.5em .5em;
    border: 0;
    background: var(--bg);
    color: var(--fg);
    font-weight: 900;
    font-style: italic;
    font-size: 1.15rem;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    transition: transform .25s var(--ease-out), background .25s;
    isolation: isolate;
    user-select: none;
}
.btn::after { /* balayage lumineux au survol */
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--sunset-x);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .45s var(--ease-out);
}
.btn:hover::after, .btn:focus-visible::after { transform: scaleX(1); }
.btn:hover, .btn:focus-visible { color: #fff; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; pointer-events: none; }

.btn-hot { --bg: var(--pink); --fg: #fff; }
.btn-hot::after { background: linear-gradient(100deg, var(--orange), var(--sun)); }
.btn-hot:hover { color: var(--ink); }

.btn-ghost {
    --bg: transparent;
    --fg: var(--paper);
    box-shadow: inset 0 0 0 2px var(--paper);
    clip-path: none;
}

.btn-link {
    border: 0;
    background: none;
    padding: 0;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.btn-link:hover { color: var(--paper); }

/* Grain photo global, très léger */
.grain {
    pointer-events: none;
    position: fixed;
    inset: -50%;
    z-index: 999;
    opacity: .07;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-6%, 4%); }
    40% { transform: translate(5%, -3%); }
    60% { transform: translate(-3%, -6%); }
    80% { transform: translate(6%, 5%); }
    100% { transform: translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Installer le jeu sur le téléphone (views/_install.php, js/install.js) ---------- */
.install-banner { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 80; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border: 3px solid #120a1e; border-radius: 18px; background: linear-gradient(180deg, #2c1a44, #170d24); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 6px 0 #120a1e, 0 16px 34px rgba(0, 0, 0, .55); color: #fff; animation: install-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.install-ico { flex: none; width: 48px; height: 48px; border: 2px solid #120a1e; border-radius: 12px; }
.install-txt { display: grid; flex: 1; min-width: 0; margin: 0; line-height: 1.25; }
.install-txt b { font-weight: 900; text-transform: uppercase; font-size: .84rem; text-wrap: balance; }
.install-txt span { color: rgba(255, 255, 255, .7); font-size: .8rem; }
.install-go, .install-chip-go, .install-ok { flex: none; padding: 10px 16px; border: 2px solid #120a1e; border-radius: 12px; background: linear-gradient(180deg, #8ef05a, #2fa82a); color: #fff; font: inherit; font-weight: 900; text-transform: uppercase; -webkit-text-stroke: 3px #120a1e; paint-order: stroke fill; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 3px 0 #120a1e; cursor: pointer; }
.install-x { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .75); cursor: pointer; }
.install-x .ico { width: 14px; height: 14px; }
.install-chip { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 35; display: flex; align-items: center; gap: 6px; translate: -50% 0; animation: install-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.install-chip-go { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; font-size: .82rem; }
.install-chip-go img { border: 2px solid #120a1e; border-radius: 8px; }
.install-chip .install-x { background: rgba(0, 0, 0, .55); }
.install-sheet { position: fixed; inset: 0; z-index: 90; display: grid; place-items: end center; padding: 12px; }
.install-sheet-bg { position: absolute; inset: 0; background: rgba(6, 3, 10, .7); }
.install-sheet-card { position: relative; display: grid; justify-items: center; gap: 12px; width: min(420px, 100%); margin-bottom: env(safe-area-inset-bottom); padding: 22px 18px 18px; border: 3px solid #120a1e; border-radius: 22px; background: linear-gradient(180deg, #2c1a44, #170d24); color: #fff; animation: install-in .4s cubic-bezier(.2, 1.3, .4, 1) both; }
.install-sheet-ico { width: 64px; height: 64px; border: 2px solid #120a1e; border-radius: 16px; }
.install-sheet-title { margin: 0; font-size: 1.15rem; font-weight: 900; text-transform: uppercase; text-align: center; }
.install-steps { display: grid; gap: 10px; width: 100%; margin: 0; padding: 0; list-style: none; }
.install-steps li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, .3); font-size: .92rem; line-height: 1.3; }
.install-steps li > span:nth-child(2) { flex: 1; }
.install-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #ff4f7e, #ffc531); color: #1a0f22; font-weight: 900; }
.install-step-ico { flex: none; width: 26px; height: 26px; color: #4aa8ff; }
.install-note { margin: 0; color: rgba(255, 255, 255, .6); font-size: .8rem; text-align: center; }
.install-sheet .is-ios, .install-sheet .is-android { display: none; }
.install-sheet.is-ios .is-ios, .install-sheet.is-android .is-android { display: grid; }
.install-sheet.is-ios p.is-ios { display: block; }
.install-ok { width: 100%; }
@keyframes install-in { from { opacity: 0; translate: 0 30px; } }
.install-chip { animation-name: install-chip-in; }
@keyframes install-chip-in { from { opacity: 0; translate: -50% 30px; } }
@media (prefers-reduced-motion: reduce) { .install-banner, .install-chip, .install-sheet-card { animation: none; } }
/* Croix « plus tard » de l’installation : bordure blanche + anneau sombre (lisible sur la carte comme sur la vitrine) */
.install-x { border: 2px solid #fff; color: #fff; box-shadow: 0 0 0 2px #120a1e, 0 3px 8px rgba(0, 0, 0, .45); }
.install-chip .install-x { background: rgba(18, 10, 30, .85); }
.install-x .ico { width: 13px; height: 13px; filter: drop-shadow(0 1px 0 #120a1e); }
