body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  color: #171717;
  background: #f4f5f7;
}

main {
  min-height: calc(100vh - 64px);
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  animation: page-in 180ms ease-out both;
}

header {
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

p {
  margin: 0;
  color: #555;
}

a {
  color: inherit;
  text-decoration: none;
}

.games {
  display: grid;
  gap: 8px;
}

.game-link,
.result {
  display: block;
  padding: 12px;
  border: 1px solid #d9dde3;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.game-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-count {
  color: #667085;
  font-size: 14px;
  white-space: nowrap;
}

.result.has-thumbnail {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: center;
}

.result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.result-link {
  min-width: 0;
}

.result-link.has-thumbnail {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: center;
}

.result.has-thumbnail {
  display: grid;
  grid-template-columns: 1fr auto;
}

.thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: #e5e7eb;
}

.thumbnail.placeholder {
  object-fit: cover;
}

.copy-link {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9dde3;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease;
}

.copy-link:hover {
  transform: translateY(-1px);
  border-color: #a7b1c2;
  background: #f8fafc;
}

.copy-link.copied {
  border-color: #5c946e;
  background: #eef8f1;
}

.copy-link.copied::after {
  content: "Copied";
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  padding: 4px 7px;
  border-radius: 4px;
  color: #fff;
  background: #1f2937;
  font-size: 12px;
  white-space: nowrap;
}

.copy-link {
  position: relative;
}

.copy-link img {
  width: 18px;
  height: 18px;
  display: block;
}

.game-link:hover,
.result:hover {
  transform: translateY(-2px);
  border-color: #a7b1c2;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  background: #fbfcff;
}

.game-link:focus-visible,
.result-link:focus-visible,
.copy-link:focus-visible,
nav a:focus-visible {
  outline: 3px solid #8ab4f8;
  outline-offset: 3px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #303846;
  font-weight: 700;
  line-height: 1;
  transition: color 140ms ease;
}

.home-link span {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding-top: 1px;
}

.home-link:hover {
  color: #111827;
}

.home-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.search {
  display: grid;
  grid-template-columns: 1fr auto 1fr 180px;
  align-items: end;
  gap: 12px;
  margin-bottom: 24px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
select {
  min-width: 0;
  padding: 10px;
  border: 1px solid #bbb;
  border-radius: 4px;
  font: inherit;
  background: #fff;
}

.as-text {
  padding-bottom: 10px;
  color: #555;
}

.results {
  display: grid;
  gap: 10px;
}

.site-footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: auto;
  padding-top: 54px;
  color: #667085;
  font-size: 14px;
}

.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  border-top: 1px solid #d9dde3;
}

.site-footer a {
  color: #303846;
  font-weight: 700;
}

.site-footer a:hover {
  text-decoration: underline;
}

.result-count {
  margin-bottom: 10px;
  color: #555;
  font-size: 14px;
}

.autoComplete_wrapper {
  display: block;
  width: 100%;
  position: relative;
}

.autoComplete_wrapper > input {
  width: 100%;
  background-image: none;
}

.autoComplete_wrapper > ul {
  position: absolute;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid #d9dde3;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.autoComplete_wrapper > ul > li {
  padding: 8px 10px;
  border-radius: 4px;
  color: #171717;
  cursor: pointer;
  font-size: 14px;
}

.autoComplete_wrapper > ul > li:hover,
.autoComplete_wrapper > ul > li[aria-selected="true"] {
  background: #f4f5f7;
}

.meta {
  margin-top: 4px;
  color: #666;
  font-size: 14px;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  main {
    animation: none;
  }

  .game-link,
  .result,
  .copy-link,
  nav a {
    transition: none;
  }

  .game-link:hover,
  .result:hover,
  .copy-link:hover {
    transform: none;
  }
}

@media (max-width: 640px) {
  .search {
    grid-template-columns: 1fr;
  }

  .as-text {
    padding-bottom: 0;
  }

  .result,
  .result.has-thumbnail {
    grid-template-columns: 1fr;
  }

  .result-link.has-thumbnail {
    grid-template-columns: 1fr;
  }

  .copy-link {
    width: 100%;
  }
}
