:root {
  color-scheme: light;
  --ink: #55475f;
  --ink-soft: #897b91;
  --paper: rgba(255, 255, 255, 0.9);
  --pink: #ff729c;
  --pink-deep: #ee4f83;
  --pink-soft: #ffe1eb;
  --purple: #8870d7;
  --purple-soft: #e8e3ff;
  --mint: #57cda7;
  --yellow: #ffd76a;
  --card-radius: 34px;
  --motion-play-state: running;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #fff5f8;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 11%, rgba(255, 226, 150, 0.66), transparent 20rem),
    radial-gradient(circle at 91% 6%, rgba(206, 225, 255, 0.82), transparent 25rem),
    linear-gradient(150deg, #fff9f3 0%, #fff2f7 48%, #f4f2ff 100%);
}

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

.sky-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cloud {
  position: absolute;
  width: 132px;
  height: 46px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  filter: drop-shadow(0 8px 16px rgba(115, 96, 132, 0.08));
  animation: cloud-float 7s ease-in-out infinite;
  animation-play-state: var(--motion-play-state);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 23px;
  width: 58px;
  height: 68px;
}

.cloud::after {
  right: 19px;
  width: 52px;
  height: 55px;
}

.cloud-one {
  top: 18%;
  left: -48px;
}

.cloud-two {
  right: -54px;
  bottom: 16%;
  width: 150px;
  animation-delay: -3s;
}

.sparkle {
  position: absolute;
  color: #ffb94f;
  opacity: 0.7;
  animation: sparkle 2.8s ease-in-out infinite;
  animation-play-state: var(--motion-play-state);
}

.sparkle-one {
  top: 11%;
  left: 17%;
  font-size: 22px;
}

.sparkle-two {
  top: 28%;
  right: 11%;
  color: #a588e5;
  font-size: 17px;
  animation-delay: -0.8s;
}

.sparkle-three {
  bottom: 13%;
  left: 10%;
  color: #ff86aa;
  font-size: 14px;
  animation-delay: -1.4s;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 56px) max(22px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  background: linear-gradient(145deg, #fff3a9, #ffc75f);
  box-shadow: 0 9px 20px rgba(226, 154, 58, 0.22);
  transform: rotate(-4deg);
}

.brand-mark svg {
  width: 45px;
  height: 45px;
  overflow: visible;
  fill: #fff9dc;
  stroke: #7d6482;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark circle {
  fill: #7d6482;
  stroke: none;
}

.brand-mark .star-smile {
  fill: none;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: clamp(20px, 3vw, 27px);
  letter-spacing: 0.05em;
}

.brand-copy small {
  margin-top: 6px;
  color: #aa95ae;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.screen-button {
  min-width: 106px;
  min-height: 52px;
  padding: 10px 17px;
  border: 2px solid rgba(154, 132, 180, 0.16);
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #6d5d77;
  background: rgba(255, 255, 255, 0.77);
  box-shadow: 0 8px 20px rgba(100, 79, 116, 0.09);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.screen-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.screen-button span {
  font-size: 15px;
  font-weight: 800;
}

.screen-button:hover {
  background: #fff;
  box-shadow: 0 10px 24px rgba(100, 79, 116, 0.14);
  transform: translateY(-2px);
}

.screen-button:active {
  transform: scale(0.96);
}

main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(22px, 4vh, 40px);
}

.hero {
  text-align: center;
}

.hero-badge {
  width: fit-content;
  margin: 0 auto 13px;
  padding: 7px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #937699;
  background: rgba(255, 255, 255, 0.64);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.hero-badge span:first-child,
.hero-badge span:last-child {
  color: #9ad8e9;
}

.hero h1 {
  margin: 0;
  color: #5e4d68;
  font-size: clamp(34px, 5.5vw, 58px);
  line-height: 1.15;
  letter-spacing: 0.03em;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.78);
}

.hero p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 2.3vw, 20px);
  font-weight: 600;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 30px);
}

.game-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--card-radius);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 18px 45px rgba(103, 78, 118, 0.14);
  text-decoration: none;
  isolation: isolate;
  transition: transform 210ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 210ms ease;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 180ms ease;
}

.sokoban-card::after {
  background: linear-gradient(150deg, rgba(231, 221, 255, 0.82), rgba(255, 255, 255, 0.1));
}

.snake-card::after {
  background: linear-gradient(150deg, rgba(255, 221, 230, 0.82), rgba(255, 255, 255, 0.1));
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-7px) rotate(-0.35deg);
  box-shadow: 0 25px 55px rgba(103, 78, 118, 0.21);
}

.game-card:hover::after,
.game-card:focus-visible::after {
  opacity: 1;
}

.game-card:focus-visible,
.screen-button:focus-visible {
  outline: 5px solid rgba(255, 187, 71, 0.66);
  outline-offset: 4px;
}

