/* =========================================================
   Jeu de l'Été — Voyance Qualité
   Design system VQ : DM Sans + Cormorant Garamond, violet #7C5CFC
   ========================================================= */

.jevq-game {
	--violet: #7C5CFC;
	--violet-d: #5b3fd9;
	--violet-soft: #efeafb;
	--gold: #FFB703;
	--gold-l: #FFD166;
	--gold-d: #F08C00;
	--sea: #6FD0C8;
	--sand: #FBF3E4;
	--ink: #2A2440;
	--muted: #6f6987;
	--card: #ffffff;

	position: relative;
	max-width: 720px;
	margin: 32px auto;
	padding: 30px 22px 36px;
	border-radius: 26px;
	overflow: hidden;
	font-family: 'DM Sans', system-ui, sans-serif;
	color: var(--ink);
	background:
		linear-gradient(180deg, #efeafb 0%, #f6eefb 26%, #fff1dd 60%, var(--sand) 100%);
	box-shadow: 0 24px 60px -24px rgba(91, 63, 217, .35), 0 2px 0 rgba(255, 255, 255, .6) inset;
	isolation: isolate;
}

/* Ciel décoratif + halo de soleil */
.jevq-sky {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
}
.jevq-sky::after { /* ligne de mer */
	content: "";
	position: absolute;
	left: 0; right: 0;
	bottom: 0;
	height: 38%;
	background: linear-gradient(180deg, rgba(111, 208, 200, 0) 0%, rgba(111, 208, 200, .22) 60%, rgba(111, 208, 200, .32) 100%);
}
.jevq-sun-glow {
	position: absolute;
	top: -90px;
	left: 50%;
	transform: translateX(-50%);
	width: 360px;
	height: 360px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 209, 102, .55) 0%, rgba(255, 183, 3, .25) 40%, rgba(255, 183, 3, 0) 70%);
	animation: jevq-breathe 6s ease-in-out infinite;
}
@keyframes jevq-breathe {
	0%, 100% { transform: translateX(-50%) scale(1); opacity: .9; }
	50%      { transform: translateX(-50%) scale(1.08); opacity: 1; }
}

/* En-tête */
.jevq-head { text-align: center; margin-bottom: 22px; }
.jevq-eyebrow {
	font-size: 12px;
	letter-spacing: .28em;
	text-transform: uppercase;
	color: var(--gold-d);
	font-weight: 600;
	margin: 0 0 6px;
}
.jevq-title {
	font-family: 'Cormorant Garamond', serif;
	font-weight: 700;
	font-size: clamp(30px, 6vw, 46px);
	line-height: 1.02;
	margin: 0 0 8px;
	color: var(--ink);
}
.jevq-sub {
	font-size: 16px;
	color: var(--muted);
	max-width: 460px;
	margin: 0 auto;
	line-height: 1.45;
}

/* ===================== GRILLE / TUILES ===================== */
.jevq-board {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	max-width: 460px;
	margin: 0 auto;
}

.jevq-tile {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	perspective: 900px;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	font-family: inherit;
}
.jevq-tile:disabled { cursor: default; }

.jevq-card {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform .7s cubic-bezier(.34, 1.4, .5, 1);
}
.jevq-tile.is-flipped .jevq-card { transform: rotateY(180deg); }

