* {
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #0f1216;
  color: #e8e6df;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(212,162,78,0.06), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(209,97,90,0.05), transparent 45%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 4px);
}

/* ===== SPLIT ===== */
.login-split {
  display: flex;
  width: 860px;
  max-width: 100%;
  min-height: 480px;
  max-height: 560px;
  background: #1c2129;
  border: 1px solid #2c333d;
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.7),
    0 0 0 1px rgba(212,162,78,0.05) inset;
}

/* ===== PANEL IZQUIERDO ===== */
.grid-panel {
  flex: 1.15;
  background: #14171c;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image:
    radial-gradient(ellipse at center, rgba(212,162,78,0.05), transparent 60%),
    radial-gradient(ellipse at center, #181d24 0%, #0f1216 100%);
}

.grid-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, #14171c 0%, transparent 12%, transparent 88%, #14171c 100%),
    linear-gradient(to bottom, #14171c 0%, transparent 15%, transparent 85%, #14171c 100%);
  z-index: 3;
}

.grid-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(212,162,78,0.18), transparent 55%);
  filter: blur(40px);
  z-index: 1;
}

.grid-scene {
  perspective: 1400px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  overflow: hidden;
}

/* ===================================================== */
/* MARQUEE VERTICAL INFINITO SIN CORTE                   */
/* Cada copia se anima translateY(-100%) sobre sí misma. */
/* Como hay 2 copias idénticas apiladas, cuando la 1ª    */
/* termina su recorrido, la 2ª está exactamente en su    */
/* posición inicial → loop perfecto, sin costura.        */
/* ===================================================== */
.grid-slider {
  width: 130%;
  transform: rotateX(18deg) rotateY(-12deg) rotateZ(2deg);
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  animation: slideUp 24s linear infinite;
  will-change: transform;
}

@keyframes slideUp {
  0%   { transform: rotateX(18deg) rotateY(-12deg) rotateZ(2deg) translateY(0); }
  100% { transform: rotateX(18deg) rotateY(-12deg) rotateZ(2deg) translateY(-50%); }
}

/* Pausar al hover */
.grid-panel:hover .grid-slider {
  animation-play-state: paused;
}

/* Filas con margen uniforme */
.grid-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

/* Truco final: la última fila del track NO tiene margen inferior,
   así la altura total es exactamente 2× una copia y el -50% cae perfecto */
.grid-row:last-child {
  margin-bottom: 0;
}

/* ===== TARJETAS ===== */
.grid-card {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 10px 20px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-card::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.10) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: shine 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

.grid-card:hover {
  transform: translateZ(28px) scale(1.06);
  box-shadow:
    0 18px 30px rgba(0,0,0,0.6),
    0 0 0 1px rgba(212,162,78,0.5) inset,
    0 0 24px rgba(212,162,78,0.25);
  z-index: 5;
}

