/* =========================================================================
   Gamification Gains — styles publics (mobile d'abord)
   Toutes les règles sont préfixées .gg-app pour cohabiter avec les thèmes.
   ========================================================================= */

:root {
	--gg-primary: #0E7C66;
	--gg-secondary: #F5A623;
}

.gg-app {
	--gg-text: #1F2937;
	--gg-muted: #6B7280;
	--gg-border: #E5E7EB;
	--gg-surface: #FFFFFF;
	--gg-soft: #F9FAFB;
	--gg-ok: #059669;
	--gg-ko: #DC2626;
	--gg-radius: 16px;
	--gg-shadow: 0 6px 24px rgba(17, 24, 39, .08);
	box-sizing: border-box;
	color: var(--gg-text);
	font-size: 16px;
	line-height: 1.5;
	max-width: 960px;
	margin: 0 auto 2rem;
}

.gg-app *,
.gg-app *::before,
.gg-app *::after { box-sizing: border-box; }

.gg-app img { max-width: 100%; height: auto; display: block; }
.gg-app [hidden] { display: none !important; }

.gg-app .gg-title {
	font-size: clamp(1.25rem, 4.5vw, 1.75rem);
	line-height: 1.25;
	margin: 0 0 .75rem;
	text-align: center;
}

.gg-app .gg-muted { color: var(--gg-muted); }

.gg-app .gg-card {
	background: var(--gg-surface);
	border: 1px solid var(--gg-border);
	border-radius: var(--gg-radius);
	box-shadow: var(--gg-shadow);
	padding: 1.25rem;
}

/* ---------- Boutons ---------- */
.gg-app .gg-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	justify-content: center;
	margin: 1rem 0 0;
}

.gg-app .gg-btn {
	-webkit-appearance: none;
	appearance: none;
	align-items: center;
	background: var(--gg-primary);
	border: 2px solid var(--gg-primary);
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-weight: 700;
	gap: .5rem;
	justify-content: center;
	line-height: 1.2;
	min-height: 48px;
	padding: .75rem 1.5rem;
	text-decoration: none;
	transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}
