/* ===== Colint Games — thème sombre inspiré Stake / Rainbet ===== */
:root {
  --bg: #0b1420;
  --bg-2: #0f1c2b;
  --panel: #14263a;
  --panel-2: #1b3350;
  --panel-hi: #21406a;
  --line: #223a56;
  --text: #e8f0fb;
  --muted: #8aa2c0;
  --accent: #00e5a8;
  --accent-2: #7b5cff;
  --gold: #ffcf4a;
  --red: #ff5d6c;
  --green: #35d07f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 800px at 80% -10%, #16324f 0%, var(--bg) 55%) fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 .3em; }

#app { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--bg-2), #0a1521);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 20px; }
.brand-logo { font-size: 26px; filter: drop-shadow(0 0 8px var(--accent)); }
.brand-name { font-weight: 800; letter-spacing: 1px; font-size: 17px; }
.brand-accent { color: var(--accent); margin-left: 3px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; margin: 16px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  background: transparent; border: 0; color: var(--muted);
  padding: 11px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 600;
  text-align: left; width: 100%; transition: .15s;
}
.nav-item .ni { font-size: 17px; width: 22px; text-align: center; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(0,229,168,.16), rgba(123,92,255,.10)); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }

.sidebar-foot { margin-top: auto; padding-top: 14px; }
.sb-user { font-size: 13px; color: var(--muted); }
.sb-user .sbu-card { display: flex; align-items: center; gap: 10px; background: var(--panel); padding: 10px; border-radius: 10px; }
.sb-user img { width: 34px; height: 34px; border-radius: 50%; }
.sb-user .sbu-name { font-weight: 700; color: var(--text); font-size: 13px; }
.sb-user a { color: var(--muted); text-decoration: none; font-size: 12px; }
.sb-user a:hover { color: var(--red); }

/* ===== Topbar ===== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: rgba(11, 20, 32, .7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 30;
}
.topbar-spacer { flex: 1; }
.hamburger { display: none; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 18px; border-radius: 10px; padding: 6px 12px; }
.wallet {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 9px 16px; border-radius: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.wallet-emoji { font-size: 16px; }
.wallet-amount { color: var(--gold); }
.btn-daily {
  background: linear-gradient(90deg, var(--gold), #ffb020); color: #3a2a00;
  border: 0; padding: 10px 16px; border-radius: 12px; font-weight: 800;
}
.btn-daily:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }

.btn-login {
  display: inline-flex; align-items: center; gap: 8px;
  background: #5865F2; color: #fff; border: 0; padding: 10px 18px;
  border-radius: 12px; font-weight: 700; text-decoration: none; font-size: 14px;
}
.btn-login:hover { filter: brightness(1.1); }
.avatar-chip { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); padding: 6px 12px 6px 6px; border-radius: 30px; }
.avatar-chip img { width: 30px; height: 30px; border-radius: 50%; }
.avatar-chip span { font-weight: 700; font-size: 13px; }

/* ===== Vue ===== */
.view { padding: 26px; max-width: 1100px; width: 100%; margin: 0 auto; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 26px; }
.page-head p { color: var(--muted); margin: 0; }

