/* Skins: each one is a full palette on <html data-skin>. "nuit" is the dark one. */
:root, [data-skin="ocean"] {
  --bg: #eef6fb; --card: #ffffff; --ink: #14324a; --muted: #5b7487; --line: #d6e5ef;
  --accent: #1f7fc4; --accent-ink: #ffffff; --accent-soft: #dcefff;
  --good: #1f8a4c; --good-soft: #def5e7; --bad: #c2412d; --bad-soft: #fde6e1;
}
[data-skin="foret"] {
  --bg: #eff6ee; --card: #ffffff; --ink: #1d3523; --muted: #5d7462; --line: #d7e6d6;
  --accent: #2f8a4a; --accent-ink: #ffffff; --accent-soft: #dcf1df;
  --good: #1f7a8a; --good-soft: #dbf1f4; --bad: #c2412d; --bad-soft: #fde6e1;
}
[data-skin="coucher"] {
  --bg: #fff3ec; --card: #ffffff; --ink: #432222; --muted: #82605a; --line: #f2dcd2;
  --accent: #e0582f; --accent-ink: #ffffff; --accent-soft: #ffe2d4;
  --good: #1f8a4c; --good-soft: #def5e7; --bad: #b4234f; --bad-soft: #fbe0e8;
}
[data-skin="nuit"] {
  --bg: #15132a; --card: #221f3d; --ink: #ece9ff; --muted: #a29dc8; --line: #34305a;
  --accent: #9b8cff; --accent-ink: #15132a; --accent-soft: #2f2a5a;
  --good: #5fd39a; --good-soft: #173a2c; --bad: #ff8a78; --bad-soft: #43231f;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 18px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent; min-height: 100vh;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
main { max-width: 760px; margin: 0 auto; padding: 24px 0 48px; }
[hidden] { display: none !important; }
h1 { font-size: 30px; margin: 8px 0 4px; }
h2 { font-size: 20px; margin: 28px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

button, .btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 16px; cursor: pointer;
  min-height: 56px; padding: 12px 22px; background: var(--accent); color: var(--accent-ink);
  touch-action: manipulation;
}
button.ghost { background: transparent; color: var(--muted); min-height: 44px; padding: 8px 12px; }
button:disabled { opacity: .5; }
button:active { transform: scale(.98); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top img { width: 44px; height: 44px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.stat .num { font-size: 32px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 15px; }

/* Deck cards */
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.deck { text-align: left; background: var(--card); color: var(--ink); border: 1px solid var(--line);
        display: flex; flex-direction: column; gap: 4px; min-height: 96px; }
.deck .dom { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }

/* Skins */
.skins { display: flex; gap: 12px; flex-wrap: wrap; }
.skin { width: 56px; height: 56px; min-height: 0; padding: 0; border-radius: 50%; border: 3px solid var(--line); }
.skin[aria-pressed="true"] { border-color: var(--ink); }
.skin[data-v="ocean"] { background: linear-gradient(135deg, #1f7fc4 50%, #eef6fb 50%); }
.skin[data-v="foret"] { background: linear-gradient(135deg, #2f8a4a 50%, #eff6ee 50%); }
.skin[data-v="coucher"] { background: linear-gradient(135deg, #e0582f 50%, #fff3ec 50%); }
.skin[data-v="nuit"] { background: linear-gradient(135deg, #9b8cff 50%, #15132a 50%); }

/* Exercise */
.progress { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.prompt { font-size: 26px; line-height: 1.5; margin: 28px 0; text-align: center; }
.gap { display: inline-block; min-width: 3.2em; border-bottom: 3px solid var(--accent); color: var(--accent); font-weight: 700; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.choices button { background: var(--card); color: var(--ink); border: 2px solid var(--line); font-size: 22px; min-height: 72px; }
.choices button.good { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.choices button.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.feedback { margin-top: 20px; border-radius: 16px; padding: 16px 18px; }
.feedback.good { background: var(--good-soft); color: var(--good); }
.feedback.bad { background: var(--bad-soft); color: var(--ink); }
.feedback strong { display: block; margin-bottom: 4px; }
.feedback.bad strong { color: var(--bad); }
.next { width: 100%; margin-top: 16px; }
.score { font-size: 56px; font-weight: 800; color: var(--accent); }

/* Parent page */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--line); }
.bars .col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; }
.bars .bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.bars .col:hover .bar, .bars .col:focus .bar { opacity: .8; }
.bars .tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap;
             background: var(--ink); color: var(--bg); font-size: 13px; padding: 4px 8px; border-radius: 8px; display: none; z-index: 2; }
.bars .col:hover .tip, .bars .col:focus .tip { display: block; }
.axis { display: flex; gap: 2px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.axis span { flex: 1; text-align: center; }
.error { color: var(--bad); }
