* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #402540;
  background: #fff0f1;
}
body {
  margin: 0;
  min-width: 260px;
  min-height: 100svh;
  background: radial-gradient(ellipse at 85% 62%, #dcf6f6, transparent 55%),
    radial-gradient(ellipse at 10% 42%, #ffdfeb, transparent 57%), #fff4ee;
}
.lobby {
  --gutter: clamp(1.65rem, 7.5vw, 5rem);
  width: min(100%, 81rem);
  min-height: 100svh;
  margin-inline: auto;
  padding: 0 var(--gutter) 4.2rem;
}
.masthead {
  --hero-height: clamp(20rem, 60vw, 37rem);
  position: relative;
  min-height: 19rem;
  height: var(--hero-height);
  overflow: hidden;
  isolation: isolate;
  margin-inline: calc(-1 * var(--gutter));
  background: #ffe1e8;
}
.masthead::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3.6rem;
  pointer-events: none;
  background: linear-gradient(transparent, #ffebed 93%);
}
.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
.hero-copy {
  position: absolute;
  z-index: 1;
  top: max(clamp(2.1rem, 9vw, 8.6rem), calc(env(safe-area-inset-top) + 1.35rem));
  left: clamp(1.35rem, 7.5vw, 8rem);
}
.studio {
  width: fit-content;
  margin: 0 0 .4rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .22em;
  color: #81315c;
}
h1 {
  margin: 0;
  font-size: clamp(2.15rem, 8.5vw, 5.2rem);
  font-weight: 900;
  letter-spacing: .05em;
  line-height: 1.2;
  color: #662048;
  text-shadow: 0 1px #fff7f7, 0 3px #f8b8cb, 0 5px #df729f73;
}
.cabinet { margin: .8rem auto 0; }
#games {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.3rem, 10vw, 4rem) clamp(1.5rem, 7vw, 4.3rem);
  max-width: 66rem;
  margin-inline: auto;
}
.game-card {
  --trim: #f4d4a1;
  --edge: #a16b40;
  --base: #7b4935;
  --fallback: #be804f;
  --turn: -14deg;
  display: block;
  min-width: 0;
  position: relative;
  isolation: isolate;
  color: inherit;
  border-radius: 1.2rem;
  outline-offset: .45rem;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.game-card:nth-child(even) { --turn: 12deg; }
.game-card[data-game="spot"] { --trim: #d5e8ad; --edge: #74864c; --base: #4c623b; --fallback: #93a362; }
.game-card[data-game="cat"] { --trim: #ffd2a8; --edge: #bd7959; --base: #8d4b39; --fallback: #c89267; }
.game-card[data-game="screw"] { --trim: #cae8ef; --edge: #6d9ead; --base: #3b6b83; --fallback: #81a4bd; }
.game-card[data-game="match"] { --trim: #f2d4f7; --edge: #a48bc9; --base: #765795; --fallback: #b596c4; }
.game-card[data-game="craft"] { --trim: #ffd8e7; --edge: #d174a1; --base: #9f4776; --fallback: #db8cb3; }
.game-card:focus-visible { outline: 2px solid #8b3c6b; }
.tile {
  display: block;
  position: relative;
  aspect-ratio: 1;
  border-radius: 19%;
  transform: perspective(680px) rotateX(12deg) rotateY(var(--turn)) rotateZ(-2deg);
  transform-origin: 50% 65%;
  background: var(--base);
  border: 2px solid var(--edge);
  box-shadow:
    1px 3px 0 var(--edge), 2px 7px 0 var(--base), 3px 12px 0 var(--base),
    4px 13px 0 #61432e, 6px 14px 8px #76441d7d, 13px 23px 18px #7b492746;
  transition: transform 190ms ease, box-shadow 190ms ease;
}
.game-card:nth-child(even) .tile {
  transform: perspective(680px) rotateX(10deg) rotateY(var(--turn)) rotateZ(2deg);
}
.tile-face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  isolation: isolate;
  background: var(--fallback);
}
.tile-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(141deg, #fff5cb43 0, transparent 31%, transparent 75%, #37213825 100%);
  box-shadow:
    inset 0 0 0 1px var(--trim), inset 3px 3px 0 #fffbdfb3,
    inset -3px -3px 0 #35221547, inset 0 -7px 10px #2f222338;
}
.cover-art {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
[data-game="cat"] .cover-art { inset: -115% auto auto -14%; width: 138%; height: auto; }
[data-game="craft"] .tile-face {
  background: radial-gradient(ellipse at 30% 16%, #fff5f4 6%, #f3afc9 52%, #b666a9 100%);
}
[data-game="craft"] .cover-art {
  inset: 6% 13%;
  width: 74%;
  height: 88%;
  object-fit: contain;
  filter: drop-shadow(4px 7px 4px #6334446b);
}
.cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: #fff4d8;
  font-size: clamp(2rem, 10vw, 5rem);
  font-weight: 900;
}
.caption {
  position: relative;
  display: grid;
  gap: .34rem;
  margin-top: clamp(1.75rem, 7.4vw, 2.85rem);
  padding-right: 1.4rem;
}
.caption strong {
  font-size: clamp(.98rem, 4.6vw, 1.6rem);
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.19;
  color: #4c2849;
  text-shadow: 0 1px #fff7fa;
}
.description {
  font-size: clamp(.67rem, 2.8vw, .9rem);
  color: #5e405a;
  line-height: 1.35;
}
.play {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(1.22rem, 5.4vw, 1.75rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff5ff;
  background: linear-gradient(#bf6795, #964273);
  box-shadow: inset 0 1px #f7bedb, 0 2px #78335f, 0 4px 5px #70375e40;
}
.play::before {
  content: "";
  border-top: .24em solid transparent;
  border-bottom: .24em solid transparent;
  border-left: .38em solid currentColor;
  transform: translateX(.08em);
}
@media (hover: hover) {
  .game-card:hover .tile { transform: perspective(680px) translateY(-.48rem) rotateY(calc(var(--turn) / 2)); }
}
.game-card:active .tile {
  transform: perspective(680px) translateY(.3rem) rotateY(var(--turn));
  box-shadow: 1px 2px 0 var(--edge), 2px 5px 0 var(--base), 3px 7px 6px #784c2e85;
}
#status { margin: 1rem auto; text-align: center; }
#status:empty { display: none; }
@media (max-width: 350px) {
  .lobby { --gutter: 1.35rem; }
  .masthead { min-height: 0; height: 17.6rem; }
  #games { column-gap: 1.1rem; }
  .caption { padding-right: 1.23rem; }
  .caption strong { letter-spacing: 0; }
}
@media (min-width: 760px) {
  .masthead { background: linear-gradient(110deg, #ffdfda 25%, #d5f2f3 93%); }
  .hero-art {
    left: auto;
    width: min(100%, calc(var(--hero-height) * 1.5));
    object-fit: contain;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%);
    mask-image: linear-gradient(90deg, transparent, #000 16%);
  }
  #games { grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); }
  .cabinet { margin-top: 1.5rem; }
  .caption strong { font-size: clamp(.95rem, 2.05vw, 1.5rem); }
}
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }
