/* style.css */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
}

header {
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  font-size: 21px;
  align-items: center;
  padding: 4px 0;
  width: 334px;
  position: relative;
  margin: 0 auto;
}

.header-wrapper {
  /* border-bottom: 1px solid #ddd; */
}	

.logo {
  font-size: 25px;	
  font-weight: bold;	
  display: flex;
  align-items: center;
  gap: 0px;
}

.logo a {
  text-decoration: none;
  color: var(--cleared-color);
}

.user-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -8px;
  font-weight: bold;
  font-size: 1em;
  color: white;
  cursor: pointer;
  text-decoration: none;
}

.counter-value {
  display: inline-block;
  font-family: ui-monospace, monospace;
  line-height: 1em;
}

#news-container {
  display: none;
  text-align: left;
}

#board-container {
  display: flex;
  justify-content: center;
}
#board {
  display: grid;
  grid-template-columns: repeat(8, 40px);
  grid-gap: 2px;
  position: relative;
}
.cell {
  width: 40px;
  height: 40px;
  background: lightgray;
  display: inline-block;
}
.active {
  background: red !important;
}
.cleared {
  background: var(--cleared-color) !important;
}
.blocked {
  background-color: black;
  color: white;
  font-weight: 900;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#piece-container {
  margin: 10px;
  display: grid;
  grid-template-columns: repeat(4, 20px);
  justify-content: end;
  gap: 2px;
}
.piece-cell {
  width: 20px;
  height: 20px;
  background: white;
  border: 0px solid #ccc;
}
.piece-active {
  background: red;
}
#line-display {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
}
#end-game-message {
  font-size: 18px;
  margin-top: 0px;
}
.piece-display {
  display: inline-block;
  font-size: 24px;
  white-space: nowrap;
  min-height: 42px;
}
.whatsapp-button {
  display: inline-block;
  background-color: #25D366;
  color: #000000;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 25px;
}
.copy-btn-styled {
	display: inline-block;
	width: 100%;
	padding: 12px;
	background-color: #FFFFFF;
	color: #000000;
	border: 1px solid #000000;
	border-radius: 12px;
	font-weight: bold;
	font-size: 17px;
	cursor: pointer;
	text-decoration: none;
	margin-top: 0;
	box-sizing: border-box;
	text-align: center;
}	
.share-button {
  font-size: 17px;
  color: #000000;
  text-decoration: none;
  cursor: pointer;	  
}
.share-btn {
  margin: 10px;
  padding: 14px 24px;
  font-size: 1em;
  font-weight: bold;
  border-radius: 8px;
  border: none;
  width: 80%;
  max-width: 300px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .share-btn {
	font-size: 1.1em;
	padding: 16px 28px;
  }
}
@media (orientation: portrait) {
  #invite-popup {
	width: 60vw;
	max-width: 400px;
  }
}
#swap-link {
  margin-left: 10px;
  font-size: 20px;
  text-decoration: none;
  cursor: pointer;
}
#piece-popup h3 {
  margin-top: 0;
}
#popup-pieces div:hover {
  transform: scale(1.0);
}

#popup-pieces {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 250px;
}

#popup-pieces > * {
  width: 75px;
  height: 75px;
  border: 1px solid #000;
  box-sizing: border-box;
}

.play-icon {
  width: 23px; 
  height: 23px;
  display: inline-block; 
  vertical-align: text-bottom;
  margin-top: 0;	  
  background-color: #26A7DE;
  padding: 1px;
  border-radius: 3px;
  box-sizing: border-box;
}

#promo-text .play-icon {
	width: 18px;
	height: 18px;
	vertical-align: middle;
	margin: 0 2px;
}

@keyframes slideUp {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-100%); opacity: 0; }
}

.board-slide-up {
  animation: slideUp 1s ease-in-out forwards;
}

@keyframes fadeLeftArrow {
  0% { opacity: 0.1; transform: translateX(4px); }
  50% { opacity: 1; transform: translateX(0px); }
  100% { opacity: 0.1; transform: translateX(4px); }
}

#gameOverControls {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-in-out; 
}

#gameOverControls.show {
  opacity: 1;
  pointer-events: auto;
}	

.arrow-pulse::after {
  content: "⬅";
  display: inline-block;
  margin-left: 6px;
  font-weight: bold;
  animation: fadeLeftArrow 2s infinite ease-in-out;
}

/* Animación de sacudida para los iconos del Toast */
@keyframes sacudidaFrenetica {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(-15deg); }
  20% { transform: rotate(15deg); }
  30% { transform: rotate(-15deg); }
  40% { transform: rotate(15deg); }
  50% { transform: rotate(0deg); }
  /* De 50% a 100% se queda quieto para hacer una pequeña pausa */
}

.icono-bailarin {
  display: inline-block;
  animation: sacudidaFrenetica 1.5s ease-in-out infinite;
}

/* Animación de la barra de progreso del Toast */
@keyframes barraProgreso {
  from { width: 100%; }
  to { width: 0%; }
}

/* =======================================================
   ANIMACIÓN DE CELDAS AL COMPLETAR LÍNEA
   ======================================================= */

.cell-fade-out {
  animation: cellFadeOut 0.6s ease-out forwards;
}

@keyframes cellFadeOut {
  0% {
    background-color: var(--cleared-color);
    opacity: 0.4; /* Color atenuado */
  }
  100% {
    background-color: lightgray;
    opacity: 1; /* Vuelve al gris vacío original */
  }
}