:root {
  --bg: #090b16;
  --card: #111525;
  --text: #f7f8ff;
  --muted: #858ba5;
  --border: rgba(255,255,255,.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;

  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(92,72,255,.20),
      transparent 38%
    ),
    var(--bg);

  color: var(--text);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  overflow-x: hidden;
}

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

/* =========================
   MAIN VIEWPORT
========================= */

.launcher {
  width: min(100% - 28px, 1100px);

  min-height: 100dvh;

  margin: 0 auto;

  padding:
    max(20px, env(safe-area-inset-top))
    0
    max(16px, env(safe-area-inset-bottom));

  display: grid;

  grid-template-rows: auto 1fr auto;

  gap: 18px;
}

/* =========================
   HEADER
========================= */

.hero {
  text-align: center;
}

.logo-mark {
  width: 42px;
  height: 42px;

  margin: 0 auto 12px;

  border-radius: 13px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 4px;

  background: linear-gradient(
    135deg,
    #765cff,
    #9b6cff
  );

  box-shadow:
    0 10px 28px rgba(118,92,255,.28);

  transform: rotate(-5deg);
}

.logo-mark span {
  width: 4px;
  height: 18px;

  border-radius: 5px;

  background: white;
}

.logo-mark span:nth-child(1) {
  height: 11px;
  opacity: .65;
}

.logo-mark span:nth-child(3) {
  height: 14px;
  opacity: .8;
}

.eyebrow {
  color: #8275ff;

  font-size: 9px;
  font-weight: 800;

  letter-spacing: .2em;

  margin-bottom: 6px;
}

h1 {
  font-size: clamp(30px, 9vw, 56px);

  line-height: 1;

  letter-spacing: -.05em;

  font-weight: 900;
}

.subtitle {
  margin-top: 8px;

  color: var(--muted);

  font-size: 12px;
}

/* =========================
   GAME GRID
========================= */

.games {
  min-height: 0;

  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  grid-template-rows: repeat(3, minmax(0, 1fr));

  gap: 10px;
}

/* =========================
   GAME CARD
========================= */

.game-card {
  position: relative;

  min-width: 0;
  min-height: 0;

  padding: 13px;

  border: 1px solid var(--border);

  border-radius: 20px;

  overflow: hidden;

  text-decoration: none;

  color: white;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.075),
      rgba(255,255,255,.025)
    );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04);

  transition:
    transform .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;

  display: flex;
  flex-direction: column;
}

/* decorative glow */

.game-card::before {
  content: "";

  position: absolute;

  width: 90px;
  height: 90px;

  right: -35px;
  top: -35px;

  border-radius: 50%;

  background: var(--accent);

  opacity: .14;

  filter: blur(5px);

  pointer-events: none;
}

.game-card:active {
  transform: scale(.96);
}

/* =========================
   ICON
========================= */

.icon {
  width: 44px;
  height: 44px;

  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 14px;

  background:
    color-mix(
      in srgb,
      var(--accent) 17%,
      transparent
    );

  color: var(--accent);
}

