/* ==========================================================
   🌊 Thème océan
   ========================================================== */
:root {
  --sky-1: #bfeffa;
  --sky-2: #e9fbff;
  --sea-0: #7fe0e6;
  --sea-1: #2bb3c9;
  --sea-2: #158fb0;
  --sea-3: #0d6a92;
  --sea-4: #0a4a73;
  --sea-5: #082f52;
  --sea-6: #061c36;
  --coral: #ff7f8c;
  --coral-dark: #e85a6c;
  --pink: #ffc3cf;
  --sand: #f6e3bd;
  --sand-dark: #d9b97c;
  --pearl: #fffaf3;
  --ink: #12324a;
  --white: #ffffff;
  --radius: 22px;
  --shadow: 0 12px 30px rgba(3, 30, 56, 0.25);
  --font-title: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--white);
  background: var(--sea-6);
  overflow-x: hidden;
  line-height: 1.5;
}
img, svg { display: block; }
a { color: inherit; }
code { background: rgba(0,0,0,.2); padding: 1px 6px; border-radius: 6px; }
[hidden] { display: none !important; }

.container { width: min(1100px, 100% - 32px); margin-inline: auto; }

/* ---------- Bannière démo ---------- */
.demo-banner {
  position: relative; z-index: 20;
  background: var(--sand); color: var(--ink);
  text-align: center; font-size: .9rem; padding: 8px 16px;
}

