:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #f4ead5;
  background: #0b120d;
  --cream: #f4ead5;
  --ink: #131b14;
  --moss: #6f8c42;
  --gold: #e9b94d;
  --red: #bd493c;
}
* {
  box-sizing: border-box;
}
html,
body,
#game {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  background: #0b120d;
  touch-action: none;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  overflow: auto;
  padding: 30px;
  background:
    radial-gradient(
      circle at 70% 20%,
      rgba(84, 116, 57, 0.38),
      transparent 40%
    ),
    linear-gradient(135deg, rgba(6, 12, 7, 0.9), rgba(14, 25, 15, 0.96));
}
.screen.active {
  display: grid;
}
.screen:before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image: repeating-linear-gradient(
    40deg,
    transparent 0 30px,
    #fff 31px 32px
  );
}
.title-card {
  position: relative;
  width: min(980px, 100%);
}
.kicker {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.22em;
}
.title-card h1 {
  margin: 0;
  font:
    900 clamp(64px, 12vw, 150px) / 0.72 Georgia,
    serif;
  letter-spacing: -0.075em;
  text-transform: uppercase;
}
.title-card h1 em {
  color: #8fb654;
  font-style: normal;
}
.lede {
  max-width: 620px;
  margin: 35px 0 25px;
  font-size: clamp(16px, 2vw, 23px);
  line-height: 1.45;
  color: #d7d1bf;
}
.factions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.factions button,
.dialog-actions button {
  appearance: none;
  border: 1px solid rgba(244, 234, 213, 0.32);
  border-radius: 12px;
  background: rgba(244, 234, 213, 0.07);
  color: var(--cream);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  transition: 0.18s;
}
.factions button:hover,
.factions button:focus-visible {
  border-color: var(--gold);
  background: rgba(233, 185, 77, 0.14);
  transform: translateY(-4px);
}
.factions span {
  display: block;
  font-size: 30px;
  margin-bottom: 18px;
}
.factions b,
.factions small {
  display: block;
}
.factions b {
  font:
    800 17px/1.2 Georgia,
    serif;
}
.factions small {
  margin-top: 7px;
  color: #b8b6a9;
  line-height: 1.35;
}
.controls-hint {
  margin: 24px 0 0;
  color: #9e9f95;
  font-size: 12px;
}
.controls-hint b {
  color: var(--cream);
}
.hidden {
  display: none !important;
}
#hud {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 5;
}
.brand {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
}
.brand button {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(244, 234, 213, 0.4);
  border-radius: 50%;
  background: rgba(10, 16, 11, 0.64);
  color: white;
}
.mission {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  text-align: center;
  text-shadow: 0 2px 8px #000;
}
.mission small {
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
}
.mission b {
  margin-top: 4px;
  font:
    700 15px Georgia,
    serif;
}
.bars {
  position: absolute;
  left: 20px;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(290px, 45vw);
}
.bars > div {
  display: grid;
  grid-template-columns: 95px 1fr 28px;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.bars span {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}
.bars i,
.boss i {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(244, 234, 213, 0.48);
  background: rgba(4, 7, 4, 0.65);
}
.bars i b,
.boss i b {
  display: block;
  height: 100%;
  width: 100%;
  background: #ba4738;
  transition: width 0.2s;
}
.bars > div:nth-child(2) i b {
  background: #d9b24d;
}
.bars strong {
  font-size: 10px;
}
.injuries {
  position: absolute;
  right: 18px;
  top: 18px;
  display: grid;
  gap: 5px;
}
.injuries span {
  padding: 7px 10px;
  border: 1px solid rgba(244, 234, 213, 0.35);
  border-radius: 4px;
  background: rgba(100, 21, 19, 0.82);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.toast {
  position: fixed;
  z-index: 9;
  left: 50%;
  bottom: 18%;
  max-width: min(520px, 85vw);
  transform: translate(-50%, 20px);
  padding: 12px 17px;
  border: 1px solid rgba(244, 234, 213, 0.3);
  border-radius: 7px;
  background: rgba(7, 12, 8, 0.88);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transition: 0.22s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.prompt {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: 28%;
  transform: translateX(-50%);
  padding: 10px 15px;
  border-radius: 6px;
  background: rgba(5, 9, 6, 0.75);
  font-size: 12px;
}
.zone-label {
  position: fixed;
  z-index: 7;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 3px 10px #000;
  animation: zone 3s both;
}
.zone-label small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.2em;
}
.zone-label b {
  font:
    900 clamp(24px, 4vw, 48px) Georgia,
    serif;
  text-transform: uppercase;
}
@keyframes zone {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, -15px);
  }
  15%,
  70% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
#crosshair {
  position: fixed;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}
.blind {
  position: fixed;
  z-index: 6;
  top: 0;
  right: 0;
  width: 52%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle at left, rgba(0, 0, 0, 0.45), #000 65%);
  opacity: 0.95;
}
.boss {
  position: fixed;
  z-index: 6;
  top: 70px;
  left: 50%;
  width: min(360px, 70vw);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}
