/* Wallet Modal Z-Index Fix */
.wallet-adapter-modal-wrapper {
  z-index: 10000 !important;
}

html, body {
  background-color: #03060f;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100%;
  -webkit-tap-highlight-color: transparent; /* Remove blue highlight on mobile */
}

body {
  background-color: #03060f;
}

.raffle-site {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  color: #fff;
  font-family: 'Funnel Sans', sans-serif;
  padding-top: 80px;
  background-color: transparent;
  z-index: 1;
}

.raffle-fixed-header {
  position: fixed;
  top: 32px;
  right: 160px;
  z-index: 50; /* Above menu header but below menu panel */
  pointer-events: auto;
}

.raffle-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

@media (max-width: 768px) {
  .raffle-fixed-header {
    top: 20px;
    right: 120px;
  }
}

.raffle-galaxy {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  z-index: 0; /* Placed at 0, site content is at 1 */
  background-color: #03060f; /* Match the canvas background */
  /* Force GPU layer promotion to prevent flashing during re-paints */
  transform: translateZ(0);
  will-change: transform;
}

.raffle-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 10;
}

.raffle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.raffle-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.raffle-btn-create-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  margin-left: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.28);
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  font-family: 'Funnel Sans', sans-serif;
  font-weight: 700;
  line-height: 1;
  overflow: visible;
  isolation: isolate;
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  transition: transform .15s ease, box-shadow .2s ease;
}

.raffle-btn-create-nav::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    #FFC0F5,
    #00E3FA,
    #5CFCA9,
    #FFD55F,
    #FF9161,
    #FFC0F5
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 1;
  z-index: -1;
}

.raffle-btn-create-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.raffle-nav-item {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
  padding: 8px 0;
  position: relative;
}

.raffle-nav-item:hover {
  opacity: 1;
}

.raffle-nav-item.active {
  opacity: 1;
}

.raffle-nav-item.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #FFC0F5, #00E3FA, #5CFCA9, #FFD55F, #FF9161);
}

/* AGGRESSIVE Wallet button styling to override library defaults */
.raffle-header-actions button[class*="wallet-adapter-button"] {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  color: #fff !important;
  border-radius: 100px !important;
  padding: 0 24px !important;
  font-family: 'Funnel Sans', sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  height: 44px !important;
  min-height: 44px !important;
  line-height: 44px !important; /* Ensure vertical centering */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(12px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2) !important;
  box-shadow: 0 8px 26px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.35) !important;
  transition: all 0.2s ease !important;
  width: auto !important;
  min-width: 160px !important; /* Give it enough space for the address */
  white-space: nowrap !important;
}

.raffle-header-actions button[class*="wallet-adapter-button"]:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.45) !important;
}

.raffle-header-actions button[class*="wallet-adapter-button"] i,
.raffle-header-actions button[class*="wallet-adapter-button"] .wallet-adapter-button-start-icon {
  display: none !important; /* Hide the wallet icon */
}

/* Ensure the wallet address/text is visible and properly colored */
.raffle-header-actions button[class*="wallet-adapter-button"] {
  color: #fff !important;
}

.raffle-header-actions button[class*="wallet-adapter-button"] * {
  color: #fff !important;
}

/* Active Raffles Grid */
.raffle-active-list {
  padding: 20px 0;
}

.section-title {
  font-size: 20px;
  margin-bottom: 20px;
  font-weight: 800;
}

.raffle-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.raffle-item-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.raffle-item-card.past {
  opacity: 0.8;
  text-align: center;
}

.raffle-item-card.past .raffle-btn-buy {
  background: #ff6b6b !important;
  color: #fff !important;
  opacity: 1 !important;
  display: block;
  margin: 12px auto 0;
  width: fit-content;
  padding: 8px 24px;
}