/* ---------- Surface ---------- */
.surface {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sea-0) 100%);
  color: var(--ink);
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
  padding: 80px 0 140px;
}
.sun {
  position: absolute; top: 6%; right: 10%;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, #fff6c4 0%, #ffd86b 60%, #ffc24a 100%);
  box-shadow: 0 0 80px 30px rgba(255, 216, 107, .45);
  animation: pulse 6s ease-in-out infinite;
}
.cloud {
  position: absolute; height: 40px; width: 140px;
  background: #fff; border-radius: 40px; opacity: .9;
  animation: drift 60s linear infinite;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: #fff; border-radius: 50%;
}
.cloud::before { width: 60px; height: 60px; top: -30px; left: 22px; }
.cloud::after { width: 46px; height: 46px; top: -20px; left: 70px; }
.cloud--1 { top: 14%; left: -160px; }
.cloud--2 { top: 26%; left: -160px; animation-duration: 85s; animation-delay: -40s; transform: scale(.7); }
.gull {
  position: absolute; top: 18%; left: 20%; font-size: 1.6rem; color: #4a6b80;
  animation: fly 14s ease-in-out infinite;
}
@keyframes drift { to { transform: translateX(calc(100vw + 320px)); } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes fly { 50% { transform: translate(80px, -20px) scaleY(.6); } }

.hero { position: relative; z-index: 2; text-align: center; padding: 0 16px; }
.hero__kicker {
  display: inline-block; margin: 0 0 12px;
  font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem;
  color: var(--sea-3); background: rgba(255,255,255,.6); padding: 6px 14px; border-radius: 999px;
}
.hero__title {
  font-family: var(--font-title); font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 5rem); line-height: 1.05; margin: 0 0 16px;
  color: var(--sea-4);
}
.shimmer {
  background: linear-gradient(90deg, var(--coral) 0%, #b07cff 30%, var(--sea-1) 60%, var(--coral) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }
.hero__sub { max-width: 560px; margin: 0 auto 28px; font-size: 1.15rem; color: var(--sea-4); }

.countdown { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.countdown__item {
  min-width: 82px; padding: 12px 8px;
  background: rgba(255,255,255,.72); border-radius: 18px;
  box-shadow: 0 6px 18px rgba(13,106,146,.15);
  display: flex; flex-direction: column; align-items: center;
}
.countdown__item span { font-family: var(--font-title); font-size: 2rem; font-weight: 600; color: var(--sea-3); font-variant-numeric: tabular-nums; }
.countdown__item small { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--sea-3); }
.countdown__caption { margin: 12px 0 0; font-weight: 700; color: var(--sea-3); }

.hero__actions { margin-top: 28px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.waves {
  position: absolute; bottom: -1px; left: 0; width: 100%; height: 140px; z-index: 1;
}
.waves__parallax > use { animation: wave 25s cubic-bezier(.55,.5,.45,.5) infinite; }
.waves__parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; }
.waves__parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; }
.waves__parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
.waves__parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; }
@keyframes wave { 0% { transform: translate3d(-90px,0,0); } 100% { transform: translate3d(85px,0,0); } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-title); font-weight: 600; font-size: 1.05rem;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn--coral { background: var(--coral); color: var(--white); box-shadow: 0 8px 20px rgba(232,90,108,.4); }
.btn--coral:hover { background: var(--coral-dark); }
.btn--ghost { background: rgba(255,255,255,.65); color: var(--sea-4); }
.btn--ghost-dark { background: rgba(13,106,146,.12); color: var(--sea-4); }
.btn--big { font-size: 1.25rem; padding: 16px 32px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Zones de profondeur ---------- */
.zone { position: relative; padding: 80px 0; z-index: 2; }
.zone--treasure { background: linear-gradient(180deg, var(--sea-1), var(--sea-2)); }
.zone--1 { background: linear-gradient(180deg, var(--sea-1) 0%, var(--sea-2) 100%); }
.zone--2 { background: linear-gradient(180deg, var(--sea-2) 0%, var(--sea-3) 100%); }
.zone--3 { background: linear-gradient(180deg, var(--sea-3) 0%, var(--sea-4) 100%); }
.zone--4 { background: linear-gradient(180deg, var(--sea-4) 0%, var(--sea-5) 100%); }
.zone--1::before {
  /* rayons de lumière */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(105deg, rgba(255,255,255,.07) 0 40px, transparent 40px 120px);
  mask-image: linear-gradient(180deg, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
  animation: rays 12s ease-in-out infinite alternate;
}
@keyframes rays { to { transform: translateX(40px); } }

.zone__title {
  font-family: var(--font-title); font-weight: 700; text-align: center;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin: 0 0 8px;
  text-shadow: 0 3px 0 rgba(0,0,0,.12);
}
.zone__subtitle { font-family: var(--font-title); text-align: center; font-size: 1.6rem; margin: 48px 0 16px; }
.zone__intro { text-align: center; max-width: 620px; margin: 0 auto 36px; opacity: .92; }

/* ---------- Formulaire parchemin ---------- */
.parchment {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px;
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,.5), transparent 40%),
    linear-gradient(135deg, var(--pearl), var(--sand));
  color: var(--ink);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  max-width: 860px; margin: 0 auto;
}
.parchment::before {
  content: "🐚"; position: absolute; top: -26px; right: 26px; font-size: 3rem;
  transform: rotate(18deg); filter: drop-shadow(0 4px 6px rgba(0,0,0,.2));
}
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field legend { font-family: var(--font-title); font-weight: 600; font-size: 1.05rem; margin-bottom: 8px; color: var(--sea-4); padding: 0; }
.parchment input[type="text"],
.parchment input[type="date"],
.parchment input[type="time"],
.parchment textarea,
.admin-form input, .admin-form select, .admin-form textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: rgba(255,255,255,.85);
  border: 2px solid rgba(13,106,146,.18); border-radius: 14px;
  padding: 11px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.parchment input:focus, .parchment textarea:focus,
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
  border-color: var(--sea-1); box-shadow: 0 0 0 4px rgba(43,179,201,.2);
}
.parchment textarea { resize: vertical; }
.hint { display: block; margin-top: 4px; font-size: .82rem; color: #5a7184; }

.range { display: flex; align-items: center; gap: 14px; }
.range output {
  min-width: 82px; text-align: center; font-family: var(--font-title); font-weight: 600;
  background: var(--sea-1); color: #fff; border-radius: 12px; padding: 6px 10px;
}
input[type="range"] { flex: 1; accent-color: var(--coral); height: 28px; }

.avatars { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-opt {
  width: 52px; height: 52px; font-size: 1.8rem; border-radius: 50%;
  border: 3px solid transparent; background: rgba(255,255,255,.7); cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.avatar-opt:hover { transform: scale(1.1) rotate(-6deg); }
.avatar-opt[aria-checked="true"] { border-color: var(--coral); background: #fff; transform: scale(1.12); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-weight: 700; font-size: .95rem; color: var(--sea-4);
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 2px solid rgba(13,106,146,.2); background: rgba(255,255,255,.7);
  transition: all .15s;
}
.chip:hover { border-color: var(--sea-1); }
.chip[aria-checked="true"] { background: var(--sea-1); color: #fff; border-color: var(--sea-1); }

.form__footer { text-align: center; margin-top: 6px; }
.form__error { color: var(--coral-dark); font-weight: 700; min-height: 1.2em; margin: 10px 0 0; }

.closed-note {
  max-width: 640px; margin: 0 auto 24px; text-align: center; font-weight: 700;
  background: rgba(255,255,255,.18); padding: 14px 18px; border-radius: 16px;
}

/* Animation bouteille lancée */
.bottle-fly {
  position: fixed; z-index: 100; font-size: 3rem; pointer-events: none;
  animation: bottle 1.6s cubic-bezier(.3,.7,.4,1) forwards;
}
@keyframes bottle {
  0% { transform: translate(-50%, -50%) rotate(0) scale(1); opacity: 1; }
  60% { transform: translate(-50%, -260px) rotate(540deg) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, 120px) rotate(720deg) scale(.4); opacity: 0; }
}

/* ---------- Statistiques ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.stat {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius); padding: 20px;
}
.stat--wide { grid-column: 1 / -1; }
.stat__label { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; margin: 0 0 6px; font-weight: 700; }
.stat__value { font-family: var(--font-title); font-size: 2rem; font-weight: 600; margin: 0; }
.stat__sub { margin: 4px 0 0; font-size: .9rem; opacity: .85; }
.bars { display: grid; gap: 8px; margin-top: 8px; }
.bar { display: grid; grid-template-columns: 130px 1fr 32px; gap: 10px; align-items: center; font-size: .92rem; }
.bar__track { height: 14px; background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden; }
.bar__fill { height: 100%; background: linear-gradient(90deg, var(--pink), var(--coral)); border-radius: 999px; transition: width .8s ease; }
.bar__count { text-align: right; font-weight: 800; }

.histo { display: flex; align-items: flex-end; gap: 4px; height: 160px; margin-top: 14px; padding-bottom: 26px; position: relative; }
.histo__col { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.histo__bar {
  background: linear-gradient(180deg, var(--sea-0), var(--sea-1)); border-radius: 6px 6px 2px 2px; min-height: 2px;
  transition: height .8s ease;
}
.histo__col--due .histo__bar { background: linear-gradient(180deg, var(--pink), var(--coral)); }
.histo__x { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); font-size: .7rem; white-space: nowrap; opacity: .8; }
.histo__n { text-align: center; font-size: .72rem; font-weight: 800; margin-bottom: 2px; }
.empty { text-align: center; opacity: .8; font-style: italic; padding: 24px; }

/* ---------- Coquillages (messages) ---------- */
.shells { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.shell {
  font: inherit; color: inherit; cursor: pointer; border: 0;
  background: rgba(255,255,255,.08); border-radius: 20px; padding: 14px;
  width: 150px; text-align: center; transition: transform .2s, background .2s;
}
.shell:hover { transform: translateY(-4px) rotate(-2deg); background: rgba(255,255,255,.15); }
.shell__icon { font-size: 2.6rem; display: block; transition: transform .4s; }
.shell__from { font-weight: 800; font-size: .85rem; display: block; margin-top: 4px; }
.shell__text { display: none; margin-top: 10px; font-size: .92rem; text-align: left; white-space: pre-wrap; word-break: break-word; }
.shell.is-open { width: min(340px, 100%); background: rgba(255,255,255,.95); color: var(--ink); transform: none; }
.shell.is-open .shell__icon { transform: rotate(360deg) scale(.8); }
.shell.is-open .shell__text { display: block; }

/* ---------- Résultats ---------- */
.birth-card {
  max-width: 720px; margin: 0 auto; text-align: center; color: var(--ink);
  background: linear-gradient(135deg, var(--pearl), var(--pink));
  border-radius: 28px; padding: 32px 24px; box-shadow: var(--shadow);
}
.birth-card__name { font-family: var(--font-title); font-size: clamp(2rem, 6vw, 3.2rem); margin: 0; color: var(--coral-dark); }
.birth-card__facts { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 18px 0 0; }
.birth-card__fact { background: rgba(255,255,255,.75); border-radius: 16px; padding: 10px 16px; font-weight: 700; }
.birth-card__fact small { display: block; font-weight: 600; opacity: .7; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.birth-card__note { margin: 18px auto 0; max-width: 520px; font-style: italic; white-space: pre-wrap; }

.podium { list-style: none; padding: 0; margin: 0 auto; display: flex; justify-content: center; align-items: flex-end; gap: 12px; max-width: 640px; }
.podium li {
  flex: 1; text-align: center; border-radius: 20px 20px 6px 6px; padding: 14px 8px;
  background: rgba(255,255,255,.18); min-width: 0;
}
.podium__avatar { font-size: 2.4rem; }
.podium__name { font-family: var(--font-title); font-weight: 600; word-break: break-word; }
.podium__pts { font-weight: 800; }
.podium__medal { font-size: 1.8rem; }
.podium li.p1 { order: 2; padding-top: 40px; background: linear-gradient(180deg, rgba(255,216,107,.55), rgba(255,255,255,.15)); }
.podium li.p2 { order: 1; padding-top: 24px; }
.podium li.p3 { order: 3; }
.my-result {
  max-width: 640px; margin: 26px auto 0; text-align: center;
  background: linear-gradient(135deg, var(--pink), var(--coral)); color: #fff;
  border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow); font-size: 1.05rem;
}
.my-result p { margin: 4px 0; }

.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.trophy {
  text-align: center; padding: 18px 12px; border-radius: 20px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  animation: rise .6s ease both;
}
.trophy__icon { font-size: 2.4rem; animation: bob 3s ease-in-out infinite; }
.trophy__title { font-family: var(--font-title); font-weight: 600; font-size: 1.05rem; margin-top: 4px; }
.trophy__who { font-weight: 800; margin-top: 6px; word-break: break-word; }
.trophy__detail { font-size: .85rem; opacity: .85; margin-top: 4px; }

.leaderboard { max-width: 760px; margin: 0 auto; }
.lb-row { border-radius: 16px; background: rgba(255,255,255,.1); margin-bottom: 8px; overflow: hidden; }
.lb-row[open] { background: rgba(255,255,255,.18); }
.lb-row.is-mine { outline: 3px solid var(--coral); }
.lb-row summary {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 12px 14px; cursor: pointer; list-style: none;
}
.lb-row summary::-webkit-details-marker { display: none; }
.lb-row summary:hover { background: rgba(255,255,255,.08); }
.lb-row__rank { font-weight: 800; text-align: center; font-size: 1.1rem; }
.lb-row--top .lb-row__rank { font-size: 1.5rem; }
.lb-row__avatar { font-size: 1.5rem; }
.lb-row__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row__bar { height: 10px; background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden; }
.lb-row__bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--sea-0), var(--coral)); border-radius: 999px; }
.lb-row__guess { font-size: .9rem; opacity: .85; text-align: right; }
.breakdown { padding: 0 14px 14px; overflow-x: auto; }
.breakdown table { width: 100%; border-collapse: collapse; font-size: .9rem; background: rgba(255,255,255,.95); color: var(--ink); border-radius: 12px; overflow: hidden; }
.breakdown th, .breakdown td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(13,106,146,.1); }
.breakdown thead th { background: var(--sea-0); color: var(--sea-5); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.breakdown tbody th { white-space: nowrap; }
.breakdown tfoot { background: var(--sand); font-size: 1rem; }
.breakdown__pts { text-align: right !important; white-space: nowrap; }

/* ---------- Fond marin ---------- */
.seabed {
  position: relative; z-index: 2; text-align: center;
  background: linear-gradient(180deg, var(--sea-5) 0%, var(--sea-6) 40%, #3a2d1d 100%);
  padding: 120px 16px 30px; color: var(--sand);
}
.seabed::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px;
  background: radial-gradient(ellipse at 30% 100%, var(--sand-dark) 0 60%, transparent 61%),
              radial-gradient(ellipse at 80% 100%, #c9a865 0 55%, transparent 56%);
  opacity: .35;
}
.seabed p { position: relative; margin: 0; font-size: .95rem; }
.seabed__decor { position: absolute; left: 0; right: 0; bottom: 40px; height: 120px; pointer-events: none; }
.weed {
  position: absolute; bottom: 0; width: 14px; border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #4fd1a5, #1f7a5e); transform-origin: bottom center;
  animation: sway 4s ease-in-out infinite;
}
.weed--1 { left: 8%; height: 90px; }
.weed--2 { left: 11%; height: 60px; animation-delay: -1s; }
.weed--3 { left: 84%; height: 100px; animation-delay: -2s; }
.weed--4 { left: 88%; height: 70px; animation-delay: -.5s; background: linear-gradient(180deg, var(--pink), var(--coral-dark)); }
.weed--5 { left: 50%; height: 50px; animation-delay: -3s; }
@keyframes sway { 50% { transform: rotate(8deg); } }
.chest { position: absolute; bottom: 0; left: 70%; font-size: 2.4rem; pointer-events: auto; cursor: pointer; transition: transform .2s; }
.chest:hover { transform: scale(1.15) rotate(-6deg); }
.anchor-btn {
  position: relative; margin-top: 14px; background: none; border: 0; cursor: pointer;
  font-size: 1.4rem; opacity: .45; transition: opacity .2s, transform .2s; color: var(--sand);
}
.anchor-btn:hover { opacity: 1; transform: rotate(-15deg); }

/* ---------- Bulles & nageurs ---------- */
.bubbles, .swimmers { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.bubble {
  position: absolute; bottom: -40px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(255,255,255,.15) 45%, rgba(255,255,255,.05) 70%);
  border: 1px solid rgba(255,255,255,.35);
  animation: bubble linear forwards;
}
@keyframes bubble {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: .9; }
  50% { transform: translate(14px, -50vh); }
  100% { transform: translate(-10px, -110vh); opacity: 0; }
}
.swimmer {
  position: absolute; font-size: 2rem; white-space: nowrap; pointer-events: auto; cursor: pointer;
  animation: swim linear forwards; opacity: .9; user-select: none;
}
.swimmer > span { display: inline-block; animation: wiggle 1.2s ease-in-out infinite; }
.swimmer--rtl > span { transform: scaleX(1); }
.swimmer--ltr > span { transform: scaleX(-1); }
@keyframes swim { from { transform: translateX(var(--from)); } to { transform: translateX(var(--to)); } }
@keyframes wiggle { 50% { translate: 0 -6px; } }
.pop { position: fixed; pointer-events: none; z-index: 50; font-size: 1.2rem; animation: pop .9s ease-out forwards; }
@keyframes pop { to { transform: translateY(-60px) scale(1.4); opacity: 0; } }

/* ---------- Jauge de profondeur ---------- */
.depth {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-title); font-weight: 600; font-size: .85rem;
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.depth__track { width: 8px; height: 180px; border-radius: 8px; background: rgba(255,255,255,.25); overflow: hidden; }
.depth__fill { width: 100%; height: 0; background: linear-gradient(180deg, var(--sea-0), var(--coral)); border-radius: 8px; }
.depth__label { background: rgba(6,28,54,.55); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }

/* ---------- Modal capitaine ---------- */
.modal {
  width: min(680px, calc(100% - 24px)); max-height: 90vh; overflow: auto;
  border: 0; border-radius: var(--radius); padding: 28px; color: var(--ink);
  background: linear-gradient(160deg, var(--pearl), #e7f7fb);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.modal::backdrop { background: rgba(6,28,54,.7); backdrop-filter: blur(3px); }
.modal h2 { font-family: var(--font-title); margin: 0 0 12px; color: var(--sea-4); }
.modal h3 { font-family: var(--font-title); margin: 26px 0 10px; color: var(--sea-4); }
.modal__close-form { position: absolute; top: 12px; right: 12px; margin: 0; }
.modal__close { background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: var(--sea-4); }
.admin-form { display: grid; gap: 12px; }
.admin-form label { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; color: var(--sea-4); }
.admin-form--grid { grid-template-columns: 1fr 1fr; }
.span-2 { grid-column: 1 / -1; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-links { margin-bottom: 16px; }
.admin-links .btn { text-decoration: none; }
.admin-who { font-size: .9rem; opacity: .8; margin: 0 0 12px; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 800; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--coral); }
.admin-list { list-style: none; padding: 0; margin: 0 0 20px; max-height: 260px; overflow: auto; }
.admin-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.admin-list li:nth-child(odd) { background: rgba(13,106,146,.07); }
.admin-list button { background: none; border: 0; cursor: pointer; font-size: 1.1rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 200%); z-index: 200;
  opacity: 0; visibility: hidden;
  background: var(--sea-5); color: #fff; padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow); font-weight: 700; transition: transform .35s ease, opacity .35s, visibility .35s; max-width: calc(100% - 32px); text-align: center;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- Confettis ---------- */
.confetti { position: fixed; top: -20px; z-index: 500; pointer-events: none; font-size: 1.5rem; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .parchment { grid-template-columns: 1fr; padding: 24px 18px; }
  .admin-form--grid { grid-template-columns: 1fr; }
  .depth { display: none; }
  .countdown__item { min-width: 68px; }
  .countdown__item span { font-size: 1.6rem; }
  .bar { grid-template-columns: 96px 1fr 26px; font-size: .85rem; }
  .lb-row summary { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; }
  .lb-row__guess { grid-column: 2; }
  .breakdown table { font-size: .8rem; }
  .breakdown th, .breakdown td { padding: 6px; }
  .sun { width: 70px; height: 70px; right: 6%; }
  .zone { padding: 60px 0; }
}

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

/* ==========================================================
   Date limite, sélecteur de date, verrous, tableau de bord
   ========================================================== */
.deadline-pill {
  display: inline-block; margin: 14px 0 0; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,255,255,.75); color: var(--sea-4); font-weight: 800; font-size: .92rem;
}
.deadline-note {
  max-width: 640px; margin: -18px auto 26px; text-align: center; font-weight: 800;
  background: rgba(255,255,255,.16); padding: 10px 16px; border-radius: 14px;
}
.deadline-note.is-urgent { background: var(--coral); color: #fff; animation: pulse 2s ease-in-out infinite; }

/* Calendrier */
.calendar {
  background: rgba(255,255,255,.85); border: 2px solid rgba(13,106,146,.18); border-radius: 18px;
  padding: 14px; max-width: 460px;
}
.calendar__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.calendar__month { font-family: var(--font-title); font-weight: 600; font-size: 1.15rem; color: var(--sea-4); text-transform: capitalize; }
.calendar__nav {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.5rem; line-height: 1;
  background: var(--sea-0); color: var(--sea-5);
}
.calendar__nav[disabled] { opacity: .3; cursor: default; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar__wd { text-align: center; font-size: .75rem; font-weight: 800; color: #5a7184; padding: 2px 0; }
.calendar__day {
  position: relative; aspect-ratio: 1; min-height: 38px; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--ink); background: rgba(43,179,201,.1);
  font-variant-numeric: tabular-nums; transition: background .12s, transform .12s;
}
.calendar__day:hover:not([disabled]) { background: rgba(43,179,201,.28); transform: scale(1.06); }
.calendar__day[disabled] { background: transparent; color: #b5c4cd; cursor: default; }
.calendar__day.is-today { box-shadow: inset 0 0 0 2px var(--sea-1); }
.calendar__day.is-due { background: var(--pink); }
.calendar__day.is-due::after { content: "🎯"; position: absolute; top: -6px; right: -4px; font-size: .75rem; }
.calendar__day.is-selected { background: var(--coral); color: #fff; transform: scale(1.08); box-shadow: 0 6px 14px rgba(232,90,108,.4); }
.calendar__quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip--small { font-size: .85rem; padding: 6px 12px; }
.chip[disabled] { opacity: .4; cursor: default; }
.calendar__choice { margin: 8px 0 0; font-size: .95rem; color: var(--sea-4); }

/* Verrous */
.lock {
  max-width: 560px; margin: 0 auto; text-align: center; display: grid; gap: 12px; justify-items: center;
  background: rgba(255,255,255,.1); border: 2px dashed rgba(255,255,255,.35); border-radius: var(--radius); padding: 28px 22px;
}
.lock p { margin: 0; }
.lock__icon { font-size: 2.6rem; animation: bob 3s ease-in-out infinite; }
.lock__count { opacity: .85; }

/* Statistiques version capitaine */
.bar__who { grid-column: 1 / -1; font-size: .78rem; opacity: .8; margin-top: -4px; }
.extremes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.extremes li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.15); }
.extremes li span:first-child { grid-column: 1 / -1; font-size: .8rem; opacity: .8; }
.extremes li span:last-child { font-family: var(--font-title); }

/* Tableau de bord du capitaine */
.zone--captain { background: linear-gradient(180deg, #0a3b5c, var(--sea-1)); border-bottom: 4px dashed rgba(255,255,255,.25); }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { background: rgba(255,255,255,.12); border-radius: 16px; padding: 14px 16px; display: grid; gap: 2px; }
.kpi span { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; font-weight: 800; }
.kpi b { font-family: var(--font-title); font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.kpi b.kpi__status { font-size: 1.05rem; }
.kpi--wide { grid-column: span 2; }
.dash-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dash-tab {
  font: inherit; font-weight: 800; cursor: pointer; border: 0; border-radius: 999px; padding: 9px 16px;
  background: rgba(255,255,255,.12); color: #fff;
}
.dash-tab[aria-selected="true"] { background: var(--pearl); color: var(--sea-4); }
.dash-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.dash-tools input {
  flex: 1; min-width: 180px; font: inherit; padding: 10px 14px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,.9); color: var(--ink);
}
.dash-table { overflow-x: auto; border-radius: 14px; background: rgba(255,255,255,.95); color: var(--ink); }
.dash-table table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.dash-table th, .dash-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid rgba(13,106,146,.1); white-space: nowrap; }
.dash-table th { position: sticky; top: 0; background: var(--sea-0); color: var(--sea-5); cursor: pointer; user-select: none; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.dash-table tbody tr:hover { background: rgba(43,179,201,.08); }
.dash-messages { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.note { margin: 0; background: var(--pearl); color: var(--ink); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.note blockquote { margin: 0 0 10px; font-style: italic; white-space: pre-wrap; word-break: break-word; }
.note figcaption { font-size: .85rem; font-weight: 800; color: var(--sea-3); }
.admin-form--inline { grid-template-columns: 1fr; }

@media (max-width: 700px) {
  .kpi--wide { grid-column: auto; }
  .calendar { padding: 10px; }
  .calendar__day { min-height: 34px; border-radius: 10px; }
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }
@keyframes bob { 50% { transform: translateY(-4px) rotate(4deg); } }
