* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cosmic-bg: #05060f;
  --cosmic-deep: #0a0e27;
  --cosmic-mid: #1a0f3d;
  --cosmic-purple: #2d1b69;
  --stellar-blue: #7986cb;
  --stellar-violet: #b39ddb;
  --stellar-gold: #ffd700;
  --stellar-rose: #ff6b9d;
  --star-white: rgba(255, 255, 255, 0.9);
  --glass-bg: rgba(20, 25, 60, 0.45);
  --glass-border: rgba(179, 157, 219, 0.2);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(179, 157, 219, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 80%, rgba(121, 134, 203, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(45, 27, 105, 0.35) 0%, transparent 70%),
    linear-gradient(135deg, #05060f 0%, #0a0e27 50%, #1a0f3d 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #fff;
  position: relative;
  overflow-x: hidden;
}

/* Champ d'étoiles en arrière-plan (3 couches à profondeurs différentes) */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  /* Petites étoiles */
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 25% 60%, #fff, transparent),
    radial-gradient(1px 1px at 40% 10%, #fff, transparent),
    radial-gradient(1px 1px at 55% 40%, #fff, transparent),
    radial-gradient(1px 1px at 70% 80%, #fff, transparent),
    radial-gradient(1px 1px at 85% 25%, #fff, transparent),
    radial-gradient(1px 1px at 95% 65%, #fff, transparent),
    radial-gradient(1px 1px at 15% 85%, #fff, transparent),
    radial-gradient(1px 1px at 35% 35%, #fff, transparent),
    radial-gradient(1px 1px at 65% 15%, #fff, transparent),
    radial-gradient(1px 1px at 80% 55%, #fff, transparent);
  background-size: 200% 200%;
  opacity: 0.6;
  animation: twinkle 6s ease-in-out infinite;
}

body::after {
  /* Grosses étoiles lumineuses */
  background-image:
    radial-gradient(2px 2px at 20% 30%, #ffd700, transparent),
    radial-gradient(2px 2px at 75% 70%, #b39ddb, transparent),
    radial-gradient(2px 2px at 50% 15%, #7986cb, transparent),
    radial-gradient(2px 2px at 90% 45%, #fff, transparent),
    radial-gradient(2px 2px at 30% 90%, #ff6b9d, transparent);
  opacity: 0.8;
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.9; }
}

/* Étoiles filantes périodiques */
.shooting-star {
  position: fixed;
  top: -10%;
  left: -10%;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px #fff, 0 0 12px rgba(255, 215, 0, 0.7);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}

.shooting-star::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), transparent);
  transform: translateX(-100%) rotate(35deg);
  transform-origin: right center;
}

.shooting-star.active {
  animation: shoot 1.4s linear;
}

@keyframes shoot {
  0%   { opacity: 0; transform: translate(0, 0); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(120vw, 80vh); }
}

/* Tout le contenu au-dessus des étoiles */
body > *:not(.shooting-star) {
  position: relative;
  z-index: 1;
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(179, 157, 219, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

h1 {
  font-size: 28px;
  margin-bottom: 8px;
  text-align: center;
  background: linear-gradient(90deg, #ffd700 0%, #ff6b9d 50%, #b39ddb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
}

.subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 28px;
  font-size: 14px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 4px;
  display: block;
}

input[type='email'],
input[type='password'] {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  transition: border-color 0.2s, background 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--stellar-violet);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(179, 157, 219, 0.15);
}

button {
  padding: 13px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #b39ddb 0%, #7986cb 100%);
  color: #fff;
  margin-top: 6px;
  box-shadow: 0 0 20px rgba(179, 157, 219, 0.3);
}

.btn-primary:hover {
  opacity: 0.9;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.btn-google {
  background: #fff;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-google:hover {
  background: #f0f0f0;
}

.btn-google svg {
  width: 20px;
  height: 20px;
}

.switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.switch a {
  color: var(--stellar-violet);
  text-decoration: none;
  font-weight: 600;
}

.switch a:hover {
  text-decoration: underline;
}

.error {
  background: rgba(255, 80, 80, 0.15);
  border: 1px solid rgba(255, 80, 80, 0.4);
  color: #ff9999;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  display: none;
}

.error.visible {
  display: block;
}

.success {
  background: rgba(80, 220, 120, 0.15);
  border: 1px solid rgba(80, 220, 120, 0.4);
  color: #8aee9d;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  display: none;
  margin-bottom: 14px;
}

.success.visible {
  display: block;
}

/* ===== Profil ===== */

.profile-card {
  max-width: 480px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 215, 0, 0.5);
}

.avatar-large {
  width: 120px;
  height: 120px;
  margin: 10px auto 16px;
  display: block;
  animation: avatar-float 5s ease-in-out infinite;
  filter: drop-shadow(0 0 25px rgba(179, 157, 219, 0.4));
}

@keyframes avatar-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.username {
  font-size: 18px;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 2px;
  word-break: break-word;
}

.email {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  word-break: break-all;
}

.chips-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 12px;
}

.chips-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
}

.chips-value {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(90deg, #ffd700, #ffa500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chips-unit {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-secondary {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.3);
  text-decoration: none;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 215, 0, 0.25);
}

/* ===== Layout app (home avec topbar) ===== */

body.layout-app {
  display: block;
  padding: 0;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(10, 14, 40, 0.95) 0%, rgba(10, 14, 40, 0.75) 100%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(179, 157, 219, 0.15);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.topbar-left .brand {
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  background: linear-gradient(90deg, #ffd700 0%, #ff6b9d 50%, #b39ddb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
  transition: filter 0.2s;
  display: inline-block;
}

.topbar-left .brand:hover {
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chips-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 107, 157, 0.12));
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 999px;
  font-weight: 700;
  color: #ffd700;
  font-size: 15px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.3s;
}

.chips-pill:hover {
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.chips-icon {
  font-size: 16px;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
  max-width: 200px;
}

.profile-pill:hover {
  background: rgba(255, 255, 255, 0.12);
}

.profile-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.btn-logout-sm {
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-logout-sm:hover {
  background: rgba(255, 80, 80, 0.2);
  border-color: rgba(255, 80, 80, 0.4);
}

.menu {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  min-height: calc(100vh - 70px);
}

.menu-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.menu-placeholder p {
  font-size: 18px;
  margin-bottom: 6px;
}

.menu-placeholder .menu-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.35);
}

.menu-title {
  font-size: 34px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #ffd700 0%, #ff6b9d 50%, #b39ddb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1.2px;
  animation: title-fade-in 0.8s ease-out;
}

@keyframes title-fade-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mode-grid {
  animation: fade-in-up 0.9s ease-out 0.2s both;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.menu-intro {
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 40px;
  font-size: 15px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Grille des modes */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.mode-card {
  display: flex;
  gap: 20px;
  padding: 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  text-decoration: none;
  color: #fff;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(179, 157, 219, 0.15) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.mode-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: rotate(25deg) translateX(-200%);
  transition: transform 0.8s;
  pointer-events: none;
}

.mode-card:hover:not(.disabled) {
  transform: translateY(-5px);
  border-color: rgba(179, 157, 219, 0.6);
  box-shadow: 0 20px 50px rgba(179, 157, 219, 0.25), 0 0 40px rgba(255, 107, 157, 0.1);
}

.mode-card:hover:not(.disabled)::before {
  opacity: 1;
}

.mode-card:hover:not(.disabled)::after {
  transform: rotate(25deg) translateX(400%);
}

.mode-card:hover:not(.disabled) .mode-icon {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 0 30px rgba(179, 157, 219, 0.4);
}

.mode-card.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.mode-icon {
  font-size: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, rgba(179, 157, 219, 0.18), rgba(121, 134, 203, 0.08));
  border-radius: 16px;
  border: 1px solid rgba(179, 157, 219, 0.25);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
}

.mode-body {
  flex: 1;
  min-width: 0;
}

.mode-body h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #fff;
}

.mode-body p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin-bottom: 10px;
}

.badge-soon,
.badge-dev {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-soon {
  background: rgba(179, 157, 219, 0.15);
  color: var(--stellar-violet);
  border: 1px solid rgba(179, 157, 219, 0.3);
}

.badge-dev {
  background: rgba(255, 107, 157, 0.15);
  color: var(--stellar-rose);
  border: 1px solid rgba(255, 107, 157, 0.3);
}

/* ===== Salle de match (vs bot) ===== */

.match-room {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}

.match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.back-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--stellar-violet);
}

.round-indicator {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.match-players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.match-players::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 50%, rgba(255, 107, 157, 0.08) 0%, transparent 40%);
  pointer-events: none;
}

.match-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  position: relative;
  z-index: 1;
  transition: transform 0.3s;
}

.match-player.me { order: 1; }
.match-player.opponent { order: 3; }

.match-player .avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid var(--stellar-gold);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.35);
  transition: transform 0.3s, box-shadow 0.3s;
}

.match-player.opponent .avatar {
  border-color: var(--stellar-rose);
  box-shadow: 0 0 25px rgba(255, 107, 157, 0.35);
}

.match-player.winning .avatar {
  transform: scale(1.08);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.7);
}

.match-player.opponent.winning .avatar {
  box-shadow: 0 0 40px rgba(255, 107, 157, 0.7);
}

.match-player .player-name {
  font-weight: 600;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.3px;
}

.match-player .player-gain {
  font-size: 28px;
  font-weight: 800;
  color: var(--stellar-gold);
  font-variant-numeric: tabular-nums;
  transition: transform 0.25s, color 0.3s;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.match-player.opponent .player-gain {
  color: var(--stellar-rose);
  text-shadow: 0 0 15px rgba(255, 107, 157, 0.3);
}

.match-player .player-gain.flash {
  animation: gain-flash 0.7s ease-out;
}

@keyframes gain-flash {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.25); filter: brightness(1.5); }
  100% { transform: scale(1); }
}

.vs-badge {
  order: 2;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--stellar-gold), var(--stellar-rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  padding: 8px 14px;
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 999px;
  background-color: rgba(255, 215, 0, 0.05);
  animation: vs-glow 3s ease-in-out infinite;
}

@keyframes vs-glow {
  0%, 100% { border-color: rgba(255, 215, 0, 0.25); }
  50%      { border-color: rgba(255, 107, 157, 0.5); }
}

.match-board {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 32px 24px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.match-board::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(179, 157, 219, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(255, 215, 0, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.match-board > * { position: relative; z-index: 1; }

.match-board h3 {
  font-size: 22px;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

/* Résultat de manche — bannière animée */
.round-outcome {
  margin-top: 18px;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 107, 157, 0.08));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  animation: outcome-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  width: 100%;
  max-width: 420px;
}

@keyframes outcome-in {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.round-outcome-text {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.round-outcome-gains {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 14px;
}

.round-outcome-gains .gain-me strong     { color: var(--stellar-gold); font-size: 16px; }
.round-outcome-gains .gain-bot strong    { color: var(--stellar-rose); font-size: 16px; }
.round-outcome-gains .no-gain strong     { color: rgba(255, 255, 255, 0.35); }

/* Écran final */
.final-screen {
  text-align: center;
  animation: final-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.final-screen.victory h3 {
  font-size: 42px;
  background: linear-gradient(135deg, #ffd700, #ff6b9d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: victory-glow 2s ease-in-out infinite;
}

@keyframes victory-glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4)); }
  50%      { filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.7)); }
}

.final-screen.defeat h3 {
  font-size: 38px;
  color: rgba(255, 107, 157, 0.8);
}

.final-screen.draw h3 {
  font-size: 38px;
  color: var(--stellar-violet);
}

@keyframes final-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

.final-reward {
  margin: 20px 0;
  font-size: 22px;
  font-weight: 700;
}

.final-reward.reward {
  color: var(--stellar-gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.final-score {
  margin: 10px 0 24px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
}

.final-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Confetti (victoire) */
.confetti {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  pointer-events: none;
  animation: confetti-fall 3s linear forwards;
  z-index: 10;
}

@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}

/* ===== Jeu Star Coin — arène orbitale ===== */

.starcoin-prompt {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.starcoin-arena {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
  margin: 10px auto;
}

/* Piste circulaire décorative (anneau pointillé qui tourne lentement) */
.starcoin-arena::before {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px dashed rgba(179, 157, 219, 0.2);
  animation: ring-drift 40s linear infinite;
  pointer-events: none;
}

.starcoin-arena::after {
  content: '';
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  border: 1px dotted rgba(255, 215, 0, 0.12);
  animation: ring-drift 60s linear infinite reverse;
  pointer-events: none;
}

@keyframes ring-drift {
  to { transform: rotate(360deg); }
}

/* Étoile centrale */
.starcoin-arena .starcoin-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44%;
  height: 44%;
  max-width: 200px;
  max-height: 200px;
  z-index: 2;
}

/* Pistes orbitales */
.orbit-track {
  position: absolute;
  inset: 0;
  animation: track-spin 22s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.orbit-track.paused,
.orbit-track.paused .orbiter {
  animation-play-state: paused;
}

/* Phase configurable (0-1) via CSS var — marche pour N orbiteurs */
.orbit-track {
  animation-delay: calc(var(--phase, 0) * -22s);
}

@keyframes track-spin {
  to { transform: rotate(360deg); }
}

/* Les mots flottants */
.orbiter {
  position: absolute;
  top: 2%;
  left: 50%;
  padding: 10px 22px;
  background: rgba(20, 25, 60, 0.6);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(179, 157, 219, 0.3);
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
  animation: orbiter-counter 22s linear infinite;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s, color 0.3s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  user-select: none;
}

.orbit-track .orbiter {
  animation-delay: calc(var(--phase, 0) * -22s);
}

@keyframes orbiter-counter {
  from { transform: translateX(-50%) rotate(0deg); }
  to   { transform: translateX(-50%) rotate(-360deg); }
}

.orbiter::before {
  content: '✦';
  margin-right: 8px;
  font-size: 12px;
  color: var(--stellar-violet);
  transition: color 0.3s;
}

.orbiter:hover {
  border-color: var(--stellar-violet);
  box-shadow: 0 0 25px rgba(179, 157, 219, 0.5);
  background: rgba(179, 157, 219, 0.12);
}

.orbiter:hover::before {
  color: var(--stellar-gold);
}

.orbiter.picked {
  border-color: var(--stellar-gold);
  color: var(--stellar-gold);
  background: rgba(255, 215, 0, 0.18);
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.25);
}

.orbiter.picked::before {
  color: var(--stellar-gold);
}

.orbiter.bot-picked {
  border-color: var(--stellar-rose);
  color: var(--stellar-rose);
  background: rgba(255, 107, 157, 0.15);
  box-shadow: 0 0 30px rgba(255, 107, 157, 0.5);
}

.orbiter.bot-picked::before {
  color: var(--stellar-rose);
}

.orbiter.both-picked {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(255, 107, 157, 0.22));
  border-color: transparent;
  border-image: linear-gradient(135deg, var(--stellar-gold), var(--stellar-rose)) 1;
  color: #fff;
  box-shadow: 0 0 40px rgba(255, 160, 180, 0.6);
}

.orbiter.result-win {
  animation: winner-pulse 1.8s ease-in-out infinite;
  border-color: #fff;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.35), rgba(179, 157, 219, 0.35));
}

.orbiter.result-win::before {
  color: #fff;
}

@keyframes winner-pulse {
  0%, 100% { box-shadow: 0 0 40px rgba(255, 255, 255, 0.6), 0 0 80px rgba(255, 215, 0, 0.4); }
  50%      { box-shadow: 0 0 60px rgba(255, 255, 255, 0.9), 0 0 120px rgba(255, 215, 0, 0.7); }
}

.orbiter.dimmed {
  opacity: 0.25;
  filter: grayscale(0.5);
}

/* Tags "Toi" / "Bot" au-dessus des orbiters */
.orbiter-tags {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  font-size: 9px;
  pointer-events: none;
}

.orbiter-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.orbiter-tag.me  { background: var(--stellar-gold); color: #1a0f3d; box-shadow: 0 0 10px rgba(255, 215, 0, 0.6); }
.orbiter-tag.bot { background: var(--stellar-rose); color: #1a0f3d; box-shadow: 0 0 10px rgba(255, 107, 157, 0.6); }

/* Cote (payout) affichée sur chaque orbiter */
.orbiter-odds {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 999px;
  background: rgba(10, 14, 40, 0.9);
  color: var(--stellar-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
  pointer-events: none;
  white-space: nowrap;
}

.orbiter-odds.risky {
  color: var(--stellar-rose);
  border-color: rgba(255, 107, 157, 0.4);
}

.orbiter-odds.jackpot {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.8), rgba(255, 107, 157, 0.8));
  border-color: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* ===== Sélecteur de mise ===== */

.bet-selector {
  width: 100%;
  max-width: 460px;
  margin: 6px auto 0;
  padding: 14px;
  background: rgba(20, 25, 60, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}

.bet-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

.bet-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.bet-btn {
  padding: 10px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.bet-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--stellar-gold);
  background: rgba(255, 215, 0, 0.1);
}

.bet-btn.selected {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 107, 157, 0.2));
  border-color: var(--stellar-gold);
  color: var(--stellar-gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.bet-btn.allin {
  color: var(--stellar-rose);
  border-color: rgba(255, 107, 157, 0.3);
}

.bet-btn.allin.selected {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.35), rgba(179, 157, 219, 0.25));
  border-color: var(--stellar-rose);
  color: #fff;
  box-shadow: 0 0 25px rgba(255, 107, 157, 0.4);
}

.bet-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 8px;
  text-align: center;
}

/* ===== Timer ===== */

.timer-bar {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto 12px;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.timer-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--stellar-violet), var(--stellar-gold));
  transform-origin: left;
  animation: timer-drain linear forwards;
  border-radius: 999px;
}

