* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft JhengHei", sans-serif;
  background: #0D1117;
  color: #E6EDF3;
  line-height: 1.7;
  padding: 30px 20px;
}
.container { max-width: 800px; margin: 0 auto; }
.card {
  background: #161B22;
  padding: 32px 36px;
  border-radius: 14px;
  margin-bottom: 24px;
  border: 1px solid #2D303A;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.header { text-align: center; padding: 30px 0 20px 0; border-bottom: 3px solid #D4AF37; margin-bottom: 30px; }
.header .logo { font-size: 28px; font-weight: 700; color: #D4AF37; letter-spacing: 2px; }
.header .logo span { color: #58A6FF; }
.header .subtitle { font-size: 16px; color: #8B949E; margin-top: 4px; }
.header .tagline { font-size: 18px; color: #D4AF37; font-weight: 600; margin-top: 12px; font-style: italic; }
h1 { font-size: 26px; font-weight: 700; color: #D4AF37; margin-bottom: 12px; }
h2 { font-size: 20px; font-weight: 700; color: #D4AF37; margin: 28px 0 12px 0; padding-bottom: 8px; border-bottom: 2px solid #2D303A; }
p { margin-bottom: 12px; color: #8B949E; }
.text-gold { color: #D4AF37; font-weight: 600; }
.text-cyan { color: #58A6FF; }
.text-green { color: #3FB950; }
.input-group { margin: 16px 0; }
.input-group label { display: block; color: #D4AF37; font-weight: 600; margin-bottom: 8px; }
.input-group input {
  width: 100%;
  padding: 12px 16px;
  background: #0D1117;
  border: 2px solid #2D303A;
  border-radius: 8px;
  color: #E6EDF3;
  font-size: 16px;
  transition: border-color 0.3s;
}
.input-group input:focus { outline: none; border-color: #D4AF37; }
.btn {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(45deg, #D4AF37, #B8860B);
  color: #0D1117;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(212,175,55,0.3);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212,175,55,0.5); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-cyan {
  background: linear-gradient(45deg, #58A6FF, #1F6FEB);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(88,166,255,0.3);
}
.monster-area {
  text-align: center;
  padding: 40px 20px;
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
  margin: 20px 0;
  border: 2px dashed #2D303A;
}
.monster {
  font-size: 100px;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s;
  animation: float 2s ease-in-out infinite;
}
.monster:hover { transform: scale(1.1); }
.monster.hit { animation: shake 0.3s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}
.hp-bar {
  width: 100%;
  height: 20px;
  background: #0D1117;
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
  border: 1px solid #2D303A;
}
.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #F85149, #D4AF37);
  width: 100%;
  transition: width 0.3s;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.stat-item {
  background: rgba(255,255,255,0.02);
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid #2D303A;
}
.stat-item .num { font-size: 28px; font-weight: 700; color: #D4AF37; }
.stat-item .label { font-size: 13px; color: #8B949E; margin-top: 4px; }
.message {
  padding: 16px 20px;
  border-radius: 10px;
  margin: 16px 0;
  border-left: 4px solid #3FB950;
  background: rgba(63,185,80,0.08);
  color: #E6EDF3;
  font-weight: 600;
  display: none;
}
.message.show { display: block; }
.message.error {
  border-color: #F85149;
  background: rgba(248,81,73,0.08);
}
.rank-list { list-style: none; padding: 0; }
.rank-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #2D303A;
}
.rank-item .rank { font-size: 20px; font-weight: 700; color: #D4AF37; margin-right: 16px; min-width: 30px; }
.rank-item .name { flex: 1; color: #E6EDF3; font-weight: 600; }
.rank-item .score { color: #58A6FF; font-weight: 600; }
.nav-links { text-align: center; margin-top: 20px; }
.nav-links a {
  display: inline-block;
  padding: 10px 24px;
  background: rgba(88,166,255,0.1);
  color: #58A6FF;
  text-decoration: none;
  border-radius: 8px;
  margin: 4px;
  font-weight: 600;
  transition: all 0.3s;
}
.nav-links a:hover { background: rgba(88,166,255,0.2); }
.footer { text-align: center; padding: 30px 0 10px 0; color: #8B949E; font-size: 13px; border-top: 1px solid #2D303A; margin-top: 20px; }
.footer .sig { color: #D4AF37; font-weight: 700; }
@media (max-width: 640px) {
  .card { padding: 20px 16px; }
  .monster { font-size: 70px; }
  .header .logo { font-size: 22px; }
}
