:root {
  --bg: #080a12;
  --bg-soft: #101322;
  --panel: rgba(20, 24, 40, .78);
  --panel-solid: #15192a;
  --text: #f6f7fb;
  --muted: #9ca4bd;
  --line: rgba(255, 255, 255, .10);
  --lime: #d8ff4f;
  --violet: #8c63ff;
  --cyan: #57e4ff;
  --pink: #ff68ae;
  --danger: #ff6685;
  --shadow: 0 28px 80px rgba(0, 0, 0, .36);
  --radius: 28px;
  --radius-sm: 18px;
  --max: 1500px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 30% -15%, rgba(140, 99, 255, .19), transparent 30rem),
    radial-gradient(circle at 100% 20%, rgba(87, 228, 255, .08), transparent 27rem),
    var(--bg);
  overflow-x: hidden;
}

body.overlay-open { overflow: hidden; }

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

button:focus-visible,
input:focus-visible,
.game-card:focus-within {
  outline: 3px solid rgba(216, 255, 79, .76);
  outline-offset: 4px;
}

.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;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -70px;
  z-index: 999;
  padding: 12px 18px;
  background: var(--lime);
  color: #0b0d11;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 14px; }

.ambient {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  filter: blur(90px);
  opacity: .18;
  border-radius: 999px;
}
.ambient-a { width: 420px; height: 420px; background: var(--violet); left: -220px; top: 34vh; }
.ambient-b { width: 350px; height: 350px; background: var(--cyan); right: -180px; top: 60vh; }

.topbar {
  width: min(calc(100% - 40px), var(--max));
  min-height: 76px;
  margin: 18px auto 0;
  padding: 10px 12px 10px 16px;
  position: sticky;
  top: 14px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 22px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 22px;
  background: rgba(10, 12, 22, .72);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 14px 50px rgba(0, 0, 0, .25);
}

.brand {
  appearance: none;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  flex: 0 0 auto;
  color: #0d0f14;
  background: linear-gradient(135deg, #efffaf, var(--lime) 55%, #8df9bd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 8px 24px rgba(216, 255, 79, .14);
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: -.6px;
}

.brand-copy { display: grid; line-height: 1.08; }
.brand-copy strong { font-size: 15px; letter-spacing: .11em; }
.brand-copy small { color: var(--muted); font-size: 10px; margin-top: 5px; letter-spacing: .05em; }

.primary-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav button,
.header-random,
.site-footer button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.primary-nav button {
  padding: 11px 14px;
  border-radius: 12px;
  color: #adb4c8;
  font-size: 13px;
  font-weight: 700;
  transition: .2s ease;
}
.primary-nav button:hover,
.primary-nav button[aria-pressed="true"] { background: rgba(255,255,255,.07); color: #fff; }

.header-random {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 17px;
  border-radius: 14px;
  background: var(--text);
  color: #11131a;
  font-size: 12px;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease;
}
.header-random:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255,255,255,.12); }

.hero {
  width: min(calc(100% - 40px), var(--max));
  min-height: 690px;
  margin: 0 auto;
  padding: 92px 30px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, .88fr);
  align-items: center;
  gap: clamp(44px, 6vw, 100px);
}

.hero-copy { max-width: 710px; }

