/* Ciel — identité visuelle : ciel de crépuscule, verre dépoli, or d'aube. */

:root {
  --ink: #f5f2ff;
  --muted: rgba(245, 242, 255, 0.62);
  --gold: #ffd27a;
  --gold-deep: #f2a65a;
  --rose: #ff9e8f;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(18, 20, 58, 0.72);
  --glass-border: rgba(255, 255, 255, 0.14);
  --radius: 18px;
  --font: 'Segoe UI', 'Avenir Next', 'Helvetica Neue', system-ui, sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #090c2b 0%, #161b4d 30%, #352f72 58%, #7b4f86 80%, #d98a86 94%, #f4b48f 100%) fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
a { color: var(--gold); }
b { font-weight: 650; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.spacer { flex: 1; }

/* ---------- Décor ---------- */

#sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
#sky i {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.15; } to { opacity: 0.95; } }

#clouds { position: fixed; inset: auto 0 0 0; height: 40vh; pointer-events: none; z-index: 0; overflow: hidden; }
#clouds i {
  position: absolute;
  bottom: -60px;
  width: 520px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 214, 200, 0.28), rgba(255, 214, 200, 0) 70%);
  filter: blur(8px);
  animation: drift 90s linear infinite;
}
#clouds i:nth-child(1) { left: -10%; }
#clouds i:nth-child(2) { left: 35%; bottom: -20px; width: 700px; animation-duration: 140s; animation-delay: -40s; opacity: 0.7; }
#clouds i:nth-child(3) { left: 70%; bottom: -80px; animation-duration: 110s; animation-delay: -70s; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(60vw); } }

#app { position: relative; z-index: 1; height: 100vh; }

.screen { display: none; height: 100vh; }
.screen.active { display: flex; }
.center-screen { align-items: center; justify-content: center; gap: 64px; padding: 32px; }

/* ---------- Logo ---------- */

.logo-mark {
  display: inline-block;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #fff3d2 0 28%, var(--gold) 29% 48%, transparent 49%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 210, 122, 0.55), transparent 60%);
  position: relative;
}
.logo-mark::after {
  content: '';
  position: absolute;
  left: 4%;
  right: -6%;
  bottom: 2%;
  height: 28%;
  border-radius: 999px;
  background: #f7f3ff;
  box-shadow: 0.18em -0.12em 0 0.02em #f7f3ff, -0.16em -0.06em 0 -0.02em #f7f3ff;
}
.logo-big { display: flex; align-items: center; gap: 18px; font-size: 64px; }
.logo-big h1 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 96px;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff 30%, #ffd9b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 10px 40px rgba(255, 200, 160, 0.25);
}
.logo-small { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-style: italic; font-size: 26px; }
.logo-small .logo-mark { font-size: 22px; }

/* ---------- Accueil ---------- */

.hero { max-width: 520px; }
.tagline { font-size: 1.15rem; line-height: 1.55; color: rgba(255, 244, 236, 0.85); margin: 8px 0 30px; }
.fan { position: relative; height: 190px; margin-left: 40px; --cw: 88px; }
.fan-card {
  position: absolute;
  left: calc(150px + var(--i) * 52px);
  top: 20px;
  transform: rotate(calc(var(--i) * 9deg)) translateY(calc(var(--i) * var(--i) * 4px));
  transform-origin: 50% 120%;
  transition: transform 0.3s;
}
.fan-card:hover { transform: rotate(calc(var(--i) * 9deg)) translateY(-14px); z-index: 2; }

.panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(5, 6, 30, 0.35);
}
.form-panel { width: 400px; padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.form-panel h2 { margin: 4px 0 0; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--muted); }
input {
  background: rgba(10, 12, 40, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 210, 122, 0.2); }
.code-input { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 700; width: 100%; text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.row > input { flex: 1; min-width: 0; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.82rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--glass-border); }

.btn {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.18); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #ffe0a0, var(--gold-deep));
  color: #3a1f2b;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(242, 166, 90, 0.35);
}
.btn.primary:hover { box-shadow: 0 10px 30px rgba(242, 166, 90, 0.55); }
.btn.big { padding: 13px 24px; font-size: 1.05rem; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }
.small-btn { padding: 6px 12px; font-size: 0.88rem; }
.link { background: none; border: none; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; align-self: center; font-size: 0.9rem; }
.link:hover { color: var(--ink); }

#join-form { display: flex; flex-direction: column; gap: 16px; }
.resume { display: flex; flex-direction: column; gap: 12px; }
.resume p { margin: 0; }
.code-tag { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.2em; color: var(--gold); }

