/**
 * Calendrier de l'Avent - thème Noël & hiver
 * @copyright (c) 2026 Kevicar
 * @license GPL-2.0-only
 */

.advent,
.advent-modal,
.advent-toast {
	--adv-night: #0b1d36;
	--adv-night-2: #14335a;
	--adv-red: #c8102e;
	--adv-red-dark: #7d0a1d;
	--adv-green: #146b3a;
	--adv-green-dark: #0b3d22;
	--adv-gold: #f3c34a;
	--adv-gold-dark: #b8861b;
	--adv-ice: #bfe3ff;
	--adv-snow: #fdfeff;
	--adv-text: #f4f7fb;
}

.advent {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	margin: 10px 0 20px;
	padding: 34px 22px 30px;
	border-radius: 16px;
	color: var(--adv-text);
	background: radial-gradient(ellipse at 50% 0%, #22497a 0%, var(--adv-night-2) 35%, var(--adv-night) 100%);
	box-shadow: 0 10px 40px rgba(4, 14, 30, .45), inset 0 0 0 1px rgba(255, 255, 255, .06);
	display: grid;
	grid-template-columns: minmax(0, 1fr) 280px;
	column-gap: 22px;
	font-family: "Trebuchet MS", "Segoe UI", Roboto, Arial, sans-serif;
}

.advent > .advent-hero,
.advent > .advent-notice,
.advent > .advent-countdown-big,
.advent > .advent-progress,
.advent > .advent-next { grid-column: 1 / -1; }
.advent > .advent-grid { grid-column: 1; }
.advent > .advent-side { grid-column: 2; align-self: start; }
.advent.no-side { grid-template-columns: minmax(0, 1fr); }
.advent > .advent-below {
	grid-column: 1 / -1; margin-top: 22px;
	display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch;
}
.advent-below > .advent-share { flex: 1 1 100%; margin-top: 0; box-sizing: border-box; }
.advent-below > .advent-card { flex: 1 1 250px; min-width: 0; box-sizing: border-box; }

.advent a { color: var(--adv-gold); }

/* ---------- Ciel, lune, étoiles, collines ---------- */
.advent-sky { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.advent-moon {
	position: absolute; top: 26px; right: 7%;
	width: 70px; height: 70px; border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #fffef4 0%, #f3ecc8 60%, #d9cf9e 100%);
	box-shadow: 0 0 40px 12px rgba(255, 248, 210, .35), 0 0 120px 40px rgba(255, 248, 210, .12);
}
.advent-stars {
	position: absolute; inset: 0;
	background-image:
		radial-gradient(1.5px 1.5px at 8% 12%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 18% 30%, #fff 50%, transparent 51%),
		radial-gradient(2px 2px at 27% 8%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 38% 22%, #fff 50%, transparent 51%),
		radial-gradient(1.5px 1.5px at 52% 6%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 61% 28%, #fff 50%, transparent 51%),
		radial-gradient(2px 2px at 72% 14%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 84% 34%, #fff 50%, transparent 51%),
		radial-gradient(1.5px 1.5px at 94% 9%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 46% 38%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 4% 44%, #fff 50%, transparent 51%),
		radial-gradient(1.5px 1.5px at 66% 46%, #fff 50%, transparent 51%);
	animation: advent-twinkle 4s ease-in-out infinite alternate;
}
.advent-hills {
	position: absolute; left: -5%; right: -5%; bottom: -40px; height: 160px;
	background:
		radial-gradient(ellipse 40% 100% at 20% 100%, #e9f3ff 60%, transparent 61%),
		radial-gradient(ellipse 45% 90% at 75% 100%, #dfeefc 60%, transparent 61%),
		radial-gradient(ellipse 30% 70% at 50% 100%, #f6fbff 60%, transparent 61%);
	opacity: .14;
}
@keyframes advent-twinkle { from { opacity: .45; } to { opacity: 1; } }

.advent-snow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* ---------- Guirlande lumineuse ---------- */
.advent-garland {
	position: absolute; top: -6px; left: 0; right: 0;
	display: flex; justify-content: space-between;
	margin: 0; padding: 0 10px; list-style: none;
	pointer-events: none;
}
.advent-garland::before {
	content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22px;
	border-bottom: 2px solid rgba(20, 40, 30, .9);
	border-radius: 0 0 50% 50% / 0 0 22px 22px;
}
.advent-garland li {
	position: relative; top: 12px;
	width: 10px; height: 16px; border-radius: 50%;
	background: var(--adv-gold);
	box-shadow: 0 2px 12px 2px var(--adv-gold);
	animation: advent-bulb 1.6s ease-in-out infinite alternate;
}
.advent-garland li::before {
	content: ""; position: absolute; top: -5px; left: 2px; width: 6px; height: 6px; border-radius: 2px; background: #2c3a2f;
}
.advent-garland li:nth-child(4n+1) { background: #ff3b4f; box-shadow: 0 2px 12px 2px #ff3b4f; animation-delay: .2s; }
.advent-garland li:nth-child(4n+2) { background: #33d17a; box-shadow: 0 2px 12px 2px #33d17a; animation-delay: .7s; }
.advent-garland li:nth-child(4n+3) { background: #4fb3ff; box-shadow: 0 2px 12px 2px #4fb3ff; animation-delay: 1.1s; }
.advent-garland li:nth-child(odd) { top: 16px; }
.advent-garland li:nth-child(3n) { top: 19px; }
@keyframes advent-bulb { from { opacity: .35; filter: saturate(.6); } to { opacity: 1; filter: saturate(1.3); } }

/* ---------- En-tête ---------- */
.advent-hero { text-align: center; padding: 14px 0 6px; }
.advent-kicker { margin: 0 0 4px; letter-spacing: .3em; text-transform: uppercase; font-size: 12px; color: var(--adv-ice); opacity: .9; }
.advent-title {
	margin: 0; padding: 0; border: 0;
	font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: bold;
	font-size: clamp(30px, 5.5vw, 54px); line-height: 1.1; color: var(--adv-snow);
	text-shadow: 0 2px 0 var(--adv-red-dark), 0 0 24px rgba(255, 215, 120, .45);
	text-transform: none;
}
.advent-title span { color: var(--adv-gold); }
.advent-subtitle { margin: 10px auto 0; max-width: 620px; font-size: 15px; line-height: 1.5; color: #d9e6f5; }

.advent-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.advent-ctrl {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 14px; border-radius: 999px; cursor: pointer;
	font: inherit; font-size: 13px; color: #fff;
	background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25);
	transition: background .2s, transform .2s;
}
.advent-ctrl:hover { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.advent-ctrl[aria-pressed="true"] { background: rgba(243, 195, 74, .25); border-color: var(--adv-gold); }
.advent-ctrl[aria-pressed="false"] .advent-ctrl-icon { opacity: .5; }
.advent-ctrl.is-calling { animation: advent-call 1.8s ease-in-out infinite; }
@keyframes advent-call { 0%, 100% { box-shadow: 0 0 0 0 rgba(243, 195, 74, .6); } 50% { box-shadow: 0 0 0 8px rgba(243, 195, 74, 0); } }

/* ---------- Bandeaux / compte à rebours ---------- */
.advent-notice {
	margin: 14px 0 0; padding: 12px 16px; border-radius: 10px; text-align: center;
	background: rgba(255, 255, 255, .1); border: 1px dashed rgba(255, 255, 255, .3); font-size: 14px;
}
.advent-notice-test { background: rgba(79, 179, 255, .15); border-color: #4fb3ff; }
.advent-notice-gold { background: rgba(243, 195, 74, .15); border-color: var(--adv-gold); }

.advent-countdown-big { margin-top: 18px; text-align: center; }
.advent-countdown-big p { margin: 0 0 10px; font-size: 16px; }
.advent-clock { display: flex; justify-content: center; gap: 10px; }
.advent-countdown-big .advent-clock span {
	display: flex; flex-direction: column; align-items: center; min-width: 70px; padding: 10px 6px;
	border-radius: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
	background: linear-gradient(180deg, var(--adv-red), var(--adv-red-dark)); box-shadow: 0 4px 0 #4d0612;
}
.advent-countdown-big .advent-clock b { font-size: 30px; font-family: Georgia, serif; letter-spacing: 0; }
.advent-clock-inline { display: inline; font-variant-numeric: tabular-nums; }
.advent-clock-inline b { color: var(--adv-gold); }
.advent-next { margin: 12px 0 0; text-align: center; font-size: 14px; color: #d9e6f5; }

/* ---------- Progression ---------- */
.advent-progress { margin-top: 18px; }
.advent-progress-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; font-size: 14px; }
.advent-bonus-hint { color: var(--adv-gold); }
.advent-progress-bar { height: 12px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4); }
.advent-progress-bar span {
	display: block; height: 100%; min-width: 4px; border-radius: inherit;
	background: repeating-linear-gradient(-45deg, var(--adv-red) 0 10px, #fff 10px 20px);
	background-size: 28px 28px; animation: advent-candy 1.2s linear infinite;
	transition: width 1s cubic-bezier(.2, .8, .2, 1);
}
@keyframes advent-candy { to { background-position: 28px 0; } }

/* ---------- Grille des portes ---------- */
.advent-grid {
	margin-top: 22px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
	grid-auto-rows: 118px;
	grid-auto-flow: dense;
	gap: 12px;
	perspective: 1200px;
}
.advent-cell { position: relative; }
.advent-cell-24 { grid-column: span 2; grid-row: span 2; }
.advent-cell-5, .advent-cell-17 { grid-row: span 2; }
.advent-cell-12 { grid-column: span 2; }

.advent-door {
	position: relative; display: block; width: 100%; height: 100%;
	padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
	font: inherit; color: inherit; perspective: 900px;
	border-radius: 10px;
}
.advent-door:focus-visible { outline: 3px solid var(--adv-gold); outline-offset: 3px; }

.advent-door-inside {
	position: absolute; inset: 0; border-radius: 10px; overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	background: radial-gradient(circle at 50% 40%, #fff8e1 0%, #f1d48a 55%, #b8861b 100%);
	box-shadow: inset 0 0 18px rgba(0, 0, 0, .55);
}
.advent-door-inside img { width: 100%; height: 100%; object-fit: cover; }
.advent-inside-icon { font-size: 40px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.advent-cell-24 .advent-inside-icon { font-size: 80px; }

.advent-door-front {
	position: absolute; inset: 0; border-radius: 10px;
	display: flex; align-items: center; justify-content: center;
	transform-origin: left center; transform-style: preserve-3d; backface-visibility: hidden;
	transition: transform .9s cubic-bezier(.3, 1.4, .5, 1), box-shadow .3s;
	background-color: var(--adv-red);
	box-shadow: 0 6px 14px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .25), inset 0 0 0 6px rgba(0, 0, 0, .12);
	overflow: hidden;
}
/* Motifs variés des portes */
.advent-cell:nth-child(6n+1) .advent-door-front { background: linear-gradient(160deg, #e0263f, var(--adv-red-dark)); }
.advent-cell:nth-child(6n+2) .advent-door-front { background: linear-gradient(160deg, #1f8a4c, var(--adv-green-dark)); }
.advent-cell:nth-child(6n+3) .advent-door-front { background: repeating-linear-gradient(45deg, #fff 0 12px, #e0263f 12px 24px); }
.advent-cell:nth-child(6n+4) .advent-door-front { background: radial-gradient(circle at 30% 30%, #6fb8ff, #1c4f8c); }
.advent-cell:nth-child(6n+5) .advent-door-front { background: linear-gradient(160deg, #f6d36b, var(--adv-gold-dark)); }
.advent-cell:nth-child(6n+6) .advent-door-front {
	background-color: #0f5a33;
	background-image: radial-gradient(rgba(255, 255, 255, .35) 2px, transparent 2.5px);
	background-size: 16px 16px;
}
.advent-cell-24 .advent-door-front {
	background:
		radial-gradient(circle at 50% 50%, rgba(255, 230, 150, .35), transparent 60%),
		linear-gradient(160deg, #b0122a, #4d0612) !important;
}
/* Ruban sur certaines portes */
.advent-cell:nth-child(3n+2) .advent-door-front::before,
.advent-cell-24 .advent-door-front::before {
	content: ""; position: absolute; inset: 0;
	background:
		linear-gradient(90deg, transparent calc(50% - 6px), rgba(243, 195, 74, .9) calc(50% - 6px), rgba(243, 195, 74, .9) calc(50% + 6px), transparent calc(50% + 6px)),
		linear-gradient(0deg, transparent calc(50% - 6px), rgba(243, 195, 74, .9) calc(50% - 6px), rgba(243, 195, 74, .9) calc(50% + 6px), transparent calc(50% + 6px));
	opacity: .85;
}
/* Neige sur le haut de chaque porte */
.advent-door-front::after {
	content: ""; position: absolute; top: -2px; left: -2px; right: -2px; height: 14px;
	background:
		radial-gradient(circle at 10% 0, #fff 9px, transparent 10px),
		radial-gradient(circle at 32% 0, #fff 7px, transparent 8px),
		radial-gradient(circle at 55% 0, #fff 10px, transparent 11px),
		radial-gradient(circle at 78% 0, #fff 7px, transparent 8px),
		radial-gradient(circle at 96% 0, #fff 9px, transparent 10px);
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2));
}

.advent-door-num {
	position: relative; z-index: 1;
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 54px; height: 54px; padding: 0 6px; border-radius: 50%;
	font-family: Georgia, "Times New Roman", serif; font-weight: bold; font-size: 30px; color: #fff;
	text-shadow: 0 2px 3px rgba(0, 0, 0, .5);
	background: rgba(0, 0, 0, .18); box-shadow: 0 0 0 2px rgba(255, 255, 255, .55);
}
.advent-cell:nth-child(6n+3) .advent-door-num, .advent-cell:nth-child(6n+5) .advent-door-num { background: rgba(125, 10, 29, .82); }
.advent-cell-24 .advent-door-num { min-width: 110px; height: 110px; font-size: 64px; color: var(--adv-gold); box-shadow: 0 0 0 3px var(--adv-gold), 0 0 30px rgba(243, 195, 74, .6); }
.advent-cell-24 .advent-door-num::after { content: "\2605"; position: absolute; top: -26px; font-size: 26px; color: var(--adv-gold); text-shadow: 0 0 12px var(--adv-gold); }

.advent-door-knob {
	position: absolute; right: 9px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #fff6cf, var(--adv-gold-dark)); box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.advent-door-tag {
	position: absolute; z-index: 1; bottom: 8px; left: 50%; transform: translateX(-50%);
	padding: 2px 8px; border-radius: 999px; white-space: nowrap;
	font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: .08em;
	background: var(--adv-gold); color: #5a1010;
}
.advent-door-tag-ice { background: var(--adv-ice); color: #12345a; }
.advent-door-lock { position: absolute; z-index: 1; top: 8px; right: 8px; font-size: 13px; opacity: .75; }

/* États */
.advent-cell.is-locked .advent-door-front { filter: saturate(.75) brightness(.85); }
.advent-cell.is-locked .advent-door { cursor: not-allowed; }
.advent-cell.is-missed .advent-door-front { filter: grayscale(.6) brightness(.9); }
.advent-cell.is-missed .advent-door-front { box-shadow: inset 0 0 25px rgba(191, 227, 255, .9), 0 6px 14px rgba(0, 0, 0, .35); }

.advent-cell.is-openable .advent-door:hover .advent-door-front,
.advent-cell.is-openable .advent-door:focus-visible .advent-door-front { transform: rotateY(-14deg); box-shadow: 8px 8px 20px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .35); }
.advent-cell.is-today .advent-door { animation: advent-glow 2s ease-in-out infinite; }
.advent-cell.is-today.is-openable .advent-door-num { animation: advent-pulse 1.4s ease-in-out infinite; }
@keyframes advent-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(243, 195, 74, .0), 0 0 18px 2px rgba(243, 195, 74, .45); } 50% { box-shadow: 0 0 0 4px rgba(243, 195, 74, .25), 0 0 34px 8px rgba(243, 195, 74, .75); } }
@keyframes advent-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

.advent-cell.is-open .advent-door-front { transform: rotateY(-108deg); box-shadow: -6px 0 12px rgba(0, 0, 0, .3); }
.advent-cell.is-open .advent-door { cursor: zoom-in; }
.advent-cell.is-open .advent-door:hover .advent-door-inside { filter: brightness(1.08); }

.advent-cell.is-shaking .advent-door { animation: advent-shake .5s ease; }
.advent-cell.is-opening .advent-door-front { transition-duration: 1.2s; }
@keyframes advent-shake {
	0%, 100% { transform: translateX(0) rotate(0); }
	20% { transform: translateX(-5px) rotate(-2deg); }
	40% { transform: translateX(5px) rotate(2deg); }
	60% { transform: translateX(-3px) rotate(-1deg); }
	80% { transform: translateX(3px) rotate(1deg); }
}

/* ---------- Colonne latérale ---------- */
.advent-side { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.advent-card {
	padding: 14px 16px; border-radius: 12px;
	background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
	backdrop-filter: blur(4px);
}
.advent-card h3 {
	margin: 0 0 8px; padding: 0 0 6px; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .15);
	font-family: Georgia, serif; font-size: 16px; color: var(--adv-gold); text-transform: none;
}
.advent-stats { margin: 0 0 8px; font-size: 13px; }
.advent-stats strong { color: var(--adv-gold); font-size: 16px; }
.advent-openers, .advent-rules { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.advent-openers li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed rgba(255, 255, 255, .1); }
.advent-openers li:last-child { border-bottom: 0; }
.advent-openers small { margin-left: auto; opacity: .6; font-size: 11px; white-space: nowrap; }
.advent-openers .username-coloured, .advent-openers .username { font-weight: bold; color: #fff; }
.advent-opener-day {
	flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
	width: 24px; height: 24px; border-radius: 6px; font-weight: bold; font-size: 12px;
	background: var(--adv-red); color: #fff;
}
.advent-rules li { position: relative; padding: 4px 0 4px 20px; line-height: 1.4; }
.advent-rules li::before { content: "\2744"; position: absolute; left: 0; color: var(--adv-ice); }
.advent-empty { margin: 0; font-size: 13px; opacity: .7; }

/* ---------- Boutons ---------- */
.advent-btn {
	display: inline-block; padding: 9px 20px; border-radius: 999px; border: 0; cursor: pointer;
	font: inherit; font-weight: bold; text-decoration: none !important;
	background: linear-gradient(180deg, #ffd76a, var(--adv-gold-dark)); color: #4d0612 !important;
	box-shadow: 0 3px 0 #7a5610;
}
.advent-btn:hover { filter: brightness(1.08); }
.advent-btn-small { padding: 4px 12px; margin-left: 8px; font-size: 12px; }

/* ---------- Fenêtre cadeau ---------- */
.advent-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.advent-modal[hidden] { display: none; }
.advent-modal-backdrop { position: absolute; inset: 0; background: rgba(5, 12, 28, .78); backdrop-filter: blur(3px); animation: advent-fade .3s ease; }
.advent-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.advent-modal-box {
	position: relative; z-index: 1; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto;
	padding: 28px 24px 24px; border-radius: 18px; text-align: center; color: #3a1b12;
	background:
		radial-gradient(circle at 50% 0%, #fffdf6 0%, #fff4dc 60%, #f6e1b5 100%);
	box-shadow: 0 0 0 6px var(--adv-red), 0 0 0 9px var(--adv-gold), 0 30px 80px rgba(0, 0, 0, .55);
	animation: advent-pop .45s cubic-bezier(.2, 1.6, .4, 1);
	font-family: "Trebuchet MS", "Segoe UI", Roboto, Arial, sans-serif;
}
.advent-modal-close {
	position: absolute; top: 6px; right: 10px; border: 0; background: none; cursor: pointer;
	font-size: 28px; line-height: 1; color: #8b1a1a; opacity: .7;
}
.advent-modal-close:hover { opacity: 1; }
@keyframes advent-fade { from { opacity: 0; } }
@keyframes advent-pop { from { transform: scale(.6) translateY(30px); opacity: 0; } }

/* Paquet cadeau animé */
.advent-present { position: relative; width: 120px; height: 120px; margin: 6px auto 10px; cursor: pointer; }
.advent-present-body {
	position: absolute; left: 10px; right: 10px; bottom: 0; height: 78px; border-radius: 6px;
	background:
		linear-gradient(90deg, transparent 42%, var(--adv-gold) 42%, var(--adv-gold) 58%, transparent 58%),
		linear-gradient(160deg, #e0263f, var(--adv-red-dark));
	box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .15), 0 8px 18px rgba(0, 0, 0, .25);
}
.advent-present-lid {
	position: absolute; z-index: 1; left: 2px; right: 2px; top: 22px; height: 26px; border-radius: 6px;
	background:
		linear-gradient(90deg, transparent 42%, #ffd76a 42%, #ffd76a 58%, transparent 58%),
		linear-gradient(160deg, #f0364f, #a00d24);
	box-shadow: 0 4px 8px rgba(0, 0, 0, .25);
	transform-origin: 20% 100%;
}
.advent-present-lid::before, .advent-present-lid::after {
	content: ""; position: absolute; top: -22px; width: 30px; height: 24px;
	border: 7px solid #ffd76a; border-radius: 50% 50% 10% 50%;
}
.advent-present-lid::before { left: 26px; transform: rotate(-25deg); }
.advent-present-lid::after { right: 26px; transform: scaleX(-1) rotate(-25deg); }
.advent-present-hint { margin: 0 0 8px; font-size: 13px; color: #8b1a1a; font-style: italic; }

.advent-modal.is-wrapped .advent-present { animation: advent-wobble 1.1s ease-in-out infinite; }
.advent-modal.is-wrapped .advent-reveal { display: none; }
.advent-modal.is-bursting .advent-present { animation: advent-rumble .7s linear; }
.advent-modal.is-revealed .advent-present { display: none; }
.advent-modal.is-revealed .advent-present-hint { display: none; }
.advent-modal.is-revealed .advent-reveal { animation: advent-reveal .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes advent-wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg) scale(1.02); } 75% { transform: rotate(4deg) scale(1.02); } }
@keyframes advent-rumble {
	0% { transform: translate(0, 0) rotate(0); }
	20% { transform: translate(-4px, 2px) rotate(-6deg); }
	40% { transform: translate(4px, -2px) rotate(6deg); }
	60% { transform: translate(-6px, 0) rotate(-8deg) scale(1.08); }
	80% { transform: translate(6px, -3px) rotate(8deg) scale(1.15); }
	100% { transform: scale(1.4); opacity: 0; }
}
@keyframes advent-reveal { from { transform: scale(.7); opacity: 0; } }

.advent-reveal-day {
	display: inline-block; margin: 0 0 8px; padding: 3px 14px; border-radius: 999px;
	background: var(--adv-red); color: #fff; font-size: 12px; font-weight: bold; letter-spacing: .1em; text-transform: uppercase;
}
.advent-reveal-title { margin: 0 0 8px; padding: 0; border: 0; font-family: Georgia, serif; font-size: 24px; color: var(--adv-red-dark); text-transform: none; }
.advent-reveal-points { margin: 6px 0; font-family: Georgia, serif; font-size: 30px; font-weight: bold; color: var(--adv-green); text-shadow: 0 2px 0 rgba(0, 0, 0, .08); }
.advent-reveal-points:empty, .advent-reveal-bonus:empty, .advent-reveal-image:empty, .advent-reveal-text:empty { display: none; }
.advent-reveal-bonus {
	margin: 8px 0; padding: 8px 12px; border-radius: 10px; font-weight: bold;
	background: linear-gradient(90deg, #ffe9a6, #ffd76a); color: #5a1010;
}
.advent-reveal-image img { max-width: 100%; max-height: 260px; border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.advent-reveal-text { margin: 10px 0 0; font-size: 15px; line-height: 1.55; color: #4a2a1d; }
.advent-reveal-link { margin: 16px 0 0; }
.advent-reveal-link[hidden] { display: none; }

/* ---------- Message éphémère ---------- */
.advent-toast {
	position: fixed; z-index: 10001; left: 50%; bottom: 26px; transform: translate(-50%, 30px);
	max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 999px;
	background: rgba(11, 29, 54, .95); color: #fff; font-size: 14px; text-align: center;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .15);
	opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.advent-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Séries ---------- */
.advent-streak { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; }
.advent-streak-now strong { color: #ff9a3c; font-size: 16px; }
.advent-streak-tiers { display: flex; flex-wrap: wrap; gap: 6px; }
.advent-streak-tier { padding: 2px 10px; border-radius: 999px; font-size: 12px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); opacity: .75; }
.advent-streak-tier.is-reached { opacity: 1; background: linear-gradient(90deg, #ff7a18, #ffb347); border-color: #ffb347; color: #3a1300; font-weight: bold; }

/* ---------- Badges sur les portes ---------- */
.advent-door-badge {
	position: absolute; z-index: 1; top: 8px; left: 8px;
	display: inline-flex; align-items: center; justify-content: center;
	width: 24px; height: 24px; border-radius: 50%;
	font-weight: bold; font-size: 13px; color: #4d0612;
	background: var(--adv-gold); box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
}
.advent-door-badge-first { width: 28px; height: 28px; font-size: 16px; animation: advent-pulse 1.4s ease-in-out infinite; }

/* ---------- Cartes latérales supplémentaires ---------- */
.advent-card-raffle { background: linear-gradient(160deg, rgba(243, 195, 74, .18), rgba(255, 255, 255, .06)); border-color: rgba(243, 195, 74, .45); }
.advent-raffle-prize { margin: 0 0 8px; font-weight: bold; font-size: 14px; color: #fff; }
.advent-tickets { margin: 0 0 4px; font-size: 13px; }
.advent-tickets strong { color: var(--adv-gold); font-size: 18px; }
.advent-small { margin: 0; font-size: 12px; opacity: .75; }
.advent-card p { margin: 0 0 6px; font-size: 13px; }
.advent-leaders { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.advent-leaders li { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px dashed rgba(255, 255, 255, .1); border-radius: 6px; }
.advent-leaders li:last-child { border-bottom: 0; }
.advent-leaders li.is-me { background: rgba(243, 195, 74, .15); }
.advent-leaders small { margin-left: auto; opacity: .7; font-size: 11px; white-space: nowrap; }
.advent-leaders .username, .advent-leaders .username-coloured { font-weight: bold; color: #fff; }
.advent-rank { flex: 0 0 24px; text-align: center; font-weight: bold; }

/* ---------- Fenêtre : extras ---------- */
.advent-reveal-streak:empty { display: none; }
.advent-reveal-streak { margin: 8px 0; padding: 8px 12px; border-radius: 10px; font-weight: bold; background: linear-gradient(90deg, #ffd3a3, #ffb347); color: #5a2200; }
.advent-reveal-first { margin: 10px 0; padding: 12px; border-radius: 12px; background: linear-gradient(135deg, #fff1b8, #f3c34a); color: #4d2a00; box-shadow: inset 0 0 0 2px #b8861b; }
.advent-reveal-first[hidden] { display: none; }
.advent-reveal-first strong { display: block; margin-bottom: 4px; font-size: 15px; }
.advent-reveal-first-prize { display: block; margin-bottom: 6px; }
.advent-reveal-first-link[hidden] { display: none; }
.advent-riddle { margin: 16px 0 0; padding: 14px; border-radius: 12px; background: rgba(20, 107, 58, .08); border: 1px dashed #146b3a; }
.advent-riddle[hidden], .advent-game-start[hidden] { display: none; }
.advent-riddle-title { margin: 0 0 4px; font-weight: bold; color: #146b3a; }
.advent-riddle-question { margin: 0 0 10px; font-size: 15px; color: #3a1b12; }
.advent-riddle-row { display: flex; gap: 8px; }
.advent-riddle-input { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 999px; border: 2px solid #d9c08a; font: inherit; font-size: 14px; background: #fff; color: #3a1b12; }
.advent-riddle-input:focus { outline: none; border-color: #146b3a; }
.advent-riddle-hint { margin: 6px 0 0; font-size: 11px; color: #8a6a4a; }
.advent-riddle-result { margin: 8px 0 0; font-weight: bold; }
.advent-riddle-result:empty { display: none; }
.advent-riddle-result.is-right { color: #146b3a; }
.advent-riddle-result.is-wrong { color: #a00d24; }
.advent-game-start { margin: 16px 0 0; padding: 14px; border-radius: 12px; background: linear-gradient(160deg, #14335a, #0b1d36); color: #e8f1fb; }
.advent-game-start p { margin: 0 0 10px; font-size: 14px; }

/* ---------- Mini-jeu ---------- */
.advent-game { position: relative; margin: 0; }
.advent-game[hidden] { display: none; }
.advent-modal.is-playing .advent-reveal, .advent-modal.is-playing .advent-modal-close { display: none; }
.advent-game-hud { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 15px; color: #7d0a1d; }
.advent-game-hud b { font-size: 20px; }
.advent-game-title { font-family: Georgia, serif; font-weight: bold; }
.advent-game-field {
	position: relative; height: 320px; overflow: hidden; border-radius: 12px; touch-action: none;
	background: radial-gradient(ellipse at 50% 0%, #2b5a8f, #0b1d36 80%);
	box-shadow: inset 0 0 30px rgba(0, 0, 0, .5);
}
.advent-flake {
	position: absolute; top: -50px; padding: 4px; margin: 0; border: 0; background: none; cursor: pointer;
	color: #fff; line-height: 1; text-shadow: 0 0 8px rgba(180, 220, 255, .9);
	animation-name: advent-fall, advent-sway; animation-timing-function: linear, ease-in-out; animation-iteration-count: 1, infinite; animation-direction: normal, alternate; animation-fill-mode: forwards;
	-webkit-tap-highlight-color: transparent;
}
.advent-flake.is-golden { color: #ffd76a; text-shadow: 0 0 12px #ffb300; }
.advent-flake.is-caught { animation: advent-catch .3s ease-out forwards; pointer-events: none; }
@keyframes advent-fall { to { top: 340px; } }
@keyframes advent-sway { from { margin-left: -12px; } to { margin-left: 12px; } }
@keyframes advent-catch { to { transform: scale(2.2); opacity: 0; } }
.advent-game-end { position: absolute; inset: 40px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; border-radius: 12px; background: rgba(11, 29, 54, .85); color: #fff; }
.advent-game-end[hidden] { display: none; }
.advent-game-result { margin: 0; padding: 0 16px; font-size: 16px; font-weight: bold; }

/* ---------- Mini-jeux supplémentaires ---------- */
.advent-game-clock[hidden] { display: none; }
.advent-score-pop { position: absolute; z-index: 3; transform: translate(-50%, 0); font-weight: bold; font-size: 18px; color: #ffd76a; text-shadow: 0 1px 3px #000; pointer-events: none; animation: advent-pop-up .7s ease-out forwards; }
@keyframes advent-pop-up { to { transform: translate(-50%, -40px); opacity: 0; } }

/* La hotte */
.advent-game-field.is-gifts { cursor: none; }
.advent-sack { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); font-size: 46px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); pointer-events: none; }
.advent-fall-item { position: absolute; top: 0; left: 0; font-size: 30px; line-height: 1; pointer-events: none; will-change: transform; }
.advent-fall-item.is-coal { filter: drop-shadow(0 0 4px rgba(255, 80, 0, .6)); }

/* Les lutins farceurs */
.advent-chimneys { position: absolute; inset: 14px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 12px; }
.advent-chimney {
	position: relative; overflow: hidden; padding: 0; border: 0; cursor: pointer; border-radius: 8px 8px 4px 4px;
	background:
		linear-gradient(#f6fbff 0 10px, transparent 10px),
		repeating-linear-gradient(0deg, #8e2b1d 0 12px, #6f1f14 12px 14px);
	box-shadow: inset 0 -8px 12px rgba(0, 0, 0, .35);
	-webkit-tap-highlight-color: transparent;
}
.advent-chimney-pop { position: absolute; left: 50%; bottom: -60px; transform: translateX(-50%); font-size: 40px; line-height: 1; transition: bottom .15s ease-out; }
.advent-chimney.is-up .advent-chimney-pop { bottom: 8px; }
.advent-chimney.is-hit { box-shadow: inset 0 0 0 4px #33d17a; }
.advent-chimney.is-oops { box-shadow: inset 0 0 0 4px #ff3b4f; }

/* Memory */
.advent-memory { position: absolute; inset: 12px; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: 10px; perspective: 800px; }
.advent-card-flip { position: relative; padding: 0; border: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform .4s; }
.advent-card-flip.is-flipped { transform: rotateY(180deg); }
.advent-card-back, .advent-card-face {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px;
	backface-visibility: hidden; font-size: 34px; box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}
.advent-card-back { color: #fff; background: repeating-linear-gradient(45deg, #c8102e 0 10px, #a00d24 10px 20px); }
.advent-card-face { transform: rotateY(180deg); background: #fff8e8; }
.advent-card-flip.is-found .advent-card-face { background: #d9f7e4; box-shadow: 0 0 0 3px #33d17a; }

/* Clochettes */
.advent-bells { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.advent-bells-status { margin: 0; min-height: 1.4em; color: #fff; font-size: 17px; font-weight: bold; }
.advent-bells-row { display: grid; grid-template-columns: repeat(2, 96px); gap: 14px; }
.advent-bell { width: 96px; height: 96px; border: 0; border-radius: 50%; cursor: pointer; font-size: 40px; color: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .35); transition: transform .1s, filter .1s; -webkit-tap-highlight-color: transparent; }
.advent-bell-0 { background: #c8102e; }
.advent-bell-1 { background: #1f8a4c; }
.advent-bell-2 { background: #d9a520; }
.advent-bell-3 { background: #2f7fd1; }
.advent-bell.is-ringing { transform: scale(1.12) rotate(-8deg); filter: brightness(1.5); box-shadow: 0 0 24px 6px rgba(255, 255, 255, .7); }

/* ---------- Bloc de partage ---------- */
.advent-share {
	margin-top: 22px; padding: 18px; border-radius: 14px; text-align: center;
	background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
}
.advent-share h3 { margin: 0 0 4px; padding: 0; border: 0; font-family: Georgia, serif; font-size: 20px; color: var(--adv-gold); text-transform: none; }
.advent-share p { margin: 0 0 14px; font-size: 14px; }
.advent-share-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.advent-share-btn {
	display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer;
	font: inherit; font-size: 13px; font-weight: bold; color: #fff !important; text-decoration: none !important;
	background: rgba(255, 255, 255, .16); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); transition: transform .15s, filter .15s;
}
.advent-share-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.advent-share-btn[hidden] { display: none; }
.advent-share-btn b { font-family: Arial, sans-serif; }
.advent-share-btn.is-whatsapp { background: #25d366; }
.advent-share-btn.is-email { background: #6b7a8f; }
.advent-share-btn.is-facebook { background: #1877f2; }
.advent-share-btn.is-x { background: #111; }
.advent-share-btn.is-telegram { background: #229ed9; }
.advent-share-btn.is-bluesky { background: #1185fe; }
.advent-share-btn.is-linkedin { background: #0a66c2; }
.advent-share-btn.is-reddit { background: #ff4500; }
.advent-share-native, .advent-share-copy { background: var(--adv-gold) !important; color: #4d0612 !important; }

/* ---------- Thème « Chalet » ---------- */
.advent.theme-chalet {
	background:
		radial-gradient(ellipse at 15% 100%, rgba(255, 140, 40, .35), transparent 55%),
		repeating-linear-gradient(0deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 46px),
		linear-gradient(180deg, #5b3420 0%, #3d2215 60%, #2a170e 100%);
}
.theme-chalet .advent-moon { background: radial-gradient(circle, #fff6d8, #ffcf7a 60%, #e08a2e); box-shadow: 0 0 60px 20px rgba(255, 170, 70, .45); border-radius: 12px; width: 60px; height: 80px; }
.theme-chalet .advent-stars { opacity: .25; }
.theme-chalet .advent-hills { opacity: .1; }
.theme-chalet .advent-title { text-shadow: 0 2px 0 #3a1608, 0 0 24px rgba(255, 170, 70, .6); }
.theme-chalet .advent-card { background: rgba(255, 230, 200, .08); border-color: rgba(255, 200, 140, .25); }
.theme-chalet .advent-cell:nth-child(6n+1) .advent-door-front { background: linear-gradient(160deg, #b5432a, #6e1e10); }
.theme-chalet .advent-cell:nth-child(6n+2) .advent-door-front { background: repeating-linear-gradient(90deg, #8a5a3a 0 10px, #7a4e31 10px 20px); }
.theme-chalet .advent-cell:nth-child(6n+3) .advent-door-front { background: repeating-linear-gradient(45deg, #f4ead8 0 10px, #b5432a 10px 20px); }
.theme-chalet .advent-cell:nth-child(6n+4) .advent-door-front { background: linear-gradient(160deg, #2f6b45, #163b25); }
.theme-chalet .advent-cell:nth-child(6n+6) .advent-door-front { background-color: #6e4428; }

/* ---------- Thème « Sucre d'orge » ---------- */
.advent.theme-candy {
	background:
		repeating-linear-gradient(-45deg, rgba(255, 255, 255, .06) 0 26px, transparent 26px 52px),
		radial-gradient(ellipse at 50% 0%, #e0457b 0%, #a3164f 45%, #5e0a2c 100%);
}
.theme-candy .advent-moon { background: radial-gradient(circle at 35% 35%, #fff, #ffd1e3 70%); box-shadow: 0 0 40px 12px rgba(255, 200, 225, .45); }
.theme-candy .advent-title { text-shadow: 0 2px 0 #5e0a2c, 0 0 24px rgba(255, 255, 255, .45); }
.theme-candy .advent-title span { color: #fff2a8; }
.theme-candy .advent-card { background: rgba(255, 255, 255, .12); }
.theme-candy .advent-cell:nth-child(6n+1) .advent-door-front { background: repeating-linear-gradient(45deg, #fff 0 12px, #e0263f 12px 24px); }
.theme-candy .advent-cell:nth-child(6n+2) .advent-door-front { background: linear-gradient(160deg, #ff8fc1, #d63c7c); }
.theme-candy .advent-cell:nth-child(6n+3) .advent-door-front { background: repeating-linear-gradient(-45deg, #fff 0 10px, #2fb36b 10px 20px); }
.theme-candy .advent-cell:nth-child(6n+4) .advent-door-front { background: radial-gradient(circle at 30% 30%, #b8f0ff, #4fb3d9); }
.theme-candy .advent-cell:nth-child(6n+5) .advent-door-front { background: linear-gradient(160deg, #fff2a8, #f0b93a); }
.theme-candy .advent-cell:nth-child(6n+6) .advent-door-front { background-color: #c2185b; }
.theme-candy .advent-cell:nth-child(6n+1) .advent-door-num, .theme-candy .advent-cell:nth-child(6n+3) .advent-door-num { background: rgba(160, 13, 60, .82); }

/* ---------- Adaptatif ---------- */
@media (max-width: 900px) {
	.advent { grid-template-columns: minmax(0, 1fr); }
	.advent > .advent-side { grid-column: 1; }
	.advent > .advent-below { order: 1; }
	.advent > .advent-side { order: 2; }
}
@media (max-width: 560px) {
	.advent { padding: 28px 12px 20px; border-radius: 12px; }
	.advent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 100px; gap: 9px; }
	.advent-cell-12 { grid-column: span 1; }
	.advent-door-num { min-width: 44px; height: 44px; font-size: 24px; }
	.advent-cell-24 .advent-door-num { min-width: 80px; height: 80px; font-size: 46px; }
	.advent-moon { width: 46px; height: 46px; top: 18px; }
	.advent-countdown-big .advent-clock span { min-width: 58px; }
	.advent-countdown-big .advent-clock b { font-size: 24px; }
	.advent-ctrl-label { display: none; }
	.advent-game-field { height: 300px; }
	.advent-bells-row { grid-template-columns: repeat(2, 80px); }
	.advent-bell { width: 80px; height: 80px; font-size: 32px; }
	.advent-card-back, .advent-card-face { font-size: 26px; }
	.advent-riddle-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	.advent *, .advent *::before, .advent *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
}
