:root {
  --color-bg: #121212;
  --color-primary: #d4af37; /* Dorado */
  --color-white: #1e1e1e;
  --color-grey: #888888;
  --color-text: #f5f5f5;
  --color-success: #4caf50;
  --color-danger: #f44336;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: url('bg.jpg') no-repeat center center fixed;
  background-size: cover;
  color: var(--color-text);
  margin: 0;
  padding: 0;
  text-align: center;
  margin-bottom: 23px;
}


header {
  background: var(--color-white);
  border-bottom: 2px solid var(--color-primary);
  color: var(--color-text);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(212, 175, 55, 0.1);
}

.usuario-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.usuario-info .nombre,
.usuario-info .saldo,
.usuario-info .banco {
  font-size: 1rem;
  background: var(--color-primary);
  border-radius: 6px;
  padding: 10px;
  color: #000;
  border: 1px solid var(--color-primary);
  font-weight: bold;
}

button#btn-todo {
  font-size: 1rem;
  background: var(--color-primary);
  border-radius: 6px;
  padding: 10px;
  color: #000;
  border: 1px solid var(--color-primary);
  font-weight: bold;
}

input#input-cantidad {
    width: 100%;
    margin: auto;
    margin-bottom: 10px;
    border: 2px solid #c9a634;
}
div:where(.swal2-container).swal2-backdrop-show, div:where(.swal2-container).swal2-noanimation {
    background: rgba(0,0,0,0.8) !important;
}

input#input-cantidad:focus {
    box-shadow: none;
}

/* Para Chrome, Safari, Edge */
.swal2-input::-webkit-outer-spin-button,
.swal2-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Para Firefox */
.swal2-input[type=number] {
  -moz-appearance: textfield;
}


h2#swal2-title {
    font-size: 20px;
    background: #d4af37;
    padding-bottom: 8px;
    padding-top: 6px;
	color: #000;
}

div#swal2-validation-message {
    background: #bf9e32 !important;
    color: #000;
	    margin-top: 0;
    margin-bottom: 15px;
}

.swal2-deny-bank {
    color: #000;
    background: #d4af37;
    height: 38.67px;
    line-height: 0;
}

p.disponible {
    margin-top: -7px;
	font-size: 16px;
}

button.swal2-confirm.swal2-styled {
    background: #c9a634;
}

.swal2-actions {
    margin-top: 0px;
}

div#swal2-html-container {
    margin-bottom: 14px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.info-usuario {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 0.95rem;
}

.info-usuario .nombre {
  font-weight: bold;
  font-size: 1.05rem;
}

.volver {
  background: var(--color-primary);
  color: #000;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.2s ease;
  box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

.volver:hover {
  background: #f1d770;
}

main {
  padding: 20px;
}

.tablero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 350px;
  margin: auto;
  background: linear-gradient(135deg, #d7d7d7 0%, #a6a6a6 25%, #7f7f7f 50%, #a6a6a6 75%, #d7d7d7 100%);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
  border: 2px solid var(--color-primary);
}

.swal2-popup {
    border: 2px solid #eee;
	box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
	border: 2px solid var(--color-primary);
	width: 80%;
}

.swal-actions-stacked {
  gap: 0.5rem;
}

.swal-actions-stacked .swal2-confirm,
.swal-actions-stacked .swal2-deny {
  width: 45%;
  display: inline-block;
  margin: 0;
}

.swal-actions-stacked .swal2-cancel {
  width: 60%;
  margin-top: 0.8rem;
}


.casilla button {
  width: 100%;
  aspect-ratio: 1;
  font-size: 2rem;
  border-radius: 12px;
  border: 2px solid #f1d770;
  cursor: pointer;
  background: var(--color-primary);
  color: #000;
  font-weight: bold;
  transition: all 0.3s ease;
}

.casilla button:hover {
  transform: scale(1.05);
  background: #f1d770;
  border: 2px solid #d4af37;
}

.casilla button:disabled {
  background-color: #2c2c2c;
  color: #888;
  cursor: not-allowed;
}

.mensaje-final {
  font-size: 1.3rem;
  font-weight: bold;
}

.ganador {
  color: var(--color-success);
}

.perdedor {
  color: var(--color-danger);
}

.info-juego,
.resultado-juego,
.intentos-juego {
  background: var(--color-white);
  max-width: 350px;
  margin: 20px auto;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.05);
  border: 2px solid var(--color-primary);
}

.resultado-juego {
  display: none;
  margin-bottom: 21px;
}

.result {
    background: #d4af37;
    border-radius: 8px;
    padding: 10px 20px;
	    color: #000;
}

span.title-win {
    color: #00ab2b;
}

span.title-loss {
    color: #ab0000;
	    font-size: 18px;
}

.result {
  position: relative; /* importante para contener los fuegos */
  overflow: hidden;
}

.fireworks {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.firework {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: explode 800ms ease-out forwards;
}

@keyframes explode {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) scale(0); opacity: 0; }
}


.info-juego h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
      margin-top: 0;
}

.info-juego ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.info-juego ul li {
  margin: 4px 0;
}

footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: var(--color-white);
  padding: 12px 0;
  text-align: center;
  border-top: 2px solid var(--color-primary);
  box-shadow: 0 -2px 5px rgba(212, 175, 55, 0.1);
}

footer .volver {
  background: var(--color-primary);
  color: #000;
  text-decoration: none;
  padding: 8px 16px;
  font-weight: bold;
  border-radius: 6px;
  display: inline-block;
  transition: background 0.2s;
}

footer .volver:hover {
  background: #f1d770;
}

#contador-volver {
  font-size: 13px;
  color: var(--color-primary);
}

/* Previene selección de texto */
* {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button:focus {
  outline: none;
  box-shadow: none;
}

button.revelado {
  animation: revelar 0.3s ease forwards;
}

@keyframes revelar {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#loading-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
}

.spinner {
  border: 6px solid #333;
  border-top: 6px solid var(--color-primary);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Clases dinámicas desde JS */
.revelado {
  background-color: #2c2c2c;
  color: #f0f0f0;
  font-weight: normal;
}

.boton-ganador {
  background-color: #f1d770 !important;
  color: #000 !important;
  font-weight: bold !important;
  border: 2px solid #d4af37 !important;
}


.boton-reintentar {
  margin-top: 15px;
  padding: 10px 20px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  background-color: var(--color-primary);
  color: black;
  cursor: pointer;
  transition: background 0.3s ease;
  font-weight: bold;
}

.boton-reintentar:hover {
  background-color: #f1d770;
}

@media (max-width: 480px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .volver {
    align-self: flex-end;
  }

  .info-juego {
    margin-bottom: 40px;
  }
}

img.logo {
    width: 50%;
    margin-bottom: 5px;
    margin-top: -10px;
}

