/* Core Premium Typography & Background Styles from example.js */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: transparent;
  color: #e0e0e0;
  min-height: 100vh;
  padding: 10px;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
}

/* Premium Header Container & Navigation Buttons styling matching example.js theme */
.header-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 20px; /* Added spacing above the navigation buttons & date */
  margin-bottom: 10px;
  padding: 15px 0 10px 0;
}

.nav-buttons-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.draw-date {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}

.draw-date span {
  background: linear-gradient(135deg, #d4af37, #f5d66a);
  color: #1a1a1a;
  padding: 8px 26px;
  border-radius: 20px;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
  font-size: 1.25rem;
  font-weight: 800;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s ease;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, .15);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.chevron {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* 3 Columns Responsive Grid Layout from example.js */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 0;
  opacity: 1;
  transition: opacity 0.3s ease;
  justify-content: center;
}

/* Perfect alignment when only one pool card is shown */
.grid.single-item,
.grid:has(.pool-card:only-child) {
  grid-template-columns: minmax(280px, 380px) !important;
  justify-content: center !important;
}

.grid.loading {
  opacity: 0.3;
  pointer-events: none;
}

@media(max-width: 960px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Pool Card Styling from example.js */
.pool-card {
  background: rgba(255, 255, 255, .08);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 175, 55, 0.3);
}

/* Pool Header styling from example.js */
.pool-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 12px;
  background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.pool-header img {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .4));
}

.pool-header .pool-name {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Prize Section & Top Prizes from example.js */
.prize-section {
  padding: 0 10px 10px;
  flex-grow: 1;
}

.top-prizes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 0 6px;
}

.top-prize {
  text-align: center;
}

.top-prize .label {
  font-size: .65rem;
  text-transform: uppercase;
  color: #999;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.top-prize .number {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 6px 4px;
  border-radius: 6px;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 1st, 2nd, 3rd Prize Colors from example.js */
.top-prize.p1 .number {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  color: #fff;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.top-prize.p2 .number {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: #fff;
}

.top-prize.p3 .number {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: #fff;
}

/* Sub-prizes Labels & Grid from example.js */
.section-label {
  font-size: .65rem;
  text-transform: uppercase;
  color: #777;
  letter-spacing: 1px;
  text-align: center;
  padding: 8px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 4px 0;
}

.number-grid .num {
  text-align: center;
  font-size: .85rem;
  font-weight: 700;
  padding: 5px 2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .04);
  color: #ccc;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 1px;
}

.number-grid .num.empty {
  color: transparent;
  background: transparent;
}

/* Special 5D & 6D Tables from example.js */
.toto5d-table, .toto6d-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.toto5d-table td, .toto6d-table td {
  padding: 6px 8px;
  font-size: .82rem;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.toto5d-table .prize-label, .toto6d-table .prize-label {
  color: #999;
  font-weight: 600;
  font-size: .7rem;
  text-transform: uppercase;
  width: 50px;
}

.toto5d-table .prize-num, .toto6d-table .prize-num {
  color: #ddd;
  font-weight: 700;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 1.5px;
}

/* Loading & Shimmer States adapted with example.js theme */
.loading-overlay {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
  font-size: 1rem;
}

.loading-overlay .spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error States adapted with example.js theme */
.error-message {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.error-card {
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.25);
  border-radius: 12px;
  padding: 25px 40px;
  text-align: center;
  max-width: 450px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.error-icon {
  fill: #e74c3c;
  margin-bottom: 12px;
}

.error-card p {
  margin: 8px 0;
  font-size: 0.95rem;
  color: #e0e0e0;
  line-height: 1.4;
}

.retry-btn {
  background: #c0392b;
  color: #ffffff;
  border: none;
  padding: 8px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 15px;
  font-family: inherit;
  transition: background 0.2s, transform 0.1s;
}

.retry-btn:hover {
  background: #e74c3c;
}

.retry-btn:active {
  transform: scale(0.97);
}

.hidden {
  display: none !important;
}

/* Premium Back Button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease;
}

.back-btn:hover {
  background: rgba(255, 255, 255, .18);
}

.back-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Premium Dynamic Brand Selector Grid styling */
.brand-selector-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1200px;
  margin: 15px auto 25px;
  padding: 10px 16px;
}

/* Individual Brand Item Button */
.brand-item {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  overflow: hidden;
}

.brand-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Hover effect */
.brand-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 175, 55, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.brand-item:hover img {
  transform: scale(1.08);
}

/* Selected state (luxury white layout as per reference) */
.brand-item.selected {
  background: #ffffff;
  border-color: #d4af37;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.35);
  transform: scale(1.06);
}

.brand-item.selected img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* Luxury Tracing Outline SVG Animating on Hover / Selected */
.fd-trace-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.fd-trace-rect {
  fill: none;
  stroke: transparent;
  stroke-width: 2px;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.6s ease, stroke 0.4s ease;
}

.brand-item:hover .fd-trace-rect {
  stroke: rgba(212, 175, 55, 0.6);
  stroke-dashoffset: 0;
}

.brand-item.selected .fd-trace-rect {
  stroke: #d4af37;
  stroke-dashoffset: 0;
  stroke-width: 2.5px;
}
