/* 
   LOTTO FORTUNA - Premium Dynamic Deep Blue with Extra Details
*/

:root {
  --bg-page: #070e3b;
  --ticket-blue: #092e91;
  --ticket-border: #142a63;
  --gold-light: #ffe566;
  --gold: #f5c518;
  --gold-grad: linear-gradient(135deg, #ffe566 0%, #f5c518 50%, #b8860b 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: #ffffff;
  background: radial-gradient(circle at 50% 0%, #1738c2 0%, #071580 40%, #030a2e 100%) fixed;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Background Animated Particles */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 150vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-animal {
  position: absolute;
  /* Reducida de 0.08 a 0.06 porque ahora son gigantes */
  opacity: 0.06;
  animation: floatAnim linear infinite;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

@keyframes floatAnim {
  0% {
    transform: translateY(110vh) rotate(0deg) scale(0.8);
  }

  100% {
    transform: translateY(-20vh) rotate(360deg) scale(1.2);
  }
}

/* ── TOP LOGO (no header) ── */
.top-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.2rem 0 0.2rem;
  flex-shrink: 0;
}

.top-logo {
  height: clamp(70px, 12vh, 120px);
  max-width: 350px;
  object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.5));
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.1rem 0.8rem 0.4rem;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Flex container for Title and Date */
.title-date-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.4rem;
  flex-shrink: 0;
}

/* Titles compressed */
.page-title {
  text-align: center;
  margin-bottom: 0;
}

.page-title h1 {
  font-size: clamp(1rem, 2.5vh, 1.5rem);
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.page-title p {
  display: none;
}

.date-selector-wrapper {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  width: max-content;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.date-selector-wrapper label {
  font-weight: 600;
  font-size: clamp(0.65rem, 1.3vh, 0.8rem);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  white-space: nowrap;
}

.date-input {
  font-family: inherit;
  font-size: clamp(0.75rem, 1.5vh, 0.95rem);
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(245, 197, 24, 0.6);
  border-radius: 30px;
  background: rgba(0, 0, 0, 0.3);
  color: #ffe566;
  font-weight: 700;
  transition: all 0.3s ease;
  cursor: pointer;
}

.date-input:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 10px rgba(245, 197, 24, 0.4);
}

.date-input::-webkit-calendar-picker-indicator {
  filter: invert(1) sepia(1) saturate(5) hue-rotate(0deg) brightness(1.2);
  cursor: pointer;
}

/* ── STATES ── */
.state-message {
  text-align: center;
  padding: 3rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  margin: 1rem auto;
  font-size: 1.2rem;
  backdrop-filter: blur(5px);
}

/* ── TICKETS GRID ── */
.resultados-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 1rem 1.5rem;
  overflow: hidden;
  padding: 0.5rem 1rem;
}

/* Time slot row */
.time-group {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.6rem;
  height: 100%;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.time-group:hover {
  transform: translateY(-3px);
}

/* Individual Ticket Card */
.ticket-card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 2px solid #ffffff;
  border-radius: 8px;
  background: linear-gradient(to bottom, #0d42b3, #082970);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  min-width: 0;
}

.ticket-header {
  background: #ffffff;
  color: #0d2a7a;
  font-size: clamp(0.85rem, 1.8vh, 1.15rem);
  font-weight: 800;
  padding: 0.25rem 0.1rem;
  width: 100%;
  text-align: center;
  flex-shrink: 0;
  white-space: nowrap;
}

.ticket-body {
  flex: 1;
  width: 100%;
  padding: 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}


/* Specifics for Animalito Ticket */
.ticket-image-container {
  width: clamp(40px, 7.5vh, 85px);
  height: clamp(40px, 7.5vh, 85px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.2rem;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  flex-shrink: 0;
}

.ticket-image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}

.ticket-card:hover .ticket-image-container img {
  transform: scale(1.1);
}

.animal-name {
  color: #ffffff;
  font-weight: 800;
  font-size: clamp(0.75rem, 1.8vh, 1.1rem);
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Specifics for Triple/Terminal Tickets */
.large-number {
  color: #ffffff;
  font-weight: 900;
  font-size: clamp(2.2rem, 6.6vh, 4.8rem);
  line-height: 1;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.7), 0 0 25px rgba(255, 255, 255, 0.4);
  z-index: 2;
}

/* Placeholder State */
.empty-data {
  color: rgba(255, 255, 255, 0.4);
  font-size: clamp(1rem, 3vh, 1.8rem);
  font-weight: 800;
}

/* ── FOOTER ── */
.site-footer {
  text-align: center;
  padding: 0.5rem;
  background: rgba(2, 6, 26, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  z-index: 10;
  position: relative;
  flex-shrink: 0;
}

/* ── RESPONSIVE: Tablet (iPad vertical) ── */
@media (max-width: 1024px) {
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .main-content {
    overflow: visible;
  }

  .resultados-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    flex: none;
    overflow: visible;
    gap: 1.5rem 1rem;
    padding: 1rem 0.5rem;
  }

  .time-group {
    height: auto;
    max-width: none;
  }

  .ticket-card {
    max-width: none;
  }

  .ticket-body {
    height: auto;
    min-height: 120px;
    flex: none;
  }

  /* Reset vh clamps for scrollable layout to prevent scaling issues */
  .large-number {
    font-size: 3rem;
  }

  .animal-name {
    font-size: 0.9rem;
  }

  .ticket-header {
    font-size: 1rem;
  }

  .ticket-image-container {
    width: 65px;
    height: 65px;
    margin-bottom: 0.5rem;
  }
}

/* ── RESPONSIVE: Móvil ── */
@media (max-width: 767px) {
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .main-content {
    overflow: visible;
    padding: 0.8rem;
  }

  .title-date-container {
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
  }

  .date-selector-wrapper {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    border-radius: 16px;
    gap: 0.8rem;
  }

  .date-input {
    width: 100%;
    text-align: center;
  }

  .resultados-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    flex: none;
    gap: 1rem;
    overflow: visible;
  }

  .time-group {
    height: auto;
    gap: 0.5rem;
  }

  .ticket-card {
    flex: 1;
    min-width: 80px;
    max-width: 150px;
  }

  .ticket-body {
    height: 90px;
    flex: none;
  }

  .large-number {
    font-size: 2rem;
  }

  .animal-name {
    font-size: 0.65rem;
  }

  .ticket-image-container {
    width: 40px;
    height: 40px;
  }
}