/* ===== NAIPES ===== */
.card-card {
  background: linear-gradient(160deg, #f5f3ec 0%, #d9d5c9 100%);
}
.card-card.red { background: linear-gradient(160deg, #f7e9e7 0%, #e2c2be 100%); }
.card-card .suit-mini {
  font-size: 2.2rem;
  color: #14171c;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.card-card.red .suit-mini { color: #c8382f; }

/* ===== FICHAS CON NÚMEROS ===== */
.card-chip {
  background:
    radial-gradient(circle at 50% 50%, #d4a24e 0 32%, transparent 33%),
    radial-gradient(circle at 50% 50%, #b8862f 0 48%, transparent 49%),
    repeating-conic-gradient(from 0deg, #d4a24e 0deg 15deg, #a86d2c 15deg 30deg);
  background-color: #8a5a1f;
}
.card-chip.blue {
  background:
    radial-gradient(circle at 50% 50%, #5b8dee 0 32%, transparent 33%),
    radial-gradient(circle at 50% 50%, #3861b8 0 48%, transparent 49%),
    repeating-conic-gradient(from 0deg, #5b8dee 0deg 15deg, #2f4f9c 15deg 30deg);
  background-color: #223a73;
}

.card-chip .chip-mini {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff8e1;
  text-shadow: 0 2px 3px rgba(0,0,0,0.5);
  width: 62%;
  height: 62%;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: 2px dashed rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

/* ===== DADOS MINI ===== */
.card-dice {
  background: linear-gradient(160deg, #2a3038 0%, #1c2129 100%);
}
.dice-mini {
  position: relative;
  width: 55%;
  aspect-ratio: 1;
  background: linear-gradient(160deg, #f5f3ec 0%, #c9c4b6 100%);
  border-radius: 20%;
  box-shadow: inset 0 -4px 6px rgba(0,0,0,0.25), 0 4px 8px rgba(0,0,0,0.4);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 12%;
  gap: 6%;
}
.dice-mini span {
  background: #14171c;
  border-radius: 50%;
  width: 100%;
  height: 100%;
  align-self: center;
  justify-self: center;
}

.dice-mini.pips-1 span:nth-child(1) { grid-area: 2 / 2; }

.dice-mini.pips-2 span:nth-child(1) { grid-area: 1 / 1; }
.dice-mini.pips-2 span:nth-child(2) { grid-area: 3 / 3; }

.dice-mini.pips-3 span:nth-child(1) { grid-area: 1 / 1; }
.dice-mini.pips-3 span:nth-child(2) { grid-area: 2 / 2; }
.dice-mini.pips-3 span:nth-child(3) { grid-area: 3 / 3; }

.dice-mini.pips-4 span:nth-child(1) { grid-area: 1 / 1; }
.dice-mini.pips-4 span:nth-child(2) { grid-area: 1 / 3; }
.dice-mini.pips-4 span:nth-child(3) { grid-area: 3 / 1; }
.dice-mini.pips-4 span:nth-child(4) { grid-area: 3 / 3; }

.dice-mini.pips-5 span:nth-child(1) { grid-area: 1 / 1; }
.dice-mini.pips-5 span:nth-child(2) { grid-area: 1 / 3; }
.dice-mini.pips-5 span:nth-child(3) { grid-area: 2 / 2; }
.dice-mini.pips-5 span:nth-child(4) { grid-area: 3 / 1; }
.dice-mini.pips-5 span:nth-child(5) { grid-area: 3 / 3; }

.dice-mini.pips-6 span:nth-child(1) { grid-area: 1 / 1; }
.dice-mini.pips-6 span:nth-child(2) { grid-area: 2 / 1; }
.dice-mini.pips-6 span:nth-child(3) { grid-area: 3 / 1; }
.dice-mini.pips-6 span:nth-child(4) { grid-area: 1 / 3; }
.dice-mini.pips-6 span:nth-child(5) { grid-area: 2 / 3; }
.dice-mini.pips-6 span:nth-child(6) { grid-area: 3 / 3; }

/* ===== RULETAS ===== */
.card-roulette {
  background: linear-gradient(160deg, #2a3038 0%, #1c2129 100%);
}
.roulette-mini {
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(
      #c8382f 0deg 30deg, #14171c 30deg 60deg,
      #c8382f 60deg 90deg, #14171c 90deg 120deg,
      #c8382f 120deg 150deg, #14171c 150deg 180deg,
      #c8382f 180deg 210deg, #14171c 210deg 240deg,
      #c8382f 240deg 270deg, #14171c 270deg 300deg,
      #c8382f 300deg 330deg, #14171c 330deg 360deg
    );
  box-shadow:
    inset 0 0 0 4px #d4a24e,
    inset 0 0 0 8px #8a5a1f,
    0 4px 10px rgba(0,0,0,0.5);
  position: relative;
}
.roulette-mini::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 22%; height: 22%;
  background: radial-gradient(circle, #f5f3ec 30%, #d4a24e 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px #14171c;
}

/* ===== PANEL DERECHO ===== */
.form-panel {
  flex: 1;
  padding: 2rem 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #1c2129;
}

.logo-login {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #2c333d;
  margin-bottom: 1rem;
}

.form-panel h2 {
  font-weight: 700;
  color: #e8e6df;
  font-size: 1.4rem;
  margin: 0 0 0.2rem;
}

.login-subtitle {
  color: #8b92a0;
  font-size: 0.82rem;
  margin: 0 0 1.4rem;
}

.input-group {
  position: relative;
  margin-bottom: 1.1rem;
}
.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #2c333d;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #14171c;
  color: #e8e6df;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.input-group input:focus {
  border-color: #d4a24e;
  box-shadow: 0 0 0 3px rgba(212,162,78,0.15);
}
.input-group label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b92a0;
  font-size: 14px;
  transition: 0.2s ease;
  background: #14171c;
  padding: 0 4px;
  pointer-events: none;
}
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 11px;
  color: #d4a24e;
  background: #1c2129;
}

.show-pass-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.2rem;
  font-size: 0.78rem;
  color: #8b92a0;
}
.show-pass-row input[type="checkbox"] {
  accent-color: #d4a24e;
  cursor: pointer;
}
.show-pass-row label { cursor: pointer; margin: 0; }

.btn-lindo {
  width: 100%;
  padding: 12px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  color: #1a1305;
  border-radius: 10px;
  background: #d4a24e;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 6px 16px rgba(212,162,78,0.25);
}
.btn-lindo:hover:not(:disabled) {
  background: #c48f39;
  transform: translateY(-2px);
}
.btn-lindo:disabled { cursor: not-allowed; }

.footer-copy { font-size: 0.75rem; color: #8b92a0; margin-top: 1.4rem; margin-bottom: 0.1rem; }
.footer-credit { font-size: 0.68rem; color: #5a6070; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .login-split {
    flex-direction: column;
    min-height: auto;
    max-height: none;
  }
  .grid-panel {
    min-height: 240px;
    flex: none;
  }
  .grid-slider {
    width: 150%;
  }
  .grid-row { gap: 10px; margin-bottom: 10px; }
  .grid-card .suit-mini { font-size: 1.5rem; }
  .form-panel { padding: 2rem 1.5rem; }
}