:root {
  --bg: #0f1624;
  --panel: #182233;
  --accent: #4fd1c5;
  --accent-2: #f6ad55;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --danger: #f56565;
  --success: #48bb78;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 20% 20%, rgba(79, 209, 197, 0.15), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(246, 173, 85, 0.18), transparent 35%),
    var(--bg);
  color: var(--text);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.meta span {
  margin-left: 12px;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.battle, .upgrades {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.battle .boss-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

button {
  background: var(--accent);
  color: #0a0f1a;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button:disabled {
  background: #334155;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79, 209, 197, 0.3);
}

.boss-timer { color: var(--muted); }

.entity {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.entity-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}

.hp-bar {
  width: 100%;
  height: 12px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.15s ease;
}

.monster .hp-fill { background: linear-gradient(90deg, #f56565, #f6ad55); }

.log {
  max-height: 240px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  padding-right: 4px;
}

.upgrades h2 { margin-top: 0; }

.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  padding: 10px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text);
}

.stat-row span:last-child {
  color: var(--accent-2);
  font-weight: 700;
}

.upgrade-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.card .title { font-weight: 700; }
.card .desc { color: var(--muted); font-size: 13px; }
.card .cost { color: var(--accent-2); font-weight: 600; }

.actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.danger {
  background: var(--danger);
  color: #fff;
}

.hint { color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}
.log .warn { color: var(--accent-2); }
.log .danger {
  color: var(--danger);
  background: transparent;
}
