   body { font-family: sans-serif; text-align: center; }
  #game {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    grid-gap: 5px;
    max-width: calc(96px * 6 + 6px * 5); /* 6枚分の幅＋隙間 */
    margin: 20px 0 0 0;
  }
  .card {
    width: 100%;
    aspect-ratio: 95 / 140; /* カード比率を維持 */
    perspective: 1000px;
    cursor: pointer;
    border: 1px solid #ccc;
  }
  .card-inner {
    position: relative;
    width: 100%; height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
  }
  .flipped .card-inner {
    transform: rotateY(180deg);
  }
  .card-front, .card-back {
    position: absolute;
    width: 100%; height: 100%;
    backface-visibility: hidden;
  }
  .card-front {
    transform: rotateY(180deg);
  }
  .matched {
    opacity: 0.3;
    cursor: default;
  }