/* Café Spinda (7/11/2026) : fenêtre de Spinda, scène d'arrivée, animations (client/js/cafe.js).
   Même style que le reste du jeu : cadres .box, police du jeu, mouvements en pas (steps) comme des sprites. */
.hub-mini .cm-grille .cm-large { grid-column: 1 / -1; }
.cafe-modal { z-index: 45; }
.cf-box { width: min(760px, 96vw); text-align: center; animation: pop .35s cubic-bezier(.2,1.4,.4,1); box-shadow: 0 0 40px rgba(255,143,200,.22); }
.cf-tete { display: flex; align-items: center; gap: 10px; text-align: left; }
.cf-spinda { flex: none; animation: cfTitube 1.3s steps(4, end) infinite; transform-origin: 50% 90%; }
.cf-spinda .portrait { width: 64px; height: 64px; }
@keyframes cfTitube { 0% { transform: rotate(-6deg) translateX(-2px); } 50% { transform: rotate(6deg) translateX(2px) translateY(-2px); } 100% { transform: rotate(-6deg) translateX(-2px); } }
.cf-titre { margin: 0 !important; }
.cf-phrase { margin: 2px 0 0; color: var(--dim); font-size: 18px; }
.cf-onglets { justify-content: center; gap: 6px; margin: 8px 0 4px; flex-wrap: wrap; }
.cf-onglet { min-width: 0; }
.cf-sac { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 6px; padding: 3px 10px; font-size: 20px;
  background: rgba(7,13,36,.55); box-shadow: inset 0 0 0 2px rgba(127,166,239,.35); }
.cf-sac-g { display: inline-flex; align-items: center; gap: 4px; }
.cf-sac-g b { font-weight: normal; min-width: 1.6em; text-align: left; }
.cf-sac-g.or { color: var(--gold); }
.cf-sac-g.saute { animation: cfSaute .4s steps(4, end); }
@keyframes cfSaute { 40% { transform: translateY(-6px) scale(1.25); filter: brightness(1.6); } }
.cf-gel { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: middle; }
.cf-contenu { min-height: 210px; }
.cf-info { margin: 6px 0; font-size: 20px; }
.cf-boutons { justify-content: center; gap: 8px; margin-top: 6px; }
.cf-invite { padding: 18px 8px; font-size: 20px; }
.cf-invite p { margin: 6px 0; }