.jevq-face {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 20px;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

/* Recto : objet de plage */
.jevq-front {
	background: linear-gradient(160deg, #ffffff 0%, #fbf7ff 100%);
	border: 1px solid rgba(124, 92, 252, .14);
	box-shadow: 0 10px 24px -14px rgba(91, 63, 217, .45), 0 1px 0 rgba(255, 255, 255, .9) inset;
	font-size: clamp(32px, 9vw, 46px);
	transition: transform .25s ease, box-shadow .25s ease;
}
.jevq-front .jevq-emoji { animation: jevq-float 4s ease-in-out infinite; }
@keyframes jevq-float {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50%      { transform: translateY(-5px) rotate(-3deg); }
}
.jevq-tile:not(:disabled):hover .jevq-front {
	transform: translateY(-4px);
	box-shadow: 0 18px 30px -14px rgba(91, 63, 217, .55);
}
.jevq-tile:focus-visible .jevq-front {
	outline: 3px solid var(--violet);
	outline-offset: 3px;
}

/* La tuile centrale = Le Soleil (signature) */
.jevq-tile.is-sun .jevq-front {
	background: radial-gradient(circle at 50% 38%, #fff6df 0%, #ffe9bd 70%, #ffdf9e 100%);
	border: 1px solid rgba(240, 140, 0, .35);
	box-shadow: 0 0 0 3px rgba(255, 209, 102, .35), 0 14px 30px -12px rgba(240, 140, 0, .5);
}
.jevq-tile.is-sun .jevq-emoji { animation: jevq-spin-soft 16s linear infinite; }
@keyframes jevq-spin-soft { to { transform: rotate(360deg); } }

/* Verso : la réduction dévoilée */
.jevq-back {
	transform: rotateY(180deg);
	flex-direction: column;
	gap: 2px;
	color: #fff;
	background: linear-gradient(150deg, var(--violet) 0%, var(--violet-d) 100%);
	box-shadow: 0 10px 24px -12px rgba(91, 63, 217, .6);
}
.jevq-back .jevq-pct {
	font-family: 'Cormorant Garamond', serif;
	font-weight: 700;
	font-size: clamp(26px, 8vw, 38px);
	line-height: 1;
}
.jevq-back .jevq-off {
	font-size: 10px;
	letter-spacing: .18em;
	text-transform: uppercase;
	opacity: .85;
}
/* verso gagnant (la tuile choisie) */
.jevq-tile.is-win .jevq-back {
	background: linear-gradient(150deg, var(--gold-l) 0%, var(--gold) 55%, var(--gold-d) 100%);
	box-shadow: 0 0 0 3px rgba(255, 209, 102, .5), 0 16px 34px -10px rgba(240, 140, 0, .7);
}
.jevq-tile.is-win .jevq-back .jevq-pct { color: #4a2c00; }
.jevq-tile.is-win .jevq-back .jevq-off { color: #6b4200; opacity: 1; }
/* tuiles non choisies dévoilées = grisées (teaser) */
.jevq-tile.is-miss .jevq-back {
	background: linear-gradient(150deg, #efeafb 0%, #e4ddf6 100%);
}
.jevq-tile.is-miss .jevq-back .jevq-pct { color: var(--violet-d); }
.jevq-tile.is-miss .jevq-back .jevq-off { color: var(--muted); }
.jevq-tile.is-miss { opacity: .82; }

/* shimmer de suspense pendant le tirage */
.jevq-tile.is-loading .jevq-front {
	animation: jevq-pulse .55s ease-in-out infinite alternate;
}
@keyframes jevq-pulse {
	from { box-shadow: 0 0 0 2px rgba(124, 92, 252, .25); transform: scale(1); }
	to   { box-shadow: 0 0 0 6px rgba(124, 92, 252, .12); transform: scale(1.04); }
}

/* ===================== PANNEAU RÉSULTAT ===================== */
.jevq-result {
	margin: 26px auto 0;
	max-width: 440px;
	background: var(--card);
	border-radius: 20px;
	padding: 24px 22px;
	text-align: center;
	box-shadow: 0 20px 44px -22px rgba(91, 63, 217, .5);
	border: 1px solid rgba(124, 92, 252, .12);
	animation: jevq-rise .5s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes jevq-rise {
	from { opacity: 0; transform: translateY(18px); }
	to   { opacity: 1; transform: translateY(0); }
}
.jevq-result.is-jackpot {
	border: 1px solid rgba(240, 140, 0, .3);
	background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
}

.jevq-r-kicker {
	font-size: 12px;
	letter-spacing: .22em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--gold-d);
	margin: 0 0 4px;
}
.jevq-r-headline {
	font-family: 'Cormorant Garamond', serif;
	font-weight: 700;
	font-size: clamp(28px, 7vw, 40px);
	line-height: 1.05;
	margin: 0 0 4px;
	color: var(--ink);
}
.jevq-r-headline em { font-style: normal; color: var(--violet); }
.jevq-result.is-jackpot .jevq-r-headline em { color: var(--gold-d); }
.jevq-r-msg { color: var(--muted); font-size: 15px; margin: 0 0 18px; line-height: 1.45; }

/* Bloc code pointillé (pattern VQ) */
.jevq-code-block {
	border: 2px dashed var(--violet);
	border-radius: 14px;
	padding: 14px 16px;
	background: var(--violet-soft);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
}
.jevq-result.is-jackpot .jevq-code-block {
	border-color: var(--gold-d);
	background: #fff4dc;
}
.jevq-code-val {
	font-family: 'DM Sans', monospace;
	font-weight: 700;
	font-size: clamp(20px, 5vw, 26px);
	letter-spacing: .06em;
	color: var(--ink);
}
.jevq-copy {
	flex: none;
	border: none;
	background: var(--violet);
	color: #fff;
	font-family: inherit;
	font-weight: 600;
	font-size: 13px;
	padding: 9px 14px;
	border-radius: 9px;
	cursor: pointer;
	transition: background .2s ease, transform .1s ease;
}
.jevq-result.is-jackpot .jevq-copy { background: var(--gold-d); }
.jevq-copy:hover { background: var(--violet-d); }
.jevq-copy:active { transform: scale(.95); }
.jevq-copy.is-done { background: #1a7f37; }

.jevq-expire { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.jevq-expire strong { color: var(--ink); }

.jevq-cta {
	display: inline-block;
	width: 100%;
	box-sizing: border-box;
	text-decoration: none;
	text-align: center;
	background: linear-gradient(135deg, var(--violet) 0%, var(--violet-d) 100%);
	color: #fff;
	font-weight: 600;
	font-size: 16px;
	padding: 14px 20px;
	border-radius: 12px;
	box-shadow: 0 12px 26px -12px rgba(91, 63, 217, .7);
	transition: transform .15s ease, box-shadow .15s ease;
}
.jevq-cta:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -12px rgba(91, 63, 217, .8); }
.jevq-result.is-jackpot .jevq-cta { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-d) 100%); box-shadow: 0 12px 26px -12px rgba(240, 140, 0, .7); }

.jevq-share {
	margin: 14px 0 0;
	background: none;
	border: none;
	color: var(--muted);
	font-family: inherit;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}
.jevq-share:hover { color: var(--violet); }

/* Bouton Rejouer (secondaire) */
.jevq-replay {
	display: inline-block;
	width: 100%;
	box-sizing: border-box;
	margin-top: 10px;
	background: #fff;
	color: var(--violet);
	border: 2px solid var(--violet);
	font-family: inherit;
	font-weight: 600;
	font-size: 15px;
	padding: 12px 20px;
	border-radius: 12px;
	cursor: pointer;
	text-align: center;
	transition: background .15s ease, transform .1s ease;
}
.jevq-replay:hover { background: var(--violet-soft); }
.jevq-replay:active { transform: scale(.98); }
.jevq-result.is-jackpot .jevq-replay { color: var(--gold-d); border-color: var(--gold-d); }
.jevq-result.is-jackpot .jevq-replay:hover { background: #fff4dc; }

/* Pied */
.jevq-foot {
	text-align: center;
	font-size: 13px;
	color: var(--muted);
	margin: 22px 0 0;
}

/* ===================== CONFETTIS ===================== */
.jevq-confetti {
	position: absolute;
	top: -12px;
	width: 9px;
	height: 14px;
	border-radius: 2px;
	z-index: 5;
	pointer-events: none;
	will-change: transform, opacity;
	animation: jevq-fall linear forwards;
}
@keyframes jevq-fall {
	0%   { transform: translateY(0) rotateZ(0deg); opacity: 1; }
	100% { transform: translateY(640px) rotateZ(540deg); opacity: 0; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 480px) {
	.jevq-game { padding: 24px 14px 30px; border-radius: 22px; margin: 20px auto; }
	.jevq-board { gap: 12px; }
	.jevq-code-block { flex-direction: column; }
	.jevq-copy { width: 100%; }
}

/* Accessibilité : mouvement réduit */
@media (prefers-reduced-motion: reduce) {
	.jevq-sun-glow,
	.jevq-front .jevq-emoji,
	.jevq-tile.is-sun .jevq-emoji,
	.jevq-tile.is-loading .jevq-front { animation: none; }
	.jevq-card { transition: transform .01s; }
	.jevq-confetti { display: none; }
}
