:root {
  --rows: 6;
  --leftColor: var(--primary);
  --rightColor: var(--secondary);
  --hoverShadow: #ff5555;
}
@supports (color: hsl(from white h s l)) {
  :root {
    --rightColor: hsl(from var(--secondary) h s min(l, 33));
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
@font-face {
  font-family: "Lato Extended";
  font-style: normal;
  font-weight: 400;
  src: url(https://du11hjcvx0uqb.cloudfront.net/br/dist/fonts/lato/extended/Lato-Regular-bd03a2cc27.woff2)
    format("woff2");
  font-display: auto;
}
@font-face {
  font-family: "Lato Extended";
  font-style: normal;
  font-weight: 700;
  src: url(https://du11hjcvx0uqb.cloudfront.net/br/dist/fonts/lato/extended/Lato-Bold-cccb897485.woff2)
    format("woff2");
  font-display: auto;
}
body {
  font-family: "Lato Extended", Lato, sans-serif;
}
#match-grid {
  display: grid;
  padding: 4px 1em;
  grid-template-columns: 2fr 0.25fr 1fr;
  grid-template-rows: repeat(var(--rows), 1fr);
  grid-auto-flow: column;
  gap: 1em 5px;
  margin: 0 auto 1em auto;
  max-width: 58em;
  position: relative;
  overflow-y: visible;
  transition: grid-template-columns 0.5s 0.2s;
}
#match-grid.done {
  grid-template-columns: 2fr 0fr 0fr;
  grid-template-rows: repeat(var(--rows), auto);
  padding-right: 1.5em;
}
.slot {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.done .matched::after {
  content: "\2713";
  position: absolute;
  left: calc(100% + 0.5em);
  top: 50%;
  color: green;
  transform: translateY(-50%);
  font-size: 1.4em;
}
.done .incorrect .matched::after {
  content: "\274C";
  color: red;
  font-size: 1rem;
}
.feedback {
  grid-column: span 2;
  padding: 0.5em;
  background: #ddd;
  opacity: 0;
  animation: fade-in 0.2s 0.7s forwards;
}
.feedback p:first-child {
  margin-top: 0;
}
.feedback p:last-child {
  margin-bottom: 0;
}
.feedback img {
  float: left;
  margin: 0 0.5rem 0.5rem 0;
  width: 50%;
  max-width: 350px;
  height: auto;
}
.item {
  padding: 0.5em 1em;
  margin: 0;
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  justify-content: center;
  font-weight: 700;
  border: none;
  font-size: 1rem;
  background-color: var(--leftColor);
  color: white;
  position: relative;
}
.item[data-side="right"] {
  background-color: var(--secondary);
  background-color: var(--rightColor);
}
#match-grid:not(.done) .item:is(:hover, :focus-visible) {
  box-shadow: inset 0px 0px 5px 4px var(--hoverShadow),
    inset 0px 0px 5px 4px white;
}
.item[aria-selected="true"] {
  outline: 4px solid black;
  z-index: 15;
}
.item[aria-selected="true"]::before {
  content: "\203A";
  position: absolute;
  font-size: 3em;
  right: 100%;
  top: 50%;
  transform: translate(-0.5rem, -50%);
  z-index: 20;
  animation: point 0.75s infinite alternate ease-out;
  color: black;
}
.item[aria-selected="true"][data-side="right"]::before {
  content: "\2039";
  left: 100%;
  right: unset;
  transform: translate(0.5rem, -50%);
  animation-name: pointR;
}
.item img {
  min-width: 0;
  width: auto;
  height: auto;
  max-width: min(100%, 250px);
  max-height: 250px;
}
.spacer {
  grid-row: span var(--rows);
}
#match-grid.done .spacer {
  display: none;
}
.connector {
  position: absolute;
  width: 4px;
  min-height: 4px;
  background-color: darkgrey;
  left: 65%;
  top: 50%;
  display: none;
  z-index: -1;
}
.connector.shown {
  display: block;
}
.connector::before,
.connector::after {
  content: "";
  background-color: inherit;
  height: 4px;
  position: absolute;
}
.connector::before {
  right: 0;
  width: 310px;
}
.connector::after {
  width: 50px;
  left: 0;
}
.connector.upward::before,
.connector.downward::after {
  bottom: 0;
}
.connector.downward::before,
.connector.upward::after {
  top: 0;
}
#setup-area {
  display: none;
}
button {
  font-family: "Lato Extended", sans-serif;
  cursor: pointer;
  color: white;
}
#match-grid.done button {
  cursor: default;
}
.btn {
  font-size: 1.4em;
  padding: 0.5em 1em;
  margin: 0.5em 0.25em 0.25em 0.25em;
  background-color: var(--primary);
}
#verify {
  background-color: #228b22;
}
#reset {
  background-color: #b33a3a;
}
#solution {
  display: none;
}
#dialog > div {
  display: grid;
  grid-template: repeat(var(--rows), 1fr) / 1fr 1fr;
  grid-auto-flow: column;
  gap: 10px 0;
  position: relative;
  padding-bottom: 5em;
  overflow: auto;
  height: 100%;
}
#dialog .item {
  border: 4px solid limegreen;
  border-width: 4px 0 4px 4px;
  padding: 1em 0.5em;
}
#dialog .item[data-side="right"] {
  border-width: 4px 4px 4px 0;
}
#close {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}
.done ~ #solution {
  display: inline-block;
}
.btn:is(:hover, :focus-visible) {
  opacity: 0.8;
}
.btn:active,
#match-grid:not(.done) .item:active {
  translate: 2px 2px;
  transition: translate 0.1s;
}
#verify:disabled,
#verify[disabled] {
  background: gray;
  cursor: initial;
  position: static;
  opacity: 0.5;
}
@keyframes fade-in {
  to {
    opacity: 1;
  }
}
@keyframes point {
  0%,
  30% {
    transform: translate(-0.5rem, -50%);
  }
  to {
    transform: translate(-0.25rem, -50%);
  }
}
@keyframes pointR {
  0%,
  30% {
    transform: translate(0.5rem, -50%);
  }
  to {
    transform: translate(0.25rem, -50%);
  }
}