@keyframes timer-drain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.timer-fill.warn {
  background: linear-gradient(90deg, var(--stellar-rose), var(--stellar-gold));
  animation-name: timer-drain, timer-pulse;
  animation-duration: inherit, 0.6s;
  animation-iteration-count: 1, infinite;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.timer-label {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.timer-label.warn {
  color: var(--stellar-rose);
  animation: pulse-text 0.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ===== Badge type de manche ===== */

.round-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-left: 10px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

.round-badge.classic {
  background: rgba(179, 157, 219, 0.2);
  color: var(--stellar-violet);
  border: 1px solid rgba(179, 157, 219, 0.4);
}

.round-badge.nova {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 107, 157, 0.2));
  color: var(--stellar-gold);
  border: 1px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.25);
}

.round-badge.final {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.3), rgba(179, 157, 219, 0.2));
  color: var(--stellar-rose);
  border: 1px solid rgba(255, 107, 157, 0.5);
  box-shadow: 0 0 15px rgba(255, 107, 157, 0.3);
  animation: final-shine 2s ease-in-out infinite;
}

@keyframes final-shine {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 107, 157, 0.3); }
  50%      { box-shadow: 0 0 30px rgba(255, 107, 157, 0.6); }
}

/* Bankroll (remplace +gain) */
.match-player .player-bankroll {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  transition: transform 0.25s, color 0.3s;
}

