/* =========================================================
   Gahlaker Arcade — lobby + player
   ========================================================= */

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgba(242, 238, 227, 0.78);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(242, 238, 227, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--acid);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.05em;
  transform: rotate(-4deg);
  transition: transform 0.35s var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(4deg) scale(1.04);
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--coral);
}

.brand-word {
  display: flex;
  flex-direction: column;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.brand-word small {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 25px;
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.site-nav a {
  position: relative;
  padding: 4px 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--ink);
  transition: right 0.3s var(--ease);
}

.site-nav a:hover::after {
  right: 0;
}

.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
}

.nav-github .icon {
  width: 12px;
  height: 12px;
}

.header-random {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 12px;
  font-weight: 500;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.header-random .icon {
  width: 15px;
  height: 15px;
  color: var(--acid);
}

.header-random:hover {
  background: #000;
  transform: translateY(-1px);
}

.header-random:active {
  transform: scale(0.97);
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(400px, 0.94fr);
  align-items: center;
  gap: 48px;
  min-height: calc(100svh - 134px);
  padding: 56px 0 72px;
}

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

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.17em;
  color: var(--muted);
}

.eyebrow-slash {
  color: var(--line-strong);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  animation: pulse 2.4s ease-out infinite;
}

.hero h1 {
  margin: 24px 0 26px;
  font-size: clamp(3.8rem, 7.6vw, 8rem);
  font-weight: 700;
  line-height: 0.91;
  letter-spacing: -0.07em;
  word-break: keep-all;
}

.hero h1 .serif {
  position: relative;
  display: inline-block;
  padding: 0 0.03em;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.11em;
  background: linear-gradient(transparent 63%, var(--acid) 63%, var(--acid) 94%, transparent 94%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transform: translateY(0.015em);
}

.lede {
  max-width: 505px;
  font-size: clamp(14.5px, 1.18vw, 17px);
  line-height: 1.75;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 21px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

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

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

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 9px 24px rgba(18, 18, 17, 0.16);
}

.btn-primary .icon {
  color: var(--acid);
}

.btn-primary:hover {
  background: #000;
  box-shadow: 0 13px 30px rgba(18, 18, 17, 0.22);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--paper-2);
  border-color: var(--ink);
}

.btn-light {
  background: var(--acid);
  color: var(--ink);
}

.btn-light .icon {
  color: var(--ink);
}

.btn-light:hover {
  background: var(--cream);
}

.hero-meta {
  display: flex;
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.hero-meta > div {
  margin-right: 27px;
  padding-right: 27px;
  border-right: 1px solid var(--line);
}

.hero-meta > div:last-child {
  margin-right: 0;
  padding-right: 0;
  border-right: 0;
}

.hero-meta dt {
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.055em;
}

.hero-meta dd {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero-art {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 610px;
  min-height: 560px;
}

.hero-glow {
  position: absolute;
  top: 8%;
  left: 12%;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 255, 67, 0.68) 0%, rgba(255, 95, 69, 0.16) 44%, transparent 70%);
  filter: blur(32px);
  opacity: 0.9;
}

