/* HS « Il est temps d'éradiquer le mal » (thème Spider) — cadeau pour un compte, activé par l'admin (« Bas les masques »).
   Ne s'applique que sous [data-sp] : <body> pour le compte concerné, #chat pour l'admin dans sa discussion avec elle.
   Identité choisie : [data-hero="gwen"] (blanc, rose, noir) ou [data-hero="woman"] (rouge et noir, toiles noires).
   Les animations sont préfixées sg- pour ne jamais remplacer celles du reste de l'app. */
@font-face { font-family: 'Bangers'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/bangers-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/playfair-display-latin-400-italic.woff2) format('woff2'); }

/* ---------- Jetons ---------- */
[data-sp], .spi, .sg-pop, .sg-fx {
  --sg-hero: #ff2e88; --sg-hero-2: #ffffff; --sg-hero-3: #22d8ea; --sg-on: #ffffff; --sg-dark: #140a17; --sg-glow: #ff5aa8;
  --sg-web: rgba(255, 255, 255, .55);
  --sg-comic: 'Bangers', Impact, sans-serif; --sg-whisper: 'Playfair Display', Georgia, serif;
}
[data-hero="woman"] { --sg-hero: #d10f2f; --sg-hero-2: #050505; --sg-hero-3: #ff4d5e; --sg-on: #ffffff; --sg-dark: #2a0308; --sg-glow: #ff2a45; --sg-web: #050505; }
[data-sp] {
  --accent: var(--sg-hero); --accent-ink: var(--sg-on);
  --bg: #0b0609; --panel: #170c14; --panel-2: #22121d; --line: #3a2232;
  --text: #fbf3f8; --muted: #b9a9b6;
  --theirs: rgba(16, 10, 16, .66); --mine: var(--sg-hero);
  --chat-bg: radial-gradient(circle at 30% 0%, color-mix(in srgb, var(--sg-hero) 32%, var(--sg-dark)), var(--sg-dark) 55%, #050205);
  /* réglages partagés avec l'Édition Sorcier (carte « Mon identité », choix de la photo de profil) */
  --house: var(--sg-hero); --house-2: var(--sg-hero-2); --house-on: var(--sg-on); --house-glow: var(--sg-glow);
  color-scheme: dark;
}
[data-sp][data-hero="woman"] { --chat-bg: radial-gradient(circle at 30% 0%, #5a0612, var(--sg-dark) 55%, #120103); }

/* ---------- Fond de la discussion : trame BD, lueur qui respire, toiles dans les coins ---------- */
[data-sp] .wallpaper::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--sg-hero) 45%, transparent) 1.1px, transparent 1.5px); background-size: 7px 7px; opacity: .14; }
[data-sp] .wallpaper::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(circle at 50% 110%, color-mix(in srgb, var(--sg-glow) 38%, transparent), transparent 60%); animation: sg-breath 5s ease-in-out infinite; }
@keyframes sg-breath { 0%, 100% { opacity: .15; } 50% { opacity: .8; } }
.sg-corner { position: absolute; width: 150px; height: 150px; pointer-events: none; z-index: 2; opacity: .45; }
.sg-corner.tl { left: 0; top: 0; opacity: .3; }
.sg-corner.br { right: 0; bottom: 0; transform: rotate(180deg); }
.sg-corner path { fill: none; stroke: var(--sg-web); stroke-width: .8; }
[data-hero="woman"] .sg-corner { opacity: .85; }
[data-hero="woman"] .sg-corner path { stroke-width: 1.1; }

/* ---------- En-tête ---------- */
#chat[data-sp] > header.bar, [data-sp] #chat > header.bar { background: linear-gradient(180deg, #000, color-mix(in srgb, var(--sg-hero) 22%, #0b0609)); border-bottom: 1px solid color-mix(in srgb, var(--sg-hero) 60%, transparent); }
[data-sp] #peer-status { color: var(--sg-hero-3); }
.sg-mask-slot { display: inline-grid; place-items: center; margin-left: 4px; }
.sg-emblem { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sg-hero); color: #0b0608; box-shadow: 0 0 12px var(--sg-glow); }
.sg-emblem svg { width: 70%; height: 70%; }
.wz-house-card .sg-emblem { width: 52px; height: 52px; }

