/* WeWeed Salta! — stile minimale, palette verde weweed (build TEST) */

#weweed-game-app { margin: 0 auto; }

.wwg-wrap {
	max-width: 960px;
	margin: 0 auto;
	font-family: "Courier New", monospace;
	-webkit-user-select: none;
	user-select: none;
}

/* ---- schermo intero (nativo o pseudo su iOS) ---- */
.wwg-wrap.wwg-fs {
	position: fixed;
	inset: 0;
	max-width: none;
	margin: 0;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	background: #122e20;
}
.wwg-fs .wwg-bar { border-radius: 0; }
.wwg-fs .wwg-stage {
	flex: 1 1 auto;
	min-height: 0;
	border-radius: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px 24px;
}
@media (pointer: coarse) {
	/* corsie laterali riservate ai comandi: mai sopra il gioco o la barra;
	 * a sinistra più larga per ospitare ◀ ▶ AFFIANCATI */
	.wwg-fs .wwg-stage { padding: 8px 96px 8px 152px; }
}
.wwg-fs .wwg-touch-l {
	left: 12px;
	bottom: auto;
	top: 50%;
	transform: translateY(-50%);
	flex-direction: row;
	gap: 10px;
}
.wwg-fs .wwg-touch-r {
	right: 16px;
	bottom: auto;
	top: 50%;
	transform: translateY(-50%);
}

/* invito a ruotare quando lo schermo intero è in verticale */
.wwg-rotate { display: none; }
@media (orientation: portrait) {
	.wwg-fs .wwg-rotate {
		display: flex;
		position: absolute;
		inset: 0;
		z-index: 60;
		background: #122e20;
		color: #f4eeda;
		align-items: center;
		justify-content: center;
		font-size: 16px;
		font-weight: bold;
		letter-spacing: 1px;
	}
}

/* barra HUD */
.wwg-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #122e20;
	color: #f4eeda;
	padding: 8px 12px;
	border-radius: 8px 8px 0 0;
	font-size: 13px;
	font-weight: bold;
	letter-spacing: 0.5px;
}
.wwg-lv { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wwg-deaths { white-space: nowrap; }

.wwg-btn {
	background: #2f8f5b;
	color: #f4eeda;
	border: 0;
	border-radius: 6px;
	font: inherit;
	font-size: 14px;
	line-height: 1;
	padding: 6px 10px;
	cursor: pointer;
	touch-action: manipulation;
}
.wwg-btn:active { transform: translateY(1px); }
.wwg-btn.wwg-off { opacity: 0.4; text-decoration: line-through; }
@media (max-width: 480px) {
	.wwg-btn { padding: 5px 7px; font-size: 12px; }
	.wwg-bar { gap: 5px; padding: 7px 8px; }
}

/* scena */
.wwg-stage {
	position: relative;
	background: #122e20;
	border-radius: 0 0 8px 8px;
	padding: 6px;
}
.wwg-canvas {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 480 / 272;
	border-radius: 4px;
	image-rendering: pixelated;
	image-rendering: crisp-edges;
	touch-action: none;
}

/* controlli touch: visibili solo su puntatori "coarse" (dita) */
.wwg-touch {
	position: absolute;
	bottom: 14px;
	display: none;
	gap: 12px;
	z-index: 2;
}
.wwg-touch-l { left: 14px; }
.wwg-touch-r { right: 14px; }
@media (pointer: coarse) {
	.wwg-touch { display: flex; }
}
.wwg-pad {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	border: 0;
	background: rgba(244, 238, 218, 0.28);
	color: #f4eeda;
	font-size: 20px;
	line-height: 1;
	touch-action: none;
	-webkit-tap-highlight-color: transparent;
	cursor: pointer;
}
.wwg-pad:active { background: rgba(244, 238, 218, 0.5); }

/* pannelli (selezione livelli / vittoria) */
.wwg-panel {
	position: absolute;
	inset: 6px;
	background: rgba(18, 46, 32, 0.94);
	color: #f4eeda;
	border-radius: 4px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	z-index: 3;
	text-align: center;
}
.wwg-panel[hidden] { display: none; }
.wwg-panel-title { font-size: 16px; font-weight: bold; letter-spacing: 2px; }
.wwg-victory-text { font-size: 14px; }

.wwg-grid {
	display: grid;
	grid-template-columns: repeat(5, 48px);
	gap: 10px;
}
.wwg-cell {
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 8px;
	background: #2f8f5b;
	color: #f4eeda;
	font: inherit;
	font-size: 16px;
	font-weight: bold;
	cursor: pointer;
}
.wwg-cell:disabled { opacity: 0.25; cursor: default; }

/* etichetta versione: nel flusso del documento, mai sovrapposta a nulla */
.wwg-ver {
	text-align: right;
	font-size: 10px;
	letter-spacing: 1px;
	color: #f4eeda;
	opacity: 0.45;
	padding: 4px 4px 0;
	-webkit-user-select: none;
	user-select: none;
}

/* FIX pagina gioco: il banner cookie (Astro/GCM) perde il suo left:50% e il
 * translateX(-50%) lo spinge fuori dallo schermo a sinistra. Ripristino il
 * centraggio (questo CSS carica SOLO sulla pagina del gioco). */
#gcm-banner {
	left: 50% !important;
	right: auto !important;
	transform: translateX(-50%) !important;
	max-width: calc(100vw - 16px) !important;
	box-sizing: border-box !important;
}

