:root {
  --ink: #1c2a3a;
  --sky: #3d8bfd;
  --mint: #2bb673;
  --amber: #f0a12a;
  --sand: #fff8ef;
  --card: rgba(255, 255, 255, .9);
  --line: rgba(28, 42, 58, .09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 8% 0%, #cfe8ff 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 92% 6%, #ffeccf 0%, transparent 52%),
    linear-gradient(180deg, #eef6ff 0%, var(--sand) 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.brand a { color: var(--sky); text-decoration: none; }
.brand a:hover { text-decoration: underline; }
.brand span { opacity: .4; }
.brand strong { font-weight: 700; }

.end-nav { display: flex; gap: 8px; }
.end-nav a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease;
}
.end-nav a:hover { border-color: var(--sky); color: var(--sky); }

.wrap {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 28px 24px 56px;
  display: grid;
  gap: 20px;
}

.hero h1 {
  font-family: Fredoka, "Noto Sans SC", sans-serif;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: .02em;
}
.hero p { margin: 0; opacity: .72; font-size: 14px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(28, 42, 58, .06);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.badge {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(43, 182, 115, .12);
  color: #1c7d4f;
}
.badge:empty { display: none; }

.pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pickers label { display: grid; gap: 6px; }
.pickers span { font-size: 13px; opacity: .66; }
select {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(28, 42, 58, .14);
  border-radius: 12px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
select:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(61, 139, 253, .14); }
select:disabled { opacity: .55; cursor: not-allowed; }

.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid rgba(28, 42, 58, .14);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn:hover { border-color: var(--sky); color: var(--sky); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 5px 10px; font-size: 12px; border-radius: 9px; }

.hint { margin: 12px 0 0; font-size: 13px; opacity: .62; }
.hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(28, 42, 58, .06);
}

.word-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.word-preview:empty { display: none; }
.word-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
}
.word-chip b { font-weight: 700; }
.word-chip i { font-style: normal; font-size: 12px; opacity: .55; }
.word-chip img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 6px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
}

.game-card {
  position: relative;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(61, 139, 253, .5);
  box-shadow: 0 14px 32px rgba(28, 42, 58, .1);
}
.game-card:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}
.game-card strong { font-size: 15px; font-weight: 700; }
.game-card span { font-size: 12.5px; opacity: .62; line-height: 1.5; }
.game-card .tag {
  justify-self: start;
  margin-top: 4px;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(61, 139, 253, .1);
  color: var(--sky);
}
.game-card .tag.asr { background: rgba(43, 182, 115, .12); color: #1c7d4f; }

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  opacity: 0;
  transition: opacity .18s ease, border-color .18s ease;
}
.game-card:hover .copy-btn { opacity: 1; }
.copy-btn:hover { border-color: var(--sky); color: var(--sky); }
.copy-btn:focus-visible { opacity: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(28, 42, 58, .9);
  color: #fff;
  font-size: 13.5px;
  z-index: 40;
}

@media (max-width: 620px) {
  .pickers { grid-template-columns: 1fr; }
  .wrap { padding: 20px 16px 44px; }
  .topbar { padding: 12px 16px; }
}