/* ---------- Bulles : plates et modernes ---------- */
[data-sp] .bubble { position: relative; }
/* opacité des bulles : le réglage des paramètres (--bubble-pct) s'applique aussi au thème */
[data-sp] .msg.mine .bubble { background: color-mix(in srgb, var(--sg-hero) var(--bubble-pct, 100%), transparent); color: var(--sg-on); border-radius: 20px 20px 6px 20px; box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--sg-glow) 70%, transparent); }
[data-sp] .msg.mine .meta { color: color-mix(in srgb, var(--sg-on) 75%, transparent); }
[data-sp] .msg.theirs .bubble { background: color-mix(in srgb, #100a10 calc(var(--bubble-pct, 100%) * .66), transparent); color: #fbf3f8; border: 1px solid rgba(255, 255, 255, .08); border-radius: 20px 20px 20px 6px; backdrop-filter: blur(14px) saturate(1.3); }
[data-sp] .msg.theirs .meta { color: #b9a9b6; }
[data-sp] .quote { border-left: 2px solid currentColor; background: rgb(0 0 0 / .18); }
[data-sp] .reacts { background: #120a10; border: 1px solid color-mix(in srgb, var(--sg-hero) 50%, transparent); color: #fbf3f8; }
[data-sp] .day-sep span { background: #fff; color: #000; font-family: var(--sg-comic); font-size: 13px; letter-spacing: .06em; transform: rotate(-2deg); display: inline-block; box-shadow: 3px 3px 0 #000; border-radius: 2px; }
[data-sp] .load-older { background: rgb(0 0 0 / .6); color: #fff; border: 1px solid color-mix(in srgb, var(--sg-hero) 50%, transparent); }
.bubble.sg-glitch { animation: sg-glitch .45s steps(5) 1; }
@keyframes sg-glitch { 20% { filter: drop-shadow(4px 0 0 #0ff) drop-shadow(-4px 0 0 #f0f); transform: translateX(-2px) skewX(3deg); } 40% { filter: drop-shadow(-5px 0 0 #0ff) drop-shadow(5px 0 0 #f0f); transform: translateX(3px); } 60% { transform: skewX(-2deg); } 100% { filter: none; transform: none; } }

/* Une petite araignée par bulle : modèle et place différents d'une bulle à l'autre */
.sg-bug { position: absolute; width: 24px; height: 24px; pointer-events: none; z-index: 1; }
.sg-bug svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .85)); }
.msg.theirs .sg-bug { color: var(--sg-hero); }
.msg.mine .sg-bug { color: #120a10; }
.sg-bug.s-tr { top: -12px; right: 16px; transform: rotate(18deg); }
.sg-bug.s-bl { bottom: -12px; left: 14px; transform: rotate(-160deg); }
.sg-bug.s-side { top: 6px; right: -14px; transform: rotate(95deg); }
.sg-bug.s-tl { top: -12px; left: 20px; transform: rotate(-24deg); }
.sg-bug.s-hang-r { bottom: -26px; right: 30%; }
.sg-bug.s-hang-l { bottom: -22px; left: 22%; transform: scale(.8); }
.sg-bug.s-hang-r::before, .sg-bug.s-hang-l::before { content: ''; position: absolute; left: 50%; bottom: 70%; width: 1px; height: 14px; background: rgba(255, 255, 255, .55); }
[data-sp] .msg:has(.sg-bug.s-hang-r, .sg-bug.s-hang-l) { margin-bottom: 14px; }

/* Araignée qui apporte un message reçu */
.sg-drop { position: absolute; top: 0; z-index: 3; width: 26px; pointer-events: none; }
.sg-drop i { position: absolute; left: 50%; top: 0; width: 1px; background: rgba(255, 255, 255, .75); }
.sg-drop svg { position: absolute; left: 0; top: 0; width: 26px; color: #0b0608; filter: drop-shadow(0 0 3px var(--sg-glow)) drop-shadow(0 0 1px #fff); }

/* ---------- Photos : avis de recherche (envoyées) et coupure de journal (reçues), empilées si plusieurs ---------- */
[data-sp] .msg:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif)) { background: none; border: 0; box-shadow: none; backdrop-filter: none; padding: 6px 4px 0; isolation: isolate; }
[data-sp] .msg:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif)) > .file { position: relative; z-index: 1; width: 214px; padding: 10px 10px 12px; border-radius: 2px; box-shadow: 0 8px 20px rgb(0 0 0 / .55); }
[data-sp] .msg:not(.sticker):not(.gif) .file > .media:not(.gif) { position: relative; border-radius: 0; }
[data-sp] .msg:not(.sticker):not(.gif) .file > .media:not(.gif) img,
[data-sp] .msg:not(.sticker):not(.gif) .file > .media:not(.gif) video { display: block; width: 100%; height: 190px; max-height: none; object-fit: cover; border-radius: 0; }
[data-sp] .msg .bubble:has(> .file > .media:not(.gif)) .meta { color: #fbf3f8; text-shadow: 0 1px 4px #000; padding: 4px 4px 2px; }
[data-sp] .msg .bubble:has(> .file > .media:not(.gif)) > .text { margin-top: 8px; padding: 7px 12px; border-radius: 16px; background: rgba(16, 10, 16, .7); color: #fbf3f8; }
[data-sp] .msg.mine .bubble:has(> .file > .media:not(.gif)) > .text { background: var(--sg-hero); color: var(--sg-on); }

/* Envoyée : AVIS DE RECHERCHE */
[data-sp] .msg.mine:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif)) > .file {
  background: #efe3c8 radial-gradient(circle at 20% 15%, rgb(255 255 255 / .35), transparent 50%); color: #2a1a10; transform: rotate(2.5deg); }
[data-sp] .msg.mine:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif)) > .file::before {
  content: 'AVIS DE RECHERCHE'; display: block; margin: -2px 0 8px; text-align: center; font: 24px/1 var(--sg-comic); letter-spacing: .08em; color: #2a1a10; }
[data-sp] .msg.mine:not(.sticker):not(.gif) .file > .media:not(.gif) { outline: 2px solid #2a1a10; outline-offset: -1px; filter: sepia(.18) contrast(1.05); }
[data-sp] .msg.mine:not(.sticker):not(.gif) .file > .media:not(.gif)::after {
  content: 'RÉCOMPENSE : UN BAISER'; position: absolute; left: 0; right: 0; bottom: -2px; transform: translateY(100%); padding-top: 8px; text-align: center;
  font: 15px/1 var(--sg-comic); letter-spacing: .08em; color: var(--sg-hero); }
[data-hero="woman"] .msg.mine:not(.sticker):not(.gif) .file > .media:not(.gif)::after { color: #b10a26; }
[data-sp] .msg.mine:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif)) > .file { padding-bottom: 32px; }
/* punaise */
[data-sp] .msg.mine:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif))::before { content: ''; position: absolute; z-index: 3; top: 4px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--sg-hero) 45%, #3a0010); box-shadow: 0 2px 3px rgb(0 0 0 / .5); }

/* Reçue : coupure du DAILY BUGLE */
[data-sp] .msg.theirs:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif)) > .file {
  background: #f1ede2; color: #1b1712; transform: rotate(-2.5deg); padding-bottom: 46px;
  clip-path: polygon(0 1%, 6% 0, 14% 1.2%, 25% .2%, 37% 1%, 50% 0, 62% 1.1%, 75% .2%, 88% 1%, 100% 0, 99.4% 50%, 100% 100%, 88% 99%, 75% 100%, 62% 98.9%, 50% 100%, 37% 99%, 25% 100%, 14% 98.8%, 6% 100%, 0 99%, .6% 50%); }