.raffle-item-card.past .raffle-item-stats.past-winner {
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.winner-label {
  opacity: 0.6;
  font-size: 11px;
  line-height: 1;
}

.winner-link {
  color: #00E3FA;
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.2s;
  line-height: 1.4;
}

.winner-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.raffle-item-card.past:hover {
  transform: none;
  box-shadow: none;
}

.raffle-item-image {
  aspect-ratio: 1;
  overflow: hidden;
  position: relative; /* CRITICAL for absolute badges/sharing buttons */
  background: rgba(255, 255, 255, 0.03); /* Fallback background color */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Manual End Button Overlay */
.raffle-manual-end-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 20;
}

.raffle-item-image:hover .raffle-manual-end-overlay,
.raffle-detail-image-wrap:hover .raffle-manual-end-overlay {
  opacity: 1;
  pointer-events: auto;
}

.raffle-btn-manual-end {
  background: #ff4d4d;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.raffle-btn-manual-end:hover {
  transform: scale(1.05);
  background: #ff3333;
}

.raffle-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.raffle-item-info {
  padding: 12px;
}

.raffle-item-info h3 {
  margin: 0 0 8px;
  font-size: 16px;
  text-align: center;
}

.raffle-item-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 12px;
}

.raffle-item-times {
  font-size: 11px;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.raffle-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time-label {
  opacity: 0.6;
  font-weight: 500;
}

.time-value {
  font-weight: 600;
  color: #fff;
}

.raffle-buy-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.raffle-quantity-selector {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  height: 38px;
  padding: 0 4px;
}

.raffle-quantity-selector button {
  background: none;
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.raffle-quantity-selector button:hover {
  opacity: 1;
}

.raffle-quantity-selector input {
  width: 30px;
  background: none;
  border: none;
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  appearance: textfield;
  -moz-appearance: textfield;
}

.raffle-quantity-selector input::-webkit-outer-spin-button,
.raffle-quantity-selector input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.raffle-btn-buy {
  flex: 1;
  background: #5CFCA9;
  color: #000;
  border: none;
  padding: 8px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.raffle-btn-buy:hover:not(:disabled) {
  background: #4ae898;
}

.raffle-btn-buy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
}

.raffle-btn-buy.sold-out {
  background: #ff4d4d !important;
  color: #fff !important;
  opacity: 1 !important;
  cursor: not-allowed;
}

.raffle-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid #5CFCA9;
  border-radius: 50%;
  animation: raffle-spin 0.8s linear infinite;
}

@keyframes raffle-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.raffle-placeholder {
  text-align: center;
  padding: 100px 0;
  opacity: 0.6;
}

.raffle-btn-wallet {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.raffle-notification-dot {
  width: 8px;
  height: 8px;
  background: #FF9161;
  border-radius: 50%;
}

.raffle-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: start;
}

.raffle-prize-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
}

.nft-prize {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.nft-prize:hover {
  background: rgba(255,255,255,0.08);
}

.raffle-prize-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.raffle-plus-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
}

.raffle-link {
  color: #FFD55F;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.raffle-prize-divider {
  text-align: center;
  margin: 24px 0;
  font-size: 24px;
  font-weight: 800;
  opacity: 0.8;
}

.token-prize h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.raffle-input-group {
  text-align: left;
}

.raffle-input-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  opacity: 0.8;
}

.raffle-select-input {
  position: relative;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
}

.raffle-select-input input {
  background: none;
  border: none;
  color: #fff;
  width: 100%;
}

.raffle-input-note {
  font-size: 12px;
  color: #FF9161;
  margin-top: 8px;
}

.raffle-profile-warning {
  color: #FF9161;
  font-size: 14px;
  margin-bottom: 24px;
}

.raffle-profile-warning a {
  color: #fff;
  text-decoration: underline;
}

.raffle-form-title {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-top: 0;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.raffle-form-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.raffle-field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.raffle-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  min-height: 20px;
}

.raffle-date-input input,
.raffle-input-dark,
.raffle-price-input input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px;
  color: #fff;
}

.input-error {
  border-color: #ff4d4d !important;
  background: rgba(255, 77, 77, 0.1) !important;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.2);
}

.raffle-field-limit {
  font-size: 14px;
  color: #B19EEF;
  font-weight: 700;
}

