/* Pages hors jeu : connexion et espace parent. Le jeu lui-même est dessiné par Phaser (game.css + js/). */

@font-face { font-family: "Lexend"; src: url("fonts/lexend.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
    --night: #2b1b5e;
    --night2: #47279a;
    --ink: #2a2350;
    --paper: #fff8e7;
    --line: #e9dcc0;
    --sun: #ffb02e;
    --sun-dark: #d98600;
    --mint: #1fbfa8;
    --pink: #ff6fae;
    --violet: #8f6bff;
    --muted: #6d6690;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Lexend", Verdana, "Trebuchet MS", system-ui, sans-serif;
    font-size: 18px;
    line-height: 1.5;
    color: var(--ink);
    background: #f4efe3;
    -webkit-tap-highlight-color: transparent;
}
body.night {
    color: #fff;
    background:
        radial-gradient(2px 2px at 12% 18%, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 78% 9%, #ffe9a8 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 42% 31%, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 91% 44%, #bfe9ff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 23% 62%, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 64% 77%, #ffe9a8 50%, transparent 51%),
        linear-gradient(170deg, var(--night) 0%, var(--night2) 55%, #1c3f8f 100%) fixed;
    min-height: 100vh;
    min-height: 100dvh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
p { margin: .5em 0; }
a { color: inherit; }
.muted { color: var(--muted); font-size: .92em; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row.center { justify-content: center; }
.stack { display: grid; gap: .6rem; max-width: 26rem; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4em;
    padding: .6em 1.1em; min-height: 48px;
    border: 0; border-radius: 16px;
    background: #fff; color: var(--ink);
    box-shadow: 0 4px 0 #cfc3a3;
    font-weight: 600; text-decoration: none;
    transition: transform .06s, box-shadow .06s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #cfc3a3; }
.btn.primary { background: var(--sun); color: #3b2500; box-shadow: 0 4px 0 var(--sun-dark); }
.btn.primary:active { box-shadow: 0 1px 0 var(--sun-dark); }
.btn.big { font-size: 1.15rem; padding: .75em 1.4em; min-height: 58px; border-radius: 20px; }
.btn.small { min-height: 38px; padding: .35em .8em; font-size: .9rem; border-radius: 12px; }
.btn.busy { opacity: .6; pointer-events: none; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }

.card { background: var(--paper); color: var(--ink); border-radius: 24px; padding: 1.1rem 1.2rem; margin: 1rem 0; box-shadow: 0 6px 0 rgba(0, 0, 0, .18); }
.notice { background: #e6f7ff; color: #0b4a6b; border-radius: 14px; padding: .7rem 1rem; }
.notice.err, .err { color: #9b1c31; }
.notice.err { background: #ffe3e8; }

label { display: block; font-weight: 600; margin: .7rem 0; }
label .muted { font-weight: 400; }
input[type=text], input[type=password], input[type=date], input:not([type]), textarea, select {
    display: block; width: 100%; margin-top: .3rem; padding: .6em .8em;
    border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; line-height: 1.6; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; flex: none; margin-top: .15rem; }

/* ── Connexion ── */
.auth { max-width: 26rem; margin: 0 auto; padding: 8vh 1.2rem 2rem; text-align: center; }
.auth form { text-align: left; }
.auth-logo { width: 110px; animation: bob 2.4s ease-in-out infinite; }
.auth .btn { width: 100%; margin-top: .5rem; }

@keyframes bob { 50% { transform: translateY(-7px); } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Espace parent (clair, sobre) ── */
.parent { font-size: 16px; }
.pwrap { max-width: 62rem; margin: 0 auto; padding: 0 1rem 3rem; }
.ptop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .9rem 0; }
.ptop nav { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.plogo { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.plogo img { width: 40px; }
.parent .card { background: #fff; box-shadow: 0 1px 3px rgba(40, 30, 80, .14); border-radius: 18px; }
.parent .btn { box-shadow: 0 3px 0 #d9d2c2; background: #f4efe3; }
.parent .btn.primary { background: var(--sun); box-shadow: 0 3px 0 var(--sun-dark); }
.parent h2 { margin-top: 1.2rem; }
.parent section.card > h2:first-child { margin-top: 0; }
.chip { display: inline-block; padding: .25rem .75rem; border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-size: .95rem; margin: .15rem 0; }
.chip.on { background: var(--night); color: #fff; border-color: var(--night); }
button.chip:hover { border-color: var(--violet); }
.grid2 { display: grid; grid-template-columns: 1fr 12rem; gap: 0 1rem; }
.photos { display: flex; gap: .6rem; overflow-x: auto; margin: .6rem 0; }
.photos img { height: 15rem; border-radius: 12px; border: 2px solid var(--line); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid #eee6d3; vertical-align: middle; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; }
tr.off { opacity: .55; }
table.words input:not([type=checkbox]) { margin: 0; padding: .35em .5em; min-width: 7rem; }
table.words input[type=checkbox] { width: 20px; height: 20px; }
td.errors { color: #9b1c31; font-size: .9rem; max-width: 12rem; }
td.center { text-align: center; }
table.facts th, table.facts td { text-align: center; }
table.facts td.ok { background: #cdf3e4; }
table.facts td.mid { background: #fff1b8; }
table.facts td.ko { background: #ffd9b8; }
.bar { display: inline-block; vertical-align: middle; width: 6rem; height: 10px; background: #eee6d3; border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--mint); }
.days { display: flex; align-items: flex-end; gap: 6px; height: 9rem; margin: 1rem 0 .4rem; }
.day { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.day i { display: block; width: 100%; max-width: 2.2rem; background: var(--violet); border-radius: 6px 6px 0 0; }
.day small { color: var(--muted); font-size: .75rem; }
.day .mark { font-size: .9rem; min-height: 1.2rem; }
.danger { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.spinner { font-size: 4rem; animation: bob 1.2s ease-in-out infinite; }
main.card.center { text-align: center; }
@media (max-width: 600px) {
    .grid2 { grid-template-columns: 1fr; }
}
