:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101014;
  color: #f4f4f5;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 15% 15%, rgb(255 255 255 / 7%), transparent 30rem),
    #101014;
}

button,
a,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 600px;
  min-height: 600px;
  overflow: hidden;
}

.draggable-grid {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
  overscroll-behavior: contain;
}

.draggable-grid.is-dragging {
  cursor: grabbing;
}

.grid-track {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  box-sizing: border-box;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.grid-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: rgb(255 255 255 / 85%);
  font-weight: 600;
  cursor: pointer;
  isolation: isolate;
}

.is-dragging .grid-tile {
  cursor: grabbing;
}

.grid-tile__number {
  position: relative;
  z-index: 0;
}

.grid-tile__image {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.grid-tile::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: inherit;
  pointer-events: none;
}

.help {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 13px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  background: rgb(10 10 14 / 64%);
  color: rgb(255 255 255 / 68%);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.help__separator {
  opacity: 0.35;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: min(90vw, 520px);
  padding: 11px 15px;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 999px;
  background: rgb(10 10 14 / 78%);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 700px), (max-height: 700px) {
  .page-shell {
    min-width: 0;
    min-height: 0;
  }

  .help {
    right: 12px;
    bottom: 12px;
  }

  .toast {
    bottom: 64px;
  }
}

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