:root {
  --accent: #4f96ff;
  --accent-strong: #6873f4;
  --accent-rgb: 79, 150, 255;
  --accent-text: #4f96ff;
  --bg: #121212;
  --bg-deep: #121212;
  --bg-elevated: #1e1e1e;
  --surface: #1e1e1e;
  --surface-solid: #1e1e1e;
  --surface-soft: #1e1e1e;
  --surface-hover: #1e1e1e;
  --text: #ffffff;
  --text-soft: #e5e5e5;
  --muted: #b3b3b3;
  --border: #2c2c2c;
  --border-strong: #3a3a3a;
  --shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  --site-width: 1100px;
  --page-gutter: clamp(16px, 3vw, 36px);
  --announcement-height: 0px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1.35, 0.36, 1);
}

html[data-theme="light"] {
  --accent: #4f96ff;
  --accent-strong: #5f78e8;
  --accent-rgb: 79, 150, 255;
  --accent-text: #2468b6;
  --bg: #f7f9fc;
  --bg-deep: #edf3fa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-hover: #edf3fb;
  --text: #1d2a3d;
  --text-soft: #42536e;
  --muted: #70819a;
  --border: #d4deeb;
  --border-strong: #b7c8dc;
  --shadow: 0 8px 22px rgba(31, 47, 70, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background-color: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family:
    Lexend, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

.site-search {
  display: flex;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.site-search:focus-within {
  background: var(--surface-solid);
  border-color: rgba(var(--accent-rgb), 0.56);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.13);
}

.site-search .icon {
  width: 18px;
  height: 18px;
}

.site-search input {
  width: 100%;
  height: 38px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.site-search input::placeholder {
  color: var(--muted);
}

.site-select {
  position: relative;
  min-width: 150px;
}

.site-select-trigger {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  outline: 0;
}

.site-select-trigger:hover,
.site-select.is-open .site-select-trigger {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.site-select-trigger:focus-visible {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

.site-select-trigger .icon {
  width: 16px;
  height: 16px;
}

.site-select-trigger [data-site-select-label] {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 740;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-select-trigger .icon:last-child {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 180ms var(--ease-out);
}

.site-select.is-open .site-select-trigger .icon:last-child {
  transform: rotate(180deg);
}

.site-select-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 7px);
  right: 0;
  width: max(100%, 178px);
  overflow: hidden;
  padding: 5px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  animation: site-menu-in 160ms var(--ease-out);
}

@keyframes site-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
}

.site-select-option {
  display: flex;
  width: 100%;
  min-height: 35px;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 690;
  text-align: left;
}

.site-select-option:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.site-select-option i {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
}

.site-select-option.is-selected {
  color: var(--accent-text);
  background: rgba(var(--accent-rgb), 0.08);
}

.site-select-option.is-selected i {
  opacity: 1;
}

.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

.skip-link {
  position: fixed;
  z-index: 5000;
  top: 10px;
  left: 12px;
  padding: 10px 14px;
  color: var(--text);
  background: var(--accent);
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 750;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
  padding:
    calc(88px + env(safe-area-inset-top) + var(--announcement-height))
    max(var(--page-gutter), env(safe-area-inset-right))
    32px
    max(var(--page-gutter), env(safe-area-inset-left));
  outline: none;
}

.site-announcement {
  position: fixed;
  z-index: 950;
  top: 64px;
  right: 0;
  left: 0;
  padding: 0 max(var(--page-gutter), env(safe-area-inset-right)) 0 max(var(--page-gutter), env(safe-area-inset-left));
}

.site-announcement-content {
  display: flex;
  width: min(var(--site-width), 100%);
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 9px 16px;
  color: var(--announcement-text);
  background: color-mix(in srgb, var(--announcement-stroke) 12%, var(--surface-solid));
  border: 1px solid var(--announcement-stroke);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

html[data-theme="light"] .site-announcement-content {
  color: var(--announcement-text);
  background: color-mix(in srgb, var(--announcement-stroke) 16%, #ffffff);
  border-color: color-mix(in srgb, var(--announcement-stroke) 72%, #b7c8dc);
}

html[data-theme="light"] .catalog-kind,
html[data-theme="light"] .pet-rarity {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--border-strong);
}
.page-view {
  width: min(var(--site-width), 100%);
  margin: 0 auto;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 280ms ease,
    transform 420ms var(--ease-out);
}

.page-view.is-current {
  opacity: 1;
  
  transform: none;
}

.page-view.is-leaving {
  opacity: 0;
  transform: translateY(-5px);
}

.section-label {
  color: var(--accent-text);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 0.86rem;
  font-weight: 760;
  outline: none;
  text-decoration: none;
  transition:
    color 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms var(--ease-spring);
}

.button .icon {
  width: 17px;
  height: 17px;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0) scale(0.98);
}

.button:focus-visible {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.24);
}

.button-primary {
  color: var(--text);
  background: var(--accent);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.button-primary:hover {
  background: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.button-secondary {
  background: var(--surface-soft);
}

.button-secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.noscript {
  width: min(620px, calc(100% - 32px));
  margin: 140px auto 0;
  padding: 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

@media (max-width: 760px) {
  .app-shell {
    padding-top: calc(92px + env(safe-area-inset-top) + var(--announcement-height));
  }

  .site-announcement {
    top: calc(82px + env(safe-area-inset-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


@media (max-width: 760px) {
  html {
    scroll-padding-top: calc(98px + env(safe-area-inset-top));
  }

  .app-shell {
    padding:
      calc(92px + env(safe-area-inset-top) + var(--announcement-height))
      max(14px, env(safe-area-inset-right))
      calc(92px + env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .site-search,
  .site-select-trigger {
    min-height: 44px;
  }

  .site-search input {
    height: 42px;
  }

  .site-select-option {
    min-height: 42px;
  }
}

@media (hover: none) {
  button,
  a {
    touch-action: manipulation;
  }
}
body:has(.welcome-dialog-backdrop) {
  overflow: hidden;
}

.welcome-dialog-backdrop {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: rgba(5, 8, 14, 0.68);
  opacity: 0;
  transition: opacity 180ms ease;
}

.welcome-dialog-backdrop.is-visible {
  opacity: 1;
}

.welcome-dialog {
  width: min(660px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: clamp(22px, 5vw, 36px);
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  transform: translateY(10px) scale(0.98);
  transition: transform 220ms var(--ease-out);
}

.welcome-dialog-backdrop.is-visible .welcome-dialog {
  transform: none;
}

.welcome-dialog h1 {
  margin: 7px 0 16px;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.2;
}

.welcome-dialog-message {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.65;
}

.welcome-dialog-message p {
  margin: 0;
}

.welcome-dialog-message p + p {
  margin-top: 13px;
}

.welcome-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 520px) {
  .welcome-dialog-actions .button {
    width: 100%;
  }
}
