/* =====================================================================
 * avent-theme.css — Habillage de Noël commun (calendrier + jeux)
 * ===================================================================== */
:root {
    --night-1: #0b1a33;
    --night-2: #13294b;
    --night-3: #1d3a63;
    --red: #c0392b;
    --red-dark: #8e2318;
    --green: #1e7a46;
    --green-dark: #135232;
    --gold: #f5c542;
    --gold-dark: #c99a1c;
    --snow: #f7fbff;
    --ink: #1b2433;
    --card: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.18);
    --radius: 16px;
    --title-font: 'Mountains of Christmas', 'Segoe UI', cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    /* Pas de zoom au double appui (les jeux utilisent le double appui) ; le zoom à deux doigts reste possible */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(ellipse at top, var(--night-3) 0%, var(--night-2) 45%, var(--night-1) 100%) fixed;
    background-color: var(--night-1);
    color: var(--snow);
    min-height: 100vh;
    font-size: 18px;
    line-height: 1.45;
    overflow-x: hidden;
}

/* ---------- Neige qui tombe ---------- */
.snowfall {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.flake {
    position: absolute;
    top: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0 45%, rgba(255,255,255,0) 72%);
    opacity: 0.8;
    animation: fall linear infinite;
    user-select: none;
}
.flake.star {
    border-radius: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M3.3 17L20.7 7M9 3.5l3 2.5 3-2.5M9 20.5l3-2.5 3 2.5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
@keyframes fall {
    0%   { transform: translate(0, -20px) rotate(0deg); }
    50%  { transform: translate(18px, 50vh) rotate(180deg); }
    100% { transform: translate(-10px, 105vh) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .flake { animation: none; display: none; }
}

/* ---------- Guirlande lumineuse ---------- */
.garland {
    position: relative;
    z-index: 2;
    height: 34px;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 0 6px;
    overflow: hidden;
}
.garland::before {
    content: '';
    position: absolute;
    left: -5%;
    right: -5%;
    top: -20px;
    height: 34px;
    border-bottom: 3px solid #2d4a2a;
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.bulb {
    position: relative;
    top: 8px;
    width: 12px;
    height: 18px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: twinkle 2.4s ease-in-out infinite;
}
.bulb::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 3px;
    width: 6px;
    height: 6px;
    background: #444;
    border-radius: 2px;
}
.bulb:nth-child(4n+1) { background: #ff4d4d; color: #ff4d4d; animation-delay: 0s; }
.bulb:nth-child(4n+2) { background: #ffd23f; color: #ffd23f; animation-delay: .6s; }
.bulb:nth-child(4n+3) { background: #3ddc84; color: #3ddc84; animation-delay: 1.2s; }
.bulb:nth-child(4n)   { background: #4dabff; color: #4dabff; animation-delay: 1.8s; }
@keyframes twinkle {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px 3px currentColor; }
    50%      { opacity: .45; box-shadow: 0 0 2px 0 currentColor; }
}
@media (prefers-reduced-motion: reduce) { .bulb { animation: none; } }

/* ---------- Mise en page ---------- */
.page {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 8px 16px 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 6px 0 10px;
}

.festive-title {
    font-family: var(--title-font);
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 2px 0 var(--red-dark), 0 0 18px rgba(245, 197, 66, 0.35);
    letter-spacing: 1px;
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    min-width: 52px;
    padding: 10px 22px;
    border-radius: 999px;
    border: 2px solid transparent;
    font: inherit;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: var(--red);
    box-shadow: 0 4px 0 var(--red-dark);
    transition: transform .1s, box-shadow .1s, filter .15s;
    touch-action: manipulation;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-dark); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
.btn-green { background: var(--green); box-shadow: 0 4px 0 var(--green-dark); }
.btn-green:active { box-shadow: 0 1px 0 var(--green-dark); }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--gold-dark); }
.btn-gold:active { box-shadow: 0 1px 0 var(--gold-dark); }
.btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: none;
}
.btn-ghost:active { box-shadow: none; }
.btn-small { min-height: 46px; padding: 8px 16px; font-size: .95rem; }

.lang-toggle { font-size: .95rem; }

/* ---------- Illustrations (avent-art.js) ---------- */
.art { display: inline-block; width: 1em; height: 1em; vertical-align: middle; flex-shrink: 0; }
.ico { width: 1.15em; height: 1.15em; }
.btn .ico { width: 1.25em; height: 1.25em; }

/* ---------- Cartes ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    backdrop-filter: blur(3px);
}

.hidden { display: none !important; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 520px) {
    body { font-size: 17px; }
    .btn { padding: 10px 16px; }
}
