* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
  background: #f4f5f7;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-weight: 700;
}

header {
  padding: 24px 20px 12px;
  max-width: 1000px;
  margin: 0 auto;
}

.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.header-text {
  text-align: center;
  flex: 1;
}

.x-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #1d9bf0;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.x-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
}

.hint {
  margin: 0;
  font-size: 16px;
  color: #555;
  font-weight: 700;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

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

.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  padding: 20px 16px;
  border: none;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.tile:active {
  transform: translateY(0);
}

.tile.copied {
  background: #dff5e1;
  color: #1a7a34;
}

.tile.copied::after {
  content: "コピーしました！";
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  font-size: 14px;
  color: #1a7a34;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  html, body {
    background: #16181c;
    color: #f0f0f0;
  }

  .hint {
    color: #aaa;
  }

  .tile {
    background: #24272d;
    color: #f0f0f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  }

  .tile.copied {
    background: #1e3a26;
    color: #6fe08c;
  }

  .tile.copied::after {
    color: #6fe08c;
  }
}