.hero-card {
  position: absolute;
  overflow: hidden;
  border: 6px solid var(--paper);
  border-radius: 17px;
  background: var(--ink);
  box-shadow: 0 30px 65px rgba(18, 18, 17, 0.24);
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
  will-change: transform;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card.card-a {
  top: 8%;
  left: 0;
  z-index: 3;
  width: 58%;
  aspect-ratio: 4 / 3;
  transform: rotate(-7deg);
}

.hero-card.card-b {
  top: 1%;
  right: 0;
  z-index: 2;
  width: 52%;
  aspect-ratio: 4 / 3;
  transform: rotate(6deg);
}

.hero-card.card-c {
  bottom: 1%;
  left: 18%;
  z-index: 4;
  width: 54%;
  aspect-ratio: 4 / 3;
  transform: rotate(2.5deg);
}

.hero-card:hover {
  z-index: 7;
  transform: rotate(0deg) translateY(-8px) scale(1.025);
  box-shadow: 0 38px 80px rgba(18, 18, 17, 0.3);
}

.sticker {
  position: absolute;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(18, 18, 17, 0.17);
}

.sticker .icon {
  width: 12px;
  height: 12px;
}

.sticker-a {
  top: -2%;
  right: 5%;
  background: var(--ink);
  color: var(--acid);
  transform: rotate(8deg);
}

.sticker-b {
  bottom: 9%;
  left: -1%;
  background: var(--acid);
  color: var(--ink);
  transform: rotate(-7deg);
}

.hero-spark {
  position: absolute;
  top: 10%;
  right: 10%;
  z-index: 1;
  color: var(--coral);
  animation: spin 24s linear infinite;
}

.hero-spark .icon {
  width: 46px;
  height: 46px;
}

.hero-caption {
  position: absolute;
  right: 1%;
  bottom: -3%;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.hero-caption::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  margin-right: 9px;
  background: var(--line-strong);
  vertical-align: middle;
}

.hero-copy > * {
  animation: rise 0.75s var(--ease) both;
}

.hero-copy > *:nth-child(1) { animation-delay: 0.04s; }
.hero-copy > *:nth-child(2) { animation-delay: 0.1s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.17s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.24s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.31s; }

.hero-art {
  animation: rise 0.9s 0.16s var(--ease) both;
}

/* ---------- marquee ---------- */
.marquee {
  position: relative;
  z-index: 2;
  width: 102%;
  margin-left: -1%;
  overflow: hidden;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  background: var(--ink);
  color: var(--cream);
  padding: 17px 0;
  transform: rotate(-1deg);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 36s linear infinite;
}

.marquee span {
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.marquee i {
  margin: 0 25px;
  color: var(--acid);
  font-style: normal;
}

/* ---------- library ---------- */
.library {
  padding: 112px 0 132px;
  scroll-margin-top: 88px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 17px;
}

.section-index {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  transform: translateY(-0.35em);
}

.section-head h2 {
  font-size: clamp(2.9rem, 5vw, 4.8rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.section-head p {
  max-width: 350px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  text-align: right;
}

.library-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 13px;
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(340px, 100%);
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.search:focus-within {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(18, 18, 17, 0.06);
}

.search .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
}

.search input::placeholder {
  color: #8b8578;
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.search kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.filter:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--acid);
}

.filter .filter-count {
  font-family: var(--mono);
  font-size: 8px;
  opacity: 0.55;
}

.filter[aria-pressed="true"] .filter-count {
  opacity: 0.8;
}

.library-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 27px;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.clear-filters .icon {
  width: 11px;
  height: 11px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 38px 24px;
}

.game-card {
  position: relative;
  min-width: 0;
  animation: card-in 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 32ms);
}

.card-main {
  display: block;
}

.cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #1c1b18;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.game-card:hover .cover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(18, 18, 17, 0.15);
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96) contrast(1.015);
  transition: transform 0.8s var(--ease), filter 0.4s var(--ease);
}

.game-card:hover .cover img {
  transform: scale(1.035);
  filter: saturate(1.03) contrast(1.02);
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 28%, transparent 70%, rgba(0, 0, 0, 0.28));
}

.cover-index {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 1;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(242, 238, 227, 0.92);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.cover-status {
  position: absolute;
  bottom: 11px;
  left: 11px;
  z-index: 1;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.play-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--acid);
  color: var(--ink);
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.play-badge .icon {
  width: 18px;
  height: 18px;
}

.game-card:hover .play-badge,
.game-card:focus-within .play-badge {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.fav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(8, 9, 11, 0.34);
  color: var(--cream);
  backdrop-filter: blur(8px);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.fav .icon {
  width: 15px;
  height: 15px;
}

.fav:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: var(--ink);
  transform: scale(1.06);
}

.fav[aria-pressed="true"] {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--ink);
}

.fav[aria-pressed="true"] .icon {
  fill: currentColor;
}

.card-body {
  padding: 15px 2px 0;
}

.card-overline {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 5px 0 6px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.recent-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 95, 69, 0.14);
}

.card-blurb {
  max-width: 33ch;
  min-height: 39px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-meta span + span::before {
  content: "";
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--line-strong);
}

.empty-state {
  margin-top: 16px;
  padding: 72px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  text-align: center;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--acid);
  font-family: var(--serif);
  font-size: 26px;
  font-style: italic;
}

