body.nempires {
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  overflow-y: auto;
  padding: 24px 18px 72px 42px;
  color: #eeeeee;
  background:
    radial-gradient(circle at top left, rgba(255, 153, 51, 0.16), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(79, 195, 247, 0.13), transparent 30rem),
    rgb(90, 90, 90);
}

.empire-shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

.empire-panel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  padding: 18px;
}

.empire-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.empire-controls h1 {
  margin: 0 0 6px;
  color: #ff9933;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
}

#empire-status {
  min-height: 20px;
  margin: 0;
  color: #d8f3ff;
  font-size: 13px;
}

.empire-form {
  display: grid;
  grid-template-columns: auto;
  gap: 10px;
  align-items: center;
}

.empire-form label {
  color: #eeeeee;
  font-size: 13px;
}

.empire-form button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 8px 15px;
  color: #272727;
  background: #ff9933;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}

.empire-form button:hover,
.empire-form button:focus-visible {
  background: #ffc107;
  outline: none;
}

.empire-form button:disabled {
  color: #8f8f8f;
  background: #4a4a4a;
  cursor: not-allowed;
  box-shadow: none;
}

.empire-board-wrap {
  position: relative;
  width: min(76vh, 100%);
  max-width: 720px;
  margin: 0 auto;
  aspect-ratio: 1;
}

.empire-board {
  display: grid;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  overflow: hidden;
  background: #2e2e2e;
}

.empire-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
}

.empire-cell.light {
  background: #d8bf8d;
}

.empire-cell.dark {
  background: #7a5f44;
}

.empire-piece {
  width: 76%;
  aspect-ratio: 1;
  position: relative;
  border-radius: 0;
  background:
    radial-gradient(circle at 28% 16%, #ff9933 0 8%, transparent 9%),
    radial-gradient(circle at 50% 8%, #ffffff 0 8%, transparent 9%),
    radial-gradient(circle at 72% 16%, #138808 0 8%, transparent 9%);
  box-shadow: none;
  transform: scale(0);
  animation: emperor-arrive 360ms ease-out forwards;
}

.empire-piece::before {
  content: "";
  position: absolute;
  inset: 18% 8% 10%;
  background: #111111;
  clip-path: polygon(
    0 38%,
    18% 48%,
    25% 12%,
    42% 44%,
    50% 4%,
    58% 44%,
    75% 12%,
    82% 48%,
    100% 38%,
    86% 82%,
    14% 82%
  );
}

.empire-piece::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 7%;
  height: 13%;
  border-radius: 999px;
  background: #111111;
}

.peace-wave {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 8px;
  opacity: 0;
}

.peace-wave.show {
  animation: peace-pulse 920ms ease-out;
}

.empire-log-wrap {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  padding-top: 14px;
}

.empire-log-wrap h2 {
  margin: 0 0 10px;
  color: #ff9933;
  font-size: 16px;
  letter-spacing: 0;
}

.empire-log {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.empire-log li {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 8px 10px;
  color: #eeeeee;
  background: rgba(0, 0, 0, 0.16);
  font-size: 12px;
}

@keyframes emperor-arrive {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes peace-pulse {
  0% {
    opacity: 0.9;
    box-shadow: inset 0 0 0 0 rgba(76, 175, 80, 0.72);
  }
  100% {
    opacity: 0;
    box-shadow: inset 0 0 0 28px rgba(76, 175, 80, 0);
  }
}

@media (max-width: 720px) {
  body.nempires {
    padding: 18px 12px 72px 28px;
  }

  .empire-panel {
    padding: 14px;
  }

  .empire-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .empire-form {
    grid-template-columns: 1fr;
  }

  .empire-form button {
    width: auto;
  }

  .empire-board-wrap {
    width: 100%;
  }
}
