:root{
	--bg: rgb(10,10,14);
	--ink: rgb(234,240,255);
	--muted: rgb(160,175,210);
	--red: rgb(196,24,39);
	--red-dark: rgb(140,18,30);
	--bezel: rgb(40,40,52);
	--screen: rgb(170,195,120);
	--accent: rgb(255,204,0);
}
*{
	box-sizing: border-box;
}
html, body{
	height: 100%;
}
body{
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: "Press Start 2P", system-ui, monospace;
	overflow: hidden; /* pas de scroll global */
}
.container{
	width: 100%;
	height: 100%;
}

/* ---------------- Pokédex : fixe au centre, 95vw x hauteur fiable ---------------- */
.dex{
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 95vw;
	height: calc(var(--vh, 1vh) * 95);
	background: var(--red);
	border: 6px solid var(--red-dark);
	border-radius: 18px;
	padding: 10px;
	box-shadow: inset 0 -6px 0 rgba(0,0,0,.2), 0 12px 30px rgba(0,0,0,.4);
	display: flex;
	flex-direction: column;
	padding-top: calc(10px + env(safe-area-inset-top));
	padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
@supports (height: 95dvh){
	.dex{ height: 95dvh; }
}
@supports (height: 95svh){
	.dex{ height: 95svh; }
}

/* ---------------- Haut du device ---------------- */
.dex-top{
	display: flex;
	align-items: center;
	gap: 12px;
}
.lens{
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: radial-gradient(circle at 30% 30%, rgb(120,200,255), rgb(19,120,210) 60%, rgb(10,60,120));
	border: 4px solid #cfe9ff;
	box-shadow: 0 0 0 4px var(--red-dark), inset 0 0 10px rgba(255,255,255,.25);
}
.dex-logo{
	height: 50px;
	flex: 0 0 auto;
	filter: drop-shadow(0 1px 0 rgba(0,0,0,.35));
}
.leds{
	display: flex;
	gap: 10px;
	margin-left: auto;
}
.led{
	width: 18px;
	height: 18px;
	border-radius: 50%;
	box-shadow: inset 0 -2px 0 rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.3);
	border: 2px solid var(--red-dark);
	padding: 0;
}
.led-green{ background: rgb(60,200,90); }
.led-yellow{ background: rgb(240,210,40); }
.led-red{
	background: rgb(220,30,30);
	cursor: pointer;
	border: 2px solid var(--red-dark);
}

.hinge{
	height: 8px;
	background: linear-gradient(to bottom, rgba(0,0,0,.25), rgba(255,255,255,.08));
	margin: 8px 0;
	border-radius: 6px;
}

/* ---------------- Cadre blanc + écran noir ---------------- */
.bezel{
	background: #f3f3f3;
	/* tes changements */
	border: 3px solid var(--bezel);
	border-radius: 12px 12px 12px 40px;
	padding: 10px 28px;

	box-shadow: inset 0 0 0 3px #ddd, 0 6px 10px rgba(0,0,0,.25);
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
	min-height: 0;
}
.sensors{
	display: flex;
	justify-content: center;
	gap: 10px;
}
.sensors span{
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgb(180,30,30);
	box-shadow: inset 0 -1px 0 rgba(0,0,0,.35);
}

.main-screen{
	background: #0a0a0a; /* noir */
	border-radius: 6px;
	border: 4px solid #b9b9b9;
	padding: 8px;
	color: #d7ffd7; /* rendu “lcd” */
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow: hidden;
	/* ton changement */
	height: 100%;
	min-height: 140px; /* garde un minimum */
}

/* ---------------- Contenu dans l’écran noir ---------------- */
.screen-title{
	margin: 0 0 6px 0;
	font-size: 14px;
	color: #bfe5b3;
}
.label{
	font-size: 10px;
	color: #9fc39a;
	display: block;       /* force sur toute la largeur */
	margin-bottom: 4px;   /* espace sous le label */
}
/* Inputs et boutons 8-bit */
input,
button{
	width: 100%;
	font-size: 12px;
	padding: 10px;
	border: 3px solid var(--bezel);
	border-radius: 0; /* coins carrés pour style pixel */
	background-color: #cfe4a8;
	color: #0c1a0c;
	font-family: "Press Start 2P", monospace;
	box-shadow:
		0 0 0 2px #000 inset,
		2px 2px 0 #000; /* effet bloc 8-bit */
	margin-bottom: 8px; /* espace entre chaque champ */
}

/* Bouton spécifique */
button{
	background-color: var(--accent);
	color: #222;
	font-weight: 700;
	cursor: pointer;
}
button:hover{
	background-color: rgb(255, 230, 100);
}
.small{
	font-size: 10px;
	color: #93a793;
}
.status{
	display: flex;
	justify-content: space-between;
	font-weight: 700;
}
.tabs{
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}
.tabs .tab{
	padding: 8px;
	border-radius: 8px;
	background: rgba(255,255,255,.08);
	color: #cfe4c8;
	border: 2px solid #2a3b2a;
	cursor: pointer;
	font-weight: 700;
}
.tabs .tab.active{
	background: #102610;
	color: #e6ffe0;
}
.pane{
	background: rgba(255,255,255,.06);
	border: 2px solid #2a3b2a;
	border-radius: 8px;
	padding: 8px;
	overflow: auto;
}
.grid2{
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
}
.list .row{
	display: flex;
	justify-content: space-between;
	padding: 6px 8px;
	border-bottom: 1px dashed rgba(255,255,255,.15);
}
.search{
	display: flex;
	gap: 6px;
}