.gg-app .gg-btn:hover { filter: brightness(1.08); color: #fff; }
.gg-app .gg-btn:active { transform: scale(.97); }
.gg-app .gg-btn:focus-visible { outline: 3px solid var(--gg-secondary); outline-offset: 2px; }
.gg-app .gg-btn[disabled] { cursor: not-allowed; opacity: .5; transform: none; }
.gg-app .gg-btn--ghost { background: transparent; color: var(--gg-primary); }
.gg-app .gg-btn--ghost:hover { color: var(--gg-primary); }
.gg-app .gg-btn--secondary { background: var(--gg-secondary); border-color: var(--gg-secondary); color: #1F2937; }
.gg-app .gg-btn--secondary:hover { color: #1F2937; }
.gg-app .gg-btn--small { min-height: 38px; padding: .45rem 1rem; font-size: .9rem; }
.gg-app .gg-btn--block { width: 100%; }

.gg-app .gg-back {
	color: var(--gg-primary);
	display: inline-block;
	font-weight: 600;
	margin-bottom: .75rem;
	text-decoration: none;
}

/* ---------- Messages ---------- */
.gg-app.gg-notice,
.gg-app.gg-guest { text-align: center; }
.gg-app .gg-notice__icon,
.gg-app .gg-guest__icon { display: block; font-size: 2.5rem; margin-bottom: .5rem; }
.gg-app.gg-notice p,
.gg-app .gg-guest__text { margin: 0; font-size: 1.05rem; }

.gg-app .gg-banner {
	align-items: center;
	background: #FFF7E6;
	background: color-mix(in srgb, var(--gg-secondary) 14%, #fff);
	border: 1px solid #FCD9A0;
	border: 1px solid color-mix(in srgb, var(--gg-secondary) 45%, #fff);
	border-radius: var(--gg-radius);
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	margin-bottom: 1rem;
	padding: 1rem;
}
.gg-app .gg-banner p { flex: 1 1 220px; margin: 0; }
.gg-app .gg-banner__icon { font-size: 1.75rem; }

.gg-app .gg-toast {
	border-radius: 12px;
	font-weight: 600;
	margin: 1rem 0 0;
	padding: .85rem 1rem;
	text-align: center;
}
.gg-app .gg-toast--ok { background: #ECFDF5; color: #065F46; }
.gg-app .gg-toast--ko { background: #FEF2F2; color: #991B1B; }
.gg-app .gg-toast--info { background: var(--gg-soft); color: var(--gg-text); }

/* ---------- Grille / tuiles ---------- */
.gg-app .gg-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}
@media (min-width: 560px) { .gg-app .gg-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .gg-app .gg-grid { grid-template-columns: repeat(3, 1fr); } }

.gg-app .gg-tile {
	background: var(--gg-surface);
	border: 1px solid var(--gg-border);
	border-radius: var(--gg-radius);
	box-shadow: var(--gg-shadow);
	color: inherit;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	text-decoration: none;
	transition: transform .2s ease, box-shadow .2s ease;
}
.gg-app a.gg-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(17, 24, 39, .12); color: inherit; }

.gg-app .gg-tile__media {
	-webkit-appearance: none;
	appearance: none;
	aspect-ratio: 16 / 9;
	background: var(--gg-primary);
	background: linear-gradient(135deg, var(--gg-primary), color-mix(in srgb, var(--gg-primary) 55%, var(--gg-secondary)));
	border: 0;
	cursor: pointer;
	display: block;
	margin: 0;
	overflow: hidden;
	padding: 0;
	position: relative;
	width: 100%;
}
.gg-app .gg-tile__media img { height: 100%; object-fit: cover; width: 100%; }
.gg-app .gg-tile__placeholder {
	align-items: center;
	display: flex;
	font-size: 3rem;
	height: 100%;
	justify-content: center;
}
.gg-app .gg-tile__body { display: flex; flex-direction: column; gap: .25rem; padding: 1rem; }
.gg-app .gg-tile__cat {
	color: var(--gg-primary);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.gg-app .gg-tile__title { font-size: 1.05rem; font-weight: 700; line-height: 1.3; margin: 0; }
.gg-app .gg-tile__meta { color: var(--gg-muted); font-size: .9rem; }
.gg-app .gg-tile__meta p { margin: 0 0 .25rem; }

.gg-app .gg-badge {
	border-radius: 999px;
	font-size: .75rem;
	font-weight: 700;
	left: .6rem;
	padding: .25rem .65rem;
	position: absolute;
	top: .6rem;
}
.gg-app .gg-badge--new { background: var(--gg-secondary); color: #1F2937; }
.gg-app .gg-badge--progress { background: #DBEAFE; color: #1E40AF; }
.gg-app .gg-badge--done { background: #ECFDF5; color: #065F46; }
.gg-app .gg-badge--off { background: #F3F4F6; color: #4B5563; }

/* ---------- Roue ---------- */
.gg-app.gg-wheel { text-align: center; }
.gg-app .gg-wheel__stage {
	margin: 0 auto;
	max-width: min(92vw, 440px);
	position: relative;
}
.gg-app .gg-wheel__canvas {
	border-radius: 50%;
	box-shadow: 0 10px 40px rgba(17, 24, 39, .25), 0 0 0 8px var(--gg-secondary), 0 0 0 12px var(--gg-primary);
	height: auto;
	width: 100%;
}
.gg-app .gg-wheel__pointer {
	border-left: 18px solid transparent;
	border-right: 18px solid transparent;
	border-top: 34px solid var(--gg-secondary);
	filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35));
	left: 50%;
	position: absolute;
	top: -14px;
	transform: translateX(-50%);
	z-index: 2;
}
.gg-app .gg-wheel__hub {
	-webkit-appearance: none;
	appearance: none;
	aspect-ratio: 1;
	background: radial-gradient(circle at 35% 30%, #fff, #F3F4F6);
	border: 5px solid var(--gg-primary);
	border-radius: 50%;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
	color: var(--gg-primary);
	cursor: pointer;
	font: inherit;
	font-size: clamp(.7rem, 3vw, .95rem);
	font-weight: 800;
	left: 50%;
	padding: 0;
	position: absolute;
	text-transform: uppercase;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 24%;
	z-index: 2;
}
.gg-app .gg-wheel__hub[disabled] { cursor: default; color: var(--gg-muted); }
.gg-app .gg-wheel__status { margin-top: 1.25rem; min-height: 1.5rem; }
.gg-app .gg-wheel__count { font-weight: 700; }
.gg-app .gg-countdown {
	display: inline-flex;
	font-size: 1.5rem;
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	gap: .35rem;
	margin-top: .25rem;
}
.gg-app .gg-wheel__history { margin-top: 1.5rem; text-align: left; }
.gg-app .gg-wheel__history h3 { font-size: 1rem; margin: 0 0 .5rem; }
.gg-app .gg-sound {
	background: none;
	border: 0;
	cursor: pointer;
	font-size: 1.25rem;
	position: absolute;
	right: 0;
	top: 0;
	z-index: 3;
}

.gg-app .gg-feed { list-style: none; margin: 0; padding: 0; }
.gg-app .gg-feed li {
	align-items: center;
	border-bottom: 1px solid var(--gg-border);
	display: grid;
	gap: .15rem .75rem;
	grid-template-columns: 1fr auto;
	padding: .6rem 0;
}
.gg-app .gg-feed li:last-child { border-bottom: 0; }
.gg-app .gg-feed__what { font-weight: 600; }
.gg-app .gg-feed__result { font-weight: 700; text-align: right; }
.gg-app .gg-feed__date { color: var(--gg-muted); font-size: .8rem; grid-column: 1 / -1; }

/* ---------- Modale résultat ---------- */
.gg-modal {
	align-items: center;
	background: rgba(17, 24, 39, .6);
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 1rem;
	position: fixed;
	z-index: 99999;
}
.gg-modal__box {
	animation: gg-pop .35s cubic-bezier(.2, 1.4, .4, 1);
	background: #fff;
	border-radius: 20px;
	color: #1F2937;
	max-height: 92vh;
	max-width: 420px;
	overflow: auto;
	padding: 1.75rem 1.25rem 1.25rem;
	position: relative;
	text-align: center;
	width: 100%;
}
.gg-modal__box--video { background: #000; max-width: 960px; padding: 0; }
.gg-modal__box--video.is-portrait { max-width: 420px; }
.gg-modal__emoji { font-size: 3.5rem; line-height: 1; }
.gg-modal__title { font-size: 1.4rem; font-weight: 800; margin: .5rem 0; }
.gg-modal__close {
	background: rgba(255, 255, 255, .9);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.25rem;
	height: 40px;
	line-height: 40px;
	position: absolute;
	right: .5rem;
	top: .5rem;
	width: 40px;
	z-index: 2;
}
@keyframes gg-pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }

.gg-confetti { inset: 0; pointer-events: none; position: fixed; z-index: 100000; }

/* ---------- Quiz ---------- */
.gg-app .gg-quiz__cover { border-radius: 12px; margin: -.25rem 0 1rem; max-height: 260px; object-fit: cover; width: 100%; }
.gg-app .gg-desc { color: var(--gg-muted); }
.gg-app .gg-facts {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	justify-content: center;
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
}
.gg-app .gg-facts li { background: var(--gg-soft); border-radius: 999px; font-size: .9rem; padding: .35rem .8rem; }
.gg-app .gg-quiz__intro { text-align: center; }
.gg-app .gg-quiz__locked { margin-top: 1rem; }
.gg-app .gg-result-mini { border-radius: 12px; font-weight: 700; margin-top: 1rem; padding: .75rem; }
.gg-app .gg-result-mini.is-pass { background: #ECFDF5; color: #065F46; }
.gg-app .gg-result-mini.is-fail { background: #FEF2F2; color: #991B1B; }

.gg-app .gg-progress { background: var(--gg-border); border-radius: 999px; height: 8px; overflow: hidden; }
.gg-app .gg-progress__bar { background: var(--gg-primary); display: block; height: 100%; transition: width .3s ease; width: 0; }
.gg-app .gg-step-label { color: var(--gg-muted); font-size: .85rem; font-weight: 600; margin: .5rem 0 1rem; }
.gg-app .gg-q-head { align-items: center; display: flex; justify-content: space-between; gap: .5rem; }
.gg-app .gg-timer {
	background: var(--gg-soft);
	border-radius: 999px;
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	padding: .2rem .7rem;
}
.gg-app .gg-timer.is-low { background: #FEE2E2; color: var(--gg-ko); }
.gg-app .gg-q__text { font-size: 1.15rem; font-weight: 700; margin: 0 0 1rem; padding: 0; }
.gg-app .gg-q__hint { color: var(--gg-muted); font-size: .85rem; margin: -.5rem 0 .75rem; }

.gg-app .gg-choices { display: grid; gap: .6rem; }
.gg-app .gg-choices--inline { grid-template-columns: 1fr 1fr; }
.gg-app .gg-choice {
	align-items: center;
	background: var(--gg-surface);
	border: 2px solid var(--gg-border);
	border-radius: 12px;
	cursor: pointer;
	display: flex;
	gap: .75rem;
	min-height: 52px;
	padding: .75rem 1rem;
	transition: border-color .15s ease, background .15s ease;
}
.gg-app .gg-choice input { accent-color: var(--gg-primary); flex: none; height: 20px; margin: 0; width: 20px; }
.gg-app .gg-choice.is-checked,
.gg-app .gg-choice:has(input:checked) { background: #F0FDF9; border-color: var(--gg-primary); }
.gg-app .gg-choice:has(input:checked) { background: color-mix(in srgb, var(--gg-primary) 8%, #fff); border-color: var(--gg-primary); }
.gg-app .gg-choice.is-correct { background: #ECFDF5; border-color: var(--gg-ok); }
.gg-app .gg-choice.is-wrong { background: #FEF2F2; border-color: var(--gg-ko); }
.gg-app .gg-choice.is-locked { cursor: default; }

.gg-app .gg-feedback { border-radius: 12px; margin-top: 1rem; padding: 1rem; }
.gg-app .gg-feedback.is-ok { background: #ECFDF5; }
.gg-app .gg-feedback.is-ko { background: #FEF2F2; }
.gg-app .gg-feedback strong { display: block; margin-bottom: .25rem; }
.gg-app .gg-feedback p { margin: .25rem 0 0; }
.gg-app .gg-feedback a { color: var(--gg-primary); font-weight: 700; }

.gg-app .gg-score {
	align-items: center;
	background: conic-gradient(var(--gg-primary) calc(var(--gg-pct, 0) * 1%), var(--gg-border) 0);
	border-radius: 50%;
	display: flex;
	height: 140px;
	justify-content: center;
	margin: 0 auto 1rem;
	width: 140px;
}
.gg-app .gg-score span {
	align-items: center;
	background: #fff;
	border-radius: 50%;
	display: flex;
	font-size: 2rem;
	font-weight: 800;
	height: 110px;
	justify-content: center;
	width: 110px;
}
.gg-app .gg-correction { list-style: none; margin: 1.25rem 0 0; padding: 0; text-align: left; }
.gg-app .gg-correction li { border-left: 4px solid var(--gg-border); margin-bottom: .75rem; padding: .5rem .75rem; }
.gg-app .gg-correction li.is-ok { border-color: var(--gg-ok); }
.gg-app .gg-correction li.is-ko { border-color: var(--gg-ko); }
.gg-app .gg-correction p { margin: .2rem 0; font-size: .92rem; }

/* ---------- Sondage ---------- */
.gg-app .gg-survey__q { border: 0; margin: 0; min-width: 0; padding: 0; }
.gg-app .gg-required { color: var(--gg-ko); }
.gg-app .gg-field-error { color: var(--gg-ko); font-weight: 600; margin: .5rem 0 0; }
.gg-app .gg-input {
	border: 2px solid var(--gg-border);
	border-radius: 12px;
	font: inherit;
	padding: .75rem 1rem;
	width: 100%;
}
.gg-app .gg-input:focus { border-color: var(--gg-primary); outline: none; }
.gg-app .gg-scale { display: grid; gap: .4rem; grid-template-columns: repeat(5, 1fr); }
.gg-app .gg-scale--10 { grid-template-columns: repeat(5, 1fr); }
@media (min-width: 560px) { .gg-app .gg-scale--10 { grid-template-columns: repeat(10, 1fr); } }
.gg-app .gg-scale__item { cursor: pointer; position: relative; }
.gg-app .gg-scale__item input { opacity: 0; position: absolute; }
.gg-app .gg-scale__item span {
	align-items: center;
	border: 2px solid var(--gg-border);
	border-radius: 12px;
	display: flex;
	font-weight: 700;
	height: 48px;
	justify-content: center;
}
.gg-app .gg-scale__item input:checked + span { background: var(--gg-primary); border-color: var(--gg-primary); color: #fff; }
.gg-app .gg-scale__item input:focus-visible + span { outline: 3px solid var(--gg-secondary); }
.gg-app .gg-scale__legend { color: var(--gg-muted); display: flex; font-size: .8rem; justify-content: space-between; margin-top: .35rem; }
.gg-app .gg-survey__nav { justify-content: space-between; }
.gg-app .gg-survey__done { padding: 1.5rem 0 .5rem; text-align: center; }

/* ---------- Vidéos ---------- */
.gg-app .gg-video__icon {
	background: rgba(0, 0, 0, .55);
	border-radius: 50%;
	height: 64px;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	transition: transform .2s ease, background .2s ease;
	width: 64px;
}
.gg-app .gg-video__icon::after {
	border-bottom: 13px solid transparent;
	border-left: 22px solid #fff;
	border-top: 13px solid transparent;
	content: "";
	left: 24px;
	position: absolute;
	top: 19px;
}
.gg-app .gg-video__play:hover .gg-video__icon { background: var(--gg-primary); transform: translate(-50%, -50%) scale(1.08); }
.gg-player { aspect-ratio: 16 / 9; width: 100%; }
.gg-player.is-portrait { aspect-ratio: 9 / 16; max-height: 86vh; margin: 0 auto; }
.gg-player.is-square { aspect-ratio: 1; }
.gg-player.is-classic { aspect-ratio: 4 / 3; }
.gg-player iframe,
.gg-player video { border: 0; display: block; height: 100%; width: 100%; }

@media (prefers-reduced-motion: reduce) {
	.gg-app *,
	.gg-modal__box { animation: none !important; transition: none !important; }
}
