* {
  box-sizing: border-box;
}

:root {
  --cream: #fffdf1;
  --yellow: #ffe7a0;
  --blue: #2fb0ef;
  --orange: #ffad08;
  --red: #f04438;
  --dark: #47352c;
  --white: #ffffff;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100vh;
  margin: 0;
  color: var(--dark);
  font-family: "Trebuchet MS", "Comic Sans MS", Arial, sans-serif;
  background: var(--cream);
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

main {
  flex: 1 0 auto;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  height: 190px;
  background: linear-gradient(180deg, #ffe9a8 0%, #ffe39b 100%);
  overflow: hidden;
}

.header-inner {
  /* position: relative;
  z-index: 5; */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 28px;
}

.header-birds {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.cloud-layer {
  position: absolute;
  left: -3%;
  right: -3%;
  bottom: -42px;
  z-index: 2;
  height: 105px;
  pointer-events: none;
}

.cloud-layer-back {
  bottom: -28px;
  opacity: 0.75;
  background:
    radial-gradient(circle at 5% 65%, var(--cream) 0 55px, transparent 56px),
    radial-gradient(circle at 14% 50%, var(--cream) 0 45px, transparent 46px),
    radial-gradient(circle at 25% 64%, var(--cream) 0 62px, transparent 63px),
    radial-gradient(circle at 39% 52%, var(--cream) 0 48px, transparent 49px),
    radial-gradient(circle at 53% 65%, var(--cream) 0 60px, transparent 61px),
    radial-gradient(circle at 68% 50%, var(--cream) 0 50px, transparent 51px),
    radial-gradient(circle at 82% 64%, var(--cream) 0 58px, transparent 59px),
    radial-gradient(circle at 95% 52%, var(--cream) 0 48px, transparent 49px);
}

.cloud-layer-front {
  z-index: 3;
  background:
    radial-gradient(circle at 0% 62%, var(--cream) 0 72px, transparent 73px),
    radial-gradient(circle at 9% 68%, var(--cream) 0 58px, transparent 59px),
    radial-gradient(circle at 17% 57%, var(--cream) 0 64px, transparent 65px),
    radial-gradient(circle at 31% 72%, var(--cream) 0 78px, transparent 79px),
    radial-gradient(circle at 43% 62%, var(--cream) 0 60px, transparent 61px),
    radial-gradient(circle at 51% 58%, var(--cream) 0 48px, transparent 49px),
    radial-gradient(circle at 66% 74%, var(--cream) 0 82px, transparent 83px),
    radial-gradient(circle at 78% 58%, var(--cream) 0 64px, transparent 65px),
    radial-gradient(circle at 88% 68%, var(--cream) 0 56px, transparent 57px),
    radial-gradient(circle at 100% 60%, var(--cream) 0 72px, transparent 73px);
}

.cloud-layer-front::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 22px;
  content: "";
  background: var(--cream);
}

.bird {
  position: absolute;
  width: 34px;
  height: 18px;
  background: var(--orange);
  border-radius: 65% 45% 50% 65%;
  animation: float-header-birds 7s ease-in-out infinite;
}

.bird::before,
.bird::after {
  position: absolute;
  content: "";
  background: var(--orange);
}

.bird::before {
  top: -10px;
  left: 8px;
  width: 21px;
  height: 18px;
  border-radius: 80% 20% 70% 20%;
  transform: rotate(-24deg);
  transform-origin: 30% 95%;
}

.bird::after {
  top: 4px;
  left: -9px;
  width: 14px;
  height: 10px;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.bird-left {
  top: 80px;
  left: 12%;
  transform: scale(0.78) rotate(-10deg);
}

.bird-mid {
  top: 95px;
  left: 56%;
  transform: scale(0.58) rotate(8deg);
  animation-delay: -1.5s;
}

.bird-right {
  top: 75px;
  right: 18%;
  transform: scale(0.68) rotate(14deg);
  animation-delay: -2.5s;
}

.site-logo {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.site-logo img {
  display: block;
  width: clamp(170px, 18vw, 270px);
  height: auto;
}

@keyframes float-header-birds {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 8px;
  }
}

.hero {
  padding: 88px 0 20px;
  text-align: center;
}

.toy-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 4.8vw, 62px);
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  font-size: clamp(2.2rem, 4.4vw, 4rem);
  line-height: 1;
}

.toy-row span {
  display: inline-block;
  color: var(--blue);
  filter: saturate(0.82) contrast(0.92) drop-shadow(0 3px 0 rgba(71, 53, 44, 0.08));
  transform-origin: center;
}

.toy-row span:nth-child(3n + 1) {
  color: #4f5cff;
}

.toy-row span:nth-child(3n + 2) {
  color: #ff8aa6;
}

.toy-row span:nth-child(3n) {
  color: #30bfa2;
}

.toy-row span:nth-child(2n) {
  transform: rotate(-8deg);
}

.toy-row span:nth-child(3n) {
  transform: rotate(9deg);
}

.hero h1,
.game-hero h1 {
  margin: 0;
  color: var(--orange);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 3px 5px 0 rgba(255, 173, 8, 0.2);
}

.hero h1 {
  font-size: clamp(2.85rem, 5vw, 4.35rem);
}

.games-section {
  padding: 22px 0 112px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 28px 30px;
  width: min(1060px, 100%);
  margin: 0 auto;
}

.game-card {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  text-decoration: none;
  background: var(--white);
  border: 5px solid var(--white);
  border-radius: 13px;
  box-shadow: 0 13px 28px rgba(71, 53, 44, 0.17);
  transform: translateY(0) scale(1) rotate(0);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.game-card:hover,
.game-card:focus-visible {
  border-color: #ffd34a;
  box-shadow: 0 22px 40px rgba(71, 53, 44, 0.23);
  transform: translateY(-8px) scale(1.045) rotate(-1deg);
}

.game-card:focus-visible {
  outline: 4px solid var(--red);
  outline-offset: 4px;
}

.game-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 320ms ease;
}

.game-card:hover img,
.game-card:focus-visible img {
  transform: scale(1.045);
}

.games-message {
  max-width: 620px;
  margin: 22px auto 0;
  padding: 16px 20px;
  color: var(--white);
  text-align: center;
  background: var(--red);
  border-radius: 18px;
}

.message-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-left: 14px;
  padding: 0 18px;
  color: var(--red);
  font-weight: 900;
  text-decoration: none;
  background: var(--white);
  border-radius: 999px;
}