.game-card.is-pressed {
  transform: scale(0.975);
}

.card-art {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8.35;
  display: block;
  overflow: hidden;
  background: #f9f4ff;
}

.card-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(to top, rgba(61, 41, 69, 0.23), transparent);
  pointer-events: none;
}

.card-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 400ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

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

.game-kind {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 1;
  min-height: 38px;
  padding: 7px 13px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #67556e;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 18px rgba(78, 58, 89, 0.12);
  font-size: 14px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.card-content {
  padding: clamp(18px, 2.7vw, 27px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.title-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.game-title {
  font-size: clamp(23px, 3.1vw, 31px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.025em;
}

.sokoban-card .game-title {
  color: #745ba3;
}

.snake-card .game-title {
  color: #e95e89;
}

.game-symbol {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  transform: rotate(7deg);
}

.box-symbol {
  color: #a47428;
  background: #ffdfa0;
  box-shadow: inset 0 -4px 0 rgba(191, 129, 39, 0.16);
}

.snake-symbol {
  color: #fff;
  background: #ff8ba9;
  box-shadow: 11px 0 0 -6px #ffb1c3, 19px 1px 0 -7px #ffd1dc;
}

.game-description {
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.9vw, 18px);
  font-weight: 600;
  line-height: 1.5;
}

.play-button {
  min-height: 58px;
  margin-top: 20px;
  padding: 12px 20px 12px 24px;
  border-radius: 19px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: inset 0 -4px 0 rgba(93, 55, 100, 0.14), 0 9px 20px rgba(105, 73, 117, 0.17);
}

.sokoban-card .play-button {
  background: linear-gradient(135deg, #947bdd, #785fc3);
}

.snake-card .play-button {
  background: linear-gradient(135deg, #ff83a8, #ed5d88);
}

.play-button svg {
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer {
  min-height: 70px;
  padding: 12px 20px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.5);
}

.site-footer p {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.site-footer strong {
  color: #715d78;
  font-size: 15px;
}

.site-footer p span {
  color: #9a8c9f;
  font-size: 13px;
}

.footer-rainbow {
  font-size: 22px;
}

.footer-heart {
  color: #ff8bab;
  font-size: 18px;
  animation: heartbeat 1.8s ease-in-out infinite;
  animation-play-state: var(--motion-play-state);
}

.launch-toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 10;
  min-width: 190px;
  min-height: 58px;
  padding: 12px 21px;
  border: 3px solid #fff;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #6b5571;
  background: #fff2a8;
  box-shadow: 0 16px 36px rgba(93, 68, 105, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 24px) scale(0.9);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

.launch-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

@keyframes cloud-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-13px); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.35; transform: scale(0.75) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(18deg); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.14); }
}

@media (max-width: 720px) {
  .page-shell {
    gap: 18px;
  }

  .brand-mark {
    width: 51px;
    height: 51px;
    border-radius: 17px;
  }

  .brand-mark svg {
    width: 39px;
    height: 39px;
  }

  .brand-copy small,
  .screen-button span {
    display: none;
  }

  .screen-button {
    min-width: 52px;
    width: 52px;
    padding: 10px;
    border-radius: 17px;
  }

  main {
    justify-content: flex-start;
    gap: 22px;
  }

  .hero-badge {
    display: none;
  }

  .hero h1 {
    font-size: clamp(31px, 9.5vw, 43px);
  }

  .hero p {
    margin-top: 8px;
  }

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

  .card-art {
    aspect-ratio: 16 / 7.7;
  }

  .card-content {
    padding: 18px 20px 20px;
  }

  .game-title {
    font-size: 24px;
  }

  .play-button {
    width: 100%;
    justify-content: center;
  }

  .site-footer {
    margin-top: 2px;
  }

  .site-footer p {
    display: block;
    text-align: center;
  }

  .site-footer p span {
    display: none;
  }
}

@media (max-width: 390px) {
  .page-shell {
    padding-inline: 13px;
  }

  .brand-copy strong {
    font-size: 19px;
  }

  .game-kind {
    top: 10px;
    left: 10px;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
  }
}

@media (orientation: landscape) and (max-height: 820px) and (min-width: 721px) {
  .page-shell {
    gap: 12px;
    padding-block: 12px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-mark svg {
    width: 37px;
    height: 37px;
  }

  main {
    gap: 12px;
  }

  .hero-badge,
  .site-footer {
    display: none;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero p {
    margin-top: 4px;
    font-size: 15px;
  }

  .card-art {
    aspect-ratio: 16 / 7.4;
  }

  .card-content {
    padding: 13px 18px 16px;
  }

  .game-title {
    font-size: 22px;
  }

  .game-description {
    margin-top: 3px;
    font-size: 14px;
  }

  .play-button {
    min-height: 45px;
    margin-top: 10px;
    padding-block: 8px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-play-state: paused;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
