@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-800.ttf") format("truetype");
}

:root {
  --cloth: #293db5;
  --ivory: #fff1d5;
  --ink: #202443;
  --coral: #ff805f;
  --amber: #ffc45b;
  --mint: #7edbc8;
  --paper: #fff1d5;
  --surface: #fff8e9;
  --muted: #585465;
  --line: #b8ae9b;
  --teal: #21388f;
  --display: "Bricolage Grotesque", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
html { min-height: 100%; background-color: var(--cloth); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--cloth);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgb(15 24 100 / 5%) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgb(226 236 255 / 3%) 3px 4px),
    radial-gradient(ellipse at 25% 22%, #384fc5, var(--cloth) 54%, #2535a4);
  font: 16px/1.5 system-ui, -apple-system, "PingFang SC", "Hiragino Sans", "Microsoft YaHei", sans-serif;
}
.shell { width: min(calc(100% - 64px), 1120px); margin-inline: auto; }

.site-header {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(18px, 3.2vw, 46px);
  min-height: 72px;
  padding: 7px 0;
  color: var(--ivory);
  border: 0;
}
.site-brand, .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ivory);
  text-decoration: none;
}
.site-brand img, .footer-brand img { flex: none; object-fit: contain; }
.site-brand img { width: 37px; height: 37px; }
.site-wordmark {
  margin: 0;
  font: 800 clamp(20px, 2.5vw, 32px)/1 var(--display);
  letter-spacing: -.018em;
  color: inherit;
}
:lang(zh) .site-wordmark, :lang(ja) .site-wordmark { letter-spacing: .025em; }
.home-brand { min-width: 0; display: grid; align-content: center; }
.game-brand-title { display: grid; gap: 2px; margin: 0; }
.game-type { color: #dfebff; font: 600 12px/1.2 system-ui, sans-serif; }
.home-brand:has(.game-brand-title) #collection-progress { margin-top: 1px; }
@media (max-width: 739px) {
  .game-type { font-size: 10px; }
}
.home-brand .site-brand { align-self: start; }
.home-brand #collection-progress {
  display: block;
  color: #dfebff;
  margin: -4px 0 0 47px;
  font: 600 10px/1.22 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .025em;
}
.site-nav {
  margin-inline: auto 0;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  border-radius: 7px;
  background: rgb(16 26 114 / 34%);
  box-shadow: inset 0 1px 2px rgb(14 16 73 / 22%), 0 1px 0 rgb(209 219 255 / 15%);
}
.site-nav a, .site-menu nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 16px;
  min-height: 44px;
  color: #f2f3ff;
  border-radius: 5px;
  text-decoration: none;
  font-size: .92rem;
  line-height: 1.22;
  font-weight: 650;
}
.site-nav a:hover { background: #354bc0; }
.site-nav a[aria-current="page"], .site-menu nav a[aria-current="page"] {
  color: #1c2450;
  background: var(--ivory);
  box-shadow: 0 2px 0 #b9a885;
}
.site-header .language-control { position: relative; display: inline-flex; flex: none; min-width: 0; align-items: center; }
.site-header .language-picker {
  font: 600 13px/1.2 system-ui, sans-serif;
  border: 1px solid rgb(233 236 255 / 53%);
  border-radius: 6px;
  width: auto;
  max-width: 19em;
  min-height: 44px;
  padding: 4px 9px;
  color: #fff8e9;
  background: #293eb1;
  cursor: pointer;
}
.site-header .language-picker option { color: var(--ink); background: var(--surface); }
.site-header .language-current { display: none; }
.site-header :focus-visible, .site-footer :focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}
.site-menu { position: relative; display: none; }
.site-menu summary {
  list-style: none;
  display: grid;
  place-items: center;
  min-height: 44px;
  width: 44px;
  border: 0;
  border-radius: 5px;
  color: var(--ivory);
  background: #1e309c;
  cursor: pointer;
}
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu[open] summary { color: var(--ink); background: var(--amber); }
.site-menu nav {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  z-index: 4;
  display: grid;
  min-width: min(230px, 80vw);
  gap: 3px;
  padding: 6px;
  border: 2px solid #111c54;
  border-radius: 7px;
  background: #20319a;
  box-shadow: 3px 5px 0 rgb(16 23 68 / 55%);
}
.site-menu nav a { justify-content: flex-start; text-align: start; }

.site-footer, .play-shell .site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 3px 22px;
  margin: 28px 0 10px;
  padding: 9px 0;
  color: #e3e9ff;
  border-top: 1px dashed rgb(238 239 255 / 40%);
  font-size: 13px;
}
.footer-brand { gap: 8px; font: 800 16px/1.2 var(--display); }
.footer-brand img { width: 24px; height: 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 19px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
.site-footer nav a:is(:hover, [aria-current="page"]) { color: var(--ivory); text-decoration: underline; text-underline-offset: 4px; }

@media (min-width: 861px) {
  .site-header .language-picker { field-sizing: content; }
}
@media (max-width: 860px) {
  .site-header { min-height: 59px; gap: 8px; }
  .site-nav { display: none; }
  .site-menu { display: block; }
  .site-header .language-control { margin-inline-start: auto; }
}
@media (max-width: 739px) {
  .shell { width: min(calc(100% - 24px), 560px); }
  .site-header { gap: 6px; min-height: 50px; padding: 3px 0; }
  .site-brand { gap: 6px; min-height: 38px; }
  .site-brand img { width: 30px; height: 30px; }
  .site-wordmark { font-size: clamp(16px, 4.5vw, 23px); }
  .home-brand #collection-progress { margin: -4px 0 0 36px; font-size: 9px; }
  .site-header .language-picker {
    position: absolute; inset: 0;
    appearance: none;
    width: 100%; max-width: none; height: 100%;
    padding: 0; color: transparent;
  }
  .site-header .language-current {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    min-height: 44px;
    padding-inline: 9px;
    color: var(--ivory);
    font: 650 12px/1.15 system-ui, sans-serif;
    pointer-events: none;
  }
  .site-header .language-current::after {
    content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
    transform: translateY(-1.5px) rotate(45deg);
  }
  .site-footer, .play-shell .site-footer { margin-top: 18px; }
}
@media (max-width: 350px) {
  .shell { width: calc(100% - 16px); }
  .site-header { gap: 4px; }
  .site-brand img { width: 25px; height: 25px; }
  .home-brand #collection-progress { margin-left: 0; }
  .site-wordmark { font-size: 15px; }
  .site-header .language-current { padding-inline: 6px; font-size: 11px; }
}
