/* v3-fiche.css : instrument jouable de la fiche produit (fiche-jeu.js) */
:root {
	--j-creme: #faf4ec;
	--j-sable: #ead7c2;
	--j-taupe: #4a4540;
	--j-ivoire: #fffaf4;
}

/* ---------- Bouton « Jouer ce modèle » posé sur la photo ---------- */
.galerie-jouer {
	position: absolute; z-index: 3; top: 16px; left: 16px;
	display: inline-flex; align-items: center; gap: 10px;
	padding: 11px 18px 11px 14px; min-height: 44px; border: 0; border-radius: 999px;
	background: rgba(255, 250, 244, .86); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
	color: var(--j-taupe); font: 650 .9rem/1 var(--sans); white-space: nowrap; cursor: pointer;
	box-shadow: 0 6px 22px rgba(74, 69, 64, .14), inset 0 0 0 1px rgba(74, 69, 64, .08);
	transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.galerie-jouer:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(74, 69, 64, .18), inset 0 0 0 1px rgba(74, 69, 64, .1); }
.galerie-jouer:active { transform: scale(.97); }
.galerie-jouer-onde { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--j-taupe); flex: none; }
.galerie-jouer-onde::before, .galerie-jouer-onde::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--j-taupe); animation: jeu-pouls 2.4s ease-out infinite; }
.galerie-jouer-onde::after { animation-delay: 1.2s; }
@keyframes jeu-pouls { from { transform: scale(1); opacity: .7; } to { transform: scale(2.8); opacity: 0; } }

