
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --primary: #FFD700;
  --secondary: #1E1E1E;
  --accent: #FF4500;
  --dark-accent: #CC0000;
  --vip-gold: linear-gradient(135deg, #FFD700, #FFA500);
  --vip-silver: linear-gradient(135deg, #C0C0C0, #A0A0A0);
  --vip-bronze: linear-gradient(135deg, #CD7F32, #A0522D);
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Press Start 2P', cursive;
  background-color: var(--secondary);
  color: var(--primary);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 215, 0, 0.05) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(255, 69, 0, 0.05) 0%, transparent 20%);
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
  position: relative;
}

.header {
  margin-bottom: 2rem;
  position: relative;
}

.logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-shadow: 4px 4px 0 var(--accent);
  letter-spacing: 2px;
}

.sub-logo {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.connect-btn {
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 0.9rem;
  font-family: 'Press Start 2P', cursive;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.5rem;
  box-shadow: 0 4px 0 #3a3f9e;
  transition: all 0.3s;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 1rem;
}

.social-link {
  color: var(--primary);
  font-size: 1.5rem;
  transition: all 0.3s;
}

.social-link:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.game-panel {
  background: rgba(30, 30, 30, 0.8);
  border: 4px solid var(--primary);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
  margin-bottom: 2rem;
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  margin: 0.5rem;
  min-width: 120px;
}

.stat-value {
  font-size: 1.5rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

.mine-btn {
  background: linear-gradient(135deg, var(--accent), #FF8C00);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-family: 'Press Start 2P', cursive;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 5px 0 var(--dark-accent);
  position: relative;
  overflow: hidden;
  margin: 0.5rem;
}

.mine-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 var(--dark-accent);
}

.mine-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--dark-accent);
}

.mine-btn:disabled {
  background: #666;
  cursor: not-allowed;
  box-shadow: 0 5px 0 #333;
}

.mine-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(45deg);
  transition: all 0.5s;
}

.mine-btn:hover:not(:disabled)::after {
  left: 100%;
}

