/* The portal shares its palette, typeface and brand with /merge/. */
.portal {
  --portal-border: #e5dac7;
  --portal-accent: #b95044;
}

.portal .wrap {
  width: min(1080px, calc(100% - 64px));
}

.portal main {
  overflow: visible;
}

.portal a:focus-visible,
.portal #games:focus-visible {
  outline: 3px solid #187b61;
  outline-offset: 6px;
}

.portal .header {
  height: 100px;
  border-bottom: 1px solid var(--portal-border);
}

.portal .brand small {
  color: var(--muted);
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 13px;
}

.portal-nav svg {
  width: 18px;
  height: 18px;
  transform: rotate(90deg);
}

.portal-nav:hover {
  color: var(--portal-accent);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.portal-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 20px;
  padding: 36px 0 48px;
}

.portal-intro-copy {
  min-width: 0;
  padding-left: 20px;
}

.portal-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
}

.portal-kicker svg {
  width: 18px;
  height: 18px;
  transform: rotate(-14deg);
}

.portal-intro h1 {
  margin: 0 0 20px;
  font-size: clamp(38px, 4.7vw, 58px);
  line-height: 1.45;
  letter-spacing: .025em;
}

.portal-intro h1 em {
  color: var(--portal-accent);
  background: linear-gradient(transparent 76%, #ffdd7899 76%, #ffdd7899 94%, transparent 94%);
}

.portal-description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

.portal-note {
  margin: 22px 0 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.portal-note span {
  display: inline-block;
  margin-left: 14px;
  color: var(--muted);
  font-weight: 400;
}

.portal-dogs {
  position: relative;
  width: 100%;
  max-width: 510px;
  aspect-ratio: 1.22;
  isolation: isolate;
}

.portal-dogs::before {
  content: "";
  position: absolute;
  inset: 9% 4% 4% 9%;
  z-index: -1;
  border-radius: 48% 52% 44% 56% / 54% 43% 57% 46%;
  background: #ffe7dc;
  transform: rotate(-10deg);
}

.portal-dogs::after {
  content: "";
  position: absolute;
  inset: 14% 9% 9% 14%;
  z-index: -1;
  border: 2px dashed #e9ba9c;
  border-radius: 50%;
  transform: rotate(-10deg);
}

.portal-photo {
  position: absolute;
  aspect-ratio: 1;
  border: 7px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px var(--photo-rim), 0 8px 0 #493b3710;
}

.portal-photo img {
  height: 100%;
  border-radius: inherit;
}

.photo-pom {
  --photo-rim: #e9bd58;
  top: 24%;
  left: 23%;
  z-index: 2;
  width: 51%;
  transform: rotate(-7deg);
}

.photo-shiba {
  --photo-rim: #a8c9b2;
  top: 7%;
  right: 2%;
  width: 33%;
  transform: rotate(10deg);
}

.photo-chihuahua {
  --photo-rim: #e8ac9c;
  bottom: 5%;
  left: 2%;
  z-index: 3;
  width: 32%;
  transform: rotate(-13deg);
}

.portal-hello {
  position: absolute;
  top: 9%;
  left: 10%;
  color: #89583f;
  font-size: clamp(11px, 1.3vw, 15px);
  font-weight: 900;
  letter-spacing: .12em;
  transform: rotate(-12deg);
}

.portal-spark {
  position: absolute;
  top: 32%;
  left: 5%;
  color: #b58d35;
  font-size: 37px;
  line-height: 1;
}

.portal-art-paw {
  position: absolute;
  right: 5%;
  bottom: 26%;
  width: 40px;
  height: 40px;
  color: #b97c61;
  transform: rotate(20deg);
}

.portal-greeting {
  position: absolute;
  right: 5%;
  bottom: 5%;
  z-index: 4;
  padding: 8px 16px;
  border: 1px solid #dfc4a7;
  border-radius: 24px 24px 24px 4px;
  background: #fffdf6;
  font-size: 12px;
  font-weight: 700;
  transform: rotate(-5deg);
}

.portal-games {
  padding-top: 28px;
  border-top: 1px solid var(--portal-border);
  scroll-margin-top: 24px;
}

.portal-games-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 24px;
  text-align: left;
}

.portal-games-heading .eyebrow {
  margin-bottom: 4px;
  font-size: 10px;
}

.portal-games-heading h2 {
  font-size: 28px;
}

.portal-games-heading > p:last-child {
  margin: 0 0 4px;
  font-size: 12px;
}

/* Add another <li> to get equal columns; a single game fills the row. */
.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-list > li {
  min-width: 0;
}

.game-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #dfd4c4;
  border-radius: 28px;
  background: #fffefa;
  box-shadow: 0 5px 0 #e9decc70;
  transition: border-color .2s, box-shadow .2s;
}