.raffle-quick-dates {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.raffle-date-btn {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 6px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.raffle-price-input {
  display: flex;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  overflow: hidden;
}

.raffle-price-input input {
  border: none;
  background: none;
}

.raffle-currency-select {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  padding: 0 12px;
  font-weight: 700;
}

.raffle-additional-settings {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.advanced-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.advanced-label-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.advanced-label-group label {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

/* Hide number input spinners */
.no-spinners::-webkit-inner-spin-button,
.no-spinners::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.no-spinners {
  -moz-appearance: textfield;
}

.advanced-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.advanced-input:focus {
  border-color: #B19EEF;
}

.static-field {
  color: #5CFCA9 !important;
  font-weight: 700;
  background: rgba(92, 252, 169, 0.05) !important;
  border: 1px solid rgba(92, 252, 169, 0.2) !important;
  cursor: default;
}

.add-collection-btn {
  background: none;
  border: none;
  color: #B19EEF;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 0;
  opacity: 0.8;
  text-align: left;
}

.collection-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.remove-collection-btn {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.2);
  color: #ff4d4d;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.remove-collection-btn:hover {
  background: rgba(255, 77, 77, 0.2);
  border-color: #ff4d4d;
}

.add-collection-btn:hover {
  opacity: 1;
}

.advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.advanced-field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.label-with-limit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.label-with-limit label {
  margin-bottom: 0;
}

.max-label {
  font-size: 11px;
  color: #B19EEF;
  font-weight: 700;
}

.field-sub {
  font-size: 11px;
  opacity: 0.5;
  margin-top: 8px !important;
}

/* NFT Modal Styles */
.nft-selection-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.nft-selection-modal {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 100001 !important;
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.nft-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.nft-item-select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.nft-item-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #5CFCA9;
  transform: translateY(-2px);
}

.nft-item-select img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

.nft-item-select span {
  font-size: 13px;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
}

.modal-loading span {
  display: block;
  margin-top: 10px;
  color: #5CFCA9;
  font-weight: 600;
}

.modal-empty {
  padding: 60px 0;
  text-align: center;
  opacity: 0.6;
}

/* Selected NFT in sidebar */
.raffle-selected-nft {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.raffle-selected-nft img {
  width: 100%;
  border-radius: 16px;
}

.selected-nft-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.selected-nft-info span {
  font-weight: 700;
  font-size: 16px;
}

.prize-action-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.change-nft-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 20px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
}

.remove-prize-btn {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: #ff4d4d;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.2s;
}

.remove-prize-btn:hover {
  background: rgba(255, 77, 77, 0.2);
  border-color: #ff4d4d;
  transform: scale(1.05);
}

.nft-prize.has-selected {
  aspect-ratio: auto;
  padding: 16px;
}

.raffle-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.raffle-balance-info {
  font-size: 12px;
  color: #B19EEF;
  font-weight: 700;
}

.raffle-submit-group {
  display: flex;
  align-items: center;
  gap: 24px;
}

.raffle-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #B19EEF;
}

.raffle-btn-create {
  background: #5CFCA9;
  color: #000;
  border: none;
  padding: 16px 40px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(92, 252, 169, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.raffle-btn-create:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.raffle-terms {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.raffle-terms h4 {
  color: #B19EEF;
  font-size: 14px;
  margin-bottom: 16px;
}

.raffle-terms ol {
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.8;
}

.raffle-terms li {
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .raffle-grid {
    grid-template-columns: 1fr;
  }
  
  .raffle-form-fields {
    grid-template-columns: 1fr;
  }
  
  .raffle-action-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  
  .raffle-submit-group {
    flex-direction: column;
    width: 100%;
  }
  
  .raffle-btn-create {
    width: 100%;
  }
}


/* Token Prize Styles */
.sidebar-token-icon {
  width: 64px !important;
  height: 64px !important;
  flex-shrink: 0; /* Prevents squeezing when text is long */
  border-radius: 12px;
  margin-bottom: 12px;
  object-fit: cover;
  background: none;
}

.token-prize-display {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  background: none; /* Removed the inner stretched background */
  border-radius: 0;
  margin-bottom: 20px;
}

.token-prize-symbol {
  font-size: 1rem;
  opacity: 0.9;
  color: #B19EEF;
  font-weight: 700;
}

.token-prize-amount {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  word-break: break-all; /* Prevents long numbers from stretching the UI */
  max-width: 100%;
  text-align: center;
}

.token-amount-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  padding: 5px 10px;
  width: 100%;
  margin-bottom: 10px;
  font-family: inherit;
  text-align: right;
}

.token-icon-placeholder {
  width: 48px;
  height: 48px;
  background: linear-gradient(90deg, #FFC0F5, #00E3FA, #5CFCA9, #FFD55F, #FF9161);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  color: #000;
  margin: 0 auto 12px;
}

.token-select-image {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  border-radius: 12px;
  margin: 0 auto 12px;
  display: block;
  background: rgba(255, 255, 255, 0.03);
}

.token-select-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.token-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff !important; /* Force white for washed color issue */
}

.token-symbol-mini {
  font-size: 11px;
  color: #B19EEF;
  font-weight: 600;
  text-transform: uppercase;
}

.token-balance {
  font-size: 11px;
  color: #fff;
  opacity: 0.7;
  margin-top: 4px;
}

.nft-item-select span {
  color: #fff !important; /* Ensure all modal spans are bright */
}

.token-prize.has-selected .raffle-selected-nft {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Countdown and Badges */
.countdown-value {
  color: #5CFCA9;
  font-weight: 800;
}

.raffle-prize-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(92, 252, 169, 0.9);
  color: #000;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.raffle-card-share {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.raffle-item-card:hover .raffle-card-share {
  opacity: 1;
}

.raffle-card-share button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: 
    linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)) padding-box,
    linear-gradient(90deg, #FFC0F5, #00E3FA, #5CFCA9, #FFD55F, #FF9161) border-box;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.2s, background 0.2s;
  font-size: 14px;
}

.raffle-card-share button:hover {
  transform: scale(1.1);
  background: 
    linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)) padding-box,
    linear-gradient(90deg, #FFC0F5, #00E3FA, #5CFCA9, #FFD55F, #FF9161) border-box;
}

/* Empty States */
.raffle-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 24px;
  margin: 20px 0;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 20px;
  display: block;
}

