/* ============================================================
   CoinsBase — styles v2 (polices locales, mode clair, cadres,
   boutique, amis, tournoi, nouveaux jeux, mobile)
   Polices : Manrope & Unbounded (SIL Open Font License)
   ============================================================ */
@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url(/fonts/manrope-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url(/fonts/manrope-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap; src: url(/fonts/manrope-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url(/fonts/manrope-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url(/fonts/manrope-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Unbounded'; font-weight: 500; font-display: swap; src: url(/fonts/unbounded-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Unbounded'; font-weight: 700; font-display: swap; src: url(/fonts/unbounded-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Unbounded'; font-weight: 800; font-display: swap; src: url(/fonts/unbounded-latin-800-normal.woff2) format('woff2'); }

/* Corrections */
.seg button svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.btn small svg, .hand-label svg { width: 14px; height: 14px; }
.stat b svg { width: 14px; height: 14px; }

/* Écran de chargement */
#splash { position: fixed; inset: 0; z-index: 999; background: var(--bg); display: grid; place-content: center; justify-items: center; gap: 16px; transition: opacity .4s; }
#splash.gone { opacity: 0; pointer-events: none; }
.splash-coin { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe7a3, var(--accent) 55%, #9a6a10); animation: spinY 1.1s linear infinite; box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 40%, transparent); }
.splash-txt { color: var(--muted); font-weight: 700; font-family: var(--ui); }
@keyframes spinY { to { transform: rotateY(360deg); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; }
.shake { animation: shake .45s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.page { animation: pageIn .25s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }

/* Mode clair */
html.light { --bg: #f4f2fa !important; --panel: #ffffff !important; --panel2: #f0edf8 !important; --border: #ddd8ec !important; --text: #1b1730 !important; --muted: #6f6a88 !important; }
html.light body::before { opacity: .5; }
html.light .pcard { box-shadow: 0 6px 16px #0002; }
html.light .tile, html.light .keno-grid button { box-shadow: inset 0 -4px 0 #0001; }
html.light .game-card::after { background: linear-gradient(180deg, transparent 40%, #0007 100%); }

/* Avatars, cadres, pseudos */
.avatar { position: relative; overflow: visible; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar.f-gold { box-shadow: 0 0 0 2px #f5b83d, 0 0 12px #f5b83d88; }
.avatar.f-neon { box-shadow: 0 0 0 2px #22d3ee, 0 0 14px #22d3ee, 0 0 4px #e879f9 inset; }
.avatar.f-fire { box-shadow: 0 0 0 2px #fb923c, 0 0 16px #f43f5e; animation: fire 1.6s ease-in-out infinite; }
@keyframes fire { 50% { box-shadow: 0 0 0 2px #facc15, 0 0 22px #fb923c; } }
.name-rainbow { background: linear-gradient(90deg, #f43f5e, #f59e0b, #84cc16, #22d3ee, #a855f7, #f43f5e); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: rainbow 3s linear infinite; }
@keyframes rainbow { to { background-position: 200% center; } }
.utitle { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--accent2) 22%, transparent); color: color-mix(in srgb, var(--accent2) 55%, var(--text)); white-space: nowrap; }

/* Bouton Discord */
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.discord svg { width: 20px; height: 20px; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Bannière d'accueil */
.banner { margin-top: 16px; border-radius: 18px; padding: 22px 24px; display: flex; align-items: center; gap: 20px; border: 1px solid var(--border); background: linear-gradient(110deg, color-mix(in srgb, var(--accent) 20%, var(--panel)), var(--panel) 60%); background-size: cover; background-position: center; position: relative; overflow: hidden; }
.banner.img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #000c, #0005); }
.banner > * { position: relative; }
.banner h3 { margin: 0 0 4px; font-family: var(--display); font-size: 19px; letter-spacing: -.02em; }
.banner p { margin: 0; color: color-mix(in srgb, var(--text) 75%, var(--muted)); }
.banner.img h3, .banner.img p { color: #fff; }
.banner .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); flex: none; }
.banner .ico svg { width: 28px; height: 28px; }

/* Barre du bas (mobile) */
.bottom-nav { display: none; }
@media (max-width: 980px) {
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 65; background: color-mix(in srgb, var(--panel) 95%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 4px 0; }
  .bottom-nav a svg { width: 21px; height: 21px; }
  .bottom-nav a.active { color: var(--accent); }
  #view { padding-bottom: 90px; }
}

/* Auto avancé */
details.adv { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
details.adv summary { cursor: pointer; font-weight: 700; font-size: 12px; color: var(--muted); }
details.adv .grid { margin-top: 10px; gap: 8px; }
details.adv label.field { font-size: 11px; }
.auto-stats { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; }

/* Blackjack multi-mains */
.bj-hands { display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; }
.bj-hand { padding: 8px; border-radius: 14px; border: 2px solid transparent; }
.bj-hand.on { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.bj-hand .res { text-align: center; font-weight: 800; font-size: 12px; margin-top: 4px; min-height: 16px; }

/* Courses de chevaux */
.track { width: 100%; max-width: 720px; background: linear-gradient(180deg, #14532d, #166534); border-radius: 16px; padding: 10px; border: 3px solid #0f3d22; position: relative; }
.lane { position: relative; height: 46px; border-bottom: 2px dashed #ffffff22; }
.lane:last-child { border-bottom: 0; }
.lane .num { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); font-weight: 900; color: #ffffff55; font-size: 13px; }
.horse { position: absolute; top: 50%; left: 0; transform: translateY(-50%); width: 46px; height: 40px; transition: left .1s linear; }
.finish { position: absolute; top: 0; bottom: 0; right: 40px; width: 8px; background: repeating-linear-gradient(0deg, #fff 0 8px, #111 8px 16px); opacity: .8; }
.horse-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.horse-pick button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--bg); border-radius: 10px; padding: 8px; cursor: pointer; text-align: left; }
.horse-pick button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.horse-pick i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.horse-pick b { font-size: 13px; flex: 1; }
.horse-pick small { color: var(--accent); font-weight: 800; }

/* Caisses */
.case-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.case-pick button { border: 1px solid var(--border); background: var(--bg); border-radius: 12px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.case-pick button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.case-pick b { font-size: 13px; } .case-pick small { color: var(--accent); font-weight: 800; }
.case-box { width: 46px; height: 40px; border-radius: 8px; position: relative; }
.case-box::after { content: ''; position: absolute; left: -3px; right: -3px; top: 8px; height: 6px; background: #0004; border-radius: 3px; }
.spinner-wrap { width: 100%; max-width: 760px; overflow: hidden; position: relative; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); height: 132px; }
.spinner-wrap::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: var(--accent); z-index: 3; transform: translateX(-50%); box-shadow: 0 0 14px var(--accent); }
.strip { display: flex; gap: 8px; padding: 10px; position: absolute; left: 0; top: 0; will-change: transform; }
.loot { width: 104px; height: 110px; flex: none; border-radius: 12px; background: var(--panel2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-bottom: 4px solid; font-weight: 800; font-size: 13px; }
.loot svg { width: 40px; height: 40px; }
.loot small { font-size: 10px; color: var(--muted); font-weight: 700; }
.loot-table { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 760px; }
.loot-table span { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 6px; background: var(--bg); border-left: 3px solid; }
.battle { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; width: 100%; align-items: start; }
.battle .side-col { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.battle .vs { font-family: var(--display); font-size: 22px; color: var(--muted); padding-top: 20px; }
.battle .total { font-family: var(--display); font-size: 22px; }

/* Morpion */
.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 330px; }
.ttt .cell { aspect-ratio: 1; border-radius: 16px; background: color-mix(in srgb, var(--border) 80%, var(--panel2)); display: grid; place-items: center; cursor: pointer; box-shadow: inset 0 -5px 0 #0003; font-family: var(--display); font-size: 54px; font-weight: 800; transition: transform .1s; }
.ttt .cell:hover { transform: translateY(-2px); }
.ttt .cell.x { color: var(--accent); } .ttt .cell.o { color: var(--lose); }
.ttt .cell.line { background: color-mix(in srgb, var(--win) 25%, var(--bg)); }
.ttt .cell span { animation: pop2 .25s cubic-bezier(.2, 1.6, .5, 1); }
.ttt.locked .cell { cursor: default; }

/* Bataille */
.war-table { display: flex; gap: 40px; align-items: center; justify-content: center; }
.war-table .col { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* Poker */
.poker-board { display: flex; gap: 8px; justify-content: center; }
.poker-board .pcard { margin-left: 0; }
.felt { width: 100%; max-width: 680px; border-radius: 120px; padding: 26px 20px; background: radial-gradient(ellipse at center, #1f7a4a, #0f4a2c); border: 8px solid #3b2512; box-shadow: inset 0 0 40px #0008, 0 20px 50px #0007; display: flex; flex-direction: column; gap: 14px; align-items: center; color: #fff; }
.felt .hand-label { color: #ffffffcc; }
.paylist2 { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 12px; font-weight: 700; }
.paylist2 span:nth-child(even) { color: var(--accent); text-align: right; }

/* Boutique */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.shop-item { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.shop-item .preview { height: 54px; display: grid; place-items: center; }
.shop-item b { font-size: 14px; }
.shop-item.own { border-color: color-mix(in srgb, var(--win) 40%, var(--border)); }

/* Amis / MP */
.friends-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; min-height: 520px; }
.friend { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; }
.friend:hover, .friend.on { background: var(--panel2); }
.friend .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); margin-left: auto; flex: none; }
.friend .dot.on { background: var(--win); box-shadow: 0 0 6px var(--win); }
.badge-n { background: var(--lose); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 99px; }
.dm-box { display: flex; flex-direction: column; height: 520px; }
.dm-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px 2px; }
.dm { max-width: 72%; padding: 8px 12px; border-radius: 14px; background: var(--panel2); font-size: 13.5px; line-height: 1.4; word-wrap: break-word; }
.dm.me { align-self: flex-end; background: var(--accent2); color: #fff; border-bottom-right-radius: 4px; }
.dm small { display: block; font-size: 10px; opacity: .6; margin-top: 2px; }

/* Tournoi */
.countdown { font-family: var(--display); font-size: 26px; letter-spacing: -.02em; }
.podium { display: flex; gap: 10px; align-items: flex-end; justify-content: center; }
.podium div { text-align: center; border-radius: 12px 12px 0 0; padding: 10px; width: 110px; background: var(--panel2); border: 1px solid var(--border); }

/* Succès */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.ach .ai { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--panel2); color: var(--muted); flex: none; }
.ach .ai svg { width: 20px; height: 20px; }
.ach.done { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.ach.done .ai { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.ach:not(.done) { opacity: .6; }
.ach b { font-size: 13px; display: block; } .ach small { color: var(--muted); font-size: 11.5px; }

/* Équité */
code.seed { display: block; font-size: 11.5px; background: var(--bg); border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px; word-break: break-all; color: var(--muted); }

/* Hub fermé (Activité) */
.hub-closed { position: relative; z-index: 1; min-height: 100vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 18px; padding: 30px; }
.hub-closed h1 { font-family: var(--display); margin: 0; font-size: 28px; }
.hub-closed p { color: var(--muted); max-width: 420px; margin: 0; }

@media (max-width: 980px) { .friends-layout { grid-template-columns: 1fr; } .battle { grid-template-columns: 1fr; } .battle .vs { padding: 0; text-align: center; } }
@media (max-width: 640px) { .banner { flex-wrap: wrap; padding: 18px; } .banner .ico { display: none; } .banner .btn { width: 100%; } .hero .row.wrap .btn { flex: 1; } }