.grid { display: grid; gap: 18px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: 1.3fr 1fr; }
@media (max-width: 900px) { .cards-3, .cards-2 { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel h2 { font-size: 17px; }
.panel .sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

/* Stat tiles */
.stat-tile { display: flex; flex-direction: column; gap: 4px; }
.stat-tile .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.stat-tile .value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.value.pos { color: var(--green); }
.value.neg { color: var(--red); }
.value.gold { color: var(--gold); }

/* Home game cards */
.game-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.game-tile {
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--line); padding: 22px 18px; text-align: left;
  background: linear-gradient(150deg, var(--panel-2), var(--panel));
  color: var(--text); transition: .18s; min-height: 130px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.game-tile:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 26px rgba(0,229,168,.15); }
.game-tile .gt-emoji { font-size: 34px; }
.game-tile .gt-name { font-weight: 800; font-size: 16px; }
.game-tile .gt-desc { color: var(--muted); font-size: 12px; }

/* ===== Contrôles de jeu ===== */
.game-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
@media (max-width: 850px) { .game-layout { grid-template-columns: 1fr; } }
.bet-panel { position: sticky; top: 90px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.input-money { display: flex; align-items: stretch; gap: 8px; }
input[type="text"], input[type="number"] {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; border-radius: 10px; font-size: 15px; font-weight: 700; outline: none;
}
input:focus { border-color: var(--accent); }
.chip-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chip { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.chip:hover { color: var(--text); border-color: var(--accent); }

.btn-primary {
  width: 100%; background: linear-gradient(90deg, var(--accent), #12c48c); color: #032018;
  border: 0; padding: 15px; border-radius: 12px; font-weight: 800; font-size: 16px; transition: .15s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 13px; border-radius: 12px; font-weight: 700; }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { background: linear-gradient(90deg, var(--red), #e03e5c); color: #fff; }

.seg { display: flex; gap: 8px; }
.seg button { flex: 1; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); padding: 12px; border-radius: 10px; font-weight: 700; }
.seg button.active { color: var(--text); border-color: var(--accent); background: var(--panel-hi); }
.seg button.red.active { border-color: var(--red); color: #fff; background: rgba(255,93,108,.25); }
.seg button.black.active { border-color: #fff; color: #fff; background: rgba(255,255,255,.12); }

.stage { min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.result-line { margin-top: 16px; font-size: 15px; font-weight: 700; min-height: 24px; }
.result-line.win { color: var(--green); }
.result-line.lose { color: var(--red); }
.result-line.push { color: var(--muted); }

/* Slot */
.reels { display: flex; gap: 14px; }
.reel {
  width: 96px; height: 110px; background: var(--bg-2); border: 2px solid var(--line);
  border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 52px;
  overflow: hidden; box-shadow: inset 0 0 20px rgba(0,0,0,.5);
}
.reel.spinning { animation: reelSpin .5s linear infinite; }
@keyframes reelSpin { 0% { transform: translateY(-8px); opacity:.5;} 50%{opacity:1;} 100% { transform: translateY(8px); opacity:.5; } }
.reel.win { border-color: var(--gold); box-shadow: 0 0 22px rgba(255,207,74,.5), inset 0 0 20px rgba(0,0,0,.5); }

/* Roulette */
.roulette-num { font-size: 74px; font-weight: 900; width: 150px; height: 150px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 4px solid var(--line); transition: .3s; }
.roulette-num.rouge { background: radial-gradient(circle, #b3243a, #7a0f22); border-color: var(--red); }
.roulette-num.noir { background: radial-gradient(circle, #2a2f3a, #12151c); border-color: #4a5568; }
.roulette-num.vert { background: radial-gradient(circle, #1a8f5a, #0c5c38); border-color: var(--green); }
.roulette-num.spin { animation: rspin .12s linear infinite; }
@keyframes rspin { from { transform: rotate(0);} to { transform: rotate(360deg);} }
.num-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 8px; }
.num-grid button { padding: 8px 0; font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.num-grid button.r { color: #ff9aa5; }
.num-grid button.active { outline: 2px solid var(--accent); color: var(--text); }

/* Plinko */
#plinkoCanvas { max-width: 100%; height: auto; background: var(--bg-2); border-radius: 14px; border: 1px solid var(--line); }

/* Blackjack */
.bj-table { width: 100%; max-width: 520px; }
.bj-side { margin-bottom: 18px; }
.bj-side .who { color: var(--muted); font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.bj-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.card-pc {
  width: 62px; height: 88px; background: #f7fafc; color: #16202c; border-radius: 8px;
  display: flex; flex-direction: column; justify-content: space-between; padding: 6px 8px;
  font-weight: 800; font-size: 15px; box-shadow: 0 4px 10px rgba(0,0,0,.4); animation: dealIn .3s ease;
}
.card-pc.red { color: #d5304a; }
.card-pc.back { background: linear-gradient(135deg, #7b5cff, #3a2a8f); color: #fff; align-items: center; justify-content: center; font-size: 26px; }
.card-pc .r2 { align-self: flex-end; transform: rotate(180deg); }
@keyframes dealIn { from { transform: translateY(-14px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* Crash */
#crashCanvas { width: 100%; height: 300px; background: var(--bg-2); border-radius: 14px; border: 1px solid var(--line); }
.crash-mult { font-size: 60px; font-weight: 900; font-variant-numeric: tabular-nums; text-shadow: 0 0 24px currentColor; }
.crash-mult.flying { color: var(--accent); }
.crash-mult.boom { color: var(--red); }
.crash-mult.cashed { color: var(--gold); }

/* Leaderboard */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-rank { width: 30px; font-weight: 800; color: var(--muted); text-align: center; }
.lb-rank.medal { font-size: 18px; }
.lb-id { flex: 1; font-weight: 600; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-id.me { color: var(--accent); }
.lb-bal { font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }

/* Toasts */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: var(--panel-hi); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 13px 18px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; animation: toastIn .25s ease; max-width: 320px; }
.toast.err { border-left-color: var(--red); }
.toast.win { border-left-color: var(--gold); }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Login gate */
.gate { text-align: center; padding: 70px 20px; }
.gate .g-emoji { font-size: 60px; }
.gate h1 { font-size: 30px; margin-top: 14px; }
.gate p { color: var(--muted); max-width: 440px; margin: 8px auto 26px; }

.muted { color: var(--muted); }
.pos { color: var(--green); } .neg { color: var(--red); }

/* Responsive sidebar */
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; transform: translateX(-100%); transition: .25s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .hamburger { display: block; }
  #app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
}

/* ===================================================================== */
/*  Colint Games — ajouts v2 (nouveaux jeux, historique, pronos, admin)  */
/* ===================================================================== */

/* Slot : atterrissage du rouleau */
.reel.landed { animation: reelLand .3s ease; border-color: var(--accent); }
@keyframes reelLand { 0% { transform: translateY(-10px) scale(1.1); } 100% { transform: none; } }

/* Leaderboard : avatars */
.lb-av { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px; }

/* Historique communautaire */
.history-panel { grid-column: 1 / -1; }
.hist-list { display: flex; flex-direction: column; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.hist-row:last-child { border-bottom: 0; }
.hist-user { font-weight: 700; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-label { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-net { font-weight: 800; font-variant-numeric: tabular-nums; }

/* Roulette : roue animée */
.wheel-wrap { position: relative; width: 320px; max-width: 100%; }
#wheelCanvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 24px rgba(0,0,0,.5)); }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); color: var(--gold); font-size: 26px; text-shadow: 0 2px 6px rgba(0,0,0,.6); z-index: 2; }

/* Pile ou face */
.coin { width: 150px; height: 150px; position: relative; transform-style: preserve-3d; }
.coin-face { position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 76px; backface-visibility: hidden; box-shadow: inset 0 0 26px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.4); }
.coin-face.pile { background: radial-gradient(circle at 35% 30%, #ffe08a, #d99a1e); }
.coin-face.face { background: radial-gradient(circle at 35% 30%, #c7d4ff, #6b5cff); transform: rotateY(180deg); }
.coin.spinning { animation: coinFlip 1.1s cubic-bezier(.3,.1,.2,1) forwards; }
@keyframes coinFlip { 0% { transform: rotateY(0); } 100% { transform: rotateY(2160deg); } }
.coin.show-face { transform: rotateY(180deg); }
.coin.show-pile { transform: rotateY(0); }

/* ===== Échecs ===== */
.chess-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
@media (max-width: 780px) { .chess-wrap { grid-template-columns: 1fr; } }
.chess-info { display: flex; flex-direction: column; gap: 12px; }
.ci-line { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.ci-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.ci-dot.w { background: #f2f2f2; } .ci-dot.b { background: #12151c; }
.chess-status { padding: 12px; border-radius: 10px; background: var(--panel-2); font-weight: 800; text-align: center; }
.chess-status.active { background: rgba(0,229,168,.15); color: var(--accent); }
.ci-pot { color: var(--gold); font-weight: 700; }
.chess-board { display: grid; grid-template-columns: repeat(8, 1fr); width: min(560px, 92vw); aspect-ratio: 1; border: 3px solid var(--panel-hi); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.sq { position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; }
.sq.light { background: #d7c3a3; } .sq.dark { background: #7d5a37; }
.sq .pc { font-size: clamp(24px, 6vw, 44px); line-height: 1; }
.sq .pc.w { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55), 0 0 2px rgba(0,0,0,.4); }
.sq .pc.b { color: #16202c; text-shadow: 0 1px 1px rgba(255,255,255,.25); }
.sq.sel { box-shadow: inset 0 0 0 4px var(--accent); }
.sq.target::after { content: ""; width: 26%; height: 26%; border-radius: 50%; background: rgba(0,229,168,.6); }
.sq.capture { box-shadow: inset 0 0 0 4px var(--red); }
.challenge-mine { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--panel-2); padding: 12px; border-radius: 10px; font-weight: 600; }
.chal-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.chal-row:last-child { border-bottom: 0; }
.chal-by { flex: 1; font-weight: 700; }
.chal-stake { color: var(--gold); font-weight: 800; }
.btn-primary.sm { width: auto; padding: 8px 14px; font-size: 13px; }
select { width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); padding: 12px 14px; border-radius: 10px; font-size: 15px; font-weight: 700; }
textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); padding: 12px 14px; border-radius: 10px; font-size: 14px; font-family: inherit; resize: vertical; }

/* Promotion overlay */
.promo-ov { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 200; }
.promo-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; text-align: center; }
.promo-title { font-weight: 800; margin-bottom: 12px; }
.promo-choices { display: flex; gap: 10px; }
.promo-choices button { width: 60px; height: 60px; font-size: 34px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.promo-choices button:hover { border-color: var(--accent); }

/* ===== Pronostics ===== */
.prono-card { margin-bottom: 16px; }
.prono-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prono-badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; }
.prono-badge.open { background: rgba(0,229,168,.18); color: var(--accent); }
.prono-badge.closed { background: rgba(138,162,192,.18); color: var(--muted); }
.prono-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.prono-opt { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.prono-opt.yours { border-color: var(--accent); }
.prono-opt.win { border-color: var(--gold); background: rgba(255,207,74,.1); }
.po-top { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.po-bar { height: 8px; background: var(--bg-2); border-radius: 6px; margin: 8px 0; overflow: hidden; }
.po-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.po-bet { margin-top: 4px; }

/* ===== Admin ===== */
.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 860px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-grid .seg { margin-top: 8px; }
.admin-grid .btn-primary, .admin-grid .btn-danger { width: auto; }
.admin-prono { padding: 14px 0; border-bottom: 1px solid var(--line); }
.admin-prono:last-child { border-bottom: 0; }
.ap-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.chip.danger { border-color: var(--red); color: #ff9aa5; }
.chip.danger:hover { background: rgba(255,93,108,.15); }
.close-opt { border-color: var(--accent); color: var(--accent); }
.sm { font-size: 12px; }
.adm-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.adm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--panel-2); padding: 10px 12px; border-radius: 8px; }