.match-player .player-bankroll .unit {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 3px;
  letter-spacing: 1px;
}

.match-player.me .player-bankroll { color: var(--stellar-gold); text-shadow: 0 0 15px rgba(255, 215, 0, 0.3); }
.match-player.opponent .player-bankroll { color: var(--stellar-rose); text-shadow: 0 0 15px rgba(255, 107, 157, 0.3); }

.match-player .player-bankroll.flash { animation: gain-flash 0.7s ease-out; }

/* ===== Comet Crash ===== */

.crash-arena {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
  margin: 10px auto;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(121, 134, 203, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 107, 157, 0.18) 0%, transparent 55%),
    linear-gradient(135deg, rgba(5, 6, 15, 0.8), rgba(26, 15, 61, 0.6));
  border: 1px solid var(--glass-border);
  transition: background 0.6s, box-shadow 0.3s;
}

/* Phases de couleur selon le multiplicateur */
.crash-arena[data-phase="calm"]   { box-shadow: inset 0 0 60px rgba(121, 134, 203, 0.2); }
.crash-arena[data-phase="warm"]   { box-shadow: inset 0 0 60px rgba(255, 215, 0, 0.3); }
.crash-arena[data-phase="hot"]    { box-shadow: inset 0 0 80px rgba(255, 107, 157, 0.4); }
.crash-arena[data-phase="danger"] {
  box-shadow: inset 0 0 100px rgba(255, 70, 100, 0.5);
  animation: danger-pulse 0.5s ease-in-out infinite;
}

