/* ===== ROOT ===== */
:root{
	--bg:#1b0b31;
	--fg:#fefefe;
	--yellow:#ffbf20;
	--frame:0 0 0 2px #ff2ebd inset,0 0 0 8px rgba(255, 20, 180, .35) inset,0 18px 60px rgba(0,0,0,.65),0 0 36px rgba(255, 0, 200, .25);
	
	
	--line:#20305f;
	--accent:#2bd9ff;
	--accent2:#ffb900;
	--danger:#ff8a8a;
	--gap:clamp(8px,5vw,5vw);
	--vsw:clamp(38px,9vw,64px);
	--user:clamp(68px,22vw,180px);
	--card-h:clamp(170px,36vw,240px);
	--h1:clamp(14px,2.4vw,18px);
	--h3:clamp(24px,24px,24px);
	--h5:clamp(12px,12px,12px);
	--btn:clamp(8px,1.6vw,11px);
	--hud-btn-w: 180px; 
	--panel-grad:linear-gradient(180deg,#121a3b 0%,#0d1330 100%);
	--frame-3:0 0 0 3px #1a2a55,0 0 0 6px #0a1636,0 6px 0 0 #000;
	--frame-4:0 0 0 4px #1a2a55,0 0 0 8px #0a1636,0 10px 0 0 #000;
}

/* ===== GLOBAL LAYOUT ===== */

*{
	box-sizing:border-box
}

a{
	color:#9bd1ff;
	text-decoration:none;
}

body{
	font:16px "VT323",monospace;
	background: var(--bg);
	color: var(--fg);
	margin:0
}

@media (min-width:680px) {
	body{
		display:flex;
		align-items:center;     /* centre vertical */
		justify-content:center; /* centre horizontal */
	}
}

.wrap{
	max-width:600px;
	max-height:100vh;
	margin:0 auto;
	display:grid;
	gap:clamp(10px, 2.4vw, 15px);
	padding:10px;
}

.topbar{
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap:12px;
	margin:6px 0 10px;
}

.brand{
	display:flex;
	align-items:center;
    justify-content:center;
	gap:12px;
	min-width:0;
}

.logo{
    max-height: 30vh;
    height: auto;
    display: block;
}

.hud{
	display: grid;
	width: 180px;
	align-items: stretch;
	font:16px "VT323",monospace;
	display:flex;
	flex-direction:column;
	align-items: stretch;
	gap:12px;
}

.badge {
	font-size:30px;
	text-align:center;
}

footer{
	margin-top:0;
	font:22px "VT323",monospace;
	text-align:center;
}

/* ===== Buttons ===== */
.btn{
	font-family:"Press Start 2P";
	font-size:11px;
	letter-spacing:1px;
	text-transform:uppercase;
	display:inline-block;
	padding:10px 14px;
	color:#111;
	background:linear-gradient(#ffd86a,#ff9800);
	border:0;
	border-radius:0;
	text-align:center;
	box-shadow:
		0 0 0 4px #25407a,
		0 0 0 8px #0a1636,
		inset 0 -4px 0 #c76b00,
		0 6px 0 #000;
	touch-action:manipulation;
}

.btn:active{
	transform:translateY(3px);
	box-shadow:
		0 0 0 4px #25407a,
		0 0 0 8px #0a1636,
		inset 0 -2px 0 #c76b00,
		0 3px 0 #000;
}

/* ===== GAME PANEL ===== */
.panel{
	position:relative;
	border-radius:18px;
	background:#1d0a2b;
	box-shadow:var(--frame);
	padding:10px;
	min-height:0;
	display:grid;
	place-items:center;
	will-change: transform;
	will-change: opacity;
}

.grid{
    display: grid;
    grid-template-columns: 48% 4% 48%;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 2%;
}

.mid{
	display:flex;
	align-items:center;
	justify-content:center;
}

.card{
	position:relative;
	overflow:hidden;
	display:flex;
	flex-direction:column;
	align-items:center;
	justify-content:center;
	gap:4px;
	min-height:90%;
	background:linear-gradient(180deg,#fc00ae 0%,#bc02a7 90%);
	border:0;
	border-radius:12px;
	cursor:pointer;
	transition:transform .08s, filter .08s;
	padding:5px 5px 10px 5px;
	-webkit-tap-highlight-color:transparent;
	touch-action:manipulation;
	will-change: transform;
	will-change: opacity;
}

.card:focus-visible{
	outline:2px solid var(--accent);
}

.card img{
	width:var(--user);
	height:var(--user);
	max-width:100%;
	object-fit:contain;
	image-rendering:crisp-edges;
	filter:contrast(1.1) saturate(1.1);
}

.card h3{
	font-family:"VT323",monospace;
	font-size:var(--h3);
	margin:0;
	text-align:center;
	color:#ffffff;
}

.card .pick{
	font-family:"Press Start 2P";
	font-size:14px;
	letter-spacing:1px;
	text-transform:uppercase;
	background:linear-gradient(#ffd86a,#ff9800);
	color:#111;
	padding:6px 10px;
	box-shadow:inset 0 -3px 0 #c76b00;
}

.card.enter{
	animation:pop .24s ease-out;
}

@keyframes pop{
	from{
		transform:scale(.96);
		filter:brightness(.9);
	}to{
		transform:scale(1);
		filter:none;
	}
}

.voted{
	animation:shake .18s;
}

@keyframes shake{
	0%,100%{
		transform:translateX(0)
	}
	25%{
		transform:translateX(-3px)
	}
	75%{
		transform:translateX(3px)
	}
}

.flashfx-card{
	position:absolute; inset:0; pointer-events:none; z-index:3;
}

/* expanding glow from card center (or click point) */
.flashfx-card::after{
	content:"";
	position:absolute;
	top:var(--fx-y,50%);
	left:var(--fx-x,50%);
	width:120vmax; height:120vmax;
	transform:translate(-50%,-50%) scale(.2);
	border-radius:50%;
	background:
		radial-gradient(circle,
		rgba(255,255,255,.95) 0%,
		rgba(200,200,200,.75) 40%,
		rgba(100,100,100,.55) 75%,
		rgba(255,255,255,0) 90%);
	filter: blur(8px);
	mix-blend-mode:screen;
	animation:flashBoom .48s ease-out forwards;
}

@keyframes flashBoom{
	0%   { opacity:.8;   transform:translate(-50%,-50%) scale(.2); }
	60%  { opacity:.6;   transform:translate(-50%,-50%) scale(1.0); }
	100% { opacity:0;   transform:translate(-50%,-50%) scale(1.25); }
}

.msg{
	margin:5px 0;
	font:18px "VT323",monospace;
	color:var(--danger);
	text-align:center;
	min-height:18px;
}

/* ===== Splash screen ===== */
.splash{
	position:fixed;
	inset:0;
	display:grid;
	place-items:center;
	background: #1d0a2b;
	z-index:999;
}

.splash .box{
	border-radius:18px;
	box-shadow:
		0 0 0 2px #ff2ebd inset,
		0 0 0 8px rgba(255, 20, 180, .35) inset,
		0 18px 60px rgba(0,0,0,.65),
		0 0 36px rgba(255, 0, 200, .25);
	padding:18px 20px;
	text-align:center;
	max-width:520px;
	margin:0 16px;
}

.splash-logo{
	width:min(200px);
	height:auto;
	filter:drop-shadow(0 8px 0 #081c4a);
}

.press{
	font:14px "Press Start 2P";
	color:#8fe3ff;
	margin:8px 0 12px;
	animation:blink 1.1s steps(2,end) infinite;
}

@keyframes blink{50%{opacity:.35}}

.copyright{
	font:16px "VT323";
	opacity:.6;
	margin:10px 0 0;
}

.hide{
	animation:fadeout .25s linear forwards;
}

.splash.hide{opacity:0; pointer-events:none; transition:opacity .25s}


@keyframes fadeout{
	to{
		opacity:0;visibility:hidden;
	}
}

/* ===== Interlude ===== */
.interlude{
	position:absolute;
	border-radius:18px;
	inset:10px;
	display:grid;
	place-items:center;
	background:#1d0a2b;
	z-index:5;
	animation:fadein .12s ease-out;
	pointer-events:all;
}

@keyframes fadein{
	from{opacity:0}to{opacity:1}
}

.interlude[hidden]{
	display:none !important;
}

.il-wrap{
	text-align:center;
	animation:pop .24s ease-out;
}

.il-title{
	font:14px "Press Start 2P";
	color:#8fe3ff;
	margin-bottom:20px;
	text-shadow:0 0 10px var(--accent);
}

.il-vs{
	display:none;
}

.il-count span{
	display:inline-block;
	min-width:auto;
	padding:0;
	background:none;
	box-shadow:none;
	font:50px "Press Start 2P";
	color:#ffbf20;
	text-shadow:0 0 10px #ffb900, 0 0 24px #ff9100, 0 6px 0 rgba(0,0,0,.5);
	animation:countPulse 1s ease-in-out infinite;
}

@keyframes countPulse{
	50%{
		transform:scale(1.3)
	}
}

/* ===== Leaderboard ===== */
.table-wrap{
	box-shadow:
		0 0 0 2px #ff2ebd inset,
		0 0 0 8px rgba(255, 20, 180, .35) inset,
		0 18px 60px rgba(0,0,0,.65),
		0 0 36px rgba(255, 0, 200, .25);
	padding:10px;
	border-radius:18px;
}

table{
	width:100%;
	border-collapse:separate;
	border-spacing:0;
}

thead th{
	font-family:"Press Start 2P";
	font-size:11px;
	letter-spacing:1px;
	text-transform:uppercase;
	padding:12px 10px;
	text-align:center;
	background:#0f1530;
	color:#bfe7ff;
}

thead th:nth-child(2){
	text-align:left;
}

tbody td{
	font-family:"VT323",monospace;
	font-size:24px;
	padding:10px 10px;
	border-top:1px solid #1e2a52;
	text-align:center;
}

tbody td:nth-child(2){
	text-align:left;
}

tbody tr:nth-child(odd){
	background:rgba(255,255,255,0.02);
}

tbody tr:hover{
	background:rgba(43,217,255,0.06);
}

.rank{
	width:56px;
	text-align:center;
}

.coin img{
	width:24px;
	height:24px;
	vertical-align:middle;
	margin-right:8px;
	image-rendering:crisp-edges;
}

tbody tr:nth-child(1) td{
	color:#ffe082;
	text-shadow:0 0 8px var(--accent2);
}

tbody tr:nth-child(2) td{
	color:#c9dafe;
}

tbody tr:nth-child(3) td{
	color:#a2ffd3;
}

/* ===== Header leaderboard ===== */
.lb-header{
	align-items:center;
	margin:8px 0 12px;
}

.lb-header .brand{
	align-items:center;
	gap:12px;
	min-width:0;
}

.lb-header{flex-direction:column;align-items:center;gap:8px}
.lb-header .brand{flex-direction:column;align-items:center;gap:6px;width:100%}
.lb-header .brand .logo{max-width:180px}
.lb-header .btn{width:100%;max-width:320px;text-align:center}

/* Leaderboard title */
.lb-title{
	margin:0;
	overflow:hidden;
	text-overflow:ellipsis;
	line-height:1.2;
	text-align:center;
	font-size:42px;
	letter-spacing:2px;
	text-transform:uppercase;
	margin:0;
	color:#8fe3ff;
	text-shadow:0 0 10px var(--accent),2px 2px 0 #001c3a;
	white-space:nowrap;
}

@media (max-width:560px){
  .lb-title{
    line-height:1.2;
  }
}

/* ===== Responsive ===== */


	
	:root{
		--gap:8px;
		--vsw:0;
		--user:min(25svh);
	}

	.topbar{
		flex-direction:column;
		align-items:center;
		gap:10px;
	}
	
	.btn{
		font-size:10px;
		padding:8px
		12px;
	}


/* ===== TOP HUD v2 ===== */
.hud2 {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* 3 colonnes */
  align-items: start;
}

.hud2-left {
  justify-self: start;   /* toujours à gauche */
  display:flex;
  align-items:center;
  gap:6px;
}

.hud2-logo {
  justify-self: center;  /* toujours centré */
}

.hud2-right {
  justify-self: end;     /* toujours à droite */
  display:flex;
  align-items:center;
}

.coin-amount{
    font: 14px "Press Start 2P";
    letter-spacing: 1px;
	color:var(--yellow);
	display:flex;
	align-items:center;
	gap:3px;
}

.sound{
	justify-self:end;
	display:inline-flex;
	background:none;
	border:0;
	cursor:pointer;
	color: var(--yellow);
}
.sound svg{
	width: 24px;    /* or clamp() like rest of your HUD */
	height: auto;   /* respects aspect ratio */
	display: block; /* removes inline whitespace */
}

.sound .off{
	display:none;
}

.sound.muted .on{
	display:none;
}

.sound.muted .off{
	display:block;
}



/* ===== INFO BAR ===== */
.info{
	padding:6px;
	border-radius:14px;
	box-shadow:var(--frame);
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap:8px;
}

.info-pill{
	text-align:center;
	padding:10px 12px;
	font:14px "Press Start 2P";
	letter-spacing:1px;
}

.info-pill.left{
	color:var(--yellow);
	text-transform: uppercase;
}

.bottom-nav{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:0;
  width:100%;
  max-width:600px;

  display:flex;
  justify-content:space-around;
  gap:6px;
  padding:8px 0 16px 0;
  background:rgba(8,10,30,.6);
  backdrop-filter:blur(6px);
  box-shadow:0 -1px 0 rgba(255,255,255,.06), 0 -10px 30px rgba(0,0,0,.35);
  z-index:900;
}

.navbtn{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:4px;
  background:none; border:0; color:#ffd86a; cursor:pointer; padding:6px 0;
  font:12px "VT323",monospace; opacity:.9;
}
.navbtn svg{ width:32px; height:32px; fill:#ffbf20; filter:drop-shadow(0 0 6px rgba(255,185,0,.35)) }
.navbtn.active{ opacity:1 }
.navbtn.active svg{ transform:translateY(-1px) }
@media (min-width:680px){ .navbtn svg{ width:22px; height:22px } }

#my-stats[hidden]{display:none}
.stats-row{display:grid; grid-template-columns: 1fr 1fr; gap:0; justify-content:space-between; margin:0}
.stat{padding:8px 12px;text-align:center;}
.stat h3 {margin: 0 0 10px 0; text-align: center; font-size: 22px;}