:root {
  color-scheme: dark;
  font-family:
    "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --app-zoom: 1;
  --page-bg: #161316;
  --hex-zoom-ratio: 1;
  --hex-tile-width: 11px;
  --hex-tile-height: 18px;
  --hex-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='18' viewBox='0 0 11 18' shape-rendering='geometricPrecision'%3E%3Cpath d='M5.5 0 11 3.2v5.8l-5.5 3.2L0 9V3.2Z M5.5 12.2V18' fill='none' stroke='%23b895c6' stroke-width='0.6' stroke-linecap='butt' stroke-linejoin='miter' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  background: var(--page-bg);
  color: #f7f4fb;
}

* {
  box-sizing: border-box;
}

.lottie-cursor-enabled,
.lottie-cursor-enabled body,
.lottie-cursor-enabled button {
  cursor: none;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--page-bg);
  overflow-x: hidden;
}

button {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--page-bg);
}

.app::before,
.hex-shine {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--hex-grid);
  background-size: calc(var(--hex-tile-width) / var(--hex-zoom-ratio)) calc(var(--hex-tile-height) / var(--hex-zoom-ratio));
  background-position: 50% 50%;
  contain: paint;
}

.app::before {
  opacity: 0;
}

.hex-shine {
  --hex-shine-size: max(220vw, 220vh);
  opacity: 0.34;
  -webkit-mask-image: linear-gradient(115deg, transparent 0 34%, rgba(0, 0, 0, 0.06) 42%, rgba(0, 0, 0, 0.18) 47%, rgba(0, 0, 0, 0.26) 50%, rgba(0, 0, 0, 0.18) 53%, rgba(0, 0, 0, 0.06) 58%, transparent 66% 100%);
  mask-image: linear-gradient(115deg, transparent 0 34%, rgba(0, 0, 0, 0.06) 42%, rgba(0, 0, 0, 0.18) 47%, rgba(0, 0, 0, 0.26) 50%, rgba(0, 0, 0, 0.18) 53%, rgba(0, 0, 0, 0.06) 58%, transparent 66% 100%);
  -webkit-mask-size: var(--hex-shine-size) var(--hex-shine-size);
  mask-size: var(--hex-shine-size) var(--hex-shine-size);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: calc(var(--hex-shine-size) * -1) calc(var(--hex-shine-size) * -1);
  mask-position: calc(var(--hex-shine-size) * -1) calc(var(--hex-shine-size) * -1);
  animation: hex-shine-loop 16s linear infinite;
}

.hex-shine-b {
  animation-delay: -4s;
}

.hex-shine-c {
  animation-delay: -8s;
}

.hex-shine-d {
  animation-delay: -12s;
}

@keyframes hex-shine-loop {
  to {
    -webkit-mask-position: 100vw 100vh;
    mask-position: 100vw 100vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hex-shine {
    animation: none;
  }

  .hex-shine-b,
  .hex-shine-c,
  .hex-shine-d {
    display: none;
  }
}

.click-cursor-lottie {
  --cursor-x: 0px;
  --cursor-y: 0px;
  position: fixed;
  left: var(--cursor-x);
  top: var(--cursor-y);
  width: 48px;
  height: 48px;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -10%);
  contain: layout paint;
}

.click-cursor-lottie[data-active="true"] {
  opacity: 1;
}

.click-cursor-lottie img,
.click-cursor-lottie svg,
.click-cursor-lottie canvas {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
}

.surface {
  --game-width: min(100vw, calc((100vh - 48px) / 2.05));
  --surface-gap: calc(var(--game-width) * 0.04);
  --surface-radius: min(8px, 2.285714cqw);
  width: var(--game-width);
  container-type: inline-size;
  display: grid;
  gap: var(--surface-gap);
  position: relative;
  z-index: 1;
  isolation: isolate;
  transform: scale(var(--app-zoom));
  transform-origin: center;
  will-change: transform;
}



.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.title {
  margin: 0;
  line-height: 1;
  width: 100%;
}

.brand {
  width: 100%;
  display: grid;
  place-items: center;
}

.logo {
  position: relative;
  width: 79.428571%;
  aspect-ratio: 278 / 72;
  display: block;
  overflow: hidden;
}