.boss span {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.boss i b {
  background: #8d3737;
}
.mobile {
  position: fixed;
  z-index: 8;
  inset: 0;
  pointer-events: none;
}
.mobile button,
.stick {
  pointer-events: auto;
  position: absolute;
}
.stick {
  left: 24px;
  bottom: 28px;
  width: 108px;
  height: 108px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(3, 6, 4, 0.25);
}
.stick i {
  position: absolute;
  left: 34px;
  top: 34px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}
.mobile button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(38, 54, 35, 0.65);
  color: white;
  font-size: 10px;
  font-weight: 900;
}
.mobile #attackBtn {
  right: 24px;
  bottom: 30px;
  width: 76px;
  height: 76px;
}
.mobile #actionBtn {
  right: 112px;
  bottom: 28px;
  width: 48px;
  height: 48px;
}
.mobile #orderBtn {
  right: 28px;
  bottom: 116px;
  width: 48px;
  height: 48px;
}
dialog {
  width: min(540px, calc(100% - 28px));
  border: 1px solid #4f5c4b;
  border-radius: 16px;
  background: #151f17;
  color: var(--cream);
  padding: 0;
  box-shadow: 0 30px 90px #000;
}
dialog::backdrop {
  background: rgba(3, 7, 4, 0.72);
  backdrop-filter: blur(7px);
}
.dialog-card {
  position: relative;
  padding: 30px;
}
.close {
  position: absolute;
  right: 18px;
  top: 15px;
  border: 0;
  background: none;
  color: white;
  font-size: 26px;
}
.dialog-card h2 {
  margin: 0 0 22px;
  font:
    800 42px Georgia,
    serif;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #3b4939;
  border: 1px solid #3b4939;
}
.stats div {
  padding: 13px;
  background: #19241b;
}
.stats small,
.stats b {
  display: block;
}
.stats small {
  font-size: 8px;
  letter-spacing: 0.1em;
  color: #99a494;
}
.stats b {
  margin-top: 4px;
  font-size: 16px;
}
.dialog-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.dialog-actions button {
  text-align: center;
  font-weight: 800;
  padding: 12px;
}
.dialog-actions button:hover {
  background: #33452f;
}
.dialog-actions .danger {
  color: #ef9e92;
}
.tiny {
  font-size: 10px;
  color: #8f998c;
  text-align: center;
}
.damage-flash {
  animation: damage 0.35s;
}
@keyframes damage {
  50% {
    box-shadow: inset 0 0 120px rgba(180, 20, 10, 0.8);
  }
}
@media (max-width: 720px) {
  .screen {
    padding: 20px;
  }
  .title-card h1 {
    font-size: 64px;
  }
  .lede {
    margin: 24px 0 18px;
  }
  .factions {
    grid-template-columns: 1fr;
  }
  .factions button {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 2px 10px;
    padding: 12px;
  }
  .factions span {
    grid-row: 1/3;
    margin: 0;
    font-size: 25px;
  }
  .factions small {
    margin: 2px 0;
  }
  .controls-hint {
    display: none;
  }
  .mission {
    top: 66px;
    width: 80%;
  }
  .bars {
    bottom: 150px;
    width: 180px;
  }
  .bars > div {
    grid-template-columns: 70px 1fr 24px;
  }
  .brand span {
    display: none;
  }
  .injuries {
    top: 18px;
  }
  .mobile:not(.hidden) {
    display: block !important;
  }
}

.raid-timer {
  position: absolute;
  top: max(66px, calc(env(safe-area-inset-top) + 48px));
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 9px;
  border-radius: 4px;
  background: rgba(8, 14, 9, 0.56);
  color: #ded8c8;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}
.raid-timer b {
  color: var(--gold);
}
.radar-wrap {
  position: absolute;
  right: 18px;
  bottom: 24px;
  width: 160px;
}
.radar-wrap canvas {
  width: 160px;
  height: 160px;
  border: 1px solid rgba(244, 234, 213, 0.45);
  border-radius: 50%;
  background: rgba(7, 12, 8, 0.72);
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}
.radar-wrap small {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 5px;
  color: #ddd6c5;
  font-size: 7px;
}
.radar-wrap small i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d84b42;
}
.radar-wrap small i:nth-of-type(2) {
  background: #62d987;
}
.radar-wrap small i:nth-of-type(3) {
  background: #efbd48;
}
.game-over-card > p:not(.kicker) {
  color: #c6c5ba;
  line-height: 1.5;
}
.game-over-card h2 {
  color: #e57a68;
}

@media (max-width: 720px) {
  .radar-wrap {
    top: max(14px, env(safe-area-inset-top));
    right: 12px;
    bottom: auto;
    width: 92px;
  }
  .radar-wrap canvas {
    width: 92px;
    height: 92px;
  }
  .radar-wrap small {
    display: none;
  }
  .raid-timer {
    top: 104px;
    width: max-content;
  }
  .injuries {
    top: 118px;
    right: 10px;
  }
  .game-over-card {
    padding: 24px;
  }
}