.game-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1.5;
  overflow: hidden;
  border-radius: 27px 27px 0 0;
  background: var(--mint);
}

.game-art::before,
.game-art::after {
  content: "";
  position: absolute;
  width: 66%;
  aspect-ratio: 1;
  border: 1px solid #bbd7c4;
  border-radius: 50%;
}

.game-art::before {
  top: -64%;
  left: -22%;
}

.game-art::after {
  right: -33%;
  bottom: -50%;
}

.game-art-label {
  position: absolute;
  top: 9%;
  left: 0;
  width: 100%;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
}

.game-pair {
  position: absolute;
  top: 31%;
  left: 10%;
  display: flex;
  align-items: center;
  width: 43%;
  gap: 5%;
}

.game-pair img {
  width: 42%;
  aspect-ratio: 1;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 3px 0 #426e5a20;
  transform: rotate(-12deg);
}

.game-pair img:last-child {
  transform: rotate(12deg);
}

.game-pair span {
  color: var(--green);
  font-size: 19px;
  font-weight: 900;
}

.game-merge-arrow {
  position: absolute;
  top: 65%;
  left: 39%;
  width: 12%;
  height: 12%;
  color: var(--green);
  transform: rotate(18deg);
}

.game-art .game-grown-dog {
  position: absolute;
  right: 8%;
  bottom: 12%;
  width: 34%;
  aspect-ratio: 1;
  border: 6px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #e9bd58, 0 5px 0 #426e5a20;
  transform: rotate(9deg);
}

.game-art-spark {
  position: absolute;
  top: 27%;
  right: 11%;
  color: #7a6740;
  font-size: 26px;
  line-height: 1;
}

.game-art-word {
  position: absolute;
  bottom: 9%;
  left: 10%;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .15em;
  transform: rotate(-9deg);
}