/* ---------------- Bas du cadre blanc ---------------- */
.bezel-bottom{
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.dot-red{
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: rgb(200,30,30);
	border: 2px solid #b9b9b9;
	box-shadow: inset 0 -2px 0 rgba(0,0,0,.35);
}
.speaker{
	width: 40px;
	height: 40px;
	background:
		repeating-linear-gradient(
			to top,
			#444 0 4px,
			transparent 4px 10px
		);
}

/* ---------------- Panneau inférieur (NOUVELLE STRUCTURE) ---------------- */
.lower{
	display: grid;
	grid-template-columns: 2fr 1fr; /* 2/3 - 1/3 */
	align-items: stretch;
	gap: 12px;
	margin-top: 10px;
}

/* colonne gauche : 2 longs boutons + mini écran vert */
.lower-left{
	display: grid;
	grid-template-rows: auto auto; /* boutons en haut, écran en bas */
	gap: 10px;
}
.long-buttons{
	display: grid;
	grid-template-columns: 1fr 1fr; /* deux longs boutons côte à côte */
	gap: 10px;
}
.long-btn{
	height: 10px;
	border-radius: 10px;
	border: 1px solid var(--bezel);
	box-shadow: inset 0 -2px 0 rgba(0,0,0,.25), 0 2px 0 rgba(255,255,255,.2);
	color: #fff;
	text-shadow: 0 1px 0 rgba(0,0,0,.5);
	cursor: pointer;
}
	#btn-left{
		background-color: rgb(255,234,87);
	}
	#btn-right{
		background-color: rgb(3,104,151);
	}
.mini-screen{
	height: 100px;
	background: rgb(135,180,95);
	border: 4px solid var(--bezel);
	border-radius: 8px;
	box-shadow: inset 0 0 0 3px #111;
	padding: 10px;              /* + */
	box-sizing: border-box;     /* + (sécurise même si * change) */
	overflow: hidden;           /* + empêche l'agrandissement visuel */
}

#mini-greet{
	white-space: pre-line;      /* conserve le \n de “Bonjour\nPSEUDO !” */
	overflow-wrap: break-word;  /* coupe les pseudos trop longs */
	word-break: break-word;     /* fallback pour certains navigateurs */
	hyphens: auto;              /* césure douce quand possible */
}

/* colonne droite : D-Pad noir (inspiré, ré-implémenté) */
.lower-right{
	display: grid;
	place-items: center;
}
.dpad{
	position: relative;
	width: 120px;
	height: 120px;
}
.dpad .bar{
	position: absolute;
	background: #1a1a1a;
}
.dpad .bar.h{
	left: 12px;
	right: 12px;
	top: 50%;
	height: 40px;
	transform: translateY(-50%);
	border-radius: 12px;
}
.dpad .bar.v{
	top: 12px;
	bottom: 12px;
	left: 50%;
	width: 40px;
	transform: translateX(-50%);
	border-radius: 12px;
}
.dpad .nub{
	position: absolute;
	top: 50%;
	left: 50%;
	width: 15px;
	height: 15px;
	background: #111;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	box-shadow:
		inset 0 2px 0 rgba(255,255,255,.06),
		inset 0 -6px 0 rgba(0,0,0,.35);
}
.dpad .arrow{
	position: absolute;
	width: 0;
	height: 0;
	border-style: solid;
	opacity: .9;
}
.dpad .arrow.up{
	left: 50%;
	top: 20px;
	transform: translateX(-50%);
	border-width: 0 12px 14px 12px;
	border-color: transparent transparent #ffffff transparent;
}
.dpad .arrow.down{
	left: 50%;
	bottom: 20px;
	transform: translateX(-50%);
	border-width: 14px 12px 0 12px;
	border-color: #ffffff transparent transparent transparent;
}
.dpad .arrow.left{
	top: 50%;
	left: 20px;
	transform: translateY(-50%);
	border-width: 12px 14px 12px 0;
	border-color: transparent #ffffff transparent transparent;
}
.dpad .arrow.right{
	top: 50%;
	right: 20px;
	transform: translateY(-50%);
	border-width: 12px 0 12px 14px;
	border-color: transparent transparent transparent #ffffff;
}
.inv-list{
	margin-top: 8px;
	display: grid;
	gap: 6px;
	max-height: 100%;
	overflow: auto;            /* permet de scroller si beaucoup d’objets */
}
.inv-row{
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 8px;
	border: 2px solid #2a3b2a;
	border-radius: 8px;
	background: rgba(255,255,255,.06);
	color: #cfe4c8;
}
.inv-row .qty{
	font-weight: 800;
}
