:root {
  color-scheme: dark;
  --bg: #090b0a;
  --panel: rgba(17, 19, 17, 0.88);
  --panel-2: rgba(28, 31, 26, 0.88);
  --line: rgba(255, 255, 255, 0.13);
  --text: #f7f1df;
  --muted: #aeb6a3;
  --gold: #f2bd55;
  --green: #32d17c;
  --red: #df5947;
  --blue: #65b7ff;
  --violet: #a982ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.game-shell {
  min-height: 100vh;
  padding: 14px;
  background:
    linear-gradient(rgba(9, 11, 10, 0.14), rgba(9, 11, 10, 0.32)),
    url("./assets/warfront.png") center / cover fixed;
}

.topbar,
.bottomline,
.panel,
.skillbar {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

.topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(242, 189, 85, 0.6);
  background: linear-gradient(145deg, #6b2b1d, #1d1511);
  color: var(--gold);
  font-weight: 950;
}

.brand strong,
.panel__title span {
  display: block;
  font-weight: 950;
}

.brand small,
.hero-row small,
.loot-box small,
.bottomline,
.resource-strip {
  color: var(--muted);
}

.resource-strip {
  display: flex;
  gap: 8px;
}

.resource-strip span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.resource-strip b {
  color: var(--gold);
}

.play-button {
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  background: linear-gradient(180deg, #ffcd64, #c77b28);
  color: #170c05;
  font-weight: 950;
  cursor: pointer;
}

.game-grid {
  display: grid;
  grid-template-columns: 280px minmax(460px, 1fr) 300px;
  gap: 14px;
  min-height: calc(100vh - 118px);
  margin-top: 14px;
}

.panel {
  padding: 14px;
}

.panel__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel__title b {
  color: var(--green);
  font-size: 12px;
  text-transform: uppercase;
}

.hero-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
}

.hero-row i {
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.avatar {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  display: block;
}

.avatar--knight {
  background: linear-gradient(135deg, #d8d2c2, #58342b);
}

.avatar--rune {
  background: linear-gradient(135deg, var(--blue), #332366);
}

.avatar--beast {
  background: linear-gradient(135deg, var(--red), #27140f);
}

.avatar--leaf {
  background: linear-gradient(135deg, var(--green), #19351f);
}

.battlefield {
  min-height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
}

.map {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(38, 85, 57, 0.28) 1px, transparent 1px),
    linear-gradient(rgba(38, 85, 57, 0.28) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, rgba(255, 197, 80, 0.18), transparent 22%),
    linear-gradient(140deg, rgba(21, 42, 33, 0.95), rgba(35, 28, 21, 0.94));
  background-size: 56px 56px, 56px 56px, auto, auto;
}

.keep,
.boss,
.node,
.unit {
  position: absolute;
}

.keep {
  width: 144px;
  height: 124px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(13, 14, 12, 0.8);
  text-align: center;
  font-weight: 950;
}

.keep span {
  width: 34px;
  height: 34px;
  display: block;
  background: var(--gold);
  clip-path: polygon(50% 0, 100% 30%, 84% 100%, 16% 100%, 0 30%);
}

.keep--left {
  left: 5%;
  top: 12%;
}

.keep--right {
  right: 5%;
  bottom: 14%;
}

.boss {
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 2px solid rgba(223, 89, 71, 0.75);
  background: radial-gradient(circle, rgba(223, 89, 71, 0.52), rgba(24, 11, 8, 0.92));
  text-align: center;
}

.boss__ring {
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(255, 236, 210, 0.38);
}

.boss strong,
.boss small {
  position: relative;
}

.boss small {
  color: #ffc2b6;
}

.node {
  min-width: 84px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #dcead2;
  font-weight: 900;
  text-align: center;
}

.node--mine {
  left: 24%;
  bottom: 20%;
}

.node--tower {
  right: 28%;
  top: 20%;
}

.node--camp {
  right: 18%;
  bottom: 38%;
}

.path {
  position: absolute;
  height: 7px;
  background: rgba(242, 189, 85, 0.28);
  transform-origin: left center;
}

.path--one {
  width: 52%;
  left: 18%;
  top: 29%;
  transform: rotate(18deg);
}

.path--two {
  width: 50%;
  left: 32%;
  bottom: 28%;
  transform: rotate(-24deg);
}

.unit {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(50, 209, 124, 0.16);
}

.unit--one {
  left: 33%;
  top: 35%;
}

.unit--two {
  left: 41%;
  bottom: 35%;
}

.unit--three {
  right: 37%;
  top: 30%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(101, 183, 255, 0.16);
}

.unit--four {
  right: 29%;
  bottom: 30%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(223, 89, 71, 0.16);
}

.skillbar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 10px;
}

.skillbar button {
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  color: var(--text);
  cursor: pointer;
}

.skillbar b {
  color: var(--gold);
}

.skillbar span {
  color: var(--muted);
  font-size: 12px;
}

.minimap {
  position: relative;
  height: 180px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,0.12) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(255,255,255,0.12) 50%, transparent 51%),
    #141b17;
}

.dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--gold);
}

.dot--a {
  left: 20%;
  top: 28%;
}

.dot--b {
  right: 22%;
  bottom: 24%;
  background: var(--red);
}

.dot--c {
  left: 46%;
  top: 52%;
  background: var(--green);
}

.dot--d {
  right: 34%;
  top: 18%;
  background: var(--blue);
}

.quest {
  margin-bottom: 14px;
}

.quest strong {
  display: block;
  margin-bottom: 8px;
}

.quest span {
  display: block;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.quest i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.loot-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(242, 189, 85, 0.34);
  background: rgba(242, 189, 85, 0.1);
}

.loot-box strong {
  display: block;
  margin: 5px 0;
  font-size: 24px;
}

.loot-box p {
  margin: 0;
  color: var(--muted);
}

.bottomline {
  min-height: 46px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 10px 14px;
  font-size: 13px;
}

@media (max-width: 1080px) {
  .game-grid {
    grid-template-columns: 1fr;
  }

  .party-panel,
  .quest-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }

  .panel__title,
  .minimap,
  .loot-box {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .game-shell {
    padding: 10px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .resource-strip {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .party-panel,
  .quest-panel,
  .skillbar {
    grid-template-columns: 1fr;
  }

  .map {
    min-height: 520px;
  }

  .keep {
    width: 118px;
    height: 104px;
  }

  .boss {
    width: 136px;
    height: 136px;
  }

  .bottomline {
    flex-direction: column;
    align-items: flex-start;
  }
}