.eyebrow, .section-kicker {
  color: #b4bbc9;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 11px; }
.eyebrow span {
  width: 30px;
  height: 2px;
  background: var(--lime);
  box-shadow: 0 0 15px var(--lime);
}

.hero h1 {
  margin: 24px 0 24px;
  font-size: clamp(58px, 7vw, 108px);
  line-height: .91;
  letter-spacing: -.07em;
  font-weight: 950;
}
.hero h1 em {
  position: relative;
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 1.5px rgba(246,247,251,.9);
  text-shadow: 0 0 50px rgba(255,255,255,.06);
}

.hero-copy > p {
  max-width: 600px;
  margin: 0;
  color: #aeb5c9;
  font-size: clamp(16px, 1.55vw, 20px);
  line-height: 1.8;
}

.hero-actions { display: flex; gap: 12px; margin-top: 35px; flex-wrap: wrap; }
.button {
  min-height: 52px;
  padding: 0 22px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  border-radius: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 850;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary {
  color: #10130c;
  background: var(--lime);
  box-shadow: 0 14px 38px rgba(216,255,79,.15);
}
.button-secondary { color: #fff; background: rgba(255,255,255,.055); border-color: var(--line); }
.button-secondary:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.18); }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 38px;
  margin: 45px 0 0;
}
.hero-stats div { position: relative; }
.hero-stats div + div::before {
  content: "";
  width: 1px;
  height: 34px;
  background: var(--line);
  position: absolute;
  left: -19px;
  top: 3px;
}
.hero-stats dt { font-size: 23px; font-weight: 950; letter-spacing: -.04em; }
.hero-stats dd { margin: 4px 0 0; color: #7f879e; font-size: 11px; }

.hero-showcase {
  position: relative;
  width: min(100%, 560px);
  justify-self: center;
  padding: 48px 38px;
  isolation: isolate;
}

.showcase-orbit {
  position: absolute;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 50%;
  z-index: -1;
}
.orbit-one { inset: 4px -12px 25px 8px; transform: rotate(-12deg); }
.orbit-two { inset: 48px -44px -7px 39px; transform: rotate(18deg); border-color: rgba(216,255,79,.14); }

.feature-card {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(30,34,54,.94), rgba(15,18,31,.98));
  box-shadow: 0 50px 100px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.08);
  transform: rotate(2.3deg);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.feature-card:hover { transform: rotate(.8deg) translateY(-7px); }

.feature-art {
  position: relative;
  min-height: 380px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 20%, hsla(var(--feature-hue, 82), 95%, 70%, .55), transparent 28%),
    linear-gradient(145deg, hsl(var(--feature-hue, 82) 76% 50% / .32), #111528 58%, #151829);
}
.scene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  object-fit: cover;
  transform: scale(1.01);
  transform-origin: center;
  transition: transform .55s cubic-bezier(.2,.8,.2,1), filter .35s ease;
}
.feature-art.has-scene-art .scene-art { z-index: 0; }
.feature-art.has-scene-art::before {
  z-index: 1;
  opacity: .4;
  mix-blend-mode: screen;
}
.feature-art.has-scene-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7,9,17,0) 48%, rgba(7,9,17,.68) 100%),
    radial-gradient(circle at 50% 35%, transparent 44%, rgba(6,8,15,.2) 100%);
}
.feature-card:hover .feature-art.has-scene-art .scene-art { transform: scale(1.035); }
.feature-art.has-scene-art .feature-emblem { display: none; }
.feature-art::before {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 44%;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 1px, transparent 1px 22px);
  transform: rotate(-23deg);
}
.feature-number {
  position: absolute;
  left: 24px;
  top: 20px;
  color: rgba(255,255,255,.5);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  z-index: 3;
}
.feature-emblem {
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 38px;
  font-size: 72px;
  background: rgba(255,255,255,.09);
  backdrop-filter: blur(15px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.19), 0 28px 50px rgba(0,0,0,.2);
  transform: rotate(-8deg);
}
.feature-lines {
  position: absolute;
  inset: auto -5% 30px 20%;
  height: 42px;
  border-top: 1px solid rgba(255,255,255,.14);
  border-bottom: 1px solid rgba(255,255,255,.07);
  transform: skewY(-7deg);
  z-index: 2;
  opacity: .65;
}

.feature-meta { padding: 23px 26px 26px; }
.feature-label { color: var(--lime); font-size: 9px; font-weight: 950; letter-spacing: .18em; }
.feature-meta h2 { margin: 8px 0 8px; font-size: clamp(24px, 3vw, 35px); letter-spacing: -.045em; }
.feature-meta p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: #979fb5;
  font-size: 13px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.feature-play {
  width: 100%;
  margin-top: 19px;
  padding: 13px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  color: #10120b;
  background: var(--lime);
  font-weight: 900;
}

.showcase-chip {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(14,17,28,.82);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  font-weight: 950;
  z-index: 5;
}
.chip-a {
  width: 78px; height: 78px; border-radius: 23px;
  left: -3px; bottom: 68px; color: var(--lime); font-size: 22px;
  transform: rotate(-10deg);
}
.chip-b {
  width: 78px; height: 38px; border-radius: 99px;
  right: -4px; top: 112px; color: #fff; font-size: 9px; letter-spacing: .17em;
  transform: rotate(8deg);
}