/* ---------- Bloc intégré à la colonne d'achat ---------- */
.jeu {
	margin: 0 0 28px; padding: 22px 22px 18px; border-radius: 28px;
	background: radial-gradient(120% 90% at 50% 0%, var(--j-ivoire) 0%, var(--j-creme) 60%, #f3e7d9 100%);
	border: 1px solid rgba(74, 69, 64, .1);
	box-shadow: 0 18px 50px -28px rgba(74, 69, 64, .35);
}
.jeu-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.jeu-sur { margin: 0 0 4px; font: 650 .72rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #8a7a6c; }
.jeu-titre { margin: 0; font: 500 clamp(1.3rem, 1.1rem + .8vw, 1.6rem)/1.15 var(--sans); color: var(--j-taupe); letter-spacing: -.01em; text-wrap: balance; }
.jeu-plein {
	flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
	background: rgba(234, 215, 194, .55); color: var(--j-taupe); transition: background .2s, transform .2s;
}
.jeu-plein:hover { background: var(--j-sable); }
.jeu-plein:active { transform: scale(.94); }
.jeu-scene { margin: 14px auto 6px; width: 100%; max-width: 440px; }
.jeu-pied { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.jeu-ecouter {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; cursor: pointer;
	background: var(--j-taupe); color: var(--j-ivoire); font: 650 .92rem/1 var(--sans); white-space: nowrap;
	transition: transform .2s, background .2s;
}
.jeu-ecouter:hover { background: #5a544e; }
.jeu-ecouter:active { transform: scale(.96); }
.jeu-ecouter svg { flex: none; width: 14px; height: 14px; display: block; color: var(--j-ivoire); opacity: 1; visibility: visible; }
.jeu-ecouter svg path { fill: currentColor; }
.jeu-legende { margin: 0; flex: 1 1 200px; font: 600 .92rem/1.4 var(--sans); color: var(--j-taupe); text-wrap: balance; }
.jeu-aide { margin: 12px 0 0; font-size: .84rem; color: #7a6d62; text-wrap: balance; }
.jeu.a-joue .jeu-aide { opacity: .65; }
.jeu-mention { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid rgba(74, 69, 64, .1); font-size: .76rem; color: #8a7a6c; text-wrap: balance; }

/* ---------- L'instrument ---------- */
.jeu-instru {
	position: relative; width: 100%; aspect-ratio: 1; touch-action: manipulation;
	-webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
	--cy: 50%; --R: 45%;
}
.jeu-ombre {
	position: absolute; left: 50%; top: calc(var(--cy) + var(--R) * .92); width: calc(var(--R) * 1.7); height: 7%;
	transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(74, 69, 64, .28), transparent); filter: blur(4px);
}
.jeu-coque {
	position: absolute; left: 50%; top: var(--cy); width: calc(var(--R) * 2); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
	background:
		radial-gradient(circle at 50% 50%, transparent 0 63%, rgba(255, 250, 244, .08) 64% 65%, transparent 66%),
		radial-gradient(85% 85% at 36% 28%, #857a70 0%, #5d564f 38%, var(--j-taupe) 70%, #3f3b37 100%);
	box-shadow: inset 0 2px 3px rgba(255, 250, 244, .25), inset 0 -10px 30px rgba(40, 36, 33, .35), 0 20px 40px -18px rgba(74, 69, 64, .55);
	transition: filter .6s;
}
.jeu-reflet { position: absolute; inset: 6% 18% 52% 12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 250, 244, .22), transparent); filter: blur(6px); }
.jeu-instru.accord .jeu-coque { animation: jeu-accord .9s ease-out; }
@keyframes jeu-accord { 30% { filter: brightness(1.12) saturate(1.1); } }
.jeu-anneau {
	position: absolute; left: 50%; top: var(--cy); width: calc(var(--R) * 2 + 17.2%); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
	border: 1.5px dashed rgba(74, 69, 64, .22);
	-webkit-mask: linear-gradient(to bottom, transparent 0 55%, #000 72%); mask: linear-gradient(to bottom, transparent 0 55%, #000 72%);
}
.jeu-sous { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); font: 600 .68rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #8a7a6c; white-space: nowrap; }

.jeu-note {
	position: absolute; width: var(--d); aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer;
	transform: translate(-50%, -50%); border-radius: 50%; color: var(--j-ivoire); touch-action: manipulation;
	display: grid; place-items: center; -webkit-tap-highlight-color: transparent;
}
.jeu-note:focus-visible { outline: 2px solid var(--j-sable); outline-offset: 3px; }
.jeu-forme {
	position: absolute; inset: 0; border-radius: 50%;
	background: radial-gradient(70% 70% at 40% 34%, #7c7268 0%, #5a534c 55%, #4f4943 100%);
	box-shadow: inset 0 3px 6px rgba(40, 36, 33, .45), inset 0 -2px 3px rgba(255, 250, 244, .14), 0 1px 0 rgba(255, 250, 244, .12);
	transition: transform .5s cubic-bezier(.2, .8, .2, 1), background .5s, box-shadow .5s;
}
.jeu-note.est-note .jeu-forme { border-radius: 50% / 46%; }
.jeu-note.est-ding .jeu-forme {
	background: radial-gradient(60% 60% at 42% 36%, #8a7f74 0%, #5f5851 60%, #534d47 100%);
	box-shadow: inset 0 -4px 8px rgba(40, 36, 33, .4), inset 0 3px 4px rgba(255, 250, 244, .2), 0 0 0 4px rgba(40, 36, 33, .12);
}
.jeu-note.est-bas { color: var(--j-taupe); }
.jeu-note.est-bas .jeu-forme { background: radial-gradient(70% 70% at 40% 34%, var(--j-ivoire), var(--j-sable)); box-shadow: inset 0 0 0 1px rgba(74, 69, 64, .16), 0 4px 10px -4px rgba(74, 69, 64, .35); }
.jeu-etiq { position: relative; z-index: 1; font: 650 clamp(.62rem, .5rem + .5vw, .82rem)/1 var(--sans); white-space: nowrap; pointer-events: none; text-shadow: 0 1px 1px rgba(40, 36, 33, .3); }
.jeu-note.est-bas .jeu-etiq { text-shadow: none; }
.jeu-note.est-ding .jeu-etiq { font-size: clamp(.82rem, .7rem + .6vw, 1.05rem); }
.jeu-oct { font-size: .72em; opacity: .7; margin-left: 1px; }
.jeu-touche {
	position: absolute; z-index: 1; left: 50%; bottom: 10%; transform: translateX(-50%); pointer-events: none;
	font: 600 .56rem/1 var(--sans); color: rgba(255, 250, 244, .62); background: none; border: 0; padding: 0;
}
.jeu-note.est-ding .jeu-touche { bottom: 18%; }
.jeu-note.est-bas .jeu-touche { color: rgba(74, 69, 64, .55); }
.jeu-touche:empty { display: none; }

/* Tongue drum : lames découpées dans la coque, pointe vers le centre */
.jeu-note.est-langue { width: var(--d); height: var(--long); aspect-ratio: auto; border-radius: 40% 40% 10% 10% / 30% 30% 6% 6%; transform: translate(-50%, -50%) rotate(var(--rot)); }
.jeu-note.est-langue .jeu-forme { border-radius: inherit; background: linear-gradient(180deg, #7a7066, #554f48); box-shadow: 0 0 0 2px rgba(35, 32, 29, .5), inset 0 2px 3px rgba(255, 250, 244, .18); }
.jeu-note.est-langue .jeu-etiq, .jeu-note.est-langue .jeu-touche { transform: rotate(calc(var(--rot) * -1)); }
.jeu-note.est-langue .jeu-touche { left: auto; bottom: 8%; }

/* Frappe */
.jeu-note.frappe .jeu-forme { animation: jeu-frappe .55s cubic-bezier(.2, .8, .2, 1); }
.jeu-note.est-bas.frappe .jeu-forme { animation-name: jeu-frappe-bas; }
@keyframes jeu-frappe {
	0% { transform: scale(.9); background: radial-gradient(70% 70% at 45% 40%, #d9c3ab 0%, #a8988a 55%, #6c6259 100%); box-shadow: inset 0 3px 6px rgba(40, 36, 33, .3), 0 0 26px 6px rgba(234, 215, 194, .55); }
	100% { transform: scale(1); }
}
@keyframes jeu-frappe-bas { 0% { transform: scale(.9); box-shadow: 0 0 0 6px rgba(234, 215, 194, .7), 0 0 24px 6px rgba(234, 215, 194, .7); } 100% { transform: scale(1); } }

.jeu-onde {
	position: absolute; z-index: 0; width: 20%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
	border: 2px solid rgba(234, 215, 194, .9); box-shadow: 0 0 18px rgba(234, 215, 194, .45);
	transform: translate(-50%, -50%) scale(.3); animation: jeu-onde 1.15s cubic-bezier(.15, .7, .3, 1) forwards;
}
.jeu-onde.onde-ding { width: 30%; }
@keyframes jeu-onde { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.35); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(calc(2.6 * var(--f, 1))); } }

/* Notes qui arrivent avec la nouvelle version */
.jeu-note.est-neuve { animation: jeu-neuve .7s cubic-bezier(.3, 1.4, .5, 1) both; }
.jeu-note.est-langue.est-neuve { animation-name: jeu-neuve-langue; }
.jeu-note.est-neuve::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--j-sable); animation: jeu-neuve-anneau 1.6s ease-out .3s both; pointer-events: none; }
@keyframes jeu-neuve { from { opacity: 0; transform: translate(-50%, -50%) scale(.2); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes jeu-neuve-langue { from { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot)) scale(.2); } to { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot)) scale(1); } }
@keyframes jeu-neuve-anneau { 0% { opacity: 1; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.7); } }

/* ---------- Plein écran ---------- */
html.jeu-ouvert, html.jeu-ouvert body { overflow: hidden; }
.jeu-feuille {
	position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center;
	padding: max(14px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
	background: radial-gradient(120% 80% at 50% 30%, var(--j-ivoire) 0%, var(--j-creme) 55%, #f1e4d4 100%);
	opacity: 0; transform: translateY(24px); transition: opacity .3s ease, transform .4s cubic-bezier(.2, .8, .2, 1);
	overscroll-behavior: contain; overflow-y: auto;
}
.jeu-feuille.est-ouverte { opacity: 1; transform: none; }
.jeu-feuille[hidden] { display: none; }
.jeu-feuille-tete { width: 100%; max-width: 640px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.jeu-feuille-nom { margin: 0; font: 500 1.35rem/1.15 var(--sans); color: var(--j-taupe); }
.jeu-fermer { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(234, 215, 194, .6); color: var(--j-taupe); cursor: pointer; }
.jeu-feuille-scene { width: min(100%, 62vh, 620px); margin: auto 0 0; padding-top: 8px; }
.jeu-feuille-scene .jeu-instru { touch-action: none; }
.jeu-feuille-legende { flex: none; margin: 10px 0 0; text-align: center; max-width: 520px; }
.jeu-puces { width: 100%; max-width: 560px; margin: 14px 0 0; display: grid; gap: 10px; }
.jeu-puces-ligne { display: grid; gap: 6px; }
.jeu-puces-titre { font: 650 .7rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #8a7a6c; text-align: center; }
.jeu-puces-options { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.jeu-puce {
	min-height: 40px; min-width: 56px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(74, 69, 64, .16); cursor: pointer;
	background: var(--j-ivoire); color: var(--j-taupe); font: 650 .9rem/1 var(--sans); white-space: nowrap; transition: background .2s, color .2s, border-color .2s;
}
.jeu-puce[aria-checked="true"] { background: var(--j-taupe); color: var(--j-ivoire); border-color: var(--j-taupe); }
.jeu-puce:disabled { opacity: .4; cursor: default; }
.jeu-feuille-pied { margin: 16px 0 auto; }

@media (max-width: 900px) {
	.galerie-jouer { top: 14px; left: calc(var(--gouttiere) + 4px); }
	.jeu { padding: 18px 16px 16px; border-radius: 24px; }
}
@media (min-width: 901px) {
	.jeu-plein { display: none; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 1px) {
	.galerie-jouer-onde::before, .galerie-jouer-onde::after, .jeu-note.est-neuve, .jeu-note.est-neuve::after, .jeu-note.frappe .jeu-forme { animation: none; }
	.jeu-feuille { transition: none; }
}
.jeu-bloc { white-space: nowrap; }