.message-back-link:hover,
.message-back-link:focus-visible {
  text-decoration: underline;
}

.kids-bottom {
  display: flex;
  justify-content: center;
  gap: 44px;
  min-height: 124px;
  margin-top: -86px;
  padding-bottom: 8px;
}

.kid {
  position: relative;
  display: grid;
  width: 122px;
  height: 146px;
  place-items: center;
}

.kid::before {
  position: absolute;
  bottom: 0;
  width: 58px;
  height: 74px;
  content: "";
  background: var(--white);
  border: 6px solid #ffc477;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
}

.kid-face {
  position: relative;
  z-index: 2;
  display: grid;
  width: 94px;
  height: 94px;
  place-items: center;
  font-size: 3.5rem;
  background: #ffb36f;
  border-radius: 50%;
  box-shadow: inset -8px -8px 0 rgba(119, 53, 35, 0.14);
}

.kid-hair {
  position: absolute;
  top: 0;
  z-index: 3;
  width: 82px;
  height: 45px;
  border-radius: 60% 60% 42% 44%;
}

.kid-hair-blonde {
  left: 12px;
  background: #ffd47d;
  transform: rotate(-12deg);
}

.kid-hair-brown {
  right: 10px;
  background: #563429;
  transform: rotate(12deg);
}

.kid-gamepad {
  position: absolute;
  bottom: 28px;
  z-index: 4;
  font-size: 2rem;
}

.cloud-footer {
  position: relative;
  flex-shrink: 0;
  min-height: 104px;
  margin-top: -82px;
  padding: 64px 28px 12px;
  color: var(--white);
  background: var(--blue);
  overflow: visible;
}

.cloud-footer::before {
  position: absolute;
  right: 0;
  top: -62px;
  left: 0;
  height: 86px;
  content: "";
  background:
    radial-gradient(circle at 4% 78%, var(--blue) 0 42px, transparent 43px),
    radial-gradient(circle at 11% 68%, var(--blue) 0 34px, transparent 35px),
    radial-gradient(circle at 18% 88%, var(--blue) 0 48px, transparent 49px),
    radial-gradient(circle at 26% 68%, var(--blue) 0 44px, transparent 45px),
    radial-gradient(circle at 34% 92%, var(--blue) 0 54px, transparent 55px),
    radial-gradient(circle at 44% 72%, var(--blue) 0 38px, transparent 39px),
    radial-gradient(circle at 54% 88%, var(--blue) 0 48px, transparent 49px),
    radial-gradient(circle at 65% 64%, var(--blue) 0 48px, transparent 49px),
    radial-gradient(circle at 76% 88%, var(--blue) 0 54px, transparent 55px),
    radial-gradient(circle at 87% 70%, var(--blue) 0 42px, transparent 43px),
    radial-gradient(circle at 96% 84%, var(--blue) 0 46px, transparent 47px);
}