.icon svg {
  width: 27px;
  height: 27px;

  fill: none;

  stroke: currentColor;

  stroke-width: 2.7;

  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================
   CARD INFO
========================= */

.game-info {
  margin-top: auto;

  position: relative;

  padding-top: 8px;
}

.game-number {
  display: block;

  color: var(--accent);

  font-size: 8px;

  font-weight: 800;

  letter-spacing: .12em;

  margin-bottom: 3px;
}

.game-info h2 {
  font-size: clamp(13px, 3.5vw, 18px);

  font-weight: 800;

  letter-spacing: -.02em;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

  padding-right: 35px;
}

.play {
  position: absolute;

  right: 0;
  bottom: 0;

  color: #8d93aa;

  font-size: 7px;

  font-weight: 800;

  letter-spacing: .1em;
}

.play b {
  color: var(--accent);

  font-size: 14px;

  margin-left: 2px;
}

/* =========================
   COLORS
========================= */

.purple { --accent: #9674ff; }
.blue   { --accent: #4d9cff; }
.green  { --accent: #45d99a; }
.orange { --accent: #ff9b54; }
.pink   { --accent: #ff5d9e; }
.cyan   { --accent: #45d9ff; }

/* =========================
   FOOTER
========================= */

footer {
  display: flex;

  justify-content: center;
  align-items: center;

  gap: 7px;

  color: #4e536b;

  font-size: 7px;

  font-weight: 700;

  letter-spacing: .1em;
}

/* =========================
   TALLER PHONES
========================= */

@media (min-height: 700px) and (max-width: 649px) {

  .launcher {
    padding-top: max(28px, env(safe-area-inset-top));

    gap: 22px;
  }

  .logo-mark {
    width: 46px;
    height: 46px;
  }

  .games {
    gap: 12px;
  }

  .game-card {
    padding: 15px;
    border-radius: 21px;
  }

  .icon {
    width: 50px;
    height: 50px;
  }

  .icon svg {
    width: 30px;
    height: 30px;
  }
}

/* =========================
   SHORT PHONES
========================= */

@media (max-height: 650px) and (max-width: 649px) {

  .launcher {
    padding-top: max(12px, env(safe-area-inset-top));

    gap: 10px;
  }

  .hero {
    display: grid;

    grid-template-columns: auto 1fr;

    column-gap: 10px;

    text-align: left;

    align-items: center;
  }

  .logo-mark {
    grid-row: span 2;

    width: 38px;
    height: 38px;

    margin: 0;
  }

  .eyebrow {
    margin: 0;
  }

  h1 {
    font-size: 26px;
  }

  .subtitle {
    display: none;
  }

  .games {
    gap: 8px;
  }

  .game-card {
    padding: 10px;

    border-radius: 16px;
  }

  .icon {
    width: 38px;
    height: 38px;

    border-radius: 11px;
  }

  .icon svg {
    width: 23px;
    height: 23px;
  }

  .game-info {
    padding-top: 4px;
  }

  .game-number {
    font-size: 7px;
    margin-bottom: 2px;
  }

  .game-info h2 {
    font-size: 12px;
  }

  .play {
    font-size: 6px;
  }

  .play b {
    font-size: 11px;
  }

  footer {
    display: none;
  }
}

/* =========================
   TABLET / DESKTOP
========================= */

@media (min-width: 650px) {

  .launcher {
    padding-top: 50px;

    padding-bottom: 30px;

    gap: 30px;
  }

  .hero {
    margin-bottom: 0;
  }

  .games {
    grid-template-columns: repeat(3, minmax(0, 1fr));

    grid-template-rows: repeat(2, minmax(0, 1fr));

    gap: 18px;
  }

  .game-card {
    padding: 22px;

    border-radius: 26px;
  }

  .icon {
    width: 68px;
    height: 68px;

    border-radius: 20px;
  }

  .icon svg {
    width: 40px;
    height: 40px;
  }

  .game-number {
    font-size: 10px;
  }

  .game-info h2 {
    font-size: 19px;
  }

  .play {
    font-size: 9px;
  }
}

/* =========================
   DESKTOP HOVER
========================= */

@media (min-width: 900px) {

  .game-card:hover {
    transform: translateY(-4px);

    border-color:
      color-mix(
        in srgb,
        var(--accent) 55%,
        transparent
      );

    box-shadow:
      0 18px 40px rgba(0,0,0,.25),
      0 0 30px
      color-mix(
        in srgb,
        var(--accent) 12%,
        transparent
      );
  }

  .game-card::after {
    content: "";

    position: absolute;

    inset: 0;

    background:
      linear-gradient(
        120deg,
        transparent 30%,
        rgba(255,255,255,.035),
        transparent 70%
      );

    transform: translateX(-100%);

    transition: transform .6s ease;

    pointer-events: none;
  }

  .game-card:hover::after {
    transform: translateX(100%);
  }
}

/* =========================
   REDUCE MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
  .game-card,
  .game-card::after {
    transition: none;
  }
}