@keyframes danger-pulse {
  0%, 100% { box-shadow: inset 0 0 100px rgba(255, 70, 100, 0.5); }
  50%      { box-shadow: inset 0 0 140px rgba(255, 70, 100, 0.85); }
}

/* Grille cosmique en fond */
.crash-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(179, 157, 219, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(179, 157, 219, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.5;
  pointer-events: none;
}

/* Multiplicateur central géant */
.crash-multiplier {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(48px, 12vw, 88px);
  font-weight: 900;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 30px rgba(255, 215, 0, 0.7),
    0 0 60px rgba(179, 157, 219, 0.5);
  z-index: 3;
  transition: color 0.3s, text-shadow 0.3s;
  background: linear-gradient(135deg, #fff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.crash-arena[data-phase="warm"]   .crash-multiplier { background: linear-gradient(135deg, #ffd700, #ff9f43); -webkit-background-clip: text; background-clip: text; }
.crash-arena[data-phase="hot"]    .crash-multiplier { background: linear-gradient(135deg, #ff9f43, #ff6b9d); -webkit-background-clip: text; background-clip: text; text-shadow: 0 0 40px rgba(255, 107, 157, 0.8); }
.crash-arena[data-phase="danger"] .crash-multiplier { background: linear-gradient(135deg, #ff6b9d, #ff4060); -webkit-background-clip: text; background-clip: text; animation: mult-shake 0.2s infinite; }

@keyframes mult-shake {
  0%, 100% { transform: translate(-50%, -50%); }
  25%      { transform: translate(-51%, -49%); }
  75%      { transform: translate(-49%, -51%); }
}

/* Comète qui tombe */
.crash-comet {
  position: absolute;
  top: 12%;
  left: 20%;
  width: 120px;
  height: 120px;
  z-index: 3;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(var(--comet-scale, 1));
  transition: transform 0.08s linear, filter 0.2s;
  filter: drop-shadow(0 0 30px rgba(255, 170, 60, 0.95));
  will-change: left, top, transform;
}

.crash-comet img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Halo autour de la tête de comète */
.crash-comet::before {
  content: '';
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 60%);
  z-index: -1;
  animation: comet-glow 1.2s ease-in-out infinite;
}

@keyframes comet-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* Phase danger : la comète vibre */
.crash-arena[data-phase="danger"] .crash-comet {
  animation: comet-shake 0.12s infinite;
}

@keyframes comet-shake {
  0%, 100% { transform: translate(-50%, -50%) scale(var(--comet-scale, 1)); }
  25%      { transform: translate(-52%, -48%) scale(var(--comet-scale, 1)); }
  75%      { transform: translate(-48%, -52%) scale(var(--comet-scale, 1)); }
}

/* Sol lumineux en bas — zone danger */
.crash-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18%;
  background: linear-gradient(to top,
    rgba(255, 70, 100, 0.4) 0%,
    rgba(255, 70, 100, 0.15) 40%,
    transparent 100%);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s, height 0.3s;
  opacity: 0.3;
}

.crash-ground::before {
  content: '';
  position: absolute;
  bottom: 18%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 70, 100, 0.6), transparent);
  box-shadow: 0 0 12px rgba(255, 70, 100, 0.4);
}

.crash-arena[data-phase="warm"]   .crash-ground { opacity: 0.5; }
.crash-arena[data-phase="hot"]    .crash-ground { opacity: 0.8; height: 22%; }
.crash-arena[data-phase="danger"] .crash-ground {
  opacity: 1;
  height: 28%;
  animation: ground-pulse 0.4s ease-in-out infinite;
}

@keyframes ground-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.5); }
}

/* Étincelles/particules autour de la comète en phase hot/danger */
.crash-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, #fff 0%, rgba(255, 215, 0, 0.8) 50%, transparent 100%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  animation: spark-fly 0.8s ease-out forwards;
}

@keyframes spark-fly {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--spark-dx, 0px), var(--spark-dy, 30px)) scale(0.2); }
}

/* Traînée derrière la comète */
.crash-trail {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.crash-trail svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.crash-trail path {
  fill: none;
  stroke: url(#trail-gradient);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

/* Infos latérales */
.crash-info-me, .crash-info-bot {
  position: absolute;
  bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 14, 40, 0.7);
  border: 1px solid var(--glass-border);
  letter-spacing: 0.5px;
  z-index: 4;
  white-space: nowrap;
}

.crash-info-me  { left: 12px;  color: var(--stellar-gold);  border-color: rgba(255, 215, 0, 0.3); }
.crash-info-bot { right: 12px; color: var(--stellar-rose);  border-color: rgba(255, 107, 157, 0.3); }

.crash-info-bot.cashed { color: #8aee9d; border-color: rgba(80, 220, 120, 0.5); }
.crash-info-bot.busted { color: rgba(255, 80, 100, 0.85); border-color: rgba(255, 80, 100, 0.5); }

/* Tireur en bas de l'arène : c'est "nous" qui visons la comète */
.crash-shooter {
  position: absolute;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 46px;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(138, 238, 157, 0.6));
  transition: filter 0.2s;
}

.crash-shooter.locked {
  filter: drop-shadow(0 0 18px rgba(80, 220, 120, 0.9)) brightness(1.1);
}

.crash-shooter.hit {
  animation: shooter-hit 0.4s ease-out;
}

@keyframes shooter-hit {
  0%   { transform: translateX(-50%) scale(1); }
  40%  { transform: translateX(-50%) scale(1.3) rotate(-8deg); }
  100% { transform: translateX(-50%) scale(1); }
}

/* Rayon laser : part du tireur vers la comète */
.crash-laser {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  height: 4px;
  background: linear-gradient(90deg,
    rgba(138, 238, 157, 0) 0%,
    rgba(138, 238, 157, 0.9) 20%,
    #ffffff 50%,
    rgba(255, 215, 0, 0.9) 80%,
    rgba(255, 215, 0, 0) 100%);
  box-shadow: 0 0 12px rgba(138, 238, 157, 0.9), 0 0 24px rgba(255, 215, 0, 0.6);
  transform-origin: left center;
  animation: laser-fade 0.45s ease-out forwards;
  border-radius: 2px;
}

@keyframes laser-fade {
  0%   { opacity: 0; transform: scaleX(0) translateY(-50%); }
  30%  { opacity: 1; transform: scaleX(1) translateY(-50%); }
  100% { opacity: 0; transform: scaleX(1) translateY(-50%); }
}

/* Marqueur bot cashout : indicateur latéral qui flashe */
.crash-bot-marker {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  padding: 6px 12px;
  background: rgba(24, 26, 56, 0.9);
  border: 1px solid rgba(255, 107, 157, 0.7);
  border-radius: 10px;
  color: #ff9fc6;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  animation: bot-marker-pop 0.5s ease-out;
  box-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
  transform: translate(-50%, -50%);
}

@keyframes bot-marker-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  50%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Bouton encaisser — énorme, visible */
.crash-cashout-btn {
  display: block;
  width: 100%;
  max-width: 460px;
  margin: 16px auto 0;
  padding: 18px 24px;
  background: linear-gradient(135deg, #ffd700 0%, #ff9f43 100%);
  color: #1a0f3d;
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(255, 215, 0, 0.4), 0 0 60px rgba(255, 215, 0, 0.25);
  transition: transform 0.1s, box-shadow 0.3s;
  animation: cashout-ready 1.4s ease-in-out infinite;
}

.crash-cashout-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 50px rgba(255, 215, 0, 0.6), 0 0 80px rgba(255, 215, 0, 0.4);
}

.crash-cashout-btn:active { transform: translateY(0) scale(0.98); }

@keyframes cashout-ready {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.15); }
}

