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

:root {
  --primary: #0098EA;
  --primary-dark: #0074C4;
  --bg-deep: #0D1117;
  --bg-secondary: #161B22;
  --card-bg: rgba(28, 33, 40, 0.8);
  --card-border: rgba(0, 152, 234, 0.2);
  --success: #00D26A;
  --error: #FF6B6B;
  --text-primary: #FFFFFF;
  --text-muted: #8B949E;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.background-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: #6366F1;
  bottom: 20%;
  left: -50px;
  animation-delay: -5s;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--primary-dark);
  bottom: -50px;
  right: 20%;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(20px);
  background: rgba(13, 17, 23, 0.8);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.status-dot.connecting {
  background: #FFD93D;
  animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.disconnected {
  background: var(--text-muted);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.settings-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.settings-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(45deg);
}

.main-content {
  flex: 1;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 1.5rem;
}

.ton-diamond {
  position: relative;
  transition: transform 0.3s ease;
}

.ton-diamond:hover {
  transform: scale(1.05);
}

.ton-diamond.floating svg {
  animation: floating 3s ease-in-out infinite;
}

.ton-diamond.exploding svg {
  animation: explode 0.5s ease-out forwards;
}

@keyframes floating {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes explode {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.3) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  top: 50%;
  left: 50%;
  animation: confetti-fall 1.5s ease-out forwards;
  animation-delay: var(--delay);
}

@keyframes confetti-fall {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--rotation));
    opacity: 0;
  }
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 400px;
  line-height: 1.6;
}

.connect-btn {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: 2px solid transparent;
  border-radius: 16px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.connect-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--primary), #6366F1, var(--primary));
  border-radius: 16px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.connect-btn:hover::before {
  opacity: 1;
}

.connect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0, 152, 234, 0.4);
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.supported-wallets {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.wallet-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.wallet-badge {
  padding: 0.375rem 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(0, 152, 234, 0.4);
  box-shadow: 0 8px 32px rgba(0, 152, 234, 0.15);
}

.balance-card {
  background: linear-gradient(135deg, rgba(0, 152, 234, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
}

.balance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.balance-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.refresh-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.refresh-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.refresh-btn.spinning {
  animation: spin 1s linear infinite;
}

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

.balance-amount {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.balance-ton {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.balance-usd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: var(--text-muted);
}

.price-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1rem;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  width: fit-content;
}

.price-change.positive {
  background: rgba(0, 210, 106, 0.15);
  color: var(--success);
}

.price-change.negative {
  background: rgba(255, 107, 107, 0.15);
  color: var(--error);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.action-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.action-button:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 152, 234, 0.2);
}

.action-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  font-size: 1.25rem;
  color: white;
}

.action-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.address-card {
  padding: 1rem 1.5rem;
}

.address-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.address-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: var(--text-muted);
}

.address-actions {
  display: flex;
  gap: 0.5rem;
}

.copy-btn, .qr-btn {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.copy-btn:hover, .qr-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  transition: background 0.2s ease;
}

.transaction-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tx-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.25rem;
}

.tx-icon.incoming {
  background: rgba(0, 210, 106, 0.15);
  color: var(--success);
}

.tx-icon.outgoing {
  background: rgba(255, 107, 107, 0.15);
  color: var(--error);
}

.tx-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tx-amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.tx-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tx-status {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.625rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.tx-status.completed {
  background: rgba(0, 210, 106, 0.15);
  color: var(--success);
}

.tx-status.pending {
  background: rgba(255, 217, 61, 0.15);
  color: #FFD93D;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2rem;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--card-border);
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(20px);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ton-brand {
  font-weight: 700;
  color: var(--primary);
}

.network-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.625rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.network-badge.mainnet {
  background: rgba(0, 210, 106, 0.15);
  color: var(--success);
}

.network-badge.testnet {
  background: rgba(255, 217, 61, 0.15);
  color: #FFD93D;
}

.footer-right {
  display: flex;
  gap: 1rem;
}

.footer-right a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-right a:hover {
  color: var(--primary);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  border-color: var(--error);
  color: var(--error);
}

.qr-container {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.qr-placeholder {
  width: 200px;
  height: 200px;
  background: white;
  border-radius: 16px;
  padding: 1rem;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: 100%;
  height: 100%;
}

.qr-cell {
  border-radius: 2px;
}

.qr-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
  text-align: center;
}

.settings-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 12px;
}

.network-toggle {
  padding: 0.5rem 1rem;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s ease;
}

.network-toggle:hover {
  background: var(--primary-dark);
}

.disconnect-btn {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid var(--error);
  border-radius: 12px;
  color: var(--error);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s ease;
}

.disconnect-btn:hover {
  background: var(--error);
  color: white;
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }
  
  .balance-ton {
    font-size: 2rem;
  }
  
  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }
  
  .action-button {
    padding: 0.75rem 0.5rem;
  }
  
  .action-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .app-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
}