* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(50, 50, 50, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(40, 40, 40, 0.3) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  gap: 20px;
}

.watermark {
  font-weight: 700;
  font-size: 18px;
  color: rgba(128, 128, 128, 0.75);
  text-align: center;
  position: relative;
  z-index: 10;
}

.connect-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 18px 48px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 10;
  will-change: transform, box-shadow;
  transform: translateZ(0);
}

.connect-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.connect-btn:active {
  transform: translate3d(0, 0, 0);
}

/* Modal styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  will-change: opacity;
  transform: translateZ(0);
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
  overflow: hidden;
  will-change: transform, opacity;
  transform: translateZ(0);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate3d(0, -50px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

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

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
}

.help-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.wallet-list {
  padding: 20px 24px;
  max-height: 500px;
  overflow-y: auto;
}

.wallet-list::-webkit-scrollbar {
  width: 8px;
}

.wallet-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.wallet-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.wallet-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.get-started-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.get-started-link:hover {
  color: #ffffff;
}

/* Wallet list items */
.wallet-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
  will-change: transform, background-color, border-color;
  transform: translateZ(0);
}

.wallet-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translate3d(4px, 0, 0);
}

.wallet-item:last-child {
  margin-bottom: 0;
}

/* All Wallets Button */
.all-wallets-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.all-wallets-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translate3d(4px, 0, 0);
}

.all-wallets-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

.all-wallets-icons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  width: 33px;
  height: 33px;
}

.preview-icon {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.all-wallets-text {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.all-wallets-count {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.wallet-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  flex-shrink: 0;
}

.wallet-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.wallet-meta {
  flex: 1;
  min-width: 0;
}

.wallet-name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.wallet-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.pill.installed {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.pill.not-installed {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

/* All wallets modal styles */
.modal-container.all-wallets-mode .wallet-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.modal-container.all-wallets-mode .wallet-item {
  flex-direction: column;
  text-align: center;
  padding: 12px;
  margin-bottom: 0;
  width: 91px;
  height: 91px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.modal-container.all-wallets-mode .wallet-icon {
  margin-right: 0;
  margin-bottom: 6px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.modal-container.all-wallets-mode .wallet-name {
  font-size: 12px;
  margin-bottom: 0;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  width: 100%;
}

.modal-container.all-wallets-mode .wallet-desc {
  display: none;
}

.modal-container.all-wallets-mode .pill {
  display: none;
}

/* Wallet Info Modal */
.wallet-info-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  will-change: opacity;
  transform: translateZ(0);
}

.wallet-info-modal.active {
  display: flex;
}

.wallet-info-modal-content {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  max-width: 314px;
  width: 100%;
  max-height: 471px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
  transform: translateZ(0);
}

.wallet-info-modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.wallet-info-modal-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  flex: 1;
  text-align: center;
  margin: 0 6px;
}

.wallet-info-back-btn,
.wallet-info-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.wallet-info-back-btn:hover,
.wallet-info-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.wallet-info-modal-body {
  padding: 12px 16px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wallet-info-modal-body::-webkit-scrollbar {
  width: 8px;
}

.wallet-info-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.wallet-info-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.wallet-info-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.info-section {
  margin-bottom: 16px;
  text-align: center;
}

.info-section:last-of-type {
  margin-bottom: 12px;
}

.icon-group {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  overflow: hidden;
  will-change: transform;
  transform: translateZ(0);
}

.icon svg {
  width: 100%;
  height: 100%;
}

.icon:hover {
  transform: translate3d(0, -4px, 0);
}

.icon-key {
  background: transparent;
}

.icon-user {
  background: transparent;
}

.icon-lock {
  background: transparent;
}

.icon-leaf {
  background: transparent;
}

.icon-wallet {
  background: transparent;
}

.icon-coins {
  background: transparent;
}

.icon-ethereum {
  background: transparent;
}

.icon-ticket {
  background: transparent;
}

.icon-layers {
  background: transparent;
}

.info-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.2;
}

.info-section p {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.3;
  max-width: 100%;
  margin: 0 auto;
}

.get-wallet-btn {
  width: 100%;
  padding: 8px 12px;
  background: linear-gradient(135deg, #5b5bd6 0%, #4a4ac4 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(91, 91, 214, 0.3);
  margin-top: 8px;
  flex-shrink: 0;
  will-change: transform, box-shadow;
  transform: translateZ(0);
}

.get-wallet-btn svg {
  width: 14px;
  height: 14px;
}

.get-wallet-btn:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 12px 32px rgba(91, 91, 214, 0.4);
}

.get-wallet-btn:active {
  transform: translate3d(0, 0, 0);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.wallet-info-modal.active .icon {
  animation: fadeInUp 0.5s ease backwards;
}

.wallet-info-modal.active .icon:nth-child(1) {
  animation-delay: 0.1s;
}

.wallet-info-modal.active .icon:nth-child(2) {
  animation-delay: 0.2s;
}

.wallet-info-modal.active .icon:nth-child(3) {
  animation-delay: 0.3s;
}

@media (max-width: 480px) {
  .wallet-info-modal {
    padding: 0;
  }

  .wallet-info-modal-content {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 95vh;
  }
  
  .wallet-info-modal-body {
    max-height: calc(95vh - 80px);
  }

  .wallet-info-modal-header h2 {
    font-size: 18px;
  }

  .icon-group {
    gap: 12px;
  }

  .icon {
    width: 48px;
    height: 48px;
  }

  .icon svg {
    width: 28px;
    height: 28px;
  }

  .info-section h3 {
    font-size: 18px;
  }

  .info-section p {
    font-size: 14px;
  }

  .wallet-info-modal-body {
    padding: 20px 24px;
  }
}