.cloud-footer nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: flex-end;
  width: min(1120px, 100%);
  margin: 0 auto;
  font-size: 0.95rem;
}

.cloud-footer a {
  color: var(--white);
  text-decoration: none;
}

.cloud-footer a:hover,
.cloud-footer a:focus-visible {
  text-decoration: underline;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  color: var(--white);
  font-weight: 900;
  text-decoration: none;
  background: var(--red);
  border: 5px solid var(--white);
  border-radius: 999px;
  box-shadow: 0 8px 0 rgba(130, 30, 26, 0.23);
  transform: translateY(0) scale(1);
  transition:
    box-shadow 180ms ease,
    filter 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.back-button:hover,
.back-button:focus-visible {
  filter: saturate(1.08);
  box-shadow: 0 11px 0 rgba(130, 30, 26, 0.23);
  transform: translateY(-3px) scale(1.04);
}

.back-button:active {
  box-shadow: 0 4px 0 rgba(130, 30, 26, 0.23);
  transform: translateY(4px) scale(0.98);
}

.back-button:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}

.top-back-button {
  position: absolute;
  top: 30px;
  left: max(22px, calc((100vw - 1120px) / 2));
  z-index: 2;
  width: 78px;
  height: 58px;
  font-size: 2.2rem;
}

.game-page {
  padding-bottom: 150px;
}

.game-hero {
  padding: 72px 0 34px;
}

.game-hero h1 {
  margin-bottom: 28px;
  font-size: clamp(2.7rem, 6vw, 4.8rem);
}

.player-shell {
  width: min(900px, 100%);
  margin: 0 auto;
  overflow: hidden;
  background: #000000;
  border: 7px solid var(--white);
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(71, 53, 44, 0.2);
}

.player-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000000;
  border-radius: 10px 10px 0 0;
}

.player-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000000;
}

.player-control-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 14px 18px;
  color: #704800;
  background: #ffd550;
}

.player-control-bar p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 1.15rem;
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fullscreen-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  color: var(--white);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  background: var(--blue);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 5px 0 #1686ca;
}

.fullscreen-button:hover,
.fullscreen-button:focus-visible {
  transform: translateY(-1px);
}

.fullscreen-button:focus-visible {
  outline: 4px solid var(--white);
  outline-offset: 2px;
}

.about-game,
.related-games-section {
  width: min(900px, 100%);
  margin: 34px auto 0;
}

.about-game {
  padding: 28px;
  background: var(--white);
  border: 5px solid #ffe09a;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(71, 53, 44, 0.14);
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.section-heading span {
  font-size: 2rem;
}

.about-game h2,
.related-games-section h2 {
  margin: 0;
  color: var(--orange);
  font-size: 2rem;
  line-height: 1.15;
}

.about-game p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.65;
}

.game-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 0;
}

.game-meta div {
  padding: 16px;
  background: #f0fbff;
  border-radius: 14px;
}

.game-meta dt {
  margin-bottom: 5px;
  color: var(--red);
  font-weight: 900;
}

.game-meta dd {
  margin: 0;
}

.related-games-section h2 {
  margin-bottom: 22px;
  text-align: center;
}

.related-games-grid {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 24px;
  width: min(900px, 100%);
}

.bottom-actions {
  display: flex;
  justify-content: center;
  margin: 34px 0 0;
}

.bottom-back-button {
  min-height: 58px;
  padding: 0 26px;
  font-size: 1.1rem;
}

.content-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 78px 0 150px;
}

.content-card {
  width: min(900px, 100%);
  padding: 34px;
  background: var(--white);
  border: 5px solid #ffe09a;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(71, 53, 44, 0.14);
}

.content-card h1,
.page-title {
  margin: 0 0 18px;
  color: var(--orange);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1;
  text-align: center;
}

.content-back-button,
.home-button {
  min-height: 50px;
  margin-bottom: 22px;
  padding: 0 22px;
}

.content-note {
  padding: 16px 18px;
  color: #6b4b00;
  background: #fff3c7;
  border-radius: 14px;
}

.page-section {
  margin-top: 28px;
}

.content-card h2,
.page-section h2 {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 1.45rem;
  line-height: 1.2;
}

.content-card p,
.page-section p {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.7;
}

