﻿.board-layout {
  display: grid;
  gap: 1rem;
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(255, 191, 128, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.board-size-control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
}

.board-size-control input {
  width: min(34vw, 220px);
  accent-color: var(--accent);
}

.board-size-control strong {
  min-width: 3.2rem;
  color: var(--accent-strong);
  text-align: right;
}

.record-check {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1 1 360px;
  justify-content: center;
}

.record-check__button {
  min-width: min(100%, 260px);
  min-height: 3rem;
  font-size: 1rem;
}

.record-check span {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.board-pan-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.board-pane {
  overflow: auto;
  max-height: min(72vh, 820px);
  overscroll-behavior: contain;
  touch-action: none;
  cursor: grab;
  border-radius: 12px;
  padding: 0.25rem;
}

.board-pane:active {
  cursor: grabbing;
}

.board-grid {
  display: grid;
  gap: 0.35rem;
  width: max-content;
  min-width: 100%;
  margin: 0 auto;
  --board-tile-size: 132px;
}

.board-cell {
  border-radius: 4px;
  border: 1px solid rgba(255, 191, 128, 0.16);
  background: rgba(255, 255, 255, 0.025);
  padding: 0;
  text-align: left;
  width: var(--board-tile-size);
  aspect-ratio: 1 / 0.9;
  min-height: 74px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  position: relative;
  overflow: hidden;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.board-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 0 solid transparent;
  border-radius: inherit;
  pointer-events: none;
}

.board-cell:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.board-cell.is-holding {
  transform: translateY(-1px) scale(0.985);
  border-color: rgba(255, 154, 82, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 154, 82, 0.34), 0 0 22px rgba(255, 154, 82, 0.18);
}

.board-cell.is-holding::before {
  content: "Hold to play";
  position: absolute;
  inset: auto 0.35rem 0.35rem;
  z-index: 3;
  padding: 0.28rem 0.4rem;
  border: 1px solid rgba(255, 154, 82, 0.38);
  border-radius: 6px;
  background: rgba(13, 16, 24, 0.88);
  color: var(--accent-strong);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}

.board-cell.is-selected {
  border-color: rgba(238, 244, 255, 0.72);
  box-shadow:
    0 0 0 1px rgba(238, 244, 255, 0.32),
    0 0 18px rgba(238, 244, 255, 0.12);
  background: rgba(238, 244, 255, 0.055);
}

.board-cell.is-claimed {
  border-color: var(--claim-border);
  background:
    linear-gradient(180deg, var(--team-soft), transparent 42%),
    rgba(255, 255, 255, 0.025);
  box-shadow:
    inset 0 0 0 1px var(--team-border),
    0 0 0 1px color-mix(in srgb, var(--team-border) 44%, transparent),
    0 0 18px var(--team-glow);
}

.board-cell.is-claimed::after {
  border-width: 2px;
  border-color: var(--team-border);
}

.board-cell.is-claimed:hover {
  border-color: var(--team-border);
  box-shadow:
    inset 0 0 0 1px var(--team-border),
    0 0 0 1px color-mix(in srgb, var(--team-border) 58%, transparent),
    0 0 24px var(--team-glow);
}

.board-cell.is-claimed.is-selected {
  border-color: var(--team-border);
  box-shadow:
    inset 0 0 0 1px var(--team-border),
    0 0 0 2px rgba(238, 244, 255, 0.44),
    0 0 24px var(--team-glow);
}

.board-cell.is-current-map:not(.is-claimed) {
  border-color: rgba(255, 154, 82, 0.78);
}

.board-cell.is-current-map .board-cell__id {
  border-color: rgba(255, 154, 82, 0.42);
  background: rgba(255, 154, 82, 0.18);
  color: #ffd5ad;
}

.board-cell__current-pulse {
  position: absolute;
  inset: 1px;
  z-index: 2;
  border: 2px solid rgba(255, 154, 82, 0.62);
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 213, 173, 0.16),
    0 0 18px rgba(255, 154, 82, 0.12);
  pointer-events: none;
  animation: current-map-pulse 1.8s ease-in-out infinite;
}

.board-cell.is-claimed .board-cell__current-pulse {
  inset: 3px;
  border-color: rgba(255, 213, 173, 0.58);
}

.board-cell__current-marker {
  position: absolute;
  top: 0.28rem;
  right: 0.28rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.26rem;
  max-width: calc(100% - 3.7rem);
  overflow: hidden;
  padding: 0.18rem 0.38rem 0.18rem 0.24rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 154, 82, 0.38);
  background: rgba(13, 16, 24, 0.86);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28), 0 0 18px rgba(255, 154, 82, 0.16);
  color: #ffd5ad;
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  animation: current-marker-float 1.8s ease-in-out infinite;
}

.board-cell__current-marker span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-cell__current-marker-icon {
  width: 0.78rem;
  height: 0.78rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 213, 173, 0.5);
  border-radius: 999px;
  background: rgba(255, 154, 82, 0.24);
}

.board-cell__current-marker-icon::after {
  content: "";
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 999px;
  background: #ffd5ad;
}

.board-cell.is-claimed .board-cell__caption {
  background:
    linear-gradient(180deg, var(--team-soft), transparent 130%),
    rgba(4, 6, 11, 0.94);
}

.board-cell__media {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 154, 82, 0.12), transparent 34%),
    rgba(7, 9, 16, 0.82);
  position: relative;
  overflow: hidden;
}

.board-cell__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.board-cell__fallback {
  display: none;
  color: var(--muted);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.board-cell__media.is-missing .board-cell__fallback {
  display: block;
}

.board-cell__caption {
  display: grid;
  gap: 0.12rem;
  padding: 0.32rem 0.42rem 0.38rem;
  background: rgba(4, 6, 11, 0.94);
  min-width: 0;
}

.board-cell__claim-tag {
  position: absolute;
  left: 0.32rem;
  right: 0.32rem;
  bottom: calc(0.42rem + 2.2em);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  max-width: calc(100% - 0.64rem);
  padding: 0.16rem 0.4rem 0.16rem 0.26rem;
  border: 1px solid color-mix(in srgb, var(--team-border) 48%, transparent);
  border-radius: 999px;
  background: rgba(4, 6, 11, 0.82);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24), 0 0 14px var(--team-glow);
  color: color-mix(in srgb, var(--team-border) 72%, white);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.board-cell__claim-tag .team-color-dot {
  width: 0.48rem;
  height: 0.48rem;
  box-shadow: none;
}

.board-cell__claim-tag span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-cell__id {
  position: absolute;
  top: 0.32rem;
  left: 0.32rem;
  color: var(--ink);
  background: rgba(4, 6, 11, 0.72);
  border: 1px solid rgba(255, 191, 128, 0.16);
  border-radius: 999px;
  padding: 0.12rem 0.34rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-weight: 700;
  line-height: 1;
  z-index: 1;
}

.board-cell__name {
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.board-cell__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--muted);
}

@keyframes current-map-pulse {
  0%,
  100% {
    opacity: 0.62;
    box-shadow:
      inset 0 0 0 1px rgba(255, 213, 173, 0.14),
      0 0 14px rgba(255, 154, 82, 0.1);
  }

  50% {
    opacity: 1;
    box-shadow:
      inset 0 0 0 1px rgba(255, 213, 173, 0.26),
      0 0 26px rgba(255, 154, 82, 0.26);
  }
}

@keyframes current-marker-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