.empty-state h3 {
  font-size: 24px;
  letter-spacing: -0.04em;
}

.empty-state p {
  margin: 8px auto 22px;
  max-width: 340px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- about ---------- */
.about {
  position: relative;
  overflow: hidden;
  padding: 118px 0;
  background: var(--ink);
  color: var(--cream);
  scroll-margin-top: 76px;
}

.about::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 58% at 12% 90%, rgba(217, 255, 67, 0.13), transparent 65%),
    radial-gradient(32% 44% at 88% 8%, rgba(255, 95, 69, 0.11), transparent 70%);
  pointer-events: none;
}

.about::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 0%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 0%, transparent 76%);
  pointer-events: none;
}

.about-star {
  position: absolute;
  top: 10%;
  right: 7%;
  z-index: 1;
  color: var(--acid);
  opacity: 0.9;
  animation: spin 32s linear infinite;
}

.about-star .icon {
  width: 74px;
  height: 74px;
}

.about-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 80px;
}

.about-head .section-index {
  color: rgba(255, 255, 255, 0.42);
}

.about-head h2 {
  margin-top: 23px;
  font-size: clamp(3.1rem, 5.5vw, 5.7rem);
  font-weight: 700;
  line-height: 0.93;
  letter-spacing: -0.07em;
}

.about-lede {
  max-width: 590px;
  color: #d9d3c5;
  font-size: clamp(17px, 1.55vw, 21px);
  line-height: 1.65;
  letter-spacing: -0.01em;
}

.features {
  margin: 40px 0 42px;
}

.features > div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  padding: 19px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.17);
}

.features > div:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.17);
}

.features > div > span {
  padding-top: 3px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.features h3 {
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.features p {
  max-width: 51ch;
  color: #a9a294;
  font-size: 12.5px;
  line-height: 1.65;
}

.about .btn-light {
  min-height: 44px;
  padding: 0 18px;
  font-size: 12px;
}

/* ---------- footer ---------- */
.site-footer {
  padding: 68px 0 25px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 60px;
  padding-bottom: 52px;
}

.footer-brand {
  position: relative;
  font-size: clamp(3.4rem, 6.8vw, 6.8rem);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.078em;
}

.footer-brand::after {
  content: "";
  position: absolute;
  top: 0.02em;
  right: -0.05em;
  width: 0.12em;
  height: 0.12em;
  border-radius: 50%;
  background: var(--coral);
}

.footer-brand span {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.24em;
  line-height: 1;
}

.footer-links {
  display: flex;
  gap: 68px;
  padding-top: 4px;
}

.footer-links h4 {
  margin-bottom: 11px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.footer-links a {
  display: block;
  width: fit-content;
  margin: 7px 0;
  border-bottom: 1px solid transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  transition: border-color 0.2s var(--ease);
}

.footer-links a:hover {
  border-bottom-color: var(--ink);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.footer-bottom a {
  border-bottom: 1px solid var(--line-strong);
}

/* ---------- player ---------- */
.player {
  --game-accent: var(--acid);
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: var(--dark);
  color: var(--cream);
}

.player-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 17px;
  flex: none;
  padding: 10px 15px;
  padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(8, 9, 11, 0.93);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.player-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.player-back .icon {
  width: 15px;
  height: 15px;
}

.player-back:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.player-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
}

.player-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 2px;
  background: var(--game-accent);
  box-shadow: 0 0 16px var(--game-accent);
  transform: rotate(45deg);
}

.player-kicker {
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.player-heading h2 {
  overflow: hidden;
  margin-top: 2px;
  color: var(--cream);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: 1px;
}

.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10.5px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.tool .icon {
  width: 15px;
  height: 15px;
}

.tool:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.player-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #050506;
}

.player-stage iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.game-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.game-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-backdrop {
  position: absolute;
  inset: -6%;
  background-position: center;
  background-size: cover;
  filter: blur(26px) saturate(0.65) brightness(0.3);
  transform: scale(1.08);
}

.game-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, transparent 0%, rgba(8, 9, 11, 0.52) 55%, rgba(8, 9, 11, 0.93) 100%);
}

.loader-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 570px;
  text-align: center;
}

.loader-kicker {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
}

