/* A value, drawn (src/tile.rs; docs/decisions.md, 3 Nov 2026, "The shared pieces of choices…", (1)):
   the tile route's picture in a square at one of the handoff's sizes, its name beside it. A colour's
   picture is its own round swatch and is drawn bare; anything else sits on the tile's ground, a
   quiet square with a hairline, so a dashed "none" box or art whose picture leaves its corners clear
   still reads as a thing in its place. Square, as a drawn thing is cut from the paper (the corners
   rule), with the drawn radius. */
.tile {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--tile-cell);
  height: var(--tile-cell);
  vertical-align: middle;
  color: var(--color-ink);
}

.tile-table { width: var(--tile-table); height: var(--tile-table); }
.tile-cell-large { width: var(--tile-cell-large); height: var(--tile-cell-large); }
.tile-list { width: var(--tile-list); height: var(--tile-list); }
.tile-sheet { width: var(--tile-sheet); height: var(--tile-sheet); }
.tile-legend { width: var(--tile-legend); height: var(--tile-legend); }
.tile-card { width: var(--tile-card); height: var(--tile-card); }

.tile-grounded {
  background: var(--color-line-panel);
  border: var(--hairline) solid var(--color-line);
  border-radius: var(--radius-drawn);
  overflow: hidden;
}

.tile-picture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* "Aa" and "?": the typed answer in an ink rim, the one to come in a dashed muted one, at the
   drawing's size less a fifth, as the handoff's tile draws them. */
.tile-typed,
.tile-to-come {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 78%;
  height: 78%;
  font-size: max(var(--text-mono-sm), calc(var(--tile-cell) * 0.5));
  line-height: 1;
}

.tile-typed {
  border: var(--line-small-stroke) solid var(--color-ink);
  font-weight: var(--weight-strong);
}

.tile-to-come {
  border: var(--hairline) dashed var(--color-muted);
  color: var(--color-muted);
  font-family: var(--font-mono);
}

.tile-list .tile-typed, .tile-list .tile-to-come,
.tile-sheet .tile-typed, .tile-sheet .tile-to-come,
.tile-legend .tile-typed, .tile-legend .tile-to-come {
  font-size: var(--text-quiet);
}

.tile-card .tile-typed, .tile-card .tile-to-come {
  font-size: var(--text-lg);
}

/* The drawing and its name: beside it, or under it in a legend or on a card. */
.tile-named {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.tile-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-under {
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-quiet);
}

/* Under the drawing the name wraps rather than ending in an ellipsis: "Crest 2027" cut to "Crest
   20…" would lose the one thing that tells it from "Crest 1987". */
.tile-under .tile-name {
  max-width: calc(var(--tile-card) * 1.5);
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.tile-quiet {
  color: var(--color-muted);
}
