/* Modal styles */
.modal[hidden] { display: none !important; }
.modal { position: fixed; inset: 0; z-index: 1000; }
.modal .modal-backdrop { position: absolute; inset: 0; background: rgba(10, 8, 18, 0.7); backdrop-filter: blur(4px); }
.modal .modal-content { position: relative; margin: 6vh auto; max-width: 720px; width: calc(100% - 32px); background: #131126; color: #e6e6f0; border-radius: 16px; padding: 20px 20px 16px; box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(123,47,247,0.1) inset; outline: none; }

/* Modern close button */
.modal .modal-close { 
  position: absolute; 
  top: 16px; 
  right: 16px; 
  background: rgba(255, 255, 255, 0.1); 
  border: none; 
  color: #e6e6f0; 
  width: 36px; 
  height: 36px; 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  cursor: pointer; 
  transition: all 0.2s ease; 
  backdrop-filter: blur(10px);
  font-size: 14px;
}
.modal .modal-close:hover { 
  background: rgba(255, 255, 255, 0.15); 
  transform: scale(1.05); 
  color: #fff;
}
.modal .modal-close:active { 
  transform: scale(0.95); 
}

.modal .modal-header { 
  display: flex; 
  align-items: flex-start; 
  justify-content: space-between; 
  gap: 12px; 
  margin-bottom: 12px; 
  padding-right: 50px; /* Make room for close button */
}
.modal .modal-header h2 { 
  font-size: 22px; 
  margin: 0 0 4px 0; 
  color: #fff; 
  line-height: 1.2;
}
.modal .trust-meta { 
  font-size: 14px; 
  color: #b8b8c8; 
  background: rgba(123, 47, 247, 0.15);
  border: 1px solid rgba(123, 47, 247, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.modal .modal-header .header-content {
  flex: 1;
  min-width: 0; /* Allow text to wrap if needed */
}

.modal .site-details .hero { width: 100%; height: 180px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.modal .bonus { background: linear-gradient(135deg, rgba(123,47,247,0.12), rgba(0,255,136,0.08)); border: 1px solid rgba(123,47,247,0.25); border-radius: 12px; padding: 14px; margin: 12px 0; }
.modal .bonus .amount { font-size: 20px; font-weight: 700; color: #00ff88; }
.modal .bonus .desc { margin: 6px 0 0; color: #cfd3ff; }
.modal .bonus .code { margin-top: 10px; }
.modal .bonus .code label { display: block; font-size: 12px; color: #9aa0bf; margin-bottom: 4px; }
.modal .bonus .code code { background: #0f0d1d; border: 1px dashed rgba(0,255,136,0.35); color: #00ff88; padding: 6px 10px; border-radius: 8px; }

.modal .meta-grids { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.modal .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.modal .chip { background: #1a1834; border: 1px solid rgba(255,255,255,0.08); color: #e6e6f0; padding: 4px 10px; border-radius: 999px; font-size: 12px; }

/* House Edge Styling */
.modal .overall-house-edge { 
  background: linear-gradient(135deg, rgba(255, 87, 87, 0.15), rgba(255, 136, 0, 0.1)); 
  border: 1px solid rgba(255, 87, 87, 0.3); 
  border-radius: 12px; 
  padding: 12px; 
  margin: 8px 0; 
}
.modal .overall-house-edge h3 { 
  margin: 0 0 8px 0; 
  font-size: 14px; 
  color: #ff8800; 
  font-weight: 600; 
}
.modal .edge-highlight { 
  font-size: 18px; 
  font-weight: 700; 
  color: #ff5757; 
}

.modal .house-edges-section { 
  background: rgba(255, 136, 0, 0.05); 
  border: 1px solid rgba(255, 136, 0, 0.2); 
  border-radius: 12px; 
  padding: 12px; 
  margin: 8px 0; 
}
.modal .house-edges-section h3 { 
  margin: 0 0 10px 0; 
  font-size: 14px; 
  color: #ff8800; 
  font-weight: 600; 
}
.modal .house-edges-list { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
  gap: 8px; 
}
.modal .house-edge-item { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  background: rgba(255, 255, 255, 0.05); 
  border-radius: 8px; 
  padding: 6px 10px; 
  font-size: 12px; 
}
.modal .house-edge-item .game-name { 
  color: #cfd3ff; 
  text-transform: capitalize; 
}
.modal .house-edge-item .edge-value { 
  color: #ff8800; 
  font-weight: 600; 
}

.modal .modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.modal .modal-footer .primary { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #7b2ff7, #00ff88); color: #0b0b13; border: none; padding: 10px 14px; border-radius: 10px; font-weight: 700; text-decoration: none; }

@media (max-width: 520px) {
  .modal .modal-content { margin: 4vh auto; padding: 16px; }
  .modal .site-details .hero { height: 140px; }
  .modal .house-edges-list { grid-template-columns: 1fr; }
}
