:root {
  --bg: #07101d;
  --bg-deep: #050b14;
  --panel: rgba(14, 28, 48, 0.82);
  --panel-strong: rgba(17, 33, 56, 0.95);
  --text: #f3f7fb;
  --muted: #94a8bf;
  --muted-2: #6f849c;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.15);
  --accent: #78aaff;
  --accent-2: #9a88ff;
  --success: #71d8ad;
  --danger: #ff8f9d;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  --radius: 22px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 0%, rgba(65, 111, 202, 0.24), transparent 31rem),
    radial-gradient(circle at 88% 22%, rgba(125, 90, 220, 0.17), transparent 30rem),
    linear-gradient(180deg, #08111f 0%, var(--bg-deep) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button, select { color: inherit; }
a { color: inherit; text-decoration: none; }

.page-shell { min-height: 100vh; position: relative; isolation: isolate; }
.page-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.container { width: min(calc(100% - 36px), var(--max)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { padding: 22px 0; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 760; letter-spacing: -.03em; }
.logo { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: white; background: linear-gradient(145deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px rgba(94,118,255,.32); }
.logo svg { width: 21px; height: 21px; }
.nav-meta { display: flex; align-items: center; gap: 12px; }
.pipeline-label { color: var(--muted-2); font-size: 12px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); color: #c8d6e7; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 5px rgba(113,216,173,0); transition: .2s ease; }
.status.online .status-dot { background: var(--success); box-shadow: 0 0 0 5px rgba(113,216,173,.10); }
.status.offline .status-dot { background: var(--danger); box-shadow: 0 0 0 5px rgba(255,143,157,.09); }

.hero { padding: 68px 0 42px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; padding: 8px 13px; border: 1px solid rgba(116,167,255,.22); border-radius: 999px; color: #bed3f4; background: rgba(74,116,188,.10); font-size: 13px; }
h1 { max-width: 900px; margin: 22px auto 16px; font-size: clamp(42px, 7vw, 75px); line-height: 1.01; letter-spacing: -.06em; font-weight: 810; }
h1 span { background: linear-gradient(90deg, #fff 5%, #94beff 48%, #b5a6ff 92%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 720px; margin: 0 auto; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }

.search-panel { max-width: 900px; margin: 36px auto 0; padding: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; background: rgba(12,25,43,.78); box-shadow: var(--shadow); backdrop-filter: blur(18px); text-align: left; }
.search-panel:focus-within { border-color: rgba(116,167,255,.48); box-shadow: 0 0 0 4px rgba(116,167,255,.075), var(--shadow); }
.query-row { display: flex; align-items: center; gap: 8px; }
.search-icon { width: 22px; height: 22px; flex: 0 0 auto; margin-left: 10px; color: #7890ab; }
.query-row input { width: 100%; min-width: 0; padding: 14px 6px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; }
.query-row input::placeholder { color: #6f829a; }
.search-button { position: relative; flex: 0 0 auto; min-width: 112px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 13px; color: #07101d; font-weight: 760; cursor: pointer; background: linear-gradient(135deg, #a8c7ff, #a99cff); transition: transform .15s ease, filter .15s ease; }
.search-button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.search-button:disabled { cursor: wait; transform: none; filter: saturate(.5); }
.button-loader { display: none; position: absolute; inset: 50% auto auto 50%; width: 19px; height: 19px; margin: -9.5px; border: 2px solid rgba(7,16,29,.25); border-top-color: #07101d; border-radius: 50%; animation: spin .7s linear infinite; }
.search-panel.is-loading .button-text { opacity: 0; }
.search-panel.is-loading .button-loader { display: block; }

.filters-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 4px 2px; border-top: 1px solid rgba(255,255,255,.07); }
.segmented { display: inline-flex; gap: 4px; margin: 0; padding: 3px; border: 1px solid var(--line); border-radius: 12px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 7px 11px; border-radius: 8px; color: var(--muted); font-size: 13px; transition: .15s ease; }
.segmented input:checked + span { color: var(--text); background: rgba(116,167,255,.14); box-shadow: inset 0 0 0 1px rgba(116,167,255,.16); }
.mode-control { display: flex; align-items: center; gap: 9px; color: var(--muted-2); font-size: 12px; }
.mode-control select { padding: 8px 30px 8px 10px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: #c9d5e4; background: #101d30; cursor: pointer; }

.examples { max-width: 880px; margin: 16px auto 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; color: #7890aa; font-size: 13px; }
.examples button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: #aebed1; background: rgba(255,255,255,.025); cursor: pointer; }
.examples button:hover { border-color: rgba(116,167,255,.35); color: var(--text); }

.workspace { padding: 28px 0 92px; }
.result-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.result-kicker { margin: 0 0 3px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 750; }
.result-toolbar h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.result-meta { color: var(--muted-2); font-size: 13px; }
.meta-separator { margin: 0 6px; }

.state-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(16,31,52,.86), rgba(10,20,35,.76)); box-shadow: 0 22px 70px rgba(0,0,0,.20); }
.welcome-state { display: grid; grid-template-columns: .9fr 1.1fr; gap: 34px; align-items: center; padding: 30px; }
.welcome-copy h2, .message-state h2 { margin: 10px 0 8px; font-size: 25px; letter-spacing: -.035em; }
.welcome-copy p, .message-state p { margin: 0; color: var(--muted); }
.state-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #bed3f4; background: rgba(116,167,255,.11); font-size: 22px; }
.pipeline-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pipeline-grid div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 14px; border: 1px solid rgba(255,255,255,.065); border-radius: 15px; background: rgba(255,255,255,.025); }
.pipeline-grid strong { grid-row: 1 / span 2; color: #7f9dca; font-size: 11px; }
.pipeline-grid span { color: #d4deea; font-size: 14px; font-weight: 680; }
.pipeline-grid small { color: var(--muted-2); font-size: 12px; }

.results-list { display: grid; gap: 11px; }
.result-card { display: grid; grid-template-columns: 66px minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, rgba(16,31,52,.83), rgba(10,20,35,.75)); box-shadow: 0 18px 55px rgba(0,0,0,.16); animation: rise .25s ease both; }
.result-card:hover { border-color: rgba(116,167,255,.25); background: linear-gradient(180deg, rgba(19,37,62,.92), rgba(11,23,40,.82)); }
.result-art { width: 66px; height: 88px; display: grid; place-items: center; overflow: hidden; border-radius: 13px; color: rgba(255,255,255,.88); background: linear-gradient(145deg, rgba(143,171,255,.94), rgba(76,57,141,.48)), #1a2941; }
.result-art.games { background: linear-gradient(145deg, rgba(107,224,188,.76), rgba(25,80,83,.48)), #122a31; }
.result-art svg { width: 30px; height: 30px; opacity: .86; }
.result-content { min-width: 0; }
.result-topline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 5px; }
.result-content h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.result-content .original-title { margin: 0 0 8px; overflow: hidden; color: var(--muted-2); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.result-description { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.badge { padding: 4px 7px; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; color: #aebed1; background: rgba(255,255,255,.035); font-size: 11px; }
.result-side { min-width: 100px; text-align: right; }
.score { display: inline-flex; padding: 7px 9px; border-radius: 10px; color: #a7e7cb; background: rgba(73,170,128,.11); font-size: 12px; font-weight: 760; font-variant-numeric: tabular-nums; }
.rating { margin-top: 9px; color: #d4deea; font-size: 13px; }
.rating span { color: #f2c86f; }

.loading-state { padding: 18px; }
.skeleton-row { display: grid; grid-template-columns: 66px 1fr; gap: 16px; padding: 12px 0; }
.skeleton-row > span { height: 88px; border-radius: 13px; background: rgba(255,255,255,.065); }
.skeleton-row div { display: grid; align-content: center; gap: 10px; }
.skeleton-row i { display: block; height: 12px; border-radius: 8px; background: rgba(255,255,255,.065); }
.skeleton-row i:nth-child(1) { width: 42%; height: 17px; }
.skeleton-row i:nth-child(2) { width: 78%; }
.skeleton-row i:nth-child(3) { width: 60%; }
.skeleton-row > span, .skeleton-row i { background-image: linear-gradient(90deg, rgba(255,255,255,.035), rgba(255,255,255,.095), rgba(255,255,255,.035)); background-size: 220% 100%; animation: shimmer 1.2s infinite linear; }
.message-state { padding: 34px; text-align: center; }
.message-state .state-icon { margin: 0 auto; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; }
.pagination button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 11px; color: #c4d1df; background: rgba(255,255,255,.035); cursor: pointer; }
.pagination button:disabled { opacity: .35; cursor: default; }
.pagination span { min-width: 90px; color: var(--muted-2); text-align: center; font-size: 13px; }

footer { padding: 25px 0 36px; border-top: 1px solid var(--line); color: #71869e; font-size: 13px; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

[hidden] { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }


body.modal-open {
  overflow: hidden;
}

.result-card {
  cursor: pointer;
}

.result-card:focus-visible {
  outline: 3px solid rgba(116, 167, 255, 0.3);
  outline-offset: 3px;
}

.item-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.item-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 7, 14, 0.76);
  backdrop-filter: blur(10px);
  cursor: default;
}

.item-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: min(850px, calc(100vh - 48px));
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0, rgba(116, 167, 255, 0.12), transparent 25rem),
    #0b1728;
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.55);
  animation: detail-dialog-in 0.2s ease both;
}

.item-dialog__header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 23, 40, 0.92);
  backdrop-filter: blur(14px);
}

.item-dialog__close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.detail-loading,
.detail-error {
  padding: 60px 24px;
  color: var(--muted);
  text-align: center;
}

.detail-error {
  color: #ffc2ca;
}

.detail-content {
  padding: 26px;
}

.detail-heading {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.detail-art {
  width: 110px;
  height: 150px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.9);
  background:
    linear-gradient(145deg, rgba(143, 171, 255, 0.94), rgba(76, 57, 141, 0.48)),
    #1a2941;
}

.detail-art.games {
  background:
    linear-gradient(145deg, rgba(107, 224, 188, 0.76), rgba(25, 80, 83, 0.48)),
    #122a31;
}

.detail-art svg {
  width: 48px;
  height: 48px;
}

.detail-heading__main h2 {
  margin: 9px 0 5px;
  font-size: clamp(25px, 4vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.detail-original {
  margin: 0 0 17px;
  color: var(--muted-2);
  font-size: 13px;
}

.detail-badges,
.detail-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.detail-summary {
  margin: 26px 0 0;
  color: #d4deea;
  font-size: 16px;
  line-height: 1.65;
}

.detail-section {
  margin-top: 25px;
}

.detail-section h3 {
  margin: 0 0 9px;
  color: #8ea4bd;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 11px;
}

.detail-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-line;
}

.detail-chip-list span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #bccbdd;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
}

.detail-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.detail-value-list {
  display: grid;
  gap: 6px;
  color: #c6d2e0;
  font-size: 13px;
}

.detail-value-list span {
  overflow-wrap: anywhere;
}

.detail-value-list .detail-empty {
  color: var(--muted-2);
}

.like-button,
.external-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #d3deeb;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  font-weight: 680;
}

.like-button.is-liked {
  border-color: rgba(113, 216, 173, 0.35);
  color: #b8f2da;
  background: rgba(93, 196, 151, 0.1);
}

.like-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.external-button {
  text-decoration: none;
  color: #07101d;
  border: 0;
  background: linear-gradient(135deg, #a8c7ff, #a99cff);
}

@keyframes detail-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@media (max-width: 780px) {
  .pipeline-label { display: none; }
  .hero { padding-top: 48px; }
  .welcome-state { grid-template-columns: 1fr; }
  .result-card { grid-template-columns: 58px minmax(0,1fr); }
  .result-art { width: 58px; height: 78px; }
  .result-side { grid-column: 2; display: flex; align-items: center; gap: 12px; text-align: left; }
  .rating { margin-top: 0; }
}

@media (max-width: 560px) {
  .container { width: min(calc(100% - 24px), var(--max)); }
  .site-header { padding-top: 15px; }
  .status { display: none; }
  .hero { padding: 38px 0 27px; }
  h1 { font-size: clamp(40px, 13vw, 58px); }
  .query-row { flex-wrap: wrap; }
  .search-icon { display: none; }
  .query-row input { padding: 13px 8px; }
  .search-button { width: 100%; }
  .filters-row { align-items: stretch; flex-direction: column; }
  .segmented { width: 100%; }
  .segmented label { flex: 1; text-align: center; }
  .mode-control { justify-content: space-between; }
  .mode-control select { flex: 1; }
  .result-toolbar { align-items: flex-start; flex-direction: column; }
  .result-card { padding: 13px; }
  .pipeline-grid { grid-template-columns: 1fr; }
  .footer-row { align-items: flex-start; flex-direction: column; }
}


@media (max-width: 640px) {
  .item-modal {
    align-items: end;
    padding: 0;
  }

  .item-dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 23px 23px 0 0;
  }

  .detail-heading {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .detail-art {
    width: 80px;
    height: 112px;
  }

  .detail-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.access-logout {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  font-size: 12px;
}

.access-logout:hover {
  color: var(--text);
  border-color: rgba(116, 167, 255, 0.35);
}

.access-gate {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 7, 14, 0.84);
  backdrop-filter: blur(14px);
}

.access-dialog {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(16, 31, 52, 0.98), rgba(8, 17, 31, 0.98));
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.access-logo {
  margin: 0 auto 18px;
}

.access-dialog h2 {
  margin: 0 0 9px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.access-dialog p {
  margin: 0 0 22px;
  color: var(--muted);
}

.access-dialog form {
  display: grid;
  gap: 10px;
}

.access-dialog input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.access-dialog input:focus {
  border-color: rgba(116, 167, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(116, 167, 255, 0.08);
}

.access-dialog button {
  border: 0;
  border-radius: 13px;
  padding: 13px 16px;
  color: #07101d;
  background: linear-gradient(135deg, #a8c7ff, #a99cff);
  cursor: pointer;
  font-weight: 750;
}

.access-error {
  margin-top: 13px;
  color: #ff9d9d;
  font-size: 13px;
}

.access-gate[hidden] {
  display: none;
}