/* ---------- Salle d'attente ---------- */

.lobby-panel { width: 640px; padding: 30px 34px; display: flex; flex-direction: column; gap: 18px; }
.lobby-panel h2 { margin: 0; font-weight: 600; }
.share { display: flex; gap: 28px; align-items: flex-end; }
.share-link { flex: 1; }
.code-big { font-family: ui-monospace, Consolas, monospace; font-size: 42px; letter-spacing: 0.22em; font-weight: 800; color: var(--gold); text-shadow: 0 0 24px rgba(255, 210, 122, 0.35); }
.lobby-players { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lobby-players li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.lobby-players li.empty { opacity: 0.35; }
.lobby-players li.empty .avatar { background: transparent; border: 1px dashed var(--glass-border); }

.avatar {
  --c: #888;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c);
  color: #24183a;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.avatar.sm { width: 22px; height: 22px; font-size: 0.75rem; }
.pname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 0.7rem; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); white-space: nowrap; font-weight: 600; }
.tag.gold { background: var(--gold); color: #3a1f2b; }
.tag.sun { background: linear-gradient(90deg, #ffe7a8, #ffb37a); color: #4a2a1a; }
.tag.dim { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

/* ---------- Cartes ---------- */

.card, .slot {
  --ch: calc(var(--cw) * 1.4);
  width: var(--cw);
  height: var(--ch);
  border-radius: calc(var(--cw) * 0.13);
  flex: none;
}
.card { position: relative; perspective: 700px; }
.card .inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.3, 1);
}
.card.down .inner { transform: rotateY(180deg); }
.face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 calc(var(--cw) * 0.05) calc(var(--cw) * 0.14) rgba(8, 6, 30, 0.45);
}
.card { border-radius: calc(var(--cw) * 0.13); }
.card .inner, .card .face { border-radius: calc(var(--cw) * 0.13); }
.face.back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.6px),
    radial-gradient(circle at 70% 12%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.6px),
    radial-gradient(circle at 84% 34%, rgba(255, 255, 255, 0.6) 0 0.8px, transparent 1.4px),
    radial-gradient(circle at 34% 40%, rgba(255, 255, 255, 0.5) 0 0.8px, transparent 1.4px),
    linear-gradient(172deg, #232a68 0%, #3e3a88 42%, #9a5f96 74%, #f0a088 100%);
  display: grid;
  place-items: center;
}
.face.back::before {
  content: '';
  position: absolute;
  inset: calc(var(--cw) * 0.06);
  border-radius: calc(var(--cw) * 0.09);
  border: 1px solid rgba(255, 222, 170, 0.45);
}
.back-emblem { width: 62%; }
.back-emblem .sun { fill: #ffd27a; opacity: 0.9; }
.back-emblem .cl { fill: #fbf6ff; opacity: 0.95; }

.face.front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--cw) * 0.02);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.c-num { font-size: calc(var(--cw) * 0.46); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.c-icon { line-height: 0; opacity: 0.9; }
.c-icon svg { width: calc(var(--cw) * 0.3); height: calc(var(--cw) * 0.3); fill: currentColor; }
.c-tl, .c-br { position: absolute; font-size: calc(var(--cw) * 0.16); font-weight: 750; opacity: 0.85; line-height: 1; }
.c-tl { top: calc(var(--cw) * 0.08); left: calc(var(--cw) * 0.09); }
.c-br { bottom: calc(var(--cw) * 0.08); right: calc(var(--cw) * 0.09); }

.tier-nuit { background: radial-gradient(circle at 70% 18%, #4a4fa8 0%, #262a6e 45%, #12143d 100%); color: #ffd98a; }
.tier-nuit::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 70%, #fff 0 0.8px, transparent 1.4px),
    radial-gradient(circle at 80% 80%, #fff 0 0.8px, transparent 1.4px),
    radial-gradient(circle at 30% 25%, #fff 0 0.6px, transparent 1.2px);
  opacity: 0.8;
}
.tier-zenith { background: linear-gradient(165deg, #ffffff 0%, #e6f4ff 55%, #cfe8ff 100%); color: #2c6aa6; }
.tier-aube { background: linear-gradient(165deg, #fff0e2 0%, #ffcdb8 50%, #ff9f95 100%); color: #8c2c47; }
.tier-nuage { background: linear-gradient(165deg, #f4f1ff 0%, #d6cff2 55%, #b3a8de 100%); color: #45397e; }
.tier-crepuscule { background: linear-gradient(165deg, #ffb27a 0%, #ec7a6e 48%, #a83d74 100%); color: #fff7ec; }
.tier-orage { background: linear-gradient(165deg, #45576a 0%, #263340 55%, #111a22 100%); color: #8ff0ff; }
.tier-orage .c-num { text-shadow: 0 0 12px rgba(143, 240, 255, 0.55); }
.tier-nuit .c-num { text-shadow: 0 0 12px rgba(255, 217, 138, 0.45); }

.slot.gone {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), transparent 70%);
}
.slot.empty-pile { border: 1px dashed rgba(255, 255, 255, 0.25); }

/* Cibles cliquables */
.card.target { cursor: pointer; transition: transform 0.15s; }
.card.target .face { animation: beckon 1.8s ease-in-out infinite; }
.card.target:hover { transform: translateY(-5px); }
.card.target:hover .face { animation: none; box-shadow: 0 0 0 3px var(--gold), 0 12px 26px rgba(8, 6, 30, 0.6); }
@keyframes beckon {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 210, 122, 0.4), 0 6px 16px rgba(8, 6, 30, 0.5); }
  50% { box-shadow: 0 0 0 2px rgba(255, 210, 122, 0.95), 0 0 18px rgba(255, 200, 120, 0.45); }
}

/* Animations */
.anim-flip .inner { animation: flipIn 0.6s cubic-bezier(0.3, 0.7, 0.3, 1); }
@keyframes flipIn { from { transform: rotateY(180deg) scale(1.06); } to { transform: rotateY(0) scale(1); } }
.anim-drop { animation: dropIn 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
@keyframes dropIn { from { transform: translateY(-18px) scale(1.1); opacity: 0.2; } to { transform: none; opacity: 1; } }
.anim-rise { animation: riseIn 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
@keyframes riseIn { from { transform: translateY(14px) scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
.anim-envol { animation: envol 1.3s ease-in forwards; pointer-events: none; }
@keyframes envol {
  0% { transform: none; opacity: 1; }
  25% { transform: translateY(-6px) rotate(-3deg); }
  100% { transform: translateY(-90px) rotate(8deg) scale(0.6); opacity: 0; }
}

/* ---------- Écran de jeu ---------- */

#screen-game {
  display: none;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: auto minmax(0, 1fr);
  --my-cw: 80px;
  --opp-cw: 52px;
}
#screen-game.active { display: grid; }

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 6px;
}
.chip { padding: 5px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border); font-size: 0.88rem; }
.chip.clickable { cursor: pointer; font-family: inherit; }
.chip.clickable:hover { border-color: var(--gold); }

.table { display: flex; flex-direction: column; gap: 10px; padding: 6px 16px 16px 20px; min-height: 0; position: relative; overflow: auto; }
.opponents { flex: 1; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-content: center; }
.bottom { display: flex; align-items: center; justify-content: center; gap: 40px; padding-bottom: 6px; }

.board {
  padding: 8px 12px 12px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s, transform 0.3s;
}
.board.opp { --cw: var(--opp-cw); }
.board.mine { --cw: var(--my-cw); padding: 10px 16px 16px; background: rgba(255, 255, 255, 0.09); }
.board.active {
  border-color: rgba(255, 210, 122, 0.9);
  background: rgba(255, 210, 122, 0.09);
  box-shadow: 0 0 0 2px rgba(255, 210, 122, 0.35), 0 0 40px rgba(255, 190, 110, 0.28);
}
.board.opp.active { transform: translateY(-3px); }
.board-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 0.86rem; min-width: 0; }
.board.mine .board-head { font-size: 0.95rem; }
.board-head .total {
  min-width: 34px;
  text-align: center;
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(10, 12, 40, 0.45);
  font-weight: 750;
}
.score-now { font-weight: 750; color: #ffe2b0; }
.score-now.bolt { color: #8ff0ff; }
.grid { display: grid; grid-template-columns: repeat(4, var(--cw)); gap: calc(var(--cw) * 0.1); justify-content: center; }

.center { display: flex; flex-direction: column; align-items: center; gap: 14px; --cw: var(--my-cw); width: calc(var(--my-cw) * 3 + 96px); }
.piles { display: flex; gap: 24px; align-items: flex-end; }
.pile-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pile { position: relative; border-radius: calc(var(--cw) * 0.13); transition: transform 0.2s, box-shadow 0.2s; }
.pile .stack { position: relative; }
.pile .stack::before, .pile .stack::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: calc(var(--cw) * 0.13);
  background: #2c2f72;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.pile .stack::before { transform: translate(4px, 4px); }
.pile .stack::after { transform: translate(2px, 2px); background: #3a3880; }
.pile .stack .card { z-index: 1; }
.pile.clickable { cursor: pointer; }
.pile.clickable .card .face, .pile.clickable .slot { box-shadow: 0 0 0 2px rgba(255, 210, 122, 0.7), 0 0 26px rgba(255, 200, 120, 0.4); }
.pile.clickable:hover { transform: translateY(-5px); }
.pile.drop .card .face { box-shadow: 0 0 0 2px rgba(143, 240, 255, 0.8), 0 0 26px rgba(143, 240, 255, 0.35); }
.pile-label { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em; }
.held-wrap .pile { filter: drop-shadow(0 0 18px rgba(255, 210, 122, 0.45)); }
.held-wrap.is-empty .pile { filter: none; opacity: 0.5; }
.held-card { transform: rotate(-4deg); }

.prompt {
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.45;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  min-height: 3.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.prompt.mine { background: rgba(255, 210, 122, 0.14); border-color: rgba(255, 210, 122, 0.6); }

.final-banner {
  align-self: center;
  padding: 8px 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 231, 168, 0.95), rgba(255, 179, 122, 0.95));
  color: #432516;
  font-size: 0.95rem;
  box-shadow: 0 6px 24px rgba(255, 179, 122, 0.4);
  animation: riseIn 0.4s ease-out;
}

/* Colonne de droite */
.side { display: flex; flex-direction: column; gap: 12px; padding: 6px 18px 18px 0; min-height: 0; }
.side-panel { padding: 14px 16px; }
.side-panel h3 { margin: 0 0 10px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 650; }
.scoreboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.scoreboard li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; font-size: 0.9rem; }
.scoreboard li .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.scoreboard li.active { background: rgba(255, 210, 122, 0.14); }
.scoreboard li.me .pname { color: var(--gold); }
.log-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.log { list-style: none; margin: 0; padding: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; line-height: 1.35; color: rgba(245, 242, 255, 0.82); }
.log li { padding-left: 10px; border-left: 2px solid rgba(255, 255, 255, 0.12); }
.log li:first-child { color: var(--ink); border-left-color: var(--gold); }
.log .ev-envol { border-left-color: #9fd4ff; }
.log .ev-close, .log .ev-roundEnd { border-left-color: var(--gold-deep); }
.log .ev-deal { color: var(--gold); }

/* Fin de journée */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 32, 0.55);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.35s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(760px, 92vw);
  max-height: 86vh;
  overflow: auto;
  padding: 28px 32px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(36, 34, 96, 0.96), rgba(70, 46, 104, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: riseIn 0.4s ease-out;
}
.modal h2 { margin: 0 0 6px; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 2rem; }
.score-table-wrap { overflow-x: auto; margin: 18px 0 22px; }
.score-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.score-table th { font-weight: 600; color: var(--muted); font-size: 0.8rem; text-align: center; padding: 6px 8px; }
.score-table td { text-align: center; padding: 9px 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; }
.score-table td.pname { text-align: left; }
.score-table td.rank { color: var(--muted); width: 28px; }
.score-table td.last { color: #ffe2b0; font-weight: 650; }
.score-table td.tot { font-weight: 800; font-size: 1.05rem; }
.score-table tr.me td.pname { color: var(--gold); }
.score-table tr.winner td { background: rgba(255, 210, 122, 0.12); }

/* Toasts & bannière */
.toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: riseIn 0.3s ease-out;
  transition: opacity 0.5s, transform 0.5s;
  max-width: 520px;
  text-align: center;
}
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast.err { border-color: rgba(255, 140, 140, 0.6); }
.toast.sky { border-color: rgba(159, 212, 255, 0.7); }
.toast.sun { border-color: rgba(255, 210, 122, 0.8); }
.conn-banner { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 12px; background: #8c2c47; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }

/* Règles */
.rules {
  width: min(720px, 92vw);
  max-height: 88vh;
  padding: 26px 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, #23215f, #3b2c66);
  color: var(--ink);
  line-height: 1.55;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.rules::backdrop { background: rgba(8, 9, 32, 0.6); backdrop-filter: blur(4px); }
.rules h2 { margin-top: 0; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.9rem; }
.rules h3 { margin: 18px 0 4px; font-size: 1rem; color: var(--gold); }
.rules p, .rules ul { margin: 6px 0; }
.rules .close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 28px; cursor: pointer; color: var(--muted); }
.rules-cards { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; --cw: 38px; }
.rules-tier { display: flex; align-items: center; gap: 14px; }
.mini-cards { display: flex; gap: 6px; flex-wrap: wrap; min-width: 340px; }
.mini-card { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.72rem; color: var(--muted); }