/* Cadeau du jour : le shaker de Spinda */
.cf-scene { position: relative; display: flex; align-items: center; justify-content: center; min-height: 128px; }
.cf-scene.petite { min-height: 78px; }
.cf-shaker { position: relative; width: 64px; height: 96px; animation: float 1.6s steps(4, end) infinite; }
.cf-shaker-corps { position: absolute; left: 12px; bottom: 0; width: 40px; height: 64px; background: linear-gradient(90deg, #c9d3e0 0 6px, #eef3fb 6px 14px, #b7c2d2 14px 34px, #8f9bb0 34px);
  box-shadow: 0 0 0 3px #2b1810, 0 4px 0 3px rgba(0,0,0,.45); }
.cf-shaker-bouchon { position: absolute; left: 18px; bottom: 64px; width: 28px; height: 18px; background: #c43c38; box-shadow: 0 0 0 3px #2b1810, inset 0 4px 0 #e86a5e; }
.cf-spirale { position: absolute; left: 22px; bottom: 18px; width: 20px; height: 20px; border-radius: 50%;
  background: repeating-conic-gradient(#c43c38 0 40deg, #f6e2be 40deg 90deg); box-shadow: 0 0 0 2px #2b1810; animation: guTourne 3s steps(12) infinite; }
.cf-shaker.vide { animation: none; filter: grayscale(.7) brightness(.7); }
.cf-shaker.secoue { animation: cfSecoue .22s steps(2, end) infinite; }
@keyframes cfSecoue { 0% { transform: rotate(-16deg) translateY(0); } 50% { transform: rotate(16deg) translateY(-8px); } 100% { transform: rotate(-16deg); } }
.cf-shaker.ouvert .cf-shaker-bouchon { animation: cfBouchon .7s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes cfBouchon { 0% { transform: translateY(0) rotate(0); } 60% { transform: translateY(-44px) rotate(160deg); } 100% { transform: translateY(-28px) translateX(36px) rotate(200deg); opacity: 0; } }
.cf-shaker.ouvert::after { content: ''; position: absolute; left: -24px; top: -20px; width: 112px; height: 112px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.9), rgba(255,143,200,.5) 35%, transparent 70%); animation: cadFlash .7s ease-out forwards; }
.cf-gains { position: absolute; left: 50%; top: 12px; width: 0; height: 0; }
.cf-gain { position: absolute; left: -16px; top: 0; animation: cfJaillit .75s cubic-bezier(.25,1.2,.45,1) both; animation-delay: calc(.35s + var(--i) * .2s); }
.cf-gain .cf-gel { width: 32px; height: 32px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.55)); }
@keyframes cfJaillit { 0% { transform: translate(0, 40px) scale(.2); opacity: 0; } 50% { transform: translate(calc(var(--dx) * .7), -36px) scale(1.2); opacity: 1; }
  100% { transform: translate(var(--dx), 70px) scale(1); opacity: 1; } }

/* Échanges */
.cf-ech { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.cf-coul-l { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.cf-coul { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 2px 4px; font-size: 18px; box-shadow: inset 0 -3px 0 var(--c); }
.cf-coul b { font-weight: normal; color: var(--gold); }
.cf-coul.bloque { opacity: .45; filter: grayscale(.6); }
.cf-coul.on { box-shadow: inset 0 -3px 0 var(--c), 0 0 0 2px var(--gold); }
.cf-ech-fleche { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 26px; color: var(--gold); line-height: 1; }
.cf-ech-fleche span { font-size: 30px; animation: nudge 1s steps(2, end) infinite; }
.cf-qte { justify-content: center; gap: 6px; margin: 8px 0 0; align-items: center; }
.cf-qte-v { min-width: 220px; font-size: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.btn[aria-disabled="true"] { opacity: .5; }
.cf-spirale-grande { width: 56px; height: 56px; border-radius: 50%; background: repeating-conic-gradient(#c43c38 0 40deg, #f6e2be 40deg 90deg);
  box-shadow: 0 0 0 3px #2b1810, 0 4px 0 3px rgba(0,0,0,.4); animation: guTourne 6s steps(24) infinite; }
.cf-scene.tourne .cf-spirale-grande { animation-duration: .6s; }
.cf-vol { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.cf-entre, .cf-sort { position: absolute; left: -12px; top: -12px; }
.cf-entre { animation: cfEntre .55s cubic-bezier(.5,0,.8,.4) both; animation-delay: calc(var(--i) * .09s); }
@keyframes cfEntre { 0% { transform: translate(var(--dx), -40px) scale(1); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(0, 0) scale(.2) rotate(240deg); opacity: 0; } }
.cf-sort { animation: cfSort .8s cubic-bezier(.2,1.5,.4,1) both; animation-delay: calc(.75s + var(--i) * .12s); }
.cf-sort .cf-gel { width: 32px; height: 32px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.55)); }
@keyframes cfSort { 0% { transform: translate(0, 0) scale(.2); opacity: 0; } 60% { transform: translate(calc(var(--dx) * .8), -46px) scale(1.3); opacity: 1; } 100% { transform: translate(var(--dx), -30px) scale(1); opacity: 1; } }
.cf-sort-or { left: -24px; top: -24px; animation-delay: .95s; filter: drop-shadow(0 0 10px #ffe27a); }
.cf-scene.dore::before { content: ''; position: absolute; left: 50%; top: 50%; width: 180px; height: 180px; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,216,90,.4) 0 10deg, transparent 10deg 30deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%);
  animation: guTourne 4s linear infinite, cfApparait .4s ease-out .9s both; }
@keyframes cfApparait { from { opacity: 0; scale: .3; } }

/* Gelée Dorée */
.cf-or-tete { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; }
.cf-or-tete p { margin: 0; text-align: left; }
.cf-or-ico { animation: float 1.6s steps(4, end) infinite; filter: drop-shadow(0 0 8px rgba(255,216,90,.6)); }
.cf-or-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin: 6px 0; }
.cf-or-l { display: flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: 18px; }
.cf-or-l b { font-weight: normal; white-space: nowrap; }
.cf-or-l.bloque { opacity: .6; }
.cf-or-l.on { box-shadow: 0 0 0 2px var(--gold); }
.cf-or-barre { flex: 1; height: 10px; background: rgba(0,0,0,.5); box-shadow: 0 0 0 2px #2b1810; position: relative; overflow: hidden; }
.cf-or-barre i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); }
.cf-confirme { animation: rar-brille 1s steps(2) infinite; }

/* Scène d'arrivée : le titre du lieu, la boîte de dialogue en bas avec le portrait (façon Donjon Mystère, dessin du jeu) */
.modal.spd-scene { background: linear-gradient(transparent 55%, rgba(3,6,20,.55)); align-items: flex-end; animation: none; z-index: 46; }
.spd-scene.sort { animation: logOut .25s forwards; }
.spd-titre { position: absolute; left: 50%; top: 12%; translate: -50% 0; pointer-events: none; animation: spdTitre 2.6s steps(26, end) forwards; }
.spd-titre span { display: block; padding: 6px 28px; font-size: 34px; color: var(--gold); background: rgba(7,13,36,.85);
  box-shadow: inset 0 0 0 2px var(--gold-line), 0 3px 0 #000; letter-spacing: 1px; white-space: nowrap; }
@keyframes spdTitre { 0% { opacity: 0; transform: translateY(-20px); } 15%, 75% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-8px); } }
.spd-passer { position: absolute; right: 16px; top: 16px; z-index: 2; }
.btn.spd-dial { display: flex; align-items: flex-start; gap: 12px; width: min(880px, 96vw); min-height: 132px; margin: 0 auto 18px; padding: 10px 16px; text-align: left; cursor: pointer;
  font: inherit; color: var(--txt); background: none; border: 12px solid transparent; border-image: url('assets/ui/cadres/cadre1_blue_translucide.png') 8 fill / 12px stretch; image-rendering: pixelated;
  animation: pop .3s cubic-bezier(.2,1.4,.4,1); position: relative; }
.btn.spd-dial:focus-visible, .btn.spd-dial.focus, .btn.spd-dial:hover { outline: none; border-image-source: url('assets/ui/cadres/cadre1_yellow_translucide.png'); }
.spd-portrait { flex: none; width: 80px; height: 80px; image-rendering: pixelated; box-shadow: 0 0 0 3px #0c1430, 0 0 0 5px #7fa6ef; }
.spd-dial.chante .spd-portrait { animation: cfTitube .8s steps(4, end) infinite; }
.spd-corps { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.spd-nom { color: #ff8fc8; font-weight: normal; font-size: 22px; }
.spd-texte { font-size: 24px; line-height: 30px; white-space: pre-wrap; }
.spd-suite { position: absolute; right: 10px; bottom: 4px; color: var(--gold); opacity: 0; }
.spd-dial.fini .spd-suite { opacity: 1; animation: float .8s steps(2, end) infinite; }

body.spd-en-scene .hub-mini, body.spd-en-scene .touch-menu-btn { opacity: 0; pointer-events: none; transition: opacity .3s steps(3); }

/* Téléphone : tout plus serré, dialogue moins haut */
body.is-touch .cf-box { padding: 4px 8px; }
body.is-touch .cf-contenu { min-height: 0; }
body.is-touch .cf-sac { font-size: 16px; gap: 2px 8px; }
body.is-touch .cf-scene { min-height: 96px; }
body.is-touch .cf-coul, body.is-touch .cf-or-l { font-size: 14px; }
body.is-touch .cf-onglets { flex-wrap: nowrap; gap: 4px; margin: 4px 0 2px; }
body.is-touch .cf-onglet { font-size: 14px; padding: 2px 6px; line-height: 16px; white-space: normal; }
body.is-touch .cf-spinda .portrait { width: 44px; height: 44px; }
body.is-touch .cf-phrase { font-size: 14px; }
body.is-touch .btn.spd-dial { min-height: 96px; margin-bottom: 8px; padding: 4px 8px; border-width: 8px; }
body.is-touch .spd-portrait { width: 56px; height: 56px; }
body.is-touch .spd-texte { font-size: 17px; line-height: 21px; }
body.is-touch .spd-titre span { font-size: 22px; }
@media (max-width: 560px) {
  .cf-ech { grid-template-columns: 1fr; }
  .cf-ech-fleche { flex-direction: row; gap: 8px; }
  .cf-ech-fleche span { transform: rotate(90deg); }
  .cf-or-liste { grid-template-columns: 1fr; }
  .cf-qte-v { min-width: 0; flex-basis: 100%; order: -1; }
}