@media (max-width: 900px) {
  main {
    width: min(100% - 28px, 1120px);
  }

  .games-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 24px;
  }

  .related-games-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    gap: 22px;
  }

  .cloud-footer nav {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  main {
    width: min(100% - 20px, 1120px);
  }

  .site-header {
    height: 135px;
  }

  .header-inner {
    padding-top: 22px;
  }

  .cloud-layer {
    left: -4%;
    right: -4%;
    bottom: -24px;
    height: 68px;
  }

  .cloud-layer-back {
    bottom: -14px;
    opacity: 0.75;
    background:
      radial-gradient(circle at 5% 65%, var(--cream) 0 32px, transparent 33px),
      radial-gradient(circle at 16% 50%, var(--cream) 0 27px, transparent 28px),
      radial-gradient(circle at 28% 66%, var(--cream) 0 36px, transparent 37px),
      radial-gradient(circle at 43% 52%, var(--cream) 0 29px, transparent 30px),
      radial-gradient(circle at 58% 66%, var(--cream) 0 35px, transparent 36px),
      radial-gradient(circle at 74% 50%, var(--cream) 0 30px, transparent 31px),
      radial-gradient(circle at 91% 64%, var(--cream) 0 34px, transparent 35px);
  }

  .cloud-layer-front {
    background:
      radial-gradient(circle at 0% 62%, var(--cream) 0 42px, transparent 43px),
      radial-gradient(circle at 10% 68%, var(--cream) 0 34px, transparent 35px),
      radial-gradient(circle at 21% 57%, var(--cream) 0 37px, transparent 38px),
      radial-gradient(circle at 36% 72%, var(--cream) 0 44px, transparent 45px),
      radial-gradient(circle at 50% 62%, var(--cream) 0 35px, transparent 36px),
      radial-gradient(circle at 62% 58%, var(--cream) 0 29px, transparent 30px),
      radial-gradient(circle at 76% 74%, var(--cream) 0 46px, transparent 47px),
      radial-gradient(circle at 89% 58%, var(--cream) 0 37px, transparent 38px),
      radial-gradient(circle at 100% 60%, var(--cream) 0 42px, transparent 43px);
  }

  .cloud-layer-front::after {
    height: 16px;
  }

  .bird {
    width: 26px;
    height: 14px;
  }

  .bird::before {
    top: -8px;
    left: 6px;
    width: 16px;
    height: 14px;
  }

  .bird::after {
    top: 3px;
    left: -7px;
    width: 11px;
    height: 8px;
  }

  .bird-left {
    top: 62px;
    left: 8%;
    transform: scale(0.68) rotate(-10deg);
  }

  .bird-mid {
    top: 68px;
    left: 56%;
    transform: scale(0.55) rotate(8deg);
  }

  .bird-right {
    top: 58px;
    right: 9%;
    transform: scale(0.58) rotate(14deg);
  }

  .site-logo {
    width: auto;
  }

  .site-logo img {
    width: 180px;
  }

  .hero {
    padding-top: 60px;
  }

  .toy-row {
    gap: 16px 24px;
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .games-section {
    padding-bottom: 132px;
  }

  .games-grid,
  .related-games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .game-card {
    border-width: 4px;
    border-radius: 10px;
  }

  .kids-bottom {
    gap: 10px;
    min-height: 138px;
    margin-top: -66px;
  }

  .kid {
    transform: scale(0.84);
  }

  .cloud-footer {
    padding: 88px 16px 18px;
  }

  .cloud-footer nav {
    justify-content: center;
    text-align: center;
  }

  .top-back-button {
    top: 22px;
    left: 10px;
    width: 58px;
    height: 48px;
    min-height: 48px;
    border-width: 4px;
    font-size: 1.7rem;
  }

  .game-page {
    padding-bottom: 124px;
  }

  .game-hero {
    padding-top: 56px;
  }

  .game-hero h1 {
    margin-bottom: 20px;
    font-size: 2.45rem;
  }

  .player-shell {
    border-width: 4px;
    border-radius: 14px;
  }

  .player-control-bar {
    min-height: auto;
    padding: 12px;
  }

  .player-control-bar p {
    font-size: 1rem;
  }

  .fullscreen-button {
    min-height: 42px;
    padding: 0 14px;
    font-size: 0.9rem;
  }

  .about-game {
    padding: 20px;
    border-width: 4px;
  }

  .about-game h2,
  .related-games-section h2 {
    font-size: 1.65rem;
  }

  .game-meta {
    grid-template-columns: 1fr;
  }

  .message-back-link {
    justify-content: center;
    width: 100%;
    margin: 12px 0 0;
  }

  .content-page {
    padding: 58px 0 124px;
  }

  .content-card {
    padding: 22px;
    border-width: 4px;
  }

  .content-card h2 {
    font-size: 1.25rem;
  }
}

@media (max-width: 360px) {
  .header-birds {
    display: none;
  }

  .toy-row {
    gap: 14px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bird {
    animation: none;
  }

  .game-card,
  .game-card img,
  .back-button {
    transition: none;
  }
}
