/* Le Narval : DA "Miami by night" — ciel violet / bleu pastel, palmiers, néons. */
:root {
  color-scheme: dark;
  --night: #140c2e;         /* fond le plus sombre */
  --bg: #1b1240;
  --surface: rgba(38, 24, 84, 0.72);
  --surface-2: rgba(58, 38, 122, 0.55);
  --line: rgba(196, 181, 253, 0.28);
  --text: #f5f0ff;
  --muted: #c9bff0;
  --violet: #b49cff;        /* violet pastel */
  --blue: #8fd3ff;          /* bleu pastel */
  --pink: #ff9ed8;          /* rose néon, pour les accents */
  --accent: #ff9ed8;
  --red: #b49cff;           /* fond des boutons (nom gardé pour la compat) */
  --on-red: #140c2e;
  --gold: #8fd3ff;          /* "gagnant" et surtitres */
  --ok: #7ef0c8;
  --grad: linear-gradient(90deg, #ff9ed8 0%, #b49cff 50%, #8fd3ff 100%);
  --sky: linear-gradient(180deg, #140c2e 0%, #2a1764 38%, #5a3bb0 68%, #c58be6 88%, #ffb3d9 100%);
  --serif: 'Anton', 'Impact', 'Arial Narrow', sans-serif;   /* titres */
  --script: 'Mr Dafoe', 'Brush Script MT', cursive;         /* "Le Narval" néon */
  --sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --glow-pink: 0 0 6px rgba(255, 158, 216, .9), 0 0 22px rgba(255, 120, 200, .55);
  --glow-blue: 0 0 6px rgba(143, 211, 255, .9), 0 0 22px rgba(120, 190, 255, .5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0; color: var(--text);
  font-family: var(--sans); line-height: 1.45; min-height: 100vh;
  background:
    url("/palms-left.svg") left -40px bottom / auto 48vh no-repeat fixed,
    url("/palms-right.svg") right -40px bottom / auto 40vh no-repeat fixed,
    var(--sky) fixed;
}
/* voile pour que le texte reste lisible au-dessus du ciel */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse at 50% 30%, rgba(20, 12, 46, .15), rgba(20, 12, 46, .55) 70%);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; margin: 0; letter-spacing: .01em; text-transform: uppercase; }
a { color: var(--blue); }
button, input, select { font: inherit; color: inherit; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }
.wrap.wide { max-width: 1080px; }

.top {
  display: flex; align-items: center; gap: 12px; padding: 18px 0 14px;
  border-bottom: 2px solid transparent;
  border-image: var(--grad) 1;
  margin-bottom: 22px;
}
.top img { width: 44px; height: 44px; object-fit: contain; border-radius: 50%; background: var(--night); padding: 2px; box-shadow: 0 0 0 2px var(--violet), var(--glow-pink); }
.top .brand { font-family: var(--script); font-size: 2.2rem; line-height: 1; color: #ffe3f4; text-shadow: var(--glow-pink); }
.top .sub { color: var(--blue); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.top .spacer { flex: 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; margin-bottom: 18px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(10, 4, 30, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.card h2 { font-size: 1.9rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card .sub { color: var(--muted); margin-top: 4px; }
.pill {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(20, 12, 46, .5);
}
.pill.open { color: var(--ok); border-color: rgba(126, 240, 200, .5); box-shadow: 0 0 12px rgba(126, 240, 200, .25); }
.pill.closed { color: var(--pink); border-color: rgba(255, 158, 216, .5); }

/* boutons de vote */
.choice {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: rgba(20, 12, 46, .55); border: 2px solid var(--line); border-radius: 16px;
  padding: 16px; margin-top: 12px; position: relative; overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .1s;
}
.choice:hover:not([disabled]) { border-color: var(--violet); box-shadow: 0 0 18px rgba(180, 156, 255, .35); }
.choice:active { transform: scale(.99); }
.choice .teams { font-family: var(--serif); font-size: 1.45rem; text-transform: uppercase; letter-spacing: .02em; position: relative; z-index: 1; }
.choice .meta { color: var(--muted); font-size: .88rem; margin-top: 2px; position: relative; z-index: 1; }
.choice .bar {
  position: absolute; inset: 0 auto 0 0; width: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(255, 158, 216, .35), rgba(143, 211, 255, .35));
  transition: width .5s ease;
}
.choice .pct { position: absolute; right: 14px; top: 14px; font-family: var(--serif); font-size: 1.2rem; z-index: 1; }
.choice.mine { border-color: var(--pink); box-shadow: 0 0 20px rgba(255, 158, 216, .35); }
.choice.mine .teams::after { content: ' ✓'; color: var(--ok); }
.choice.winner { border-color: var(--blue); box-shadow: 0 0 22px rgba(143, 211, 255, .45); }
.choice[disabled] { cursor: default; }
.note { color: var(--muted); font-size: .9rem; margin-top: 12px; }
.msg { margin-top: 12px; font-weight: 600; }
.msg.err { color: var(--pink); }
.msg.ok { color: var(--ok); }

.btn {
  background: var(--grad); color: var(--on-red); border: 0; border-radius: 999px; padding: 10px 18px;
  font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block;
  box-shadow: 0 4px 18px rgba(180, 156, 255, .35);
}
.btn.ghost { background: rgba(20, 12, 46, .5); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: transparent; color: var(--pink); border: 1px solid rgba(255, 158, 216, .6); box-shadow: none; }
.btn.small { padding: 6px 13px; font-size: .86rem; }
.btn:disabled { opacity: .5; cursor: default; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- admin ---------- */
.grid { display: grid; gap: 18px; }
@media (min-width: 900px) { .grid.two { grid-template-columns: 1fr 1fr; align-items: start; } }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--muted); flex: 1 1 140px; }
input[type='text'], input[type='password'], input[type='datetime-local'] {
  background: rgba(20, 12, 46, .7); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%;
}
input[type='checkbox'] { accent-color: var(--violet); }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mrow { border-top: 1px solid var(--line); padding: 12px 0; }
.mrow:first-of-type { border-top: 0; }
.count { font-family: var(--serif); font-size: 1.9rem; }
.resbar { height: 10px; border-radius: 99px; background: rgba(20, 12, 46, .6); overflow: hidden; margin-top: 6px; }
.resbar > i { display: block; height: 100%; background: var(--grad); transition: width .4s; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sect { margin: 28px 0 12px; font-size: 1.15rem; color: var(--muted); font-family: var(--sans); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