[data-sp] .msg.theirs:not(.sticker):not(.gif) .file > .media:not(.gif) { filter: grayscale(.55) contrast(1.08) sepia(.12); }
[data-sp] .msg.theirs:not(.sticker):not(.gif) .file > .media:not(.gif)::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: multiply; opacity: .28;
  background-image: radial-gradient(circle, #000 .8px, transparent 1.2px); background-size: 4px 4px; }
/* fausses colonnes de texte sous la photo */
[data-sp] .msg.theirs:not(.sticker):not(.gif) .file > .media:not(.gif)::after { content: ''; position: absolute; left: 0; right: 0; bottom: -40px; height: 30px;
  background: repeating-linear-gradient(180deg, #b9b2a3 0 2px, transparent 2px 6px) left / 48% 100% no-repeat, repeating-linear-gradient(180deg, #b9b2a3 0 2px, transparent 2px 6px) right / 48% 100% no-repeat; }
/* titre du journal (DAILY BUGLE, posé par-dessus) et ligne d'édition sous le titre */
[data-sp] .msg.theirs:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif)) > .file::before { content: 'ÉDITION SPÉCIALE · SPIDER GIRL FRAPPE ENCORE'; display: block; margin: 0 0 8px; padding: 26px 0 6px; text-align: center;
  border-bottom: 2px solid #1b1712; font: 700 9.5px/1.2 Georgia, serif; letter-spacing: .12em; color: #1b1712; }
[data-sp] .msg.theirs:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif))::after { content: 'DAILY BUGLE'; position: absolute; z-index: 2; left: 4px; right: 4px; top: 13px; text-align: center; transform: rotate(-2.5deg);
  font: 900 22px/1 Georgia, 'Times New Roman', serif; letter-spacing: .03em; color: #1b1712; pointer-events: none; }

/* Pile : plusieurs photos à la suite = une pile de feuilles (on touche pour ouvrir) */
[data-sp] .msg.wz-stack-member { display: none; }
[data-sp] .msg.wz-stack-head:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif)) > .file {
  box-shadow: 0 8px 20px rgb(0 0 0 / .55), 11px 9px 0 0 #d6c9ab, 11px 9px 12px 0 rgb(0 0 0 / .45), -9px 14px 0 0 #e2d5b8, -9px 14px 12px 0 rgb(0 0 0 / .45); }
[data-sp] .msg.theirs.wz-stack-head:not(.sticker):not(.gif) .bubble:has(> .file > .media:not(.gif)) > .file { clip-path: none;
  box-shadow: 0 8px 20px rgb(0 0 0 / .55), 11px 9px 0 0 #d9d4c6, 11px 9px 12px 0 rgb(0 0 0 / .45), -9px 14px 0 0 #e6e1d4, -9px 14px 12px 0 rgb(0 0 0 / .45); }
[data-sp] .msg.wz-stack-head .bubble > .file::after { content: '×' attr(data-count); position: absolute; right: -14px; top: 64px; z-index: 4; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 999px;
  display: grid; place-items: center; font: 17px var(--sg-comic); letter-spacing: .04em; background: var(--sg-hero); color: var(--sg-on); border: 2px solid #000; box-shadow: 0 2px 8px rgb(0 0 0 / .5); transform: rotate(8deg); }

/* ---------- Saisie ---------- */
#chat[data-sp] .composer, [data-sp] .composer { background: linear-gradient(0deg, #000, color-mix(in srgb, var(--sg-hero) 14%, #0b0609)); border-top: 1px solid color-mix(in srgb, var(--sg-hero) 40%, transparent); }
[data-sp] .composer textarea { background: rgba(20, 12, 20, .9); color: #fbf3f8; border: 1px solid color-mix(in srgb, var(--sg-hero) 50%, transparent); }
[data-sp] .composer textarea::placeholder { color: rgba(255, 255, 255, .45); font-style: italic; }
[data-sp] .send { background: var(--sg-hero); color: var(--sg-on); box-shadow: 0 0 16px var(--sg-glow); }
.send.sg-shoot { animation: sg-shoot .3s; }
@keyframes sg-shoot { 40% { transform: scale(.86) rotate(-10deg); } }
[data-sp] .reply-bar, [data-sp] .edit-bar { background: color-mix(in srgb, var(--sg-hero) 18%, #0b0609); color: #fbf3f8; }

/* Tir de toile à l'envoi */
.sg-fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.sg-fx svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sg-fx path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 3px var(--sg-glow));
  animation: sg-draw .22s ease-out forwards, sg-fade .4s .5s forwards; }
@keyframes sg-draw { to { stroke-dashoffset: 0; } }
@keyframes sg-fade { to { opacity: 0; } }
.sg-fx b { position: absolute; font: 40px var(--sg-comic); letter-spacing: 1px; color: #fff; -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; text-shadow: 3px 3px 0 var(--sg-hero); animation: sg-onoma 1.2s ease-out forwards; }
.msg.mine .bubble.sg-stuck::after { content: ''; position: absolute; right: -7px; bottom: -7px; width: 24px; height: 24px; pointer-events: none; animation: sg-mark .3s cubic-bezier(.2,1.5,.4,1);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cg stroke='%23fff' stroke-width='.9' fill='none'%3E%3Cpath d='M11 11L0 0M11 11L22 0M11 11L0 22M11 11L22 22M11 11V0M11 11H0'/%3E%3Cpath d='M5 5Q11 8 17 5Q14 11 17 17Q11 14 5 17Q8 11 5 5Z'/%3E%3C/g%3E%3C/svg%3E"); }
@keyframes sg-onoma { 0% { opacity: 0; transform: scale(.3) rotate(-14deg); } 25% { opacity: 1; transform: scale(1.15) rotate(-8deg); } 100% { opacity: 0; transform: rotate(-8deg) translateY(-20px); } }

/* ---------- Jeux ---------- */
[data-sp] .game-title { font-family: var(--sg-comic); font-weight: 400; font-size: 18px; letter-spacing: .05em; }
[data-sp] .game-title small { font-family: inherit; letter-spacing: 0; }
[data-sp] .game-status { font-family: var(--sg-whisper); font-style: italic; }
[data-sp] .game-status.win { color: inherit; }
/* morpion : la grille est une toile tendue (fils irréguliers), araignée (X) contre spirale de toile (O) */
[data-sp] .ttt.sg-ttt { position: relative; gap: 0 !important; padding: 0; width: 210px; height: 210px; grid-template-columns: repeat(3, 1fr) !important; grid-template-rows: repeat(3, 1fr) !important; margin: 8px auto 4px; }
[data-sp] .ttt.sg-ttt.big { width: 250px; height: 250px; grid-template-columns: repeat(var(--ttt-n, 10), 1fr) !important; grid-template-rows: repeat(var(--ttt-n, 10), 1fr) !important; }
[data-sp] .ttt.sg-ttt.big .ttt-cell { padding: 2px; }
.sg-webgrid { position: absolute; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); pointer-events: none; }
.sg-webgrid path { fill: none; stroke: color-mix(in srgb, var(--sg-on) 70%, transparent); stroke-width: 1; stroke-linecap: round; }
[data-sp] .msg.theirs .sg-webgrid path { stroke: color-mix(in srgb, var(--sg-hero) 75%, #fff); }
[data-hero="woman"] .msg.theirs .sg-webgrid path { stroke: #ff6b7d; }
[data-sp] .sg-ttt .ttt-cell { position: relative; z-index: 1; border: 0; border-radius: 50%; background: none; padding: 10px; font-size: 0; color: inherit; display: grid; place-items: center; }
[data-sp] .sg-ttt .ttt-cell:not(:disabled):hover { background: rgba(255, 255, 255, .07); transform: none; }
[data-sp] .sg-ttt .ttt-cell svg { width: 100%; height: 100%; overflow: visible; animation: sg-mark .35s cubic-bezier(.2,1.5,.4,1); }
[data-sp] .sg-ttt .ttt-cell.x svg { color: #0b0608; filter: drop-shadow(0 0 2px rgba(255, 255, 255, .8)); }
[data-sp] .msg.theirs .sg-ttt .ttt-cell.x svg { color: var(--sg-hero); filter: none; }
[data-sp] .sg-ttt .ttt-cell.o svg { color: #fff; }
[data-sp] .sg-ttt .ttt-cell.line { background: none; }
@keyframes sg-mark { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }
.sg-winline { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.sg-winline path { stroke: #fff; stroke-width: 3; stroke-linecap: round; fill: none; filter: drop-shadow(0 0 6px var(--sg-glow)); stroke-dasharray: 1; stroke-dashoffset: 1; animation: sg-drawline .6s .1s ease-out forwards; }
@keyframes sg-drawline { to { stroke-dashoffset: 0; } }
/* pile ou face : pièce aux couleurs du costume, masque (pile) ou araignée (face) */
[data-sp] .coin { position: relative; width: 96px; height: 96px; margin: 8px auto 22px; display: grid; place-items: center; color: #0b0608;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--sg-hero) 55%, #fff), var(--sg-hero) 60%, color-mix(in srgb, var(--sg-hero) 55%, #000));
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .35), inset 0 0 0 7px rgba(0, 0, 0, .25), 0 8px 22px -6px var(--sg-glow); }
[data-sp] .coin svg { width: 54%; height: 54%; }
[data-sp] .coin b { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font: 16px var(--sg-comic); letter-spacing: 1px; color: inherit; }
[data-sp] .msg.mine .coin b { color: var(--sg-on); }
[data-sp] .msg.theirs .coin b { color: #fbf3f8; }

/* Pop-ups de fin de partie */
.sg-pop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(5, 2, 6, .55); backdrop-filter: blur(4px); animation: sg-fadein .25s; overflow: hidden; }
@keyframes sg-fadein { from { opacity: 0; } }
.sg-pop-card { position: relative; z-index: 2; width: min(290px, 82vw); padding: 26px 20px 20px; text-align: center; background: var(--sg-dark); border: 2px solid var(--sg-hero); border-radius: 22px; box-shadow: 0 0 40px -6px var(--sg-glow); animation: sg-slam .5s cubic-bezier(.2,1.5,.4,1); color: #fbf3f8; }
@keyframes sg-slam { 0% { opacity: 0; transform: scale(2.2) rotate(8deg); } 100% { opacity: 1; transform: none; } }
.sg-pop h3 { font: 46px/1 var(--sg-comic); letter-spacing: 2px; color: var(--sg-hero); -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; text-shadow: 4px 4px 0 #000; }
[data-hero="woman"].sg-pop h3 { color: #ff2a45; }
.sg-pop p { margin-top: 10px; font: italic 16px var(--sg-whisper); color: #f4dbe4; }
.sg-pop small { display: block; margin-top: 14px; font-size: 11px; color: #b9a9b6; }
.sg-pop-ico { width: 70px; height: 70px; margin: -60px auto 10px; border-radius: 50%; background: var(--sg-hero); color: #0b0608; display: grid; place-items: center; box-shadow: 0 0 0 3px #000, 0 0 24px var(--sg-glow); }
.sg-pop-ico svg { width: 46px; height: 46px; }
.sg-dangle { position: absolute; top: 0; width: 30px; z-index: 1; animation: sg-dangle 1.6s cubic-bezier(.3,.7,.3,1.2) both; }
.sg-dangle::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 1px; height: 900px; background: rgba(255, 255, 255, .55); }
.sg-dangle svg { width: 30px; color: #0b0608; filter: drop-shadow(0 0 2px rgba(255, 255, 255, .85)); }
.sg-dangle.r svg { color: var(--sg-hero); }
.sg-dangle.sway { animation: sg-dangle 1.6s cubic-bezier(.3,.7,.3,1.2) both, sg-swing 2.4s 1.6s ease-in-out infinite alternate; }
@keyframes sg-dangle { from { transform: translateY(-60px); } to { transform: translateY(var(--y)); } }
@keyframes sg-swing { from { transform: translateY(var(--y)) rotate(-8deg); } to { transform: translateY(var(--y)) rotate(8deg); } }
.sg-pop.lose { background: rgba(5, 2, 6, .7); }
.sg-net { position: absolute; inset: -10%; width: 120%; height: 120%; z-index: 1; animation: sg-netfall .8s cubic-bezier(.5,0,.3,1.3) both; }
.sg-net path { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 1; vector-effect: non-scaling-stroke; }
@keyframes sg-netfall { from { transform: translateY(-110%) rotate(-8deg); } to { transform: none; } }
.sg-crawl { position: absolute; z-index: 3; width: 30px; animation: sg-crawl 3s linear infinite; }
.sg-crawl svg { width: 30px; color: var(--sg-hero); }
@keyframes sg-crawl { 0% { left: -40px; top: 70%; transform: rotate(90deg); } 100% { left: 110%; top: 62%; transform: rotate(90deg); } }
.sg-duo { display: flex; justify-content: center; gap: 70px; margin: 4px 0 10px; }
.sg-duo svg { width: 40px; color: var(--sg-hero); }
.sg-duo span:first-child { transform: rotate(90deg); animation: sg-duelL 1s ease-in-out infinite alternate; }
.sg-duo span:last-child { transform: rotate(-90deg); animation: sg-duelR 1s ease-in-out infinite alternate; }
@keyframes sg-duelL { to { transform: rotate(90deg) translateY(-10px); } }
@keyframes sg-duelR { to { transform: rotate(-90deg) translateY(-10px); } }

/* ---------- Cérémonie : HS, la phrase, le baiser, le choix, le verdict ---------- */
.spi { position: fixed; inset: 0; z-index: 80; overflow: hidden; background: #050306; color: #fbf3f8; font-family: inherit; transition: opacity .45s; }
.spi.out { opacity: 0; }
.spi.glitch { animation: sg-rgb .6s steps(6) 1; }
@keyframes sg-rgb { 20% { filter: drop-shadow(6px 0 0 #0ff) drop-shadow(-6px 0 0 #f0f); transform: translateX(-4px) skewX(4deg); } 40% { filter: drop-shadow(-8px 0 0 #0ff) drop-shadow(8px 0 0 #f0f); transform: translateX(5px); } 60% { filter: drop-shadow(3px 0 0 #0ff) drop-shadow(-3px 0 0 #f0f); transform: skewX(-3deg); } 100% { filter: none; transform: none; } }
.spi-pulse { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 35%, rgba(170, 0, 60, .6)); animation: sg-breath 3.2s ease-in-out infinite; }
.spi-halftone, .spi-ht { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, color-mix(in srgb, var(--sg-hero) 55%, transparent) 1.2px, transparent 1.6px); background-size: 7px 7px; mix-blend-mode: screen; }
.spi-logo-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: opacity .5s; }
.spi-logo-wrap.in { opacity: 1; }
.spi-logo-wrap .spi-halftone { opacity: .5; }
.spi-logo-wrap.out { animation: sg-logoout .5s ease-in forwards; }
@keyframes sg-logoout { to { opacity: 0; transform: scale(1.12); filter: blur(8px); } }
.spi-logo { position: relative; font: 150px/.9 var(--sg-comic); letter-spacing: 4px; color: var(--sg-hero); -webkit-text-stroke: 3px #000; paint-order: stroke fill; text-shadow: 6px 6px 0 #000, -4px 0 0 var(--sg-hero-3), 4px 0 0 #f0f; opacity: 0; }
.spi-logo-wrap.in .spi-logo { animation: sg-emerge 1.4s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes sg-emerge { 0% { opacity: 0; transform: scale(.7); filter: blur(12px) brightness(.2); } 60% { opacity: 1; filter: blur(2px); } 100% { opacity: 1; transform: none; filter: none; } }
.spi-logo-web { position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); opacity: .22; mix-blend-mode: overlay; -webkit-mask: radial-gradient(circle at 0 0, #000 40%, transparent 72%); mask: radial-gradient(circle at 0 0, #000 40%, transparent 72%); }
.spi-logo-web path { fill: none; stroke: #fff; stroke-width: .8; }
.spi-tag { margin-top: 26px; font: 25px/1.15 var(--sg-comic); letter-spacing: 1.5px; text-align: center; padding: 0 24px; min-height: 60px; }
.spi-tag span { display: inline-block; opacity: 0; transform: translateY(10px) scale(1.4); }
.spi-tag span.on { animation: sg-word .35s cubic-bezier(.2,1.6,.4,1) forwards; }
.spi-tag span.red { color: var(--sg-hero); text-shadow: 2px 2px 0 #000; }
[data-hero="woman"] .spi-tag span.red { color: #ff2a45; }
@keyframes sg-word { to { opacity: 1; transform: none; } }
.spi-kiss { position: absolute; left: 0; right: 0; top: 36%; text-align: center; font-size: 150px; line-height: 1; opacity: 0; transform: rotate(-12deg); pointer-events: none;
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; filter: drop-shadow(0 0 22px rgba(220, 0, 40, .55)); }
.spi-kiss.on { animation: sg-kiss 1.5s ease-out forwards; }
@keyframes sg-kiss { 0% { opacity: 0; transform: rotate(-12deg) scale(1.7); } 18% { opacity: 1; transform: rotate(-12deg) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(-12deg) scale(.96); } }
.spi-skip { position: absolute; right: 18px; top: max(18px, env(safe-area-inset-top)); z-index: 9; font-size: 12px; padding: 6px 12px; border-radius: 20px; border: 0; background: #ffffff14; color: #fffa; }
/* choix : Spider-Gwen en haut, Spider-Woman en bas */
.spi-choose { position: absolute; inset: 0; display: flex; flex-direction: column; }
.spi-q { position: relative; z-index: 2; padding: max(54px, calc(env(safe-area-inset-top) + 30px)) 24px 14px; text-align: center; }
.spi-q small { display: block; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #b9a9b6; }
.spi-q b { display: block; margin-top: 6px; font: 34px var(--sg-comic); letter-spacing: 1px; text-shadow: 3px 3px 0 #000; }
.spi-cards { position: relative; flex: 1; }
.spi-card { position: absolute; left: 0; right: 0; height: 54%; overflow: hidden; display: flex; align-items: flex-end; padding: 22px; border: 0; color: #fff; text-align: left; cursor: pointer; transition: transform .4s, filter .4s; opacity: 0; }
.spi-card.gwen { top: 0; padding-bottom: 50px; clip-path: polygon(0 0, 100% 0, 100% 82%, 0 100%); --sg-hero: #ff2e88;
  background: linear-gradient(160deg, #fff 0 34%, #ff2e88 34% 62%, #140a17 62%); animation: sg-slidel .6s .1s cubic-bezier(.2,.9,.3,1) forwards; }
.spi-card.woman { bottom: 0; justify-content: flex-end; text-align: right; clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 100%); --sg-hero: #d10f2f;
  background: linear-gradient(200deg, #d10f2f 0 46%, #0a0203 46% 58%, #d10f2f 58% 60%, #0a0203 60%); animation: sg-slider .6s .25s cubic-bezier(.2,.9,.3,1) forwards; }
@keyframes sg-slidel { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes sg-slider { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
.spi-card .spi-ht { opacity: .5; z-index: 0; }
.spi-ph { position: absolute; inset: 0; z-index: 1; background-repeat: no-repeat; background-size: auto 100%; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .55)); }
.spi-card.gwen .spi-ph { background-position: right 6px bottom 0; }
.spi-card.woman .spi-ph { background-position: left 0 bottom 0; background-size: auto 96%; }
.spi-txt { position: relative; z-index: 2; }
.spi-txt b { display: block; font: 44px/1 var(--sg-comic); letter-spacing: 1.5px; -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; text-shadow: 4px 4px 0 #000; }
.spi-txt small { display: block; margin-top: 6px; font-size: 13px; text-shadow: 0 1px 3px #000; max-width: 230px; }
.spi-card.woman .spi-txt small { margin-left: auto; }
.spi-card.picked { transform: scale(1.04); z-index: 3; }
.spi-card.dim { filter: grayscale(1) brightness(.35); }
/* verdict : case de BD qui claque */
.spi-verdict { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--sg-dark); }
.spi-burst { position: absolute; width: 900px; height: 900px; left: 50%; top: 42%; margin: -450px 0 0 -450px; background: repeating-conic-gradient(var(--sg-hero) 0 6deg, transparent 6deg 14deg); opacity: .35; animation: sg-spin 30s linear infinite; }
@keyframes sg-spin { to { transform: rotate(360deg); } }
.spi-panel { position: relative; width: min(290px, 74vw); padding: 10px; background: #fff; transform: rotate(-3deg); box-shadow: 8px 8px 0 #000; animation: sg-slampanel .55s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes sg-slampanel { 0% { opacity: 0; transform: scale(2.2) rotate(8deg); } 100% { opacity: 1; transform: rotate(-3deg); } }
.spi-photo { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--sg-hero) center bottom / auto 100% no-repeat; }
.spi-photo .spi-ht { mix-blend-mode: multiply; opacity: .25; }
.spi-stamp { position: absolute; right: -22px; top: 18px; transform: rotate(14deg); padding: 6px 12px; border: 3px solid var(--sg-hero); color: var(--sg-hero); font: 20px var(--sg-comic); letter-spacing: 1px; background: rgba(255, 255, 255, .92); opacity: 0; animation: sg-stamp .35s 1.1s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes sg-stamp { from { opacity: 0; transform: rotate(14deg) scale(2.4); } to { opacity: 1; transform: rotate(14deg) scale(1); } }
.spi-verdict h2 { position: relative; margin-top: 26px; font: 52px var(--sg-comic); letter-spacing: 2px; color: var(--sg-hero); -webkit-text-stroke: 2px #000; paint-order: stroke fill; text-shadow: 5px 5px 0 #000; opacity: 0; animation: sg-word .4s .6s cubic-bezier(.2,1.6,.4,1) forwards; }
.spi-verdict p { position: relative; margin-top: 6px; font: italic 17px var(--sg-whisper); color: #f4dbe4; text-align: center; padding: 0 30px; opacity: 0; animation: sg-fadein2 .6s 1.4s forwards; }
@keyframes sg-fadein2 { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .spi *, .sg-pop *, [data-sp] .wallpaper::before { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
