:root {
  color-scheme: dark;
  --ink: #f7fbff;
  --muted: #98acc6;
  --night: #030817;
  --panel: #071329;
  --panel-2: #0b1b36;
  --cyan: #00eaff;
  --blue: #168bff;
  --pink: #ff28c9;
  --yellow: #ffe04b;
  --line: rgba(44, 205, 255, .25);
  --shadow: 0 18px 60px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--night); }
body { margin: 0; min-width: 320px; overflow-x: clip; color: var(--ink); background: radial-gradient(circle at 50% 24%, #102954 0, var(--night) 42rem); font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { color: inherit; }

.topbar { position: fixed; inset: 0 0 auto; z-index: 20; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 4vw, 64px); border-bottom: 1px solid rgba(0,234,255,.2); background: rgba(3,8,23,.82); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: white; text-decoration: none; line-height: .9; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--cyan); border-radius: 11px; color: var(--pink); background: #071329; box-shadow: 0 0 20px rgba(0,234,255,.28), inset 0 0 16px rgba(0,234,255,.12); font-size: 23px; font-weight: 950; font-style: italic; }
.brand strong { display: block; font-size: 17px; font-style: italic; text-shadow: 0 0 16px rgba(0,234,255,.55); }
.brand small { display: block; margin-top: 5px; color: var(--cyan); font-size: 11px; font-weight: 900; letter-spacing: .22em; }
.top-link { color: var(--cyan); text-decoration: none; font-size: 14px; font-weight: 800; }

.hero { position: relative; min-height: min(720px, 88vh); display: grid; align-items: end; padding: 140px clamp(20px, 7vw, 110px) 70px; isolation: isolate; overflow: hidden; }
.hero-image, .hero-shade { position: absolute; inset: 0; z-index: -2; }
.hero-image { background: url("assets/reborn-arcade.jpg") center / cover no-repeat; transform: translate(9%, 6%) scale(1.16); transform-origin: center; }
.hero-shade { z-index: -1; background: linear-gradient(90deg, rgba(3,8,23,.95) 0%, rgba(3,8,23,.7) 38%, rgba(3,8,23,.08) 72%), linear-gradient(0deg, var(--night) 0%, transparent 38%); }
.hero-brand-stamp { position: absolute; left: 0; bottom: 0; z-index: -1; width: min(360px, 38vw); min-height: 92px; display: flex; align-items: center; gap: 9px; padding: 30px clamp(20px, 4vw, 64px) 20px; color: white; background: linear-gradient(90deg, #030817 72%, transparent); font-style: italic; letter-spacing: .08em; }
.hero-brand-stamp strong { color: var(--cyan); }
.hero-brand-stamp span { color: var(--pink); font-weight: 900; }
.hero-content { width: min(660px, 100%); }
.eyebrow { margin: 0 0 12px; color: var(--cyan); font-size: 13px; font-weight: 900; letter-spacing: .18em; }
h1, h2 { margin: 0; line-height: .96; letter-spacing: -.045em; }
h1 { max-width: 700px; font-size: clamp(48px, 7vw, 96px); text-transform: uppercase; text-shadow: 0 8px 40px rgba(0,0,0,.5); }
h1 span { color: transparent; background: linear-gradient(105deg, var(--cyan), #64a8ff 45%, var(--pink)); -webkit-background-clip: text; background-clip: text; }
.intro { max-width: 590px; margin: 24px 0 30px; color: #d5e2f1; font-size: clamp(17px, 2vw, 20px); }
.metrics { display: flex; flex-wrap: wrap; gap: 14px; }
.metrics div { min-width: 176px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(6,20,43,.76); backdrop-filter: blur(12px); box-shadow: inset 0 0 22px rgba(0,234,255,.06); }
.metrics strong { display: block; color: var(--cyan); font-size: 27px; line-height: 1.1; }
.metrics span { color: var(--muted); font-size: 13px; }

.catalogue { width: min(1440px, 100%); margin: 0 auto; padding: 72px clamp(16px, 4vw, 56px) 100px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(34px, 5vw, 60px); }
.result-count { margin: 0 0 5px; color: var(--muted); font-weight: 700; }
.search-panel { position: sticky; top: 84px; z-index: 10; display: flex; gap: 12px; margin: 0 0 26px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: rgba(3,8,23,.88); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.search-box { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 1px solid rgba(152,172,198,.25); border-radius: 12px; background: rgba(11,27,54,.8); transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,234,255,.1); }
.search-box svg { width: 22px; flex: 0 0 auto; fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; }
.search-box input { width: 100%; min-width: 0; height: 52px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.search-box input::placeholder { color: #7f94af; }
.clear-button, .load-more { border: 1px solid rgba(255,40,201,.42); border-radius: 12px; color: white; background: linear-gradient(135deg, rgba(255,40,201,.23), rgba(22,139,255,.23)); font-weight: 850; cursor: pointer; }
.clear-button { padding: 0 20px; }
.search-status { margin: 0 0 20px; padding: 15px 18px; border-left: 3px solid var(--pink); border-radius: 6px 12px 12px 6px; color: #dce9f6; background: rgba(255,40,201,.08); }
.system-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.system-card { min-width: 0; overflow: hidden; border: 1px solid rgba(0,234,255,.22); border-radius: 16px; background: linear-gradient(160deg, rgba(14,39,74,.95), rgba(5,14,31,.97)); box-shadow: 0 12px 30px rgba(0,0,0,.25); transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.system-card:hover { transform: translateY(-4px); border-color: rgba(0,234,255,.7); box-shadow: 0 16px 42px rgba(0,0,0,.42), 0 0 24px rgba(0,234,255,.1); }
.card-open { width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.system-visual { position: relative; aspect-ratio: 1 / .78; overflow: hidden; background: #061024; }
.system-visual img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.fallback-logo { width: 100%; height: 100%; display: grid; place-items: center; color: var(--cyan); background: radial-gradient(circle, #143a6c, #051126 70%); font-size: 34px; font-weight: 950; letter-spacing: -.06em; text-shadow: 0 0 24px rgba(0,234,255,.55); }
.system-card:hover img { transform: scale(1.035); }
.count-badge { position: absolute; right: 10px; bottom: 10px; padding: 5px 9px; border: 1px solid rgba(0,234,255,.5); border-radius: 999px; color: #04101e; background: var(--cyan); box-shadow: 0 0 18px rgba(0,234,255,.32); font-size: 12px; font-weight: 950; }
.card-body { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 68px; padding: 12px 14px 14px; }
.card-title { min-width: 0; overflow: hidden; font-size: 15px; font-weight: 850; line-height: 1.25; text-overflow: ellipsis; }
.card-arrow { flex: 0 0 auto; color: var(--pink); font-size: 23px; }
.load-more { display: block; min-width: 260px; margin: 34px auto 0; padding: 14px 24px; }

.games-dialog { width: min(980px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; overflow: hidden; border: 1px solid rgba(0,234,255,.45); border-radius: 22px; color: var(--ink); background: #050d1e; box-shadow: 0 30px 100px rgba(0,0,0,.8), 0 0 36px rgba(0,234,255,.12); }
.games-dialog::backdrop { background: rgba(0,3,12,.83); backdrop-filter: blur(8px); }
.dialog-shell { max-height: calc(100dvh - 30px); overflow: auto; padding: clamp(20px, 4vw, 40px); }
.dialog-header { display: flex; justify-content: space-between; gap: 22px; }
.dialog-header h2 { font-size: clamp(30px, 5vw, 52px); }
.dialog-header p:last-child { margin: 10px 0 0; color: var(--muted); }
.close-button { width: 46px; height: 46px; flex: 0 0 auto; border: 1px solid rgba(255,40,201,.5); border-radius: 50%; color: var(--pink); background: rgba(255,40,201,.08); font-size: 30px; line-height: 1; cursor: pointer; }
.dialog-search { margin-top: 26px; }
.alphabet { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.alphabet button { min-width: 34px; min-height: 34px; padding: 4px 8px; border: 1px solid rgba(152,172,198,.25); border-radius: 8px; color: var(--muted); background: var(--panel); cursor: pointer; }
.alphabet button:hover, .alphabet button.active { border-color: var(--cyan); color: var(--cyan); }
.dialog-result { color: var(--muted); font-size: 14px; }
.game-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px 24px; margin: 0; padding: 0; list-style-position: inside; counter-reset: games; }
.game-list li { min-width: 0; padding: 9px 11px; overflow: hidden; border-bottom: 1px solid rgba(152,172,198,.12); color: #d8e6f4; white-space: nowrap; text-overflow: ellipsis; }
.game-list li::marker { color: #57708e; font-variant-numeric: tabular-nums; }

footer { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 28px 20px; border-top: 1px solid var(--line); color: var(--muted); background: #020611; font-size: 13px; }
footer strong { color: var(--cyan); letter-spacing: .12em; }

@media (max-width: 1100px) { .system-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 820px) {
  .hero { min-height: 680px; padding-top: 120px; }
  .hero-image { background-position: 58% center; }
  .hero-shade { background: linear-gradient(90deg, rgba(3,8,23,.93), rgba(3,8,23,.5)), linear-gradient(0deg, var(--night) 0%, transparent 50%); }
  .system-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .game-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .topbar { height: 64px; }
  .top-link { display: none; }
  .hero { min-height: 650px; padding: 112px 18px 44px; align-items: end; }
  .hero-image { background-position: 66% center; }
  .hero-shade { background: linear-gradient(90deg, rgba(3,8,23,.88), rgba(3,8,23,.28)), linear-gradient(0deg, var(--night) 0%, rgba(3,8,23,.22) 58%, transparent 100%); }
  .hero-image { transform: translate(10%, 5%) scale(1.2); }
  .hero-brand-stamp { left: 0; right: auto; bottom: 0; width: min(270px, 74vw); min-height: 62px; padding: 20px 18px 14px; font-size: 12px; }
  h1 { font-size: clamp(42px, 14vw, 66px); }
  .intro { font-size: 16px; }
  .metrics div { min-width: 0; flex: 1 1 140px; }
  .catalogue { padding-top: 55px; }
  .section-head { align-items: start; flex-direction: column; gap: 10px; }
  .search-panel { top: 73px; }
  .clear-button { padding: 0 12px; }
  .system-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
  .system-card { border-radius: 12px; }
  .system-visual { aspect-ratio: 1 / .9; }
  .card-body { min-height: 62px; padding: 10px; }
  .card-title { font-size: 14px; }
  .game-list { grid-template-columns: minmax(0,1fr); }
  footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }
