/* Soulrend board tiles: one visual language, shape stays board-specific. */
.board .tile,.bonus-tiles .tile {
  --tile-glow: var(--accent);
  position:relative;
  isolation:isolate;
  overflow:hidden;
  color:var(--text);
  background:linear-gradient(160deg,color-mix(in srgb,var(--board-open) 94%,white 6%),var(--board-open) 68%,color-mix(in srgb,var(--board-open) 91%,black 9%));
  border-color:color-mix(in srgb,var(--line) 82%,var(--accent) 18%);
  box-shadow:inset 0 1px 0 color-mix(in srgb,white 12%,transparent),0 7px 22px rgba(0,0,0,.13);
  transition:transform .22s cubic-bezier(.2,.8,.2,1),filter .22s ease,box-shadow .22s ease;
}
.board .tile::before,.bonus-tiles .tile::before {
  content:"";position:absolute;inset:2px;z-index:-1;pointer-events:none;
  border-radius:inherit;
  background:radial-gradient(ellipse at 25% 0%,color-mix(in srgb,var(--tile-glow) 11%,transparent),transparent 64%);
}
.board .tile.pending,.bonus-tiles .tile.pending {--tile-glow:var(--warn)}
.board .tile.approved,.bonus-tiles .tile.approved {--tile-glow:var(--good)}
.board .tile.rejected,.bonus-tiles .tile.rejected {--tile-glow:var(--bad)}
.board .tile.locked,.bonus-tiles .tile.locked {--tile-glow:var(--muted);filter:saturate(.68);box-shadow:inset 0 1px 0 color-mix(in srgb,white 5%,transparent)}
.board a.tile:hover,.board button.tile:hover,.bonus-tiles a.tile:hover,.bonus-tiles button.tile:hover {
  transform:translateY(-4px) scale(1.025);
  filter:brightness(1.09);
  box-shadow:inset 0 1px 0 color-mix(in srgb,white 16%,transparent),0 13px 30px color-mix(in srgb,var(--tile-glow) 16%,transparent);
  z-index:3;
}
.board .tile.locked:hover {transform:none;filter:saturate(.68)}
.board .tile:focus-visible,.bonus-tiles .tile:focus-visible {
  outline:3px solid var(--accent);outline-offset:4px;
}
.board .tile img,.bonus-tiles .tile img {filter:drop-shadow(0 5px 9px rgba(0,0,0,.26));transition:transform .25s ease}
.board a.tile:hover img,.bonus-tiles a.tile:hover img {transform:scale(1.08)}
.board .tile strong,.bonus-tiles .tile strong {position:relative;z-index:1;font-weight:750;letter-spacing:-.01em}
.board .tile-number,.board .tile-status,.bonus-tiles .tile-number,.bonus-tiles .tile-status {font-weight:750;letter-spacing:.085em}
.board.square .tile {border-radius:20px;min-height:146px}
.board.pyramid .tile {border-radius:50%;width:146px;min-height:146px;height:146px}
.board.hex .tile {border-radius:0;box-shadow:inset 0 1px 0 color-mix(in srgb,white 11%,transparent),0 8px 20px rgba(0,0,0,.14)}
.board.hex .tile::before {clip-path:inherit;border-radius:0}
.tile-presence {position:absolute;left:50%;bottom:7px;transform:translateX(-50%);z-index:5;padding:4px 7px;border-radius:999px;max-width:88%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:color-mix(in srgb,var(--accent) 78%,#160d26);border:1px solid color-mix(in srgb,var(--accent) 60%,white);color:white;font-size:9px;font-weight:750;box-shadow:0 3px 12px rgba(0,0,0,.24)}
.tile-presence[hidden]{display:none!important}
.board .tile.is-busy {--tile-glow:var(--accent);filter:brightness(1.055)}
.board .tile.is-busy::before {animation:tile-presence-breathe 2.6s ease-in-out infinite alternate}
.board.hex .tile-presence{bottom:19px;max-width:68%;font-size:8px}
.board.pyramid .tile-presence{bottom:13px;max-width:75%}
.board-live-toolbar {display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:10px 0 6px;padding:10px 13px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2)}
.board-live-indicator{display:inline-flex;align-items:center;gap:9px;font-size:12px;font-weight:750}
.board-live-dot{width:8px;height:8px;border-radius:50%;background:var(--good);box-shadow:0 0 0 4px color-mix(in srgb,var(--good) 14%,transparent)}
.board-live-toolbar [data-board-refresh]{margin-left:auto}
.tile-presence-hint{margin-bottom:12px}
@keyframes tile-presence-breathe {to{opacity:.38}}
@media (prefers-reduced-motion:reduce) {
 .board .tile,.bonus-tiles .tile,.board .tile img,.bonus-tiles .tile img{transition:none!important}
 .board .tile.is-busy::before{animation:none}
 .board a.tile:hover,.board button.tile:hover,.bonus-tiles a.tile:hover,.bonus-tiles button.tile:hover {transform:none}
}


/* Shared main-board ownership is visible without hover; the dashed frontline
   remains distinct from the owner-color outline in either theme. */
.tile.shared-owned {outline:2px solid var(--territory-color,var(--accent));outline-offset:-3px}
.tile.shared-frontline {border-style:dashed!important;border-width:2px!important}
.tile .tile-territory-label {
  display:inline-flex;align-items:center;gap:4px;max-width:95%;
  border:1px solid var(--line);background:var(--surface);
  padding:2px 5px;border-radius:7px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:10px;font-weight:650;line-height:1.25;color:var(--text);
}
.tile .tile-territory-label img {width:16px!important;height:16px!important;max-width:16px!important;object-fit:contain!important}
@media(max-width:620px){.tile .tile-territory-label{font-size:9px;padding:2px 4px}}


.tile .tile-strategic-label {
  display:inline-flex;justify-content:center;align-items:center;
  max-width:95%;padding:2px 6px;border:1px solid var(--line);
  border-radius:7px;background:color-mix(in srgb,var(--accent) 15%,var(--surface));
  color:var(--text);font-size:9px;font-weight:750;line-height:1.15;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}


/* Phase 4 mode states: only already-revealed nodes receive these markers. */
.mode-gameplay-summary {display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin:10px 0;padding:10px 13px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);font-size:12px}
.mode-gameplay-summary strong {color:var(--text)}
.mode-branch-status {display:flex;flex-wrap:wrap;gap:6px}
.mode-branch-status span {border-radius:6px;border:1px solid var(--line);padding:3px 6px}
.tile .tile-node-role {display:inline-flex;max-width:95%;border:1px solid var(--line);border-radius:6px;padding:2px 5px;background:var(--surface);color:var(--text);font-size:9px;font-weight:750;line-height:1.25}
.tile.mode-discovered {border-style:dashed!important;opacity:.82}
.tile.mode-completed .tile-node-role {color:var(--good)}
@media(max-width:620px){.mode-gameplay-summary{font-size:11px;padding:8px 10px}.tile .tile-node-role{font-size:8px}}