.logo canvas,
.logo svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.player-panel {
  width: 100%;
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2.285714cqw;
  padding: 2.857143cqw 3.428571cqw;
  border-radius: 0;
  background: #362443;
}

.topbar + .player-panel {
  border-radius: var(--surface-radius) var(--surface-radius) 0 0;
  overflow: hidden;
}

.player-name {
  display: flex;
  align-items: center;
  gap: 2.285714cqw;
  font-size: 4.285714cqw;
  font-weight: 800;
  line-height: 5.142857cqw;
}

.team-mark {
  width: 3.714286cqw;
  height: 3.714286cqw;
  border-radius: 50%;
  background: #f7d7c4;
}

.player-panel[data-team="spongey"] .team-mark {
  background: #ffc83d;
}

.player-timer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.142857cqw;
  min-width: 0;
  color: #f7f4fb;
  font-size: 4.285714cqw;
  font-weight: 800;
  line-height: 5.142857cqw;
  font-variant-numeric: tabular-nums;
}

.timer-value {
  white-space: nowrap;
}

.unit-panel {
  width: 100%;
  justify-self: center;
  display: grid;
  padding: 2.285714cqw 2.857143cqw;
  border-radius: 0 0 var(--surface-radius) var(--surface-radius);
  background: #2f203a;
  min-height: 24.857143cqw;
  opacity: 1;
  overflow: hidden;
}

.player-panel + .board-wrap,
.board-wrap + .player-panel,
.player-panel + .unit-panel {
  margin-top: calc(-1 * var(--surface-gap));
}

.unit-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19.714286cqw;
  gap: 2.857143cqw;
  align-items: center;
  min-height: 19.714286cqw;
  color: #d8cfe0;
  font-size: 3.714286cqw;
  line-height: 4.571429cqw;
}

.unit-panel[data-visible="placeholder"] .unit-info {
  grid-template-columns: minmax(0, 1fr);
}

.unit-panel[data-visible="placeholder"] .unit-diagram {
  display: none;
}

.unit-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2.285714cqw;
}

.unit-emoji {
  width: 14.285714cqw;
  height: 14.285714cqw;
  flex: 0 0 auto;
  display: block;
}

.unit-emoji svg,
.unit-emoji canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.unit-name {
  min-width: 0;
  color: #f7f4fb;
  font: inherit;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-diagram {
  width: 19.714286cqw;
  height: 19.714286cqw;
}

.movement-diagram {
  position: relative;
  width: 19.714286cqw;
  height: 19.714286cqw;
}

.movement-grid {
  display: grid;
  grid-template-columns: repeat(7, 2.571429cqw);
  grid-template-rows: repeat(7, 2.571429cqw);
  gap: 0.285714cqw;
  width: 19.714286cqw;
  height: 19.714286cqw;
}

.movement-cell {
  width: 2.571429cqw;
  height: 2.571429cqw;
  background: #25192e;
}

.movement-cell[data-target="true"] {
  background: #0078d7;
}

.movement-cell[data-center="true"] {
  background: #ffc83d;
}

.movement-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--length);
  height: 0.571429cqw;
  background: #0078d7;
  transform: rotate(var(--angle));
  transform-origin: 0 50%;
  pointer-events: none;
}

.movement-arrow::after {
  content: "";
  position: absolute;
  right: -0.285714cqw;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 1.142857cqw solid transparent;
  border-bottom: 1.142857cqw solid transparent;
  border-left: 1.714286cqw solid #0078d7;
  transform: translateY(-50%);
}

.board-wrap {
  width: 100%;
  aspect-ratio: 7 / 9;
  justify-self: center;
  position: relative;
  overflow: hidden;
  border: 1px solid #6e557c;
  background: #825f8e;
  box-shadow: none;
  user-select: none;
  -webkit-user-select: none;
}

