:root {
  --font-title: 'Chewy', 'Marker Felt', 'Comic Sans MS', cursive;
  --font-chalk: 'Gochi Hand', 'Chalkboard SE', 'Marker Felt', cursive;
  --chalk: #f6f4ec;
  --chalk-yellow: #f3e36a;
  --board: #343a3a;
  --brass-light: #f4d98a;
  --brass: #c99a3b;
  --brass-dark: #7a5512;
  --wall: #3a1a09;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--wall);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--chalk);
  font-family: var(--font-chalk);
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255, 196, 110, 0.28), transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.6) 100%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0 3px, rgba(255, 190, 130, 0.08) 3px 5px, transparent 5px 170px),
    linear-gradient(rgba(40, 12, 0, 0.45), rgba(40, 12, 0, 0.45)),
    url('../img/wood.jpg') center top / 340px 760px;
  background-attachment: fixed;
}

.launcher {
  max-width: 1120px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left));
}

/* Chalkboard sign */

.sign {
  display: flex;
  justify-content: center;
  margin-bottom: 64px;
}

.sign__board {
  position: relative;
  width: min(620px, 100%);
  padding: 22px 28px 26px;
  border: 16px solid transparent;
  border-radius: 8px;
  text-align: center;
  background:
    url('../img/chalk.svg') center / cover padding-box,
    radial-gradient(ellipse at 45% 35%, #4a5050 0%, var(--board) 55%, #202424 100%) padding-box,
    url('../img/wood.jpg') center / 500px 250px border-box;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.6),
    inset 0 4px 14px rgba(0, 0, 0, 0.7),
    0 14px 30px rgba(0, 0, 0, 0.7);
}

.sign__title {
  display: inline-block;
  position: relative;
  margin: 0;
  padding: 4px 36px 10px;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(40px, 9vw, 76px);
  line-height: 1;
  white-space: nowrap;
  color: #ef4b3a;
  text-shadow: 3px 3px 0 #7a1309;
  transform: rotate(-3deg);
}

.sign__title::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 46% 54% 50% 50% / 60% 55% 45% 40%;
  background: #2f66d8;
  box-shadow: 0 0 0 4px var(--chalk), 4px 6px 0 4px rgba(0, 0, 0, 0.4);
}

.sign__subtitle {
  margin: 16px 0 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.1;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.6);
}

/* Game tiles */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 72px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.15s ease;
}

.game:focus {
  outline: none;
}

.game:focus-visible .game__frame {
  outline: 4px dashed var(--chalk-yellow);
  outline-offset: 6px;
}

.game:active,
.game.is-launching {
  transform: scale(0.96);
}

.game__frame {
  position: relative;
  width: 100%;
  padding: 14px;
  border-radius: 6px;
  background: url('../img/wood.jpg') center / 600px 300px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 210, 160, 0.25),
    inset 0 0 14px rgba(0, 0, 0, 0.6),
    0 16px 28px rgba(0, 0, 0, 0.75);
  transform: rotate(var(--tilt, 0deg));
}

.game__frame::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -34px;
  width: 120px;
  height: 36px;
  margin-left: -60px;
  border: 3px solid rgba(30, 14, 4, 0.9);
  border-bottom: 0;
  border-radius: 60px 60px 0 0 / 36px 36px 0 0;
  transform-origin: 50% 100%;
}

.game__frame::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -42px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--brass-light), var(--brass) 55%, var(--brass-dark));
  box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.6);
}

.game__picture {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.7);
}

.game__picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game__picture::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.16), transparent 35%);
  pointer-events: none;
}

.game__plaque {
  margin-top: 18px;
  padding: 8px 26px 10px;
  border-radius: 6px;
  text-align: center;
  color: #3b2606;
  background: linear-gradient(160deg, var(--brass-light), var(--brass) 55%, #a87a22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25),
    0 6px 12px rgba(0, 0, 0, 0.6);
}

.game__name {
  display: block;
  font-family: var(--font-title);
  font-size: 34px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6);
}

.game__tagline {
  display: block;
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.1;
}

.game--soon {
  opacity: 0.55;
}

.game--soon .game__picture {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-size: 32px;
  line-height: 1.1;
  background:
    url('../img/chalk.svg') center / cover,
    radial-gradient(ellipse at 45% 35%, #4a5050 0%, var(--board) 55%, #202424 100%);
}

.launcher__error {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 30px;
}

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