/* Official photographs used as the pieces of the guided table. */
body.tt-playmode .tt-board-unit { aspect-ratio: 714 / 457; }
body.tt-playmode .tt-board-frame {
  background: radial-gradient(ellipse at center, #37372e, #201f1a 79%);
  isolation: isolate;
}
.tt-authentic-tile {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: transparent;
}
.tt-map-plate {
  position: absolute;
  left: -30.392%;
  top: -21.663%;
  width: 168.068%;
  height: 161.926%;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
}
.tt-authentic-tile.is-preview { filter: saturate(.78) brightness(.75); }
button.tt-authentic-tile { z-index: 2; cursor: pointer; background: #43382c; }
button.tt-authentic-tile .tt-map-plate { opacity: .5; }
button.tt-authentic-tile:hover .tt-map-plate,
button.tt-authentic-tile:focus-visible .tt-map-plate { opacity: .85; }
button.tt-authentic-tile b {
  position: absolute;
  left: var(--tile-x);
  top: var(--tile-y);
  transform: translate(-50%, -50%);
  padding: .3em .5em;
  border: 1px solid #ebcd8f;
  border-radius: 4px;
  background: #231b10ed;
  color: #ffebc1;
  font: 750 clamp(14px, 2cqw, 25px)/1.1 Georgia, serif;
}
[data-tt-step="board"] .tt-authentic-tile.is-placed,
[data-tt-step="move-2c"] .tt-authentic-tile:last-of-type {
  animation: tt-place-piece .35s ease-out both;
}
@keyframes tt-place-piece {
  from { opacity: .5; translate: 0 -5px; }
  to { opacity: 1; translate: 0 0; }
}
.tt-board-corner.tt-reference {
  position: absolute;
  z-index: 7;
  right: 5px;
  bottom: 6px;
  padding: 3px 6px;
  border: 1px solid #958564;
  border-radius: 3px;
  background: #211a14;
  color: #f2deb6;
  cursor: zoom-in;
}
body.tt-playmode .tt-waypoint.tt-map-site {
  z-index: 4;
  display: grid;
  place-items: center;
  width: clamp(28px, 5cqw, 38px);
  height: auto;
  aspect-ratio: 1;
  background: #695020a3;
  border: 2px solid #ffdf98;
  border-radius: 45%;
  color: #fff8d9;
  outline-offset: 3px;
}
.tt-waypoint.tt-map-site > span { font: 800 19px/1 system-ui, sans-serif; }
.tt-waypoint small {
  position: absolute;
  top: calc(100% + 4px);
  width: max-content;
  max-width: 125px;
  padding: 4px 6px;
  border-radius: 3px;
  background: #211b12;
  color: #fff0c9;
  font: 700 10px/1.1 system-ui, sans-serif;
}
body.tt-playmode .tt-game-marker.tt-photo-marker {
  z-index: 5;
  display: grid;
  place-items: center;
  width: clamp(26px, 4.5cqw, 46px);
  height: auto;
  aspect-ratio: 1;
  padding: 2px;
  transform: translate(-50%, -50%);
  background: #2f281b;
  border: 1px solid #e9cd8e;
  border-radius: 50%;
  box-shadow: 0 3px 8px #070605c0;
  pointer-events: none;
}
body.tt-playmode .tt-king-marker.tt-photo-marker { border-color: #fc987d; }
body.tt-playmode .tt-photo-marker .tt-art-fit { border-radius: 50%; width: 100%; height: 100%; }
body.tt-playmode .tt-photo-marker > .tt-art-fit {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: minmax(0,1fr) / minmax(0,1fr);
}
.tt-deck-supply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 0.23fr;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  height: 100%;
}
.tt-deck-rack {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 5fr);
  align-items: center;
  min-width: 0;
  min-height: 0;
  gap: 3px;
  padding: 3px;
  border: 1px solid #9e8c666e;
  border-radius: 6px;
  background: linear-gradient(155deg, #34293d, #201c23);
}
.tt-deck-rack:nth-child(2) { background: linear-gradient(155deg, #364033, #232820); }
.tt-deck-rack.tt-deck-only { grid-template-columns: 1fr; }
.tt-deck-stack {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0,1fr) auto;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 3px;
  border: 1px dashed #9d885c;
  border-radius: 5px;
  background: #23221d;
  color: #f4e9d1;
  text-align: center;
}
.tt-deck-stack b { padding: 4px 0; font: 700 clamp(8px, 1cqw, 14px)/1.15 system-ui, sans-serif; }
.tt-deck-stack.is-empty { opacity: .8; }
button.tt-deck-stack { cursor: pointer; border: 1px solid #e3c481; }
button.tt-deck-stack:hover { background: #493b2a; }
.tt-dealt-cards { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px; min-width: 0; min-height: 0; height: 100%; align-items: center; }
.tt-dealt-card, .tt-deck-back {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  padding: 1px;
  border-radius: 4px;
  background: transparent;
  color: #fff2ce;
  cursor: zoom-in;
}
.tt-deck-rack .tt-deck-back { min-width: 0; }
.tt-card-front .tt-art-fit { pointer-events: none; }
.tt-card-front b {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  min-width: 12px;
  padding: 2px;
  background: #191211e6;
  border: 1px solid #a89566;
  border-radius: 3px;
  color: #fff0be;
  font: 800 clamp(7px, .8cqw, 11px)/1 system-ui;
}
body.tt-playmode .tt-card-front.is-drawn {
  outline: 2px solid #ffde99;
  background: #886738a8;
}
body.tt-playmode .tt-mode-cards .tt-top-decks .tt-deck-rack {
  max-height: 75%;
  align-self: center;
}
body.tt-playmode .tt-mode-cards .tt-card-front {
  width: 100%;
  height: auto;
  aspect-ratio: .71;
}
body.tt-playmode .tt-mode-cards .tt-deck-back { align-self: center; }
[data-tt-step="decks"] .tt-dealt-card { animation: tt-place-piece .3s ease-out both; }
.tt-art-fit.tt-rotate-card { transform: rotate(180deg); }
body.tt-playmode .component-zoom-display .component-rotate-card { transform: rotate(180deg) !important; }
body.tt-playmode .tt-hex-die .tt-die-art,
body.tt-playmode .tt-die-hit .tt-die-art { display: block; }
.tt-die-model { display: block; width: 100%; height: 100%; }
body.tt-playmode .tt-die-hit:disabled { opacity: .31; cursor: default; }
.tt-dice-zone.is-tumbling { cursor: progress; }
.tt-dice-zone.is-tumbling button { pointer-events: none; }
body.tt-playmode .tt-sheet-pins {
  bottom: 0;
  background: #1d1b15ee;
  color: #fff2d1;
}
.tt-sheet-pins span:first-child { color: #ffe3a3; }
.tt-map-touch:focus-visible, .tt-reference:focus-visible,
.tt-dealt-card:focus-visible, button.tt-deck-stack:focus-visible {
  outline: 2px solid #ffe4a5;
  outline-offset: -3px;
}
@media (max-width: 760px) {
  .tt-deck-supply, .tt-dealt-cards { gap: 2px; }
  .tt-deck-rack { padding: 1px; gap: 1px; }
  .tt-waypoint small { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-tt-step="board"] .tt-authentic-tile.is-placed,
  [data-tt-step="move-2c"] .tt-authentic-tile,
  [data-tt-step="decks"] .tt-dealt-card { animation: none; }
}
.tt-king-mini {
  position: absolute;
  top: -72%;
  right: -74%;
  width: 91%;
  height: 100%;
  background: #31241d;
  border: 1px solid #bda089;
  border-radius: 5px;
}

/* Recessed rolling surface behind the physical dice during their turn phase. */
body.tt-playmode .tt-mode-dice .tt-dice-zone {
  isolation: isolate;
}
body.tt-playmode .tt-mode-dice .tt-dice-zone::before {
  position: absolute;
  z-index: -1;
  inset: -3% -2.5% -8%;
  content: "";
  pointer-events: none;
  border: 2px solid #76674a;
  border-radius: clamp(10px, 2cqw, 29px);
  background:
    repeating-linear-gradient(127deg, #fff1 0 1px, transparent 1px 3px) center / 100% 100%,
    radial-gradient(ellipse at 50% 30%, #293936, #152421 66%, #101916);
  background-blend-mode: soft-light, normal;
  box-shadow: inset 0 0 0 3px #1d251e, inset 0 0 27px 9px #030b0a9e, 0 12px 24px #050906a1;
  opacity: .96;
}
body.tt-playmode .tt-mode-dice .tt-die-outcome,
body.tt-playmode .tt-mode-dice .tt-roll-result {
  z-index: 3;
  top: 1%;
  right: 7%;
  padding: 4px 8px;
  min-width: 25px;
  min-height: 25px;
  height: auto;
  font: 800 clamp(11px, 1.2cqw, 15px)/1.15 var(--sans);
}

.dice-tool { color: #f1dcaa; }
.dice-preview-dialog[open] {
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1.15vw, 15px);
  width: min(885px, calc(100vw - 26px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: clamp(10px, 2vw, 22px);
  border-color: #8e7951;
  background: radial-gradient(ellipse at 50% 7%, #293630, #141e1b 77%);
  box-shadow: 0 22px 75px #030609e6, inset 0 0 0 3px #272a23;
}
.dice-preview-dialog .dialog-header { margin: 0; }
.dice-preview-dialog .dialog-header h2 {
  font-size: clamp(23px, 3.5vw, 38px);
  color: #f4e4c5;
}
.dice-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(5px, 1vw, 10px);
  padding: clamp(5px, 1vw, 11px);
  border: 1px solid #6f624b;
  border-radius: 12px;
  background: #101a17;
  box-shadow: inset 0 0 14px #060b09;
}
.dice-preview-die {
  --die-accent: #aa7add;
  width: 100%;
  height: clamp(150px, 28vw, 227px);
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 3px;
  padding: 9px 5px 8px;
  border: 1px solid #736348;
  border-top-color: var(--die-accent);
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 24%, #2c332c, #17231f 72%);
  box-shadow: inset 0 0 16px #0b1513;
  color: #f3ead6;
  cursor: pointer;
}
.dice-preview-die[data-preview-roll="navigate"] { --die-accent: #7bcf92; }
.dice-preview-die[data-preview-roll="explore"] { --die-accent: #e9bc57; }
.dice-preview-die[data-preview-roll="survive"] { --die-accent: #7cc3eb; }
.dice-preview-die:hover, .dice-preview-die:focus-visible {
  outline: 2px solid var(--die-accent);
  outline-offset: -2px;
}
.dice-preview-die:disabled { cursor: progress; }
.dice-preview-name {
  display: block;
  overflow: hidden;
  color: #f6e7ca;
  font: 750 clamp(12px, 1.7vw, 16px)/1.2 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dice-preview-name small {
  color: var(--die-accent);
  font-size: .75em;
  margin-inline-start: 2px;
}
.dice-preview-die .tt-die-art { width: 100%; height: 100%; min-height: 0; display: block; }
.dice-preview-result {
  justify-self: center;
  min-width: 38px;
  padding: 4px 8px;
  border: 1px solid #a59265;
  border-radius: 5px;
  background: #141b16;
  color: #f6e8c6;
  font: 800 14px/1 var(--sans);
}
.dice-preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}
.dice-preview-status {
  flex: 1 1 250px;
  color: #ddcfb1;
  font: 600 12px/1.35 var(--sans);
}
.dice-preview-actions button:disabled { opacity: .55; }
@media (max-width: 760px) {
  .dice-tool { min-width: 32px; justify-content: center; }
  #dice-preview-button-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (max-width: 580px) {
  .dice-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dice-preview-die { height: clamp(115px, 24dvh, 175px); }
  .dice-preview-status { flex-basis: 100%; margin: 0 0 3px; }
}

@media (max-width: 440px) {
  body.tt-playmode .topbar-inner { width: calc(100% - 12px); gap: 5px; }
  body.tt-playmode .brand > span:first-child { display: none; }
  body.tt-playmode .tutorial-language select { width: 77px; padding-inline: 2px; font-size: 11px; }
  body.tt-playmode .topbar-actions .utility-button { min-width: 32px; }
}