.marquee-strip {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.025);
}
.marquee-track {
  width: max-content;
  height: 57px;
  display: flex;
  align-items: center;
  gap: 29px;
  color: #7e879c;
  animation: marquee 26s linear infinite;
}
.marquee-track span { font-size: 11px; font-weight: 850; letter-spacing: .18em; }
.marquee-track i { color: var(--lime); font-style: normal; font-size: 9px; }
@keyframes marquee { to { transform: translateX(-50%); } }

.library {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 90px 16px 120px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 32px;
}
.section-heading h2 {
  margin: 7px 0 0;
  font-size: clamp(34px, 4.5vw, 64px);
  letter-spacing: -.055em;
  line-height: 1;
}
.section-heading p { margin: 0 0 4px; color: var(--muted); font-size: 13px; text-align: right; }

.library-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.search-box {
  min-width: 0;
  flex: 1;
  min-height: 58px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.04);
  transition: border-color .2s ease, background .2s ease;
}
.search-box:focus-within { border-color: rgba(216,255,79,.45); background: rgba(255,255,255,.06); }
.search-icon { color: #848ca2; font-size: 26px; line-height: 1; transform: rotate(-14deg); }
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 14px;
}
.search-box input::placeholder { color: #737c94; }
.search-box button {
  width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.08); color: #b9c0d1; font-size: 17px;
}

.view-actions { display: flex; gap: 8px; }
.toolbar-button {
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.04);
  color: #c4cad8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: .2s ease;
}
.toolbar-button:hover,
.toolbar-button[aria-pressed="true"] { border-color: rgba(216,255,79,.28); background: rgba(216,255,79,.08); color: var(--lime); }
.count-badge {
  min-width: 22px;
  margin-left: 5px;
  padding: 2px 6px;
  display: inline-block;
  border-radius: 99px;
  color: #10120c;
  background: var(--lime);
  text-align: center;
  font-size: 10px;
}

.category-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 21px;
  scrollbar-width: none;
}
.category-row::-webkit-scrollbar { display: none; }
.category-pill {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: #929aaf;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition: .2s ease;
}
.category-pill:hover { color: #fff; border-color: rgba(255,255,255,.2); }
.category-pill[aria-pressed="true"] {
  color: #0d1009;
  border-color: var(--lime);
  background: var(--lime);
}
.category-pill span { opacity: .65; margin-left: 5px; font-size: 9px; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  --card-hue: 80;
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: #121522;
  box-shadow: 0 13px 35px rgba(0,0,0,.16);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s ease, box-shadow .25s ease;
  content-visibility: auto;
  contain-intrinsic-size: 340px;
}
.game-card:hover {
  transform: translateY(-7px);
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 24px 50px rgba(0,0,0,.28);
}

.card-art {
  position: relative;
  min-height: 225px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 70% 20%, hsl(var(--card-hue) 92% 68% / .52), transparent 28%),
    radial-gradient(circle at 20% 90%, hsl(calc(var(--card-hue) + 64) 85% 56% / .24), transparent 35%),
    linear-gradient(145deg, hsl(var(--card-hue) 60% 20%), #121725 62%, #141625);
}
.card-art .scene-art { z-index: 0; }
.game-card.has-artwork .card-art::before {
  z-index: 1;
  width: 260px;
  height: 260px;
  opacity: .14;
}
.game-card.has-artwork .card-art::after { z-index: 2; }
.game-card.has-artwork:hover .scene-art {
  transform: scale(1.055);
  filter: saturate(1.08) contrast(1.02);
}
.card-art::before,
.card-art::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.card-art::before {
  width: 210px; height: 210px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 46%;
  transform: rotate(32deg);
}
.card-art::after {
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.08) 49%, transparent 54%);
  transform: translateX(-110%);
  transition: transform .7s ease;
}
.game-card:hover .card-art::after { transform: translateX(110%); }

.card-index {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  color: rgba(255,255,255,.6);
  background: rgba(6,8,14,.28);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  z-index: 3;
}
.card-emblem {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 26px;
  background: rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 22px 40px rgba(0,0,0,.17);
  backdrop-filter: blur(12px);
  font-size: 46px;
  transform: rotate(-5deg);
  transition: transform .25s ease;
}
.game-card:hover .card-emblem { transform: rotate(0) scale(1.06); }