/* The ohajiki table keeps the same photo-led format as the merge card. */
.oshikura-game-art { background: #e3ebd9; }
.oshikura-game-art .portal-board-shot {
  position: absolute;
  top: 23%;
  left: 5%;
  width: 74%;
  border: 4px solid #fffaf0;
  border-radius: 17px;
  box-shadow: 0 5px 12px #326d5a20;
  transform: rotate(-7deg);
}
.portal-medal {
  position: absolute;
  right: 7%;
  bottom: 10%;
  width: 25%;
  aspect-ratio: 1;
  padding: 4px;
  border: 2px solid #327b66;
  border-radius: 50%;
  background: #68a38a;
  box-shadow: 0 5px 0 #327b66;
  transform: rotate(10deg);
}
.portal-medal img { height: 100%; border: 3px solid #fffdf6; border-radius: 50%; }
.portal-match {
  position: absolute;
  top: 25%;
  right: 9%;
  padding: 2px 13px;
  border: 2px solid #fffdf6;
  border-radius: 30px;
  background: #ebc97d;
  color: #624b2c;
  font-size: clamp(16px, 2vw, 23px);
  font-weight: 900;
  transform: rotate(8deg);
}
.portal-match i { font-size: .65em; }
.oshikura-game-art .game-art-word { bottom: 5%; left: 9%; padding: 3px 8px; border-radius: 5px; background: #fff8e5; color: #39624e; }
.game-card-oshikura .game-action { border-color: #286a58; background: #dcebd5; color: #2c5d4b; box-shadow: 0 3px 0 #286a58; }
.game-card-oshikura:hover, .game-card-oshikura:focus-visible { border-color: #286a58; }
.game-card-oshikura:hover .game-action, .game-card-oshikura:focus-visible .game-action { background: #c9dfbf; }

.game-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px;
}

.game-category {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}

.game-info h3 {
  margin: 8px 0 10px;
  font-size: 27px;
  line-height: 1.5;
  letter-spacing: .02em;
}

.game-info p {
  max-width: 28em;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.game-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 48px;
  margin-top: auto;
  padding: 7px 9px 7px 20px;
  border: 1px solid #b65d50;
  border-radius: 30px;
  background: var(--coral);
  color: #452d28;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 3px 0 #b65d50;
  transition: background .2s;
}

.game-action > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cream);
}

.game-action svg {
  width: 18px;
  height: 18px;
}

.game-card:hover,
.game-card:focus-visible {
  border-color: #b65d50;
  box-shadow: 0 5px 0 #e4bfad70;
}

.game-card:hover .game-action,
.game-card:focus-visible .game-action {
  background: #ff9a87;
}

.portal-signoff {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 32px 0 38px;
  color: var(--muted);
  font-size: 12px;
}

.portal-signoff svg {
  width: 19px;
  height: 19px;
  color: var(--portal-accent);
  transform: rotate(-14deg);
}

.portal .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-block: 20px;
  color: var(--muted);
  font-size: 11px;
}

.portal .footer p {
  margin: 0;
}

.portal .footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.portal .footer-links a:hover {
  color: var(--portal-accent);
}

@media (min-width: 761px) {
  .game-list > li:only-child .game-card {
    display: grid;
    grid-template-columns: 45% minmax(0, 1fr);
  }

  .game-list > li:only-child .game-art {
    height: 100%;
    min-height: 300px;
    border-radius: 27px 0 0 27px;
  }

  .game-list > li:only-child .game-info {
    justify-content: center;
    padding: 32px 40px;
  }

  .game-list > li:only-child .game-info h3 {
    font-size: 32px;
  }

  .game-list > li:only-child .game-action {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .portal .wrap {
    width: min(540px, calc(100% - 40px));
  }

  .portal .header {
    height: 80px;
  }

  .portal-nav {
    gap: 6px;
    font-size: 11px;
  }

  .portal-intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 32px 0 28px;
    text-align: center;
  }

  .portal-intro-copy {
    padding-left: 0;
  }

  .portal-kicker {
    justify-content: center;
    margin-bottom: 14px;
    font-size: 11px;
  }

  .portal-intro h1 {
    margin-bottom: 16px;
    font-size: clamp(35px, 9vw, 44px);
  }

  .portal-description {
    font-size: 12px;
  }

  .portal-note {
    margin-top: 16px;
    font-size: 10px;
  }

  .portal-note span {
    margin-left: 10px;
  }

  .portal-dogs {
    width: min(360px, 100%);
    margin-inline: auto;
  }

  .portal-photo {
    border-width: 5px;
  }

  .portal-art-paw {
    width: 28px;
    height: 28px;
  }

  .portal-spark {
    font-size: 28px;
  }

  .portal-greeting {
    padding: 6px 12px;
    font-size: 10px;
  }

  .portal-games {
    padding-top: 24px;
  }

  .portal-games-heading {
    gap: 7px;
    margin-bottom: 20px;
  }

  .portal-games-heading h2 {
    font-size: 25px;
  }

  .game-info {
    padding: 24px;
  }

  .game-info h3 {
    font-size: 25px;
  }

  .game-info p {
    font-size: 13px;
  }

  .portal-signoff {
    gap: 7px;
    margin: 28px 0;
    font-size: 11px;
  }

  .portal .footer {
    flex-direction: column;
    gap: 4px;
    padding-block: 14px 24px;
    text-align: center;
  }
}
