:root {
  --bg-top: #21331f;
  --bg-bottom: #10190f;
  --panel: rgba(11, 20, 10, 0.84);
  --line: rgba(188, 230, 176, 0.16);
  --text: #f5fff2;
  --soft: #b8d1b4;
  --mint: #96ff8d;
  --gold: #ffd56b;
  --danger: #ff8d7b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(164, 219, 119, 0.18), transparent 36%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.monster-shell {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
  align-items: start;
}

.monster-sidebar,
.monster-main {
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

.monster-sidebar {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 2.3rem;
}

.intro,
.card p {
  color: var(--soft);
  line-height: 1.55;
}

.card {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--mint);
  text-decoration: none;
  font-weight: 700;
}

.monster-main {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.hud,
.bars {
  display: grid;
  gap: 12px;
}

.hud {
  grid-template-columns: repeat(4, 1fr);
}

.hud > div,
.bar-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hud span,
.bar-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--soft);
  font-size: 0.82rem;
}

.bars {
  grid-template-columns: repeat(2, 1fr);
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 100%;
}

.health-fill {
  background: linear-gradient(90deg, #8eff88, #3cd27b);
}

.attack-fill {
  background: linear-gradient(90deg, #ffd56b, #ff9958);
}

.arena-wrap {
  position: relative;
  width: min(100%, 960px);
  min-width: min(100%, 320px);
  margin: 0 auto;
}

canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #20341b;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 7, 4, 0.68);
  border-radius: 24px;
}

.overlay.visible {
  display: flex;
}

.overlay-card {
  width: min(560px, 100%);
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 32, 17, 0.98), rgba(9, 15, 8, 0.98));
  border: 1px solid rgba(150, 255, 141, 0.2);
}

.tag {
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.overlay-card p {
  color: var(--soft);
  line-height: 1.55;
}

.actions,
.upgrade-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #0b180a;
  background: linear-gradient(90deg, var(--mint), #e9ffd8);
}

.secondary,
.upgrade-buttons button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.hidden {
  display: none;
}

@media (max-width: 1280px) {
  .monster-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {

  .hud,
  .bars {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .monster-shell {
    padding: 12px;
    gap: 12px;
  }

  .monster-sidebar,
  .monster-main {
    border-radius: 18px;
  }

  .arena-wrap,
  canvas,
  .overlay {
    border-radius: 18px;
  }

  .overlay {
    padding: 12px;
  }

  .overlay-card {
    padding: 18px;
    border-radius: 18px;
  }
}