.raffle-empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #fff;
}

.raffle-empty-state p {
  opacity: 0.6;
  font-size: 14px;
}

/* Notifications */
.raffle-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 24px;
  border-radius: 16px;
  background: rgba(15, 20, 35, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  z-index: 10000;
  animation: slide-up 0.3s ease-out;
  max-width: 400px;
}

@keyframes slide-up {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.raffle-notification.success {
  border-left: 4px solid #5CFCA9;
}

.raffle-notification.info {
  border-left: 4px solid #00E3FA;
}

.raffle-notification.error {
  border-left: 4px solid #ff4d4d;
}

.notification-icon {
  font-size: 20px;
}

.notification-message {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

.notification-close {
  background: none;
  border: none;
  color: #fff;
  opacity: 0.5;
  font-size: 20px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.notification-close:hover {
  opacity: 1;
}

.raffle-item-limit-info {
  font-size: 11px;
  color: #FFD55F;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
  opacity: 0.9;
}

/* Sorting and Detail Modal */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.raffle-sort-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.raffle-sort-select {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: background-color 0.2s, border-color 0.2s; /* Specified transitions to avoid arrow sliding */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 140px;
}

.raffle-sort-select:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.raffle-sort-select option {
  background: #0f1423;
  color: #fff;
}

.detail-modal {
  max-width: 800px !important;
  width: 90% !important;
}

.raffle-detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.raffle-detail-image-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  align-self: start; /* Fix: Don't stretch if the right column is taller */
  background: rgba(255, 255, 255, 0.03);
}

.raffle-detail-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  margin: 0;
  padding: 0;
}

.raffle-detail-id {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.85); /* Slightly darker for better contrast */
  backdrop-filter: blur(8px);
  padding: 8px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  letter-spacing: 0.5px;
  /* Remove border-top to eliminate the visible "gap" line */
}

.raffle-detail-id span {
  color: #B19EEF;
  text-transform: uppercase;
  font-size: 10px;
}

.raffle-prize-badge.large {
  font-size: 14px;
  padding: 6px 14px;
  top: 15px;
  left: 15px;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 25px;
}