.favourite-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  background: rgba(7,9,16,.45);
  backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  z-index: 3;
  transition: .2s ease;
}
.favourite-button:hover { transform: scale(1.08); background: rgba(7,9,16,.7); }
.favourite-button[aria-pressed="true"] { color: var(--pink); background: rgba(255,104,174,.15); border-color: rgba(255,104,174,.32); }

.card-content { padding: 17px 17px 18px; }
.card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: hsl(var(--card-hue) 80% 70%);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.card-category::before { content:""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.card-content h3 {
  margin: 7px 0 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 19px;
  letter-spacing: -.03em;
}
.card-content p {
  min-height: 39px;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: #858da3;
  font-size: 11px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-footer { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.card-tags {
  min-width: 0;
  flex: 1;
  display: flex;
  gap: 5px;
  overflow: hidden;
}
.card-tags span {
  flex: 0 0 auto;
  max-width: 100px;
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  color: #727b91;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8px;
}
.card-play {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: #10120c;
  background: var(--lime);
  cursor: pointer;
  font-size: 13px;
  transition: transform .18s ease;
}
.card-play:hover { transform: scale(1.06); }

.card-coming {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 34px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #7e879c;
  background: rgba(255,255,255,.035);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .05em;
}
.game-card.is-planned .card-art::after { opacity: .55; }
.game-card.is-planned .card-emblem { filter: saturate(.82); }

.empty-state {
  margin: 34px auto 0;
  max-width: 560px;
  padding: 55px 28px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255,255,255,.025);
}
.empty-icon { font-size: 40px; color: var(--lime); }
.empty-state h3 { margin: 15px 0 8px; font-size: 22px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

.site-footer {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto 24px;
  padding: 28px 30px;
  display: flex;
  align-items: center;
  gap: 22px;
  border-top: 1px solid var(--line);
  color: #70798f;
}
.footer-brand { display: flex; align-items: center; gap: 11px; }
.footer-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 11px; }
.footer-brand div { display: grid; gap: 2px; }
.footer-brand strong { color: #dce0e9; font-size: 11px; letter-spacing: .08em; }
.footer-brand span { font-size: 8px; letter-spacing: .12em; }
.site-footer p { margin: 0 auto; font-size: 10px; }
.site-footer button { color: #aeb5c7; font-size: 11px; font-weight: 750; }
.site-footer button:hover { color: var(--lime); }

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
}
.game-overlay[hidden] { display: none; }
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3,4,9,.88);
  backdrop-filter: blur(18px);
  animation: fadeIn .2s ease both;
}
.game-shell {
  position: relative;
  width: min(1500px, 96vw);
  height: min(900px, 92vh);
  min-height: 430px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 24px;
  background: #0b0e17;
  box-shadow: 0 40px 120px rgba(0,0,0,.62);
  animation: shellIn .28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes shellIn { from { opacity:0; transform: translateY(16px) scale(.985); } }

.game-shell-bar {
  min-height: 72px;
  padding: 10px 13px 10px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #111521;
}
.game-shell-info { display: flex; align-items: center; min-width: 0; gap: 11px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 15px var(--lime); }
.game-shell-info > div { min-width: 0; display: grid; gap: 2px; }
.game-shell-info span { color: #747d92; font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.game-shell-info h2 {
  margin: 0;
  max-width: 60vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 15px;
}
.game-shell-actions { margin-left: auto; display: flex; gap: 7px; }
.game-shell-actions button {
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.04); color: #cbd0dc; cursor: pointer; font-size: 18px;
  transition: .18s ease;
}
.game-shell-actions button:hover { background: rgba(255,255,255,.09); color: #fff; }
.game-shell-actions #overlay-favourite[aria-pressed="true"] { color: var(--pink); }
.game-shell-actions #close-overlay:hover { color: #fff; background: rgba(255,102,133,.16); border-color: rgba(255,102,133,.3); }

.frame-stage { position: relative; min-height: 0; background: #05070c; }
#game-frame { width: 100%; height: 100%; display: block; border: 0; background: #05070c; }
.frame-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  background: #090c14;
  transition: opacity .3s ease, visibility .3s ease;
}
.frame-loading.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-ring {
  width: 44px; height: 44px; margin-bottom: 15px;
  border: 3px solid rgba(255,255,255,.1); border-top-color: var(--lime); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.frame-loading strong { font-size: 14px; }
.frame-loading small { margin-top: 5px; color: #687187; font-size: 10px; }
.overlay-hint {
  margin: 0;
  padding: 7px 15px 8px;
  color: #555f75;
  background: #0a0d15;
  text-align: center;
  font-size: 9px;
}

.noscript {
  position: fixed; left: 50%; bottom: 20px; z-index: 999; transform: translateX(-50%);
  padding: 14px 20px; border-radius: 12px; color: #160e0e; background: #ff9b9b; font-weight: 800;
}

@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0,1fr) minmax(370px,.75fr); padding-inline: 18px; }
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .primary-nav { display: none; }
}

@media (max-width: 840px) {
  .topbar { width: calc(100% - 24px); margin-top: 10px; top: 8px; min-height: 66px; }
  .brand-copy small { display:none; }
  .header-random { margin-left: auto; padding: 11px 13px; }
  .hero {
    width: calc(100% - 24px);
    min-height: auto;
    padding: 72px 8px 58px;
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero-copy { max-width: 670px; }
  .hero h1 { font-size: clamp(58px, 15vw, 90px); }
  .hero-showcase { width: min(100%, 530px); padding-inline: 28px; }
  .library { width: calc(100% - 24px); padding: 75px 0 90px; }
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .section-heading { align-items: start; flex-direction: column; gap: 13px; }
  .section-heading p { text-align: left; }
  .site-footer { width: calc(100% - 24px); padding-inline: 8px; }
  .site-footer p { display: none; }
  .site-footer button { margin-left: auto; }
  .game-overlay { padding: 8px; }
  .game-shell { width: 100%; height: 96vh; border-radius: 18px; }
}

@media (max-width: 560px) {
  .topbar { padding-left: 10px; gap: 10px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
  .brand-copy strong { font-size: 12px; }
  .header-random { font-size: 0; width: 42px; height: 42px; justify-content: center; padding: 0; }
  .header-random span { font-size: 16px; }
  .hero { padding-top: 62px; }
  .hero h1 { font-size: clamp(53px, 18vw, 76px); }
  .hero-copy > p { font-size: 15px; line-height: 1.68; }
  .hero-actions .button { flex: 1; min-width: 150px; }
  .hero-stats { gap: 23px; }
  .hero-stats div + div::before { left: -12px; }
  .hero-stats dt { font-size: 19px; }
  .hero-stats dd { font-size: 9px; }
  .hero-showcase { padding: 34px 13px; }
  .feature-art { min-height: 285px; }
  .feature-emblem { width: 112px; height: 112px; font-size: 57px; border-radius: 31px; }
  .chip-a { left: -2px; bottom: 55px; }
  .chip-b { right: -7px; }
  .library-toolbar { align-items: stretch; flex-direction: column; }
  .view-actions { width: 100%; }
  .toolbar-button { flex: 1; min-height: 50px; }
  .search-box { min-height: 54px; }
  .games-grid { grid-template-columns: 1fr; }
  .game-card { display: grid; grid-template-columns: 42% 58%; min-height: 170px; border-radius: 20px; }
  .card-art { min-height: 170px; }
  .card-emblem { width: 72px; height: 72px; border-radius: 21px; font-size: 36px; }
  .card-content { min-width: 0; padding: 15px 14px; display: flex; flex-direction: column; justify-content: center; }
  .card-content h3 { font-size: 17px; }
  .card-content p { -webkit-line-clamp: 2; min-height: 34px; }
  .card-footer { margin-top: 11px; }
  .card-tags span:nth-child(n+2) { display: none; }
  .card-index { left: 9px; top: 9px; }
  .favourite-button { top: 9px; right: 9px; width: 34px; height: 34px; }
  .game-shell-bar { min-height: 62px; padding-left: 12px; }
  .game-shell-actions button { width: 38px; height: 38px; }
  .game-shell-info h2 { max-width: 39vw; font-size: 13px; }
  #open-new-window { display: none; }
}

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