/* =========================================================
   LOTERIE DE LA NAISSANCE
   ========================================================= */
body { overflow: hidden; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#gl:active { cursor: grabbing; }

/* ---------- avant le premier tirage ---------- */
.intro {
  position: fixed; z-index: 10; left: 50%; bottom: calc(var(--pad) + 28px);
  transform: translateX(-50%); width: min(560px, calc(100% - 2 * var(--pad)));
  display: grid; justify-items: center; gap: 18px; text-align: center;
  transition: opacity .5s, transform .6s var(--ease-out);
}
.intro-text { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.45; color: #cfcfcf; }
.intro.gone { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }

.legend { position: fixed; z-index: 10; left: var(--pad); bottom: var(--pad); max-width: 250px; line-height: 1.7; transition: opacity .4s; }

/* ---------- résultat ---------- */
.result {
  position: fixed; z-index: 15; top: 0; right: 0; bottom: 0; width: min(500px, 100%);
  padding: calc(var(--pad) + 70px) var(--pad) var(--pad);
  background: #0d0d0d; border-left: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; transform: translateX(40px);
  transition: transform .7s var(--ease-out), opacity .45s;
}
.result.open { opacity: 1; transform: none; }

.res-name { font-size: clamp(42px, 5.4vw, 80px); margin: 12px 0 20px; overflow-wrap: break-word; hyphens: auto; }
.res-name.long { font-size: clamp(30px, 3.6vw, 52px); }
.res-odds { font-size: 19px; line-height: 1.4; }
.res-summary { font-size: 19px; line-height: 1.4; color: var(--muted); margin-top: 6px; }

.compare-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 30px 0 18px; }
.compare-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 10px; height: 10px; display: inline-block; }
.sw.here { background: var(--blue); }
.sw.mine { background: #3d3d3d; }
.sw.world { width: 2px; height: 12px; background: var(--fg); }

.stats { display: grid; gap: 20px; }
.stat dt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; margin-bottom: 8px; }
.bar { position: relative; height: 24px; display: flex; align-items: center; background: rgba(255,255,255,.04); }
.bar + .bar { margin-top: 3px; }
.bar > span { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--w)); background: var(--blue); transition: transform .9s var(--ease-out); }
.bar.mine > span { background: #3d3d3d; }
.bar .world { position: absolute; top: -3px; bottom: -3px; width: 2px; left: calc(var(--m) * 100%); background: var(--fg); }
.bar b { position: relative; padding-left: 9px; font-family: var(--mono); font-size: 11px; font-weight: 500; }

.mine-pick { display: grid; gap: 8px; margin-top: 30px; }
.mine-pick select {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 30px;
  background: transparent; font-family: var(--sans); font-size: 15px; text-transform: none; cursor: pointer;
}
.mine-pick option { background: #111; color: var(--fg); }

.res-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.btn-main.small { height: 48px; padding: 0 28px; font-size: 16px; }
.pill-btn { height: 48px; padding: 0 20px; border: 1px solid var(--line); border-radius: 40px; transition: background .25s, color .25s; }
.pill-btn:hover { background: var(--fg); color: var(--bg); }

.count { margin-top: 20px; }
.source { margin-top: 18px; line-height: 1.75; text-transform: none; letter-spacing: 0; }
.source a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- survol du globe ---------- */
.tip {
  position: fixed; z-index: 30; left: 0; top: 0; pointer-events: none;
  background: var(--fg); color: var(--bg); padding: 6px 10px; border-radius: 20px; white-space: nowrap;
}

/* ---------- petits écrans : le résultat monte du bas ---------- */
@media (max-width: 900px) {
  .result {
    top: auto; left: 0; width: 100%; height: 60vh; height: 60dvh;
    border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
    padding-top: calc(var(--pad) + 6px); transform: translateY(40px);
  }
  .result.open { transform: none; }
  body.has-result .legend { opacity: 0; }
  .legend { bottom: auto; top: calc(var(--pad) + 46px); }
}