/* nome giocatore */
.wwg-namer-stats { font-size: 14px; font-weight: bold; }
.wwg-namer-label { font-size: 11px; opacity: 0.8; letter-spacing: 1px; }
.wwg-name {
	width: 150px;
	background: #0a120d;
	color: #f4eeda;
	border: 2px solid #2f8f5b;
	border-radius: 8px;
	font-family: inherit;
	font-size: 24px;
	font-weight: bold;
	letter-spacing: 8px;
	text-align: center;
	text-transform: uppercase;
	padding: 8px 4px 8px 12px;
	outline: none;
}
.wwg-name:focus { border-color: #f4eeda; }

/* classifica */
.wwg-board-list {
	width: min(320px, 84%);
	max-height: 60%;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.wwg-row {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 13px;
	background: rgba(244, 238, 218, 0.06);
}
.wwg-r-pos { width: 18px; text-align: right; opacity: 0.7; }
.wwg-r-name { flex: 1 1 auto; text-align: left; font-weight: bold; letter-spacing: 2px; }
.wwg-r-deaths { white-space: nowrap; }
.wwg-r-time { width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* podio: oro, argento, bronzo */
.wwg-gold, .wwg-silver, .wwg-bronze { font-size: 15px; padding: 6px 10px; }
.wwg-gold   { color: #ffd75e; background: rgba(255, 215, 94, 0.14);  }
.wwg-silver { color: #d8dfe6; background: rgba(216, 223, 230, 0.12); }
.wwg-bronze { color: #e09a63; background: rgba(224, 154, 99, 0.12);  }
.wwg-gold .wwg-r-pos, .wwg-silver .wwg-r-pos, .wwg-bronze .wwg-r-pos { opacity: 1; font-weight: bold; }

.wwg-board-note { font-size: 10px; opacity: 0.6; max-width: 84%; line-height: 1.5; }

/* schermata sconti (prima della partita) */
.wwg-tiers { display: flex; flex-direction: column; gap: 8px; width: min(320px, 86%); }
.wwg-tier {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: rgba(244, 238, 218, 0.07);
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 12px;
	text-align: left;
	line-height: 1.35;
}
.wwg-tier b { white-space: nowrap; letter-spacing: 1px; }
.wwg-t20 { color: #d8dfe6; background: rgba(216, 223, 230, 0.10); }
.wwg-t30 { color: #ffd75e; background: rgba(255, 215, 94, 0.12); }
.wwg-tg  { color: #f4eeda; background: rgba(255, 215, 94, 0.20); border: 1px dashed #ffd75e; }
.wwg-tg b { white-space: normal; text-align: right; font-size: 11px; color: #ffd75e; }
.wwg-intro-note { font-size: 10px; opacity: 0.65; max-width: 86%; line-height: 1.6; }
.wwg-go { font-size: 16px; padding: 10px 26px; letter-spacing: 2px; }

/* banner codice sconto in classifica */
.wwg-coupon {
	width: min(320px, 86%);
	background: rgba(244, 238, 218, 0.08);
	border: 1px dashed rgba(244, 238, 218, 0.4);
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 11px;
	line-height: 1.6;
}
.wwg-coupon-won {
	background: rgba(255, 215, 94, 0.12);
	border-color: #ffd75e;
	color: #ffd75e;
}
.wwg-code {
	display: block;
	font-size: 17px;
	font-weight: bold;
	letter-spacing: 2px;
	color: #f4eeda;
	margin: 2px 0;
	user-select: text;
	-webkit-user-select: text;
}
.wwg-gift {
	display: block;
	margin-top: 6px;
	font-weight: bold;
	color: #ffd75e;
}
.wwg-wa {
	display: inline-block;
	margin-top: 6px;
	background: #25d366;
	color: #0a120d;
	font-weight: bold;
	text-decoration: none;
	border-radius: 6px;
	padding: 7px 12px;
}
.wwg-wa:hover { filter: brightness(1.1); }

@media (max-width: 420px) {
	.wwg-bar { font-size: 11px; gap: 6px; }
	.wwg-grid { grid-template-columns: repeat(5, 42px); gap: 8px; }
	.wwg-cell { width: 42px; height: 42px; }
}