/* État "crashé" */
.crash-boom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(44px, 10vw, 72px);
  font-weight: 900;
  color: #ff4060;
  text-shadow: 0 0 40px rgba(255, 64, 96, 0.8), 0 0 80px rgba(255, 0, 40, 0.6);
  z-index: 5;
  letter-spacing: 4px;
  animation: boom-in 0.5s cubic-bezier(0.2, 1.5, 0.3, 1) forwards;
  pointer-events: none;
}

@keyframes boom-in {
  0%   { opacity: 0; transform: scale(0.2); }
  60%  { opacity: 1; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}

.crash-launch-btn {
  display: block;
  width: 100%;
  max-width: 460px;
  margin: 14px auto 0;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(121, 134, 203, 0.3), rgba(179, 157, 219, 0.2));
  color: #fff;
  border: 2px solid var(--stellar-violet);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.3s;
  box-shadow: 0 0 30px rgba(179, 157, 219, 0.25);
}

.crash-launch-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(121, 134, 203, 0.45), rgba(179, 157, 219, 0.35));
  box-shadow: 0 0 40px rgba(179, 157, 219, 0.4);
  transform: translateY(-2px);
}

.crash-launch-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Étoile stellaire rotative */
.starcoin-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  perspective: 1000px;
  margin: 10px 0;
}