.loader-card h3 {
  margin: 14px 0 8px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

.loader-controls {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.loader-bar {
  width: 180px;
  height: 2px;
  margin: 28px auto 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.loader-bar i {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--acid);
  animation: loader 1.35s ease-in-out infinite;
}

.loader-hint {
  color: rgba(255, 255, 255, 0.38);
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

.loader-hint a {
  color: var(--acid);
  border-bottom: 1px solid currentColor;
}

/* ---------- dialog ---------- */
.game-dialog {
  position: relative;
  width: min(780px, calc(100% - 32px));
  max-height: min(650px, calc(100dvh - 32px));
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
}

.game-dialog[open] {
  animation: dialog-in 0.3s var(--ease) both;
}

.game-dialog::backdrop {
  background: rgba(5, 5, 6, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dialog-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 390px;
}

.dialog-cover {
  min-height: 100%;
  background: #121211;
}

.dialog-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-content {
  padding: 33px 32px 28px;
}

.dialog-kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
}

.dialog-content h2 {
  margin-bottom: 4px;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
}

.dialog-sub {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-description {
  max-width: 48ch;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.72;
}

.dialog-facts {
  display: grid;
  gap: 10px;
  margin-top: 21px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dialog-facts > div {
  display: grid;
  grid-template-columns: 47px minmax(0, 1fr);
  gap: 12px;
  font-size: 11.5px;
  line-height: 1.5;
}

.dialog-facts dt {
  padding-top: 1px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
}

.dialog-facts dd {
  min-width: 0;
  color: var(--ink-soft);
}

.dialog-facts a {
  border-bottom: 1px solid var(--line-strong);
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.dialog-note {
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.03em;
  line-height: 1.6;
}

.dialog-actions .btn {
  min-height: 41px;
  padding: 0 15px;
  font-size: 11.5px;
}

.dialog-close-form {
  position: absolute;
  top: 11px;
  right: 11px;
  z-index: 2;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(242, 238, 227, 0.94);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(18, 18, 17, 0.18);
  backdrop-filter: blur(8px);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.dialog-close:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--cream);
}

.dialog-close .icon {
  width: 15px;
  height: 15px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 900;
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.3);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast strong {
  color: var(--acid);
  font-weight: 600;
}

body.is-playing .toast {
  background: var(--cream);
  color: var(--ink);
  border-color: transparent;
}

body.is-playing .toast strong {
  color: inherit;
}

/* ---------- keyframes ---------- */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 95, 69, 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(255, 95, 69, 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(13px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loader {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .hero {
    grid-template-columns: minmax(0, 1.02fr) minmax(350px, 0.98fr);
    gap: 32px;
  }

  .hero-art {
    min-height: 490px;
  }

  .hero h1 {
    font-size: clamp(3.6rem, 7.2vw, 6.8rem);
  }
}

@media (max-width: 940px) {
  .site-nav {
    display: none;
  }

  .header-random {
    margin-left: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 66px;
    padding: 52px 0 80px;
  }

  .hero-copy {
    max-width: none;
  }

  .hero h1 {
    font-size: clamp(3.8rem, 10.4vw, 7.4rem);
  }

  .hero-art {
    justify-self: center;
    max-width: 650px;
    min-height: 480px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

  .section-head p {
    text-align: left;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-head h2 {
    max-width: 560px;
  }

  .about-star {
    top: 5%;
    right: 4%;
  }

  .about-star .icon {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 780px) {
  .header-inner {
    height: 66px;
    gap: 14px;
  }

  .brand-word {
    font-size: 15px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .hero {
    padding-top: 38px;
  }

  .hero h1 {
    margin-top: 20px;
  }

  .hero-meta {
    margin-top: 42px;
  }

  .hero-art {
    min-height: 410px;
  }

  .hero-card {
    border-width: 4px;
    border-radius: 13px;
  }

  .hero-caption {
    display: none;
  }

  .library {
    padding: 84px 0 94px;
  }

  .library-tools {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }

  .search {
    width: 100%;
  }

  .filters {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
    gap: 5px;
  }

  .filter {
    flex: none;
    padding: 8px 13px;
  }

  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 30px 18px;
  }

  .footer-top {
    flex-direction: column;
    gap: 38px;
  }

  .footer-links {
    gap: 56px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
  }

  .about {
    padding: 86px 0;
  }

  .player-bar {
    gap: 8px;
    padding: 8px 10px;
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .player-back {
    width: 38px;
    height: 38px;
    padding: 0;
  }

  .player-back span,
  .tool span {
    display: none;
  }

  .player-tools {
    gap: 0;
  }

  .tool {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .player-back {
    width: 40px;
    height: 40px;
  }

  .player-kicker {
    display: none;
  }

  .player-heading h2 {
    margin-top: 0;
    font-size: 13px;
  }

  .player-dot {
    width: 7px;
    height: 7px;
  }

  .dialog-body {
    grid-template-columns: 1fr;
  }

  .dialog-cover {
    max-height: 188px;
    min-height: 168px;
  }

  .dialog-content {
    padding: 24px 21px 22px;
  }

  .dialog-cover img {
    object-position: center 42%;
  }

  .marquee {
    padding: 14px 0;
  }

  .marquee span {
    font-size: 8.5px;
  }

  .marquee i {
    margin: 0 18px;
  }
}

@media (max-width: 560px) {
  .header-random {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }

  .header-random span {
    display: none;
  }

  .header-random .icon {
    width: 16px;
    height: 16px;
  }

  .hero {
    gap: 48px;
    padding-bottom: 66px;
  }

  .hero h1 {
    font-size: clamp(3.15rem, 14.4vw, 5.2rem);
    letter-spacing: -0.075em;
  }

  .lede {
    font-size: 13.5px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-meta {
    justify-content: space-between;
    gap: 0;
    margin-top: 36px;
  }

  .hero-meta > div {
    margin-right: 14px;
    padding-right: 14px;
  }

  .hero-meta dt {
    font-size: 22px;
  }

  .hero-meta dd {
    font-size: 7.5px;
  }

  .hero-art {
    min-height: 330px;
  }

  .sticker {
    padding: 6px 9px;
    font-size: 7.5px;
  }

  .sticker-b {
    bottom: 5%;
    left: 0;
  }

  .sticker-a {
    top: -3%;
    right: 2%;
  }

  .hero-spark {
    top: 6%;
    right: 4%;
  }

  .hero-spark .icon {
    width: 30px;
    height: 30px;
  }

  .section-head h2 {
    font-size: clamp(2.5rem, 13vw, 3.8rem);
  }

  .section-title {
    gap: 12px;
  }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .card-blurb {
    min-height: 0;
  }

  .card-title {
    font-size: 23px;
  }

  .footer-brand {
    font-size: clamp(3.2rem, 16vw, 4.6rem);
  }

  .footer-links {
    gap: 44px;
  }

  .about h2 {
    font-size: clamp(2.8rem, 14vw, 4rem);
  }

  .about-lede {
    font-size: 16px;
  }

  .features > div {
    grid-template-columns: 30px 1fr;
    gap: 10px;
  }

  .tool-external {
    display: none;
  }

  .loader-card h3 {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }

  .loader-controls {
    font-size: 11px;
  }

  .toast {
    bottom: 18px;
    font-size: 11px;
  }

  .search kbd {
    display: none;
  }
}

/* ---------- small state fixes ---------- */
.cover-fallback::before {
  content: attr(data-initial);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--acid);
  font-size: 72px;
  font-weight: 600;
}

.cover-fallback img {
  visibility: hidden;
}

.card-main:focus-visible {
  outline: none;
}

.card-main:focus-visible .cover {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.filter-fav .icon {
  fill: none;
}

.filter-fav[aria-pressed="true"] .icon {
  fill: currentColor;
}

.player :focus-visible,
.game-dialog :focus-visible {
  outline-color: var(--acid);
}

.skip-link:focus-visible {
  outline-color: var(--acid);
}

body.is-playing .skip-link {
  display: none;
}

.dialog-actions .btn-ghost[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--acid);
  color: var(--ink);
}

.dialog-actions .btn-ghost[aria-pressed="true"] .icon {
  fill: currentColor;
}

.header-random:focus-visible,
.btn:focus-visible,
.filter:focus-visible {
  outline-color: var(--ink);
}

.player .btn:focus-visible {
  outline-color: var(--acid);
}