.board {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  display: block;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.move-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.motion-trail-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.motion-trail {
  --x: 0;
  --y: 0;
  --trail-fade-duration: 115ms;
  --trail-rotation: 0turn;
  position: absolute;
  left: 0;
  top: 0;
  width: calc(100% / 7);
  height: calc(100% / 9);
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(calc(var(--x) * 100%), calc(var(--y) * 100%), 0) rotate(var(--trail-rotation));
  transform-origin: center;
  backface-visibility: hidden;
  contain: layout paint;
  will-change: opacity, transform;
}

.motion-trail[data-active="true"] {
  opacity: 1;
  visibility: visible;
}

.motion-trail svg,
.motion-trail canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.drag-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.drag-preview-line {
  display: none;
  stroke: #0078d7;
  stroke-width: 4px;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
}

.drag-preview-line[data-active="true"] {
  display: block;
}

.move-marker {
  --x: 0;
  --y: 0;
  position: absolute;
  left: calc(var(--x) * 100% / 7);
  top: calc(var(--y) * 100% / 9);
  width: calc(100% / 7);
  height: calc(100% / 9);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.move-marker::before {
  content: "";
  width: min(5.142857cqw, 44%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #0078d7;
  transition:
    background-color 120ms ease,
    transform 120ms ease;
}

.move-marker[data-active="false"] {
  pointer-events: none;
  cursor: default;
}

.move-marker[data-active="false"]::before {
  background: #5f5f5f;
}

.move-marker[data-active="true"][data-tile="light"]:hover,
.move-marker[data-active="true"][data-tile="light"]:focus-visible {
  background: #ad7ebd;
}

.move-marker[data-active="true"][data-tile="dark"]:hover,
.move-marker[data-active="true"][data-tile="dark"]:focus-visible {
  background: #402f46;
}

.move-marker[data-active="true"]:hover::before,
.move-marker[data-active="true"]:focus-visible::before {
  background: #ffffff;
  transform: scale(1.12);
}

.move-marker:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.piece {
  --x: 0;
  --y: 0;
  position: absolute;
  left: 0;
  top: 0;
  width: calc(100% / 7);
  height: calc(100% / 9);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  z-index: 3;
  touch-action: none;
  user-select: none;
  transform: translate3d(calc(var(--x) * 100%), calc(var(--y) * 100%), 0);
  transform-origin: center;
  backface-visibility: hidden;
  contain: layout paint;
  transition:
    transform var(--move-duration, 230ms) linear,
    background-color 120ms ease;
  will-change: transform;
}

.piece[data-selected="true"] {
  background: #0078d7;
}

.piece[data-moving="true"] {
  background: transparent;
  pointer-events: none;
}

.piece[data-rolling="true"] .piece-animation {
  animation: roll-piece var(--move-duration, 230ms) linear;
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform;
}

.piece:hover,
.piece:focus-visible {
  backdrop-filter: brightness(1.2);
  -webkit-backdrop-filter: brightness(1.2);
}

.piece[data-moving="true"],
.piece[data-moving="true"]:hover,
.piece[data-moving="true"]:focus-visible {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition:
    transform var(--move-duration, 230ms) linear,
    background-color 0ms linear;
}

.piece:focus-visible {
  outline: 0;
}

.piece:focus-visible .piece-animation {
  filter: drop-shadow(0 0 4px #0078d7);
}

.piece-animation,
.piece-animation canvas,
.piece-animation svg,
.piece img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  backface-visibility: hidden;
}

.piece-animation canvas,
.piece-animation svg {
  position: absolute;
  inset: 0;
}

.piece-animation {
  position: relative;
  overflow: hidden;
}

@keyframes roll-piece {
  from {
    transform: translateZ(0) rotate(0turn);
  }

  to {
    transform: translateZ(0) rotate(var(--roll-turns, 1turn));
  }
}

@keyframes motion-trail-fade {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@media (max-width: 420px) {
  body {
    min-height: 100dvh;
    overflow: hidden;
  }

  .app {
    place-items: start center;
    min-height: 100dvh;
    padding: 4px 0 16px;
  }

  .surface {
    --mobile-available-height: calc(100dvh - 20px);
    --game-width: min(100vw, calc(var(--mobile-available-height) / 1.873714));
  }

  .topbar,
  .title,
  .brand {
    line-height: 0;
  }

  .logo {
    width: clamp(
      31.771428%,
      calc((var(--mobile-available-height) - var(--game-width) * 1.791429) * 3.861111),
      79.428571%
    );
  }

  .unit-info {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}
