#game {
  padding: 1rem 0;
}
#game h1 {
  color: #514783;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 1rem 0;
}
.controls label {
  display: grid;
  gap: 0.3rem;
}
.controls select {
  font: inherit;
  padding: 0.6rem;
  border-radius: 12px;
  max-width: 100%;
}
.board {
  background: #f3efff;
  border-radius: 24px;
  padding: 1rem;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  background: white;
  border: 2px solid #d8cfea;
  border-radius: 16px;
  padding: 6px;
  gap: 4px;
  font-size: 14px;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}
.tile img {
  width: 100%;
  height: 65px;
  object-fit: contain;
}
.emoji {
  font-size: 44px;
  line-height: 1.2;
}
.menu-card {
  min-height: 100px;
  background: #ebe7fa;
  font-size: 1.1rem;
}
.message {
  min-height: 2em;
  font-weight: bold;
}
.tile:disabled {
  opacity: 0.75;
}
@media (min-width: 700px) {
  .tiles {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .tile img {
    height: 95px;
  }
  .tile {
    min-height: 130px;
  }
  .emoji {
    font-size: 60px;
  }
}
#game .menu-card {
  line-height: 1.5;
  padding: 0.8rem;
}
.menu-card:nth-child(3n + 2) {
  background: #dff2e9;
}
.menu-card:nth-child(3n) {
  background: #fff0ce;
}
.light-grid,
.changes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tile.lit,
.tile.clue {
  outline: 4px solid #655092;
  outline-offset: -4px;
  background: #fff3c3;
}
.tile[aria-pressed='true'] {
  background: #d8f2e2;
  border-color: #387450;
}
.frame,
.box {
  position: relative;
  overflow: hidden;
}
.frame:disabled,
.light-grid button:disabled {
  opacity: 1;
}
.frame .pic {
  width: 65%;
  min-height: 48px;
  display: grid;
  place-items: center;
  position: relative;
}
.pic:not(:has(.blank))::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #735596;
  border-radius: 1px 5px 5px 5px;
  position: absolute;
  left: 0;
  top: 0;
}
.frame .left-pic {
  transform: translateX(-23%);
}
.frame .right-pic {
  transform: translateX(23%);
}
.frame .tilted {
  transform: rotate(32deg);
}
.frame .little {
  transform: scale(0.54);
}
.frame.tint-a {
  background: #fff0a8;
}
.frame.tint-b {
  background: repeating-linear-gradient(
    45deg,
    #b6defa,
    #b6defa 7px,
    #e0f3ff 7px,
    #e0f3ff 14px
  );
}
.drop-row {
  min-height: 76px;
  border: 2px dashed #9c8fba;
  border-radius: 12px;
}
.cup-track {
  position: relative;
  height: 135px;
  margin: 1rem 0;
}
.cup {
  position: absolute;
  top: 0;
  height: 100%;
  background: transparent;
  padding: 2px;
  border: 0;
  transition: left 1.05s ease-in-out;
}
.cup:disabled {
  opacity: 1;
}
.box {
  display: flex;
  height: 88%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffdeac;
  border: 3px solid #a9764c;
  border-top: 8px solid #ca9573;
  border-radius: 9px;
}
.box img {
  max-height: 58px;
  max-width: 95%;
}
.box .emoji,
.box > span {
  font-size: clamp(20px, 5vw, 46px);
}
.flipped {
  animation: flip-in 0.22s ease-out;
}
@keyframes flip-in {
  from {
    transform: scaleX(0.45);
  }
  to {
    transform: scaleX(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cup {
    transition: none;
  }
  .flipped {
    animation: none;
  }
}
[data-motion='reduced'] .cup,
.reduce-motion .cup {
  transition: none;
}
[data-motion='off'] .cup {
  transition: none;
}
[data-motion='off'] .flipped {
  animation: none;
}
.light-grid .tile {
  min-width: 0;
}
.menu-card:focus-visible,
.tile:focus-visible {
  outline: 3px solid #533d7d;
}
#game {
  --lilac: #ded6ef;
  --plum: #514783;
}
#game h1 {
  line-height: 1.35;
  margin-bottom: 0.3em;
}
#game > h1 + p {
  margin-top: 0;
}
.menu-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 2px solid #d2cbd6;
  border-radius: 20px;
  font-weight: 750;
}
.menu-picture {
  display: grid;
  place-items: center;
  width: 62px;
  height: 58px;
}
.menu-picture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.controls > button {
  min-height: 46px;
}
.board {
  border: 1px solid #ded6ef;
}
.board.finished {
  border: 3px solid #79a988;
}
.tile {
  color: #403b49;
  min-width: 0;
}
.pair-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.pair-grid .tile {
  min-height: 80px;
}
.pair-grid .tile img {
  height: clamp(42px, 12vw, 80px);
}
.board .tile.clue {
  outline: 4px dashed #705789;
  outline-offset: -5px;
}
.menu-card:active,
.tile:not(:disabled):active {
  background: #f8edcf;
}
@media (min-width: 720px) {
  .menu-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .menu-picture {
    width: 82px;
    height: 76px;
  }
  .pair-grid {
    max-width: 740px;
  }
}
@media (max-width: 430px) {
  .wrap {
    width: calc(100% - 24px);
  }
  .board {
    padding: 10px;
  }
  .tiles,
  .light-grid {
    gap: 6px;
  }
  .pair-grid .tile {
    padding: 3px;
  }
  .menu-card {
    font-size: 1rem;
  }
  .controls {
    gap: 6px;
  }
  .board h2 {
    font-size: 1.18rem;
  }
  .controls label {
    max-width: 100%;
  }
}
.frame .pic{height:65px}.frame{min-height:108px}.changes{align-items:stretch}
@media(min-width:700px){.frame .pic{height:95px}.frame{min-height:140px}}
