:root {
  --rb-bg: #04091a;
  --rb-panel: rgba(17, 31, 70, 0.78);
  --rb-panel-strong: rgba(13, 21, 52, 0.94);
  --rb-border: rgba(106, 178, 255, 0.28);
  --rb-cyan: #27d6ff;
  --rb-purple: #8b55ff;
  --rb-pink: #f43bd3;
  --rb-gold: #ffcc48;
  --rb-text-soft: #b9c8ea;
}

* {
  box-sizing: border-box;
}

body.realmbeasts-body {
  margin: 0;
  min-height: 100vh;
  color: #fff;
  background:
    radial-gradient(circle at 14% 18%, rgba(44, 214, 255, 0.22), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(244, 59, 211, 0.2), transparent 30rem),
    linear-gradient(135deg, #031326 0%, #08091f 45%, #190b2c 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.realmbeasts-body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

.realmbeasts-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(4, 9, 26, 0.86);
  border-bottom: 1px solid var(--rb-border);
  backdrop-filter: blur(18px);
}

.realmbeasts-brand,
.realmbeasts-header nav,
.realmbeasts-header nav a {
  display: flex;
  align-items: center;
}

.realmbeasts-brand {
  gap: 0.7rem;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.realmbeasts-brand img {
  width: 44px;
  height: 44px;
}

.realmbeasts-header nav {
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.realmbeasts-header nav a {
  min-height: 42px;
  padding: 0 1rem;
  color: #dfe8ff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
}

.realmbeasts-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 2rem);
}

.realmbeasts-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: stretch;
  min-height: 480px;
}

.hero-copy,
.hero-card,
.game-panel,
.realmbeasts-loop article {
  border: 1px solid var(--rb-border);
  background: linear-gradient(145deg, rgba(24, 42, 90, 0.84), rgba(9, 15, 43, 0.9));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 460px;
  padding: clamp(1.4rem, 4vw, 3rem);
  border-radius: 28px;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: #82f4ff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3rem, 6.8vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 58ch;
  color: var(--rb-text-soft);
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.55;
}

.hero-actions,
.hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.primary-action,
.secondary-action {
  min-height: 52px;
  padding: 0 1.35rem;
  color: #fff;
  font: inherit;
  font-weight: 900;
  border-radius: 16px;
  cursor: pointer;
}

.primary-action {
  background: linear-gradient(135deg, #24c8ff, #7557ff 54%, #ee39c8);
  border: 0;
  box-shadow: 0 16px 38px rgba(93, 87, 255, 0.32);
}

.secondary-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.full-width {
  width: 100%;
}

.hero-card {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  border-radius: 32px;
}

.hero-card img {
  width: 100%;
  height: 100%;
  min-height: 460px;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgba(4, 9, 26, 0.86), transparent 54%);
}

.hero-card-overlay {
  position: absolute;
  left: 1.2rem;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 1;
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  background: rgba(4, 9, 26, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
}

.hero-card-overlay span {
  color: #82f4ff;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-card-overlay strong {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
}

.realmbeasts-loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.realmbeasts-loop article {
  padding: 1.1rem;
  border-radius: 22px;
}

.realmbeasts-loop span {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #061021;
  font-weight: 1000;
  background: linear-gradient(135deg, var(--rb-cyan), var(--rb-gold));
  border-radius: 14px;
}

.realmbeasts-loop h2,
.game-panel h2 {
  margin: 0.7rem 0 0.35rem;
  line-height: 1.05;
}

.realmbeasts-loop p,
.game-panel p,
.game-panel li {
  color: var(--rb-text-soft);
  font-weight: 650;
  line-height: 1.45;
}

.realmbeasts-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.game-panel {
  min-height: 280px;
  padding: 1.25rem;
  border-radius: 24px;
}

.hub-panel,
.battle-panel {
  grid-column: span 5;
}

.creature-panel,
.dex-panel {
  grid-column: span 4;
}

.hatch-panel,
.roadmap-panel {
  grid-column: span 3;
}

.hub-actions span {
  padding: 0.7rem 0.9rem;
  color: #fff;
  font-weight: 900;
  background: rgba(39, 214, 255, 0.12);
  border: 1px solid rgba(39, 214, 255, 0.28);
  border-radius: 999px;
}

.creature-stage {
  display: grid;
  place-items: center;
  min-height: 250px;
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(39, 214, 255, 0.22), transparent 44%),
    radial-gradient(circle at 70% 30%, rgba(244, 59, 211, 0.2), transparent 35%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
}

.creature-stage img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.stat-grid span {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  color: #dfe8ff;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.egg-shell {
  display: grid;
  place-items: center;
  min-height: 180px;
}

.egg-shell span {
  width: 116px;
  height: 148px;
  background:
    radial-gradient(circle at 34% 25%, #fff, transparent 18%),
    linear-gradient(135deg, #37e7ff, #8b55ff 55%, #f43bd3);
  border-radius: 56% 56% 48% 48%;
  box-shadow: 0 0 42px rgba(139, 85, 255, 0.68);
  animation: eggPulse 2.4s ease-in-out infinite;
}

@keyframes eggPulse {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

.battle-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.8rem;
  align-items: center;
  margin: 1rem 0;
}

.fighter {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
}

.versus {
  color: var(--rb-gold);
  font-size: 1.35rem;
  font-weight: 1000;
}

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

.hp span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #5aff91, var(--rb-cyan));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.rival .hp span {
  background: linear-gradient(90deg, #ff7a58, var(--rb-pink));
}

.dex-card {
  min-height: 190px;
  padding: 1rem;
  background:
    linear-gradient(145deg, rgba(255, 204, 72, 0.1), transparent),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 204, 72, 0.3);
  border-radius: 20px;
}

.rarity {
  display: inline-flex;
  padding: 0.45rem 0.7rem;
  color: #140a20;
  font-weight: 1000;
  background: var(--rb-gold);
  border-radius: 999px;
}

.roadmap-panel ul {
  padding-left: 1rem;
}

@media (max-width: 980px) {
  .realmbeasts-hero,
  .realmbeasts-loop {
    grid-template-columns: 1fr;
  }

  .hub-panel,
  .battle-panel,
  .creature-panel,
  .dex-panel,
  .hatch-panel,
  .roadmap-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .realmbeasts-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-copy h1 {
    font-size: clamp(2.6rem, 16vw, 4.5rem);
  }

  .hero-copy,
  .hero-card,
  .hero-card img {
    min-height: 380px;
  }

  .battle-arena {
    grid-template-columns: 1fr;
  }

  .versus {
    text-align: center;
  }
}