.starcoin-ring {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Halo statique derrière l'étoile */
.starcoin-ring::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.star-coin {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  z-index: 1;
  animation: star-idle 6s ease-in-out infinite;
}

.star-coin.spinning {
  animation: star-spin 2.6s cubic-bezier(0.2, 0.1, 0.05, 1) forwards;
}

.star-coin.revealed {
  animation: star-pulse 1.2s ease-out;
}

@keyframes star-idle {
  0%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5)); }
  50%      { transform: scale(1.06) rotate(-4deg); filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.8)); }
}

/* Rotation Y uniquement, finit à 1800deg = 5 tours complets (revient à 0) */
@keyframes star-spin {
  0%   { transform: rotateY(0deg) scale(1); }
  15%  { transform: rotateY(540deg) scale(1.1); }
  100% { transform: rotateY(1800deg) scale(1); }
}

@keyframes star-pulse {
  0%   { transform: scale(1); filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.7)); }
  40%  { transform: scale(1.15); filter: drop-shadow(0 0 60px rgba(255, 215, 0, 1)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.7)); }
}

.star-coin svg,
.star-coin .star-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.7));
  user-select: none;
  pointer-events: none;
}

/* Le mot est AU-DESSUS de la pièce et ne tourne pas avec elle */
.star-word {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 12px rgba(255, 215, 0, 0.9),
    0 0 22px rgba(179, 157, 219, 0.8),
    0 2px 6px rgba(0, 0, 0, 0.85);
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.2s;
}