.address {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2rem;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status {
  margin-top: 1rem;
  min-height: 1.5rem;
  color: var(--accent);
}

.cooldown {
  margin-top: 1rem;
  color: #FF6347;
}

.loader {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 4px solid rgba(255, 215, 0, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
  margin-left: 10px;
  vertical-align: middle;
}

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

.leaderboard {
  margin-top: 2rem;
  background: rgba(30, 30, 30, 0.8);
  border: 3px solid var(--primary);
  border-radius: 8px;
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.leaderboard h3 {
  margin-top: 0;
  color: var(--accent);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  border-bottom: 1px solid #444;
}

.leaderboard-item:nth-child(odd) {
  background: rgba(255, 215, 0, 0.05);
}

.leaderboard-address {
  text-align: left;
  flex: 2;
  display: flex;
  align-items: center;
}

.leaderboard-score {
  text-align: right;
  flex: 1;
  color: var(--accent);
}

.tab-container {
  display: flex;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  padding: 0.5rem;
  background: #333;
  border: none;
  border-bottom: 3px solid transparent;
  color: white;
  font-family: 'Press Start 2P', cursive;
  cursor: pointer;
}

.tab.active {
  border-bottom: 3px solid var(--accent);
  background: #444;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

@keyframes mining {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

.mining-animation {
  animation: mining 0.5s ease-in-out;
}

.progress-container {
  width: 100%;
  background-color: #333;
  border-radius: 5px;
  margin: 1rem 0;
  overflow: hidden;
}

.progress-bar {
  height: 20px;
  background: linear-gradient(90deg, var(--accent), #FF8C00);
  width: 0%;
  transition: width 0.3s;
  text-align: center;
  line-height: 20px;
  font-size: 0.7rem;
}

.vip-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  margin-left: 0.5rem;
  color: black;
}

.vip-gold {
  background: var(--vip-gold);
}

.vip-silver {
  background: var(--vip-silver);
}

.vip-bronze {
  background: var(--vip-bronze);
}

.vip-info {
  text-align: left;
  padding: 1rem;
}

.vip-tier {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.vip-tier h4 {
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.vip-tier p {
  color: #AAA;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.vip-tier ul {
  list-style-type: none;
  padding-left: 1rem;
}

.vip-tier li {
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: #DDD;
}

.vip-tier li:before {
  content: "•";
  color: var(--accent);
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

/* 钱包菜单和头像样式 */
.wallet-menu {
  position: relative;
  display: inline-block;
}

.wallet-dropdown {
  display: none;
  position: absolute;
  background-color: #333;
  min-width: 240px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  right: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--primary);
}

.wallet-dropdown button {
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  cursor: pointer;
}

.wallet-dropdown button:hover {
  background-color: #444;
}

.wallet-menu:hover .wallet-dropdown {
  display: block;
}

.miner-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 10px;
  display: inline-block;
  background-size: cover;
  background-position: center;
  border: 2px solid var(--primary);
}

.leaderboard-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 5px;
  display: inline-block;
  background-size: cover;
  background-position: center;
  vertical-align: middle;
}

.wallet-options {
  display: none;
  gap: 10px;
  margin-top: 10px;
}

.wallet-option {
  padding: 8px 12px;
  background: #444;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}

.wallet-option:hover {
  background: #555;
}
.wallet-options.active {
    display: flex;
  }

@media (max-width: 600px) {
  .logo {
    font-size: 2rem;
  }

  .sub-logo {
    font-size: 1rem;
  }

  .game-panel {
    padding: 1rem;
  }

  .stat-item {
    min-width: 100px;
  }

  .mine-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  .tab {
    font-size: 0.8rem;
    padding: 0.5rem 0.3rem;
  }

  .vip-tier {
    padding: 0.8rem;
  }

  .wallet-dropdown {
    min-width: 140px;
  }
}
.connect-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
  }

  .connect-btn:hover {
    background-color: #0056b3;
    transform: scale(1.05);
  }

  /* 优化钱包选项容器 */
  .wallet-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    background-color: #f8f9fa;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
   /* 优化单个钱包选项 */
   .wallet-option {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
  }

  .wallet-option:hover {
    background-color: #f1f1f1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  .wallet-option i,
  .wallet-option img {
    margin-right: 10px;
  }
  .upgrades-info {
    text-align: left;
    padding: 1rem;
  }
  
  .upgrade-category {
    margin-bottom: 2rem;
  }
  
  .upgrade-category h4 {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .upgrade-info {
    flex: 1;
  }
  
  .upgrade-name {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.3rem;
  }
  
  .upgrade-desc {
    color: #AAA;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }
  
  .upgrade-level {
    color: #DDD;
    font-size: 0.9rem;
  }
  
  .upgrade-btn {
    background: linear-gradient(135deg, var(--accent), #FF8C00);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    margin-left: 1rem;
  }
  
  .upgrade-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 var(--dark-accent);
  }
  
  .upgrade-btn:disabled {
    background: #666;
    cursor: not-allowed;
  }
  
  .max-level {
    background: var(--vip-gold);
    color: black;
  }
  .shop-item {
    background: rgba(30, 30, 30, 0.8);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem;
    text-align: center;
    transition: all 0.3s;
  }
  
  .shop-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
  }
  
  .equipment-canvas {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    image-rendering: pixelated;
  }
  
  .equipment-name {
    font-weight: bold;
    margin: 0.5rem 0;
    height: 25px;
    color: var(--primary);
  }
  .equipment-stats {
    font-size: 0.8rem;
    color: #AAA;
    margin-bottom: 0.5rem;
  }
  
  .equipment-price {
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 0.5rem;
  }
  
  .buy-btn {
    background: linear-gradient(135deg, var(--accent), #FF8C00);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
  }
  
  .buy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 var(--dark-accent);
  }
  .buy-btn:disabled {
    background: #666;
    cursor: not-allowed;
  }
  
  .shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
  }
  
  .equipment-category {
    margin-bottom: 2rem;
  }
  
  .equipped-badge {
    background: var(--accent);
    color: black;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-top: 0.5rem;
    display: inline-block;
  }
  .shop-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .equipment-category {
    margin: 20px 0;
    width: 100%;
  }

  .shop-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .shop-item {
    background-color: #222;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    width: 120px;
    font-size: 12px;
    box-shadow: 0 0 5px #444;
  }

  .equipment-name {
    font-weight: bold;
    margin-bottom: 5px;
  }



  .equipment-price {
    margin: 5px 0;
    color: #ffd700;
  }

  .buy-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    background-color: #333;
    color: white;
    cursor: pointer;
    border-radius: 4px;
  }

  .buy-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
  }

  .equipped-badge {
    margin-top: 5px;
    color: #00ff99;
    font-size: 11px;
  }
  .shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
  }
  
  .shop-item {
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }
  
  .equipment-name {
    font-weight: bold;
    margin-bottom: 10px;
  }
  
  .equipment-price {
    margin: 10px 0;
    color: var(--accent);
  }
  
  .buy-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
  }
  
  .buy-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
  }
  
  .equipment-canvas {
    image-rendering: pixelated;
    margin: 0 auto;
  }