.board { container-type: inline-size; }
.corner-row {
  position: absolute;
  inset-inline: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  pointer-events: none;
}
#corners-north { top: 0; }
#corners-south { bottom: 0; }
#corners-middle {
  inset-block: 0;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-items: center;
}
.corner-player {
  --item-size: clamp(9px, 2.7cqw, 20px);
  --tile-gap: clamp(1px, .23cqw, 2px);
  display: flex;
  align-items: center;
  gap: var(--tile-gap);
  grid-row: 1;
  justify-self: start;
  padding: 1px;
  color: #f8efda;
  background: #141e10ef;
  border: 1px solid #a1a95d;
  pointer-events: auto;
  cursor: default;
}
.corner-player[data-side="right"] { justify-self: end; }
#corners-middle .corner-player {
  --item-size: clamp(8px, 1.9cqw, 16px);
  display: grid;
  justify-items: center;
}
#corners-middle .corner-player[data-side="right"] { grid-row: 2; }
#corners-middle .corner-loadout {
  display: grid;
  grid-template-columns: repeat(2, var(--item-size));
}
#corners-middle .corner-identity {
  padding-inline: 0;
  font-size: clamp(4px, .85cqw, 6px);
}
#corners-middle .corner-queue-label {
  inline-size: calc(2 * var(--item-size) + var(--tile-gap));
  padding: 0;
  text-align: center;
  white-space: normal;
  font-size: 4px;
}
.corner-own { border-color: #ffe493; }
.corner-portrait {
  width: var(--item-size);
  height: var(--item-size);
  flex: none;
  aspect-ratio: 1;
}
.corner-identity, .corner-value, .corner-queue-label, #your-bomber {
  font-family: 'Press Start 2P', monospace;
  font-weight: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.corner-identity {
  inline-size: calc(5ch + 4px);
  flex: none;
  padding-inline: 2px;
  display: grid;
  gap: 1px;
  text-align: center;
  color: #dce6be;
  font-size: clamp(5px, 1.05cqw, 8px);
  line-height: 1.15;
}
.corner-name { font: inherit; }
.corner-connection { text-align: right; }
.corner-own .corner-name { color: #ffe493; }
.corner-offline { color: #efc57a; }
.corner-ko .corner-connection { opacity: .7; }
.corner-queue-label { padding-inline: 3px; color: #f4e3ad; font-size: clamp(5px, 1.35cqw, 10px); }
.corner-loadout { display: flex; gap: var(--tile-gap); }
.corner-stats, .corner-tools { display: contents; }
.corner-stat { position: relative; display: block; width: var(--item-size); height: var(--item-size); }
.corner-value {
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: .95em;
  padding: 1px 0 0 1px;
  color: #fff;
  background: #141619;
  font-size: clamp(5px, 1.2cqw, 9px);
  line-height: 1;
  text-align: center;
}
.corner-item {
  display: block;
  width: var(--item-size);
  height: var(--item-size);
  image-rendering: pixelated;
  background: url('/assets/hud-items.png') no-repeat;
  background-size: calc(4 * var(--item-size)) var(--item-size);
  background-position: calc(-1 * var(--item-index) * var(--item-size)) 0;
}
.corner-tool {
  width: var(--item-size);
  height: var(--item-size);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  image-rendering: pixelated;
}
/* Kick is the 12th 20px tile in the original 512px atlas. */
.corner-kick {
  background-image: url('/assets/items.png');
  background-position: calc(-11 * var(--item-size)) 0;
  background-size: calc(25.6 * var(--item-size)) auto;
}
.corner-punch { background-image: url('/assets/punch.png'); }
.corner-glove { background-image: url('/assets/glove.png'); }
.corner-locked { filter: grayscale(1); opacity: .51; }
.corner-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#round-clock {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  inline-size: calc(9ch + 6px);
  padding: 1px 2px;
  background: #141e10ef;
  border: 1px solid #a1a95d;
  color: #f8efda;
  font: normal clamp(6px, 2.1cqw, 14px)/1.4 'Press Start 2P', monospace;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
#round-clock.hurry { color: #ffcd77; border-color: #ffcd77; }

#your-bomber {
  position: absolute;
  transform: translateY(-50%);
  color: #fff0a1;
  font-size: clamp(8px, 2.1cqw, 16px);
  line-height: 1.2;
  text-shadow: -1px 0 #160f16, 1px 0 #160f16, 0 -1px #160f16, 0 2px #160f16;
  pointer-events: none;
  animation: bomber-marker-blink .58s steps(1, end) infinite;
}
#your-bomber:not([hidden]) { display: flex; align-items: center; gap: .35em; }
#your-bomber[data-side="left"] { transform: translate(-100%, -50%); }
#your-bomber::after {
  content: '';
  inline-size: .8em;
  block-size: .9em;
  background: currentColor;
  clip-path: polygon(0 33%, 46% 33%, 46% 0, 63% 0, 63% 17%, 81% 17%, 81% 33%,
    100% 33%, 100% 67%, 81% 67%, 81% 83%, 63% 83%, 63% 100%, 46% 100%, 46% 67%, 0 67%);
}
#your-bomber[data-side="right"]::after { order: -1; transform: scaleX(-1); }
@keyframes bomber-marker-blink {
  0%, 100% { opacity: 1; }
  70% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #your-bomber { animation: none; }
}