.star-word.hidden { opacity: 0; }

.star-word.reveal {
  font-size: 22px;
  animation: word-pop 0.5s ease-out;
}

@keyframes word-pop {
  0%   { opacity: 0; transform: scale(0.5); }
  60%  { opacity: 1; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}

/* Flash de révélation : onde qui part du centre */
.reveal-flash {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  border: 2px solid var(--stellar-gold);
  animation: reveal-ring 0.9s ease-out forwards;
  z-index: 2;
}

@keyframes reveal-ring {
  0%   { opacity: 0.9; transform: scale(0.3); border-width: 4px; }
  100% { opacity: 0;   transform: scale(2.2); border-width: 1px; }
}

.star-reveal {
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--stellar-gold), var(--stellar-rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: reveal-in 0.6s ease-out;
}

@keyframes reveal-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

.starcoin-outcome {
  font-size: 16px;
  margin-top: 10px;
}

.starcoin-outcome .gain-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
  font-size: 15px;
}

.starcoin-outcome .gain-row span strong {
  color: var(--stellar-gold);
}
.starcoin-outcome .gain-row span.loss strong {
  color: rgba(255, 255, 255, 0.4);
}

/* Responsive : topbar sur mobile */
@media (max-width: 600px) {
  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .topbar-left .brand {
    font-size: 16px;
  }

  .profile-pill span {
    display: none;
  }

  .profile-pill {
    padding: 4px;
  }

  .chips-pill {
    padding: 5px 10px;
    font-size: 13px;
  }
}


/* Home page */
.home-container {
  text-align: center;
}

.home-container h1 {
  margin-bottom: 16px;
}

.home-container p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.15);
}
