/* Decorative surfaces for the Matrix preview; the tools retain their own styles. */
:root { --ttc-matrix-purple: #4a2668; }

.matchup-matrix {
  --matrix-cell: 44px;
  background-color: var(--ttc-matrix-purple);
  background-image: url('/assets/matchup-matrix.svg?v=neutral');
  background-size: calc(var(--matrix-cell) * 6) calc(var(--matrix-cell) * 6);
  background-position: center;
}

.tools-home .hub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 950px) {
  .tools-home .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tools-home .hub-grid { grid-template-columns: minmax(0, 1fr); }
}
.hub-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  overflow: hidden;
  border-radius: var(--ttc-hub-radius);
  background: var(--ttc-matrix-purple);
  color: #fff;
}
:root[data-matrix-type] .hub-intro { --ttc-matrix-purple: var(--ttc-banner-tint); }
.hub-intro-copy { align-self: center; padding: clamp(20px, 4vw, 44px); }
.hub-intro h1 {
  font-size: clamp(2rem, 4.4vw, 3.45rem); font-weight: 900;
  letter-spacing: -.04em; line-height: 1.06; text-wrap: balance;
}
.hub-intro p {
  color: #fff; opacity: .97; max-width: 48ch;
  font-size: clamp(1rem, 1.6vw, 1.1rem); line-height: 1.55;
}
.hub-intro-types {
  --matrix-cell: clamp(30px, 4.6vw, 44px);
  display: grid;
  grid-template-columns: repeat(6, var(--matrix-cell));
  grid-auto-rows: var(--matrix-cell);
  place-content: center;
  place-items: center;
  padding-block: 12px;
  /* The repeating tile has an even number of rows; the icon grid has three. */
  background-position: center calc(50% + var(--matrix-cell) / 2);
}
.hub-intro-types img {
  display: block;
  width: calc(var(--matrix-cell) - 10px);
  height: auto;
  border-radius: 7px;
  transition: opacity 120ms ease;
}
.hub-intro-types button {
  display: grid;
  place-items: center;
  width: var(--matrix-cell);
  height: var(--matrix-cell);
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
.tools-home .hub-intro-types button:not(:focus-visible) { outline: none; }
@media (hover: hover) {
  .hub-intro-types button:hover img { opacity: .78; }
}
.hub-intro-types button:focus-visible { outline: 2px dashed #fff; outline-offset: -1px; }
.tools-home .tools-app .text-link { text-decoration: none; }
.tools-home .tools-app .text-link:is(:hover, :focus-visible) { text-decoration: underline; }

.tools-home .hub-art { background: none; }
.hub-gambit-board {
  --sample-square: 27px;
  --sample-turn: #3c5aa6;
  display: grid; grid-template-columns: repeat(4, var(--sample-square));
  grid-template-rows: repeat(2, var(--sample-square)); overflow: hidden;
  border: 1px solid var(--line); border-radius: 7px;
}
:root[data-theme="dark"] .hub-gambit-board {
  --sample-turn: #aebdf0; --sample-light-square: 10%; --sample-dark-square: 28%;
}
.hub-gambit-board > span {
  display: grid; place-items: center; position: relative;
  background: color-mix(in srgb, #3c5aa6 var(--sample-light-square, 7%), var(--surface-strong));
}
.hub-gambit-board > span:is(:nth-child(2), :nth-child(4), :nth-child(5), :nth-child(7)) {
  background: color-mix(in srgb, #3c5aa6 var(--sample-dark-square, 16%), var(--surface-strong));
}
.hub-gambit-board img {
  display: block; box-sizing: border-box; width: calc(var(--sample-square) - 9px); height: auto;
  border-radius: 4px; border: 2px solid #fff; background: #fff;
  box-shadow: 0 0 0 1px #555;
}
.hub-gambit-board .hub-gambit-capture img { border-color: #000; background: #000; }
.hub-gambit-board :is(.hub-gambit-selected,.hub-gambit-capture)::after {
  content: ''; position: absolute; inset: 2px; border: 1px solid var(--sample-turn); border-radius: 5px;
}
.hub-gambit-board .hub-gambit-capture::after { border-style: dashed; }
.hub-gambit-board .hub-gambit-destination::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--sample-turn);
}
.hub-victory-art .hub-medal { color: var(--secondary); width: 34px; height: auto; flex: none; opacity: .42; }
.hub-victory-art .hub-medal.is-earned { color: #e52c3b; opacity: 1; }
:root[data-theme="dark"] .hub-victory-art .hub-medal:not(.is-earned) { opacity: .62; }
:root[data-theme="dark"] .hub-victory-art .hub-medal.is-earned { color: #ff6977; }
@media (max-width: 760px) {
  .hub-gambit-board { --sample-square: 23px; }
  .hub-victory-art .hub-medal { width: 29px; }
}

.app-get--matrix { padding: 0; gap: 0; overflow: hidden; }
.app-get--matrix > .app-get-copy { padding: clamp(18px, 4vw, 44px); }
.app-preview-backdrop {
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(16px, 3vw, 28px);
}

@media (max-width: 680px) {
  .hub-intro { grid-template-columns: minmax(0, 1fr); }
  .hub-intro-types {
    --matrix-cell: clamp(31px, 9vw, 40px);
    padding-block: 9px;
  }
}