.detail-stat-item {
  background: rgba(255,255,255,0.03);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.detail-stat-item label {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.detail-stat-item span {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.detail-description h4 {
  margin: 0 0 10px;
  color: #B19EEF;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-description p {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.8;
  margin-bottom: 25px;
}

.detail-actions {
  margin-top: 20px;
}

.raffle-btn-buy.large {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  border-radius: 12px;
}

@media (max-width: 650px) {
  .raffle-detail-content {
    grid-template-columns: 1fr;
  }
}

.detail-buy-row {
  margin-top: 10px;
  gap: 15px;
}

.detail-buy-row .raffle-quantity-selector {
  height: 54px; /* Matches the large button height */
  padding: 0 10px;
}

.detail-buy-row .raffle-quantity-selector input {
  font-size: 18px;
  width: 40px;
}

.detail-buy-row .raffle-quantity-selector button {
  font-size: 20px;
  width: 32px;
}

.prize-bullet-list {
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prize-bullet {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
}

/* Winner Modal Styles */
.winner-backdrop {
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(15px) !important;
}

.winner-modal {
  background: linear-gradient(135deg, #0f1423 0%, #1a1f3d 100%) !important;
  border: 2px solid #5CFCA9 !important;
  max-width: 500px !important;
  max-height: 85vh !important;
  text-align: center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 24px !important;
  box-shadow: 0 0 50px rgba(92, 252, 169, 0.2) !important;
}

.winner-modal-content {
  padding: 30px 24px 20px;
  overflow-y: auto;
  flex: 1;
}

.winner-crown {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 15px rgba(92, 252, 169, 0.5));
}

.winner-modal-content h1 {
  font-size: 26px;
  font-weight: 900;
  color: #5CFCA9;
  margin-bottom: 6px;
  letter-spacing: 1.5px;
}

.winner-sub {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 20px;
}

.winner-prize-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.winner-prize-card img {
  width: 100%;
  max-height: 180px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
}

.winner-prize-card h3 {
  font-size: 16px;
  margin: 0;
  color: #fff;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  gap: 20px;
}

.modal-tab {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 0 0 8px;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s;
  position: relative;
}

.modal-tab.active {
  opacity: 1;
}

.modal-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #FFC0F5, #00E3FA, #5CFCA9, #FFD55F, #FF9161);
}

/* Leaderboard */
.leaderboard-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.leader-rank {
  font-weight: 800;
  color: #B19EEF;
  width: 40px;
  font-size: 14px;
}

.leader-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.leader-link {
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'JetBrains Mono', monospace;
}

.leader-link:hover {
  color: #B19EEF;
  text-shadow: 0 0 8px rgba(177, 158, 239, 0.4);
}

.leader-tickets {
  font-weight: 700;
  color: #5CFCA9;
  font-size: 14px;
  text-align: right;
  min-width: 80px;
}

/* Live Activity Feed - Toast Version */
.live-activity-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

@media (max-width: 640px) {
  .live-activity-toast-container {
    position: relative;
    bottom: auto;
    right: auto;
    width: 100%;
    display: flex;
    justify-content: center; /* Center the notification */
    padding: 10px 0;
    margin: 10px 0;
    pointer-events: auto;
    z-index: 50;
    min-height: 80px; /* Reserve space so UI doesn't jump */
  }

  .activity-toast {
    width: 90% !important; /* Take up most of the width */
    max-width: 320px !important;
    margin: 0 auto !important;
    flex-shrink: 0;
    animation: slideInRightMobile 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards !important;
  }
}

.activity-toast {
  background: rgba(15, 20, 35, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(92, 252, 169, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  width: 300px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 10px rgba(92, 252, 169, 0.1);
  animation: toastSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: auto;
  transition: all 0.5s ease;
  overflow: hidden;
  max-height: 100px;
}

@keyframes slideInRightMobile {
  0% {
    opacity: 0;
    transform: translateX(-100px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.activity-toast.exiting {
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
  max-height: 0;
  margin-bottom: -12px; /* Collapses the gap */
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  pointer-events: none;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(50px); }
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #B19EEF;
  margin-bottom: 6px;
}

.activity-dot {
  width: 6px;
  height: 6px;
  background: #5CFCA9;
  border-radius: 50%;
  box-shadow: 0 0 8px #5CFCA9;
  animation: pulse 2s infinite;
}

.activity-item {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.activity-wallet {
  color: #fff;
  font-weight: 700;
  font-family: monospace;
}

.activity-count {
  color: #5CFCA9;
  font-weight: 800;
}

.activity-raffle {
  color: #FFD55F;
  font-weight: 700;
}

/* Prize Type Indicators */
.raffle-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 3;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.raffle-type-badge.nft {
  background: rgba(0, 227, 250, 0.8); /* Cyan for NFT */
  color: #000;
}

.raffle-type-badge.token {
  background: rgba(177, 158, 239, 0.8); /* Purple for Token */
  color: #fff;
}

.raffle-type-badge.dual {
  background: linear-gradient(90deg, #00E3FA, #B19EEF);
  color: #000;
}

.prize-type-header {
  font-size: 10px;
  font-weight: 900;
  color: #00E3FA;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  width: 100%;
  text-align: center;
}

.prize-type-header.token {
  color: #B19EEF;
}

/* Ensure sharing buttons don't overlap badges */
.raffle-card-share {
  top: 40px !important; /* Move down a bit to clear type badge */
}

/* Mobile Header Optimization (iPhone/Smaller Screens) */
@media (max-width: 640px) {
  .staggered-menu-header {
    padding: 12px 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .sm-logo-img {
    height: 28px !important; 
  }

  .sm-toggle {
    padding: 0 14px !important;
    font-size: 14px !important; /* Made bigger */
    height: 38px !important; /* Made bigger */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .raffle-fixed-header {
    top: 16px !important;
    right: 100px !important;
    left: auto !important;
    transform: none !important;
    width: auto !important;
    z-index: 60 !important;
  }

  .raffle-header-actions {
    gap: 8px !important;
  }

  .raffle-header-actions button[class*="wallet-adapter-button"] {
    min-width: 70px !important;
    width: auto !important;
    height: 38px !important;
    min-height: 38px !important;
    line-height: 38px !important;
    padding: 0 10px !important;
    font-size: 11px !important; /* Show address text on mobile */
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .raffle-header-actions button[class*="wallet-adapter-button"]::before {
    content: "💳"; /* Neutral/Men's wallet style card */
    font-size: 16px;
    display: block;
    margin-right: 4px;
  }

  /* Hide the default ::after emoji we added before */
  .raffle-header-actions button[class*="wallet-adapter-button"]::after {
    display: none !important;
  }

  /* Adjust main container padding for larger header */
  .raffle-site {
    padding-top: 70px;
  }

  .raffle-container {
    padding: 20px 16px;
  }

  .raffle-btn-create-nav {
    display: none !important; /* Hide by default on desktop for non-creators */
  }

  .is-authorized .raffle-btn-create-nav {
    display: inline-flex !important; /* Show on desktop if authorized */
  }

  /* Center align the tabs in one line and place Create button under them */
  .raffle-nav {
    display: flex !important;
    flex-direction: row !important; /* Back to row for tabs */
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px 24px !important; /* Horizontal gap 24px, Vertical gap 10px */
    width: 100%;
  }

  .raffle-nav-item {
    font-size: 14px; /* Slightly smaller to ensure they fit on one line */
    padding: 8px 0;
    white-space: nowrap;
  }

  .raffle-btn-create-nav {
    display: inline-flex !important; /* Force show on mobile */
    flex-basis: 100%; /* Force this button to its own line */
    max-width: 220px;
    margin: 10px auto 0 !important;
    font-size: 14px;
    padding: 10px 20px;
    justify-content: center;
  }

  /* Center Active Raffles Title and Sort dropdown below it */
  .section-header {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }

  .section-title {
    margin-bottom: 0 !important;
    text-align: center !important;
  }

  .raffle-sort-wrapper {
    justify-content: center !important;
    width: 100% !important;
  }
}

/* NFT Collection Grouping Styles */
.collection-group-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.collection-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 10px;
}

.collection-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.collection-count-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(4px);
}

.collection-group-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-back-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
}

.modal-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-2px);
}

/* NFT Modal Mobile Grid Optimization */
@media (max-width: 640px) {
  .nft-list-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  
  .nft-item-select {
    padding: 10px !important;
  }

  .collection-group-name {
    font-size: 11px !important;
  }
}

/* Modal Text Contrast Fix */
.modal-loading, 
.modal-empty {
  color: #fff !important;
  opacity: 1 !important;
  font-weight: 600;
  font-size: 16px;
}

.modal-body {
  color: #fff !important;
}

/* Final NFT Selector Mobile Fit Fixes */
@media (max-width: 640px) {
  .nft-selection-modal {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 85vh !important;
    border-radius: 16px !important;
  }

  .modal-body {
    padding: 12px !important;
  }

  .nft-list-grid {
    gap: 8px !important;
  }

  .collection-group-card {
    padding: 8px !important;
  }

  .collection-group-name {
    font-size: 10px !important;
    margin-top: 4px !important;
    opacity: 0.9 !important;
  }

  .collection-count-badge {
    bottom: 4px !important;
    right: 4px !important;
    padding: 1px 6px !important;
    font-size: 9px !important;
  }

  .winner-modal {
    width: 92% !important;
    max-width: 92% !important;
    max-height: 90vh !important;
    margin: 0 auto;
  }

  .winner-modal-content {
    padding: 20px 16px !important;
  }

  .winner-prize-card {
    max-width: 220px !important;
    padding: 10px !important;
  }

  .winner-prize-card img {
    max-height: 140px !important;
  }

  .winner-modal-content h1 {
    font-size: 20px !important;
  }
}

/* Past Raffle Modal Styles */
.raffle-winner-display {
  background: rgba(92, 252, 169, 0.1);
  border: 1px solid rgba(92, 252, 169, 0.3);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-top: 10px;
}

.raffle-winner-display .winner-label {
  color: #5CFCA9;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 12px;
  display: block;
  opacity: 1;
}

.winner-link-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  font-family: monospace;
  transition: transform 0.2s;
}

.winner-link-large:hover {
  transform: scale(1.02);
  text-decoration: underline;
}

.winner-link-large span {
  font-size: 24px;
}

.picking-winner {
  color: #B19EEF;
  font-weight: 700;
  font-style: italic;
}

.winner-crown-emoji {
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
  cursor: help;
}

/* Admin Dashboard Styles */
.nav-creator-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.raffle-btn-admin-nav {
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(177, 158, 239, 0.1);
  border: 1px solid rgba(177, 158, 239, 0.3);
  color: #B19EEF;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.raffle-btn-admin-nav:hover {
  background: rgba(177, 158, 239, 0.2);
  transform: translateY(-1px);
}

.raffle-btn-admin-nav.active {
  background: #B19EEF;
  color: #000 !important;
  border-color: #B19EEF;
}

.admin-dashboard {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 20px;
}

/* Admin Dashboard Enhancements */
.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.admin-sub-nav {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sub-nav-btn {
  background: transparent;
  border: none;
  color: #888;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
}

.admin-sub-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.admin-sub-nav-btn.active {
  background: linear-gradient(135deg, #B19EEF 0%, #5227FF 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(82, 39, 255, 0.3);
}

/* Retro Terminal Styling */
.terminal-wrap {
  background: #000;
  border: 2px solid #333;
  border-radius: 8px;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin-top: 10px;
}

.terminal-header {
  background: #222;
  color: #5cfca9;
  padding: 8px 15px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #333;
}

.terminal-body {
  padding: 20px;
  color: #ccc;
  background: #000;
  height: 500px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: #0f0 #000;
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
  background: #000;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: #0f0;
  border-radius: 10px;
}

.terminal-line {
  margin-bottom: 5px;
  white-space: pre-wrap;
  word-break: break-all;
  opacity: 0.9;
  border-bottom: 1px solid rgba(0, 255, 0, 0.05);
  padding-bottom: 5px;
}

.terminal-line.error {
  color: #ff4d4d;
  border-bottom-color: rgba(255, 77, 77, 0.1);
}

.terminal-line.success {
  color: #5cfca9;
  border-bottom-color: rgba(92, 252, 169, 0.1);
}

.terminal-line.cancel {
  color: #ffd55f;
  border-bottom-color: rgba(255, 213, 95, 0.1);
}

.terminal-line:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
  .admin-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .admin-sub-nav {
    width: 100%;
    justify-content: space-between;
  }
  
  .admin-sub-nav-btn {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    font-size: 12px;
  }
  
  .terminal-body {
    font-size: 11px;
    padding: 10px;
  }
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.admin-stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.admin-stat-card label {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 700;
}

.admin-stat-card span {
  font-size: 24px;
  font-weight: 800;
  color: #5CFCA9;
}

/* NFT Visibility Controls */
.admin-visibility-controls {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 24px;
}

.admin-visibility-controls h3 {
  margin: 0 0 20px;
  font-size: 16px;
  color: #00E3FA;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.visibility-switches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.visibility-switch-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.visibility-switch-info label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  margin-bottom: 4px;
}

.visibility-switch-info p {
  margin: 0;
  font-size: 11px;
  opacity: 0.5;
}

/* Toggle Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #00E3FA;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.admin-visibility-controls.loading {
  opacity: 0.6;
  pointer-events: none;
}

.admin-leaderboards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.admin-leaderboard {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 24px;
}

.admin-leaderboard h3 {
  margin: 0 0 20px;
  font-size: 16px;
  color: #B19EEF;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.leader-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.wins-count {
  font-weight: 800;
  color: #5CFCA9;
}

.sub-detail {
  font-size: 10px;
  opacity: 0.6;
}

.admin-management {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 24px;
}

.admin-management h3 {
  margin: 0 0 20px;
  font-size: 16px;
  color: #ff4d4d;
  text-transform: uppercase;
  text-align: center;
}

.admin-raffle-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-raffle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-raffle-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-raffle-main img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.admin-raffle-info {
  display: flex;
  flex-direction: column;
}

.admin-raffle-name {
  font-weight: 700;
  font-size: 14px;
}

.admin-raffle-status {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

.admin-raffle-status.active { color: #5CFCA9; background: rgba(92, 252, 169, 0.1); }
.admin-raffle-status.ended { color: #ff4d4d; background: rgba(255, 77, 77, 0.1); }

.admin-btn-delete {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: #ff4d4d;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-btn-delete:hover {
  background: #ff4d4d;
  color: #fff;
}

.empty-text {
  opacity: 0.5;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

@media (max-width: 768px) {
  .nav-creator-buttons {
    flex-direction: column;
    width: 100%;
    gap: 10px;
    align-items: center;
  }
  
  .raffle-btn-admin-nav {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
  }

  .admin-leaderboards-row {
    grid-template-columns: 1fr;
  }
}

/* Admin Delete Button */
.admin-quick-delete-btn {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #ff4d4d !important;
  border: 1px solid rgba(255, 77, 77, 0.3) !important;
}

.admin-quick-delete-btn:hover {
  background: #ffffff !important;
  transform: scale(1.1) !important;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.3);
}

/* User Profile Styles */
.header-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 16px 4px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.header-profile-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.header-profile-btn img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-placeholder {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.header-username {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-edit-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.profile-edit-form .raffle-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-edit-form .raffle-input-dark {
  text-align: center;
  max-width: 300px;
}

/* Username Availability Status */
.username-status-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  min-height: 20px;
  width: 100%;
}

.username-status-wrap span {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-pfp-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-pfp-display {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  background-image: linear-gradient(#1a1a1a, #1a1a1a), 
                    conic-gradient(from 0deg, #FFC0F5, #00E3FA, #5CFCA9, #FFD55F, #FF9161, #FFC0F5);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(92, 252, 169, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.profile-pfp-display:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 227, 250, 0.3);
}

.profile-pfp-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pfp-placeholder {
  width: 100%;
  height: 100%;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: rgba(255, 255, 255, 0.3);
}

.pfp-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
}

.profile-pfp-display:hover .pfp-edit-overlay {
  opacity: 1;
}

.nft-item-select.selected {
  border-color: #5CFCA9;
  background: rgba(92, 252, 169, 0.1);
  box-shadow: 0 0 15px rgba(92, 252, 169, 0.3);
}

/* Fairness Styles */
.fairness-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fairness-explainer {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.9;
}

.fairness-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.fairness-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-num {
  width: 24px;
  height: 24px;
  background: #5CFCA9;
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 4px;
}

.fairness-step h4 {
  margin: 0 0 4px;
  color: #5CFCA9;
}

.fairness-step p {
  margin: 0;
  font-size: 13px;
  opacity: 0.7;
}

.fairness-data {
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fairness-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fairness-row label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
}

.seed-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
  color: #fff;
}

.fairness-verify {
  margin-top: 8px;
}

.fairness-tab-content {
  padding: 10px 0;
}

@media (max-width: 640px) {
  .header-username {
    display: none;
  }
  
  .header-profile-btn {
    padding: 4px;
  }
}
