:root {
  color-scheme: dark;
  --bg: #101114;
  --surface: #181b20;
  --surface-strong: #22262e;
  --text: #f6f3ea;
  --muted: #b9bdc7;
  --line: rgba(255, 255, 255, 0.12);
  --focus: #52d6ff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(115deg, rgba(255, 79, 123, 0.16), transparent 38%),
    linear-gradient(290deg, rgba(24, 183, 164, 0.13), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.82);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: url("../images/cugl.svg") center / contain no-repeat;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.gallery-shell,
.game-page,
.info-page,
.landing-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(34px, 6vw, 76px) 0;
}

.festival-banner {
  aspect-ratio: 10 / 4;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: clamp(28px, 5vw, 56px);
  overflow: hidden;
  background: #0f1115;
}

.festival-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-intro,
.landing-intro {
  max-width: 820px;
}

.landing-intro {
  max-width: 1040px;
}

.landing-intro h1 {
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 0.98;
  margin-bottom: 12px;
}

.landing-subtitle {
  color: var(--text);
  font-size: clamp(1.3rem, 2.6vw, 2.15rem);
  font-weight: 850;
  line-height: 1.12;
  margin-bottom: 16px;
}

.eyebrow {
  color: var(--accent, #52d6ff);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.96;
  margin-bottom: 18px;
}

.gallery-intro p:not(.eyebrow),
.landing-intro p:not(.eyebrow):not(.landing-subtitle),
.info-page > p:not(.eyebrow),
.tagline {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  max-width: 720px;
}

.landing-intro p:not(.eyebrow):not(.landing-subtitle) {
  max-width: 760px;
}

.home-note {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  margin: 0 auto clamp(28px, 5vw, 52px);
  max-width: 760px;
  text-align: center;
}

.event-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 28px 0 clamp(36px, 6vw, 70px);
}

.event-details div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.78);
  padding: 20px;
}

.event-details span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.event-details strong {
  display: block;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.15;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.feature-grid a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.78);
  color: var(--text);
  padding: 22px;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.feature-grid a:hover,
.feature-grid a:focus-visible {
  border-color: color-mix(in srgb, var(--focus) 70%, white);
  background: color-mix(in srgb, var(--surface) 84%, var(--focus));
  box-shadow: 0 0 0 2px rgba(82, 214, 255, 0.2);
  transform: translateY(-2px);
}

.feature-grid h2 {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.08;
  margin-bottom: 12px;
}

.feature-grid p:not(.eyebrow) {
  color: var(--muted);
}

.gallery-tools {
  display: grid;
  gap: 22px;
  margin: 34px 0 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.78);
}

.search-field {
  display: grid;
  gap: 8px;
}

.search-field span,
legend {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.search-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1115;
  color: var(--text);
  padding: 0 14px;
}

.filter-groups {
  display: grid;
  gap: 18px;
}

fieldset {
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.segmented-control button,
.pagination button,
.text-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  padding: 0 14px;
}

.segmented-control button.is-active,
.pagination button.is-active {
  background: var(--text);
  border-color: var(--text);
  color: #101114;
}

.segmented-control button:not([data-filter-value="all"]).is-active::after {
  content: " selected";
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gallery-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-weight: 800;
  margin: 16px 0;
}

.text-button {
  min-height: 36px;
  background: transparent;
  color: var(--text);
}

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

.game-card {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  min-height: 108px;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), rgba(24, 27, 32, 0.94) 54%);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.game-card:hover {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
  transform: translateY(-2px);
}

.game-card img {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: #0f1115;
}

.game-card strong,
.game-card small {
  display: block;
}

.game-card strong {
  font-size: 1.05rem;
  line-height: 1.2;
}

.game-card small {
  color: var(--muted);
  margin-top: 5px;
}

.game-card small + small {
  color: color-mix(in srgb, var(--accent) 62%, var(--muted));
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin-top: 18px;
  padding: 36px;
  text-align: center;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 28px;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.game-header {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: clamp(18px, 4vw, 32px);
  align-items: start;
  margin-bottom: 28px;
}

.game-header h1 {
  margin-bottom: 12px;
}

.game-showcase {
  --showcase-gap: 16px;
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(250px, 0.75fr);
  gap: var(--showcase-gap);
  align-items: start;
}

.trailer-panel {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050608;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
}

.trailer-panel iframe,
.trailer-panel video,
.trailer-panel img,
.screenshot-card img {
  display: block;
  width: 100%;
  border: 0;
}

.trailer-panel iframe,
.trailer-panel video,
.trailer-panel > img {
  height: 100%;
}

.trailer-panel img,
.trailer-panel video {
  object-fit: cover;
}

.screenshot-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050608;
  overflow: hidden;
}

.screenshot-card img {
  height: auto;
}

.trailer-placeholder {
  display: grid;
  gap: 6px;
  width: 100%;
  height: 100%;
  place-content: center;
  text-align: center;
  padding: 28px;
}

.trailer-placeholder strong {
  font-size: clamp(1.5rem, 4vw, 3rem);
  line-height: 1;
}

.trailer-placeholder span {
  color: var(--muted);
  font-weight: 800;
}

.screenshot-panel {
  display: grid;
  gap: 16px;
  align-self: start;
  max-height: calc(((100cqw - var(--showcase-gap)) * 1.6 / 2.35) * 9 / 16);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 4px 4px 0;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.12);
}

.screenshot-card {
  display: block;
  margin: 0;
  box-shadow: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.screenshot-card:hover {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 42%, transparent);
}

.screenshot-card:focus-visible {
  outline-offset: -3px;
}

.game-hero__icon {
  width: 112px;
  height: 112px;
  border-radius: 8px;
  background: #0f1115;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.chip {
  border: 1px solid color-mix(in srgb, var(--accent) 58%, white);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 6px 10px;
}

.chip--quiet {
  border-color: var(--line);
  color: var(--muted);
}

.game-details,
.download-section,
.credits-section {
  margin-top: clamp(48px, 8vw, 92px);
}

.game-details {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.game-description p:not(.eyebrow) {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.game-facts {
  display: grid;
  gap: 10px;
}

.fact-card {
  display: grid;
  gap: 4px;
  min-height: 88px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.78);
  padding: 16px;
  text-decoration: none;
}

.fact-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fact-card strong {
  font-size: 1.06rem;
}

.fact-card--link {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), rgba(24, 27, 32, 0.92) 58%);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 20px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.download-card {
  display: grid;
  gap: 4px;
  min-height: 112px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 24%, transparent), rgba(24, 27, 32, 0.9) 58%);
  padding: 18px;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.download-card:hover,
.download-card:focus-visible,
.fact-card--link:hover,
.fact-card--link:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 76%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 34%, transparent);
  transform: translateY(-2px);
}

.download-card strong {
  font-size: 1.08rem;
}

.download-card span,
.download-card small {
  color: var(--muted);
}

.studio-credit {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.studio-credit img {
  width: 86px;
  height: 86px;
  border-radius: 8px;
  background: #0f1115;
}

.studio-credit h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 0;
}

.team-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.team-list li {
  display: grid;
  gap: 2px;
  min-height: 68px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.78);
  padding: 12px 14px;
}

.team-list span {
  color: var(--muted);
}

.placeholder-panel {
  display: grid;
  gap: 6px;
  min-height: 220px;
  align-content: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 32, 0.62);
  margin-top: 26px;
  padding: 28px;
}

.placeholder-panel span,
.info-page p {
  color: var(--muted);
}

.floorplan-table {
  border-collapse: separate;
  border-spacing: 14px;
  margin-top: 18px;
  table-layout: fixed;
  width: 100%;
}

.floorplan-table th {
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.25rem);
  padding-bottom: 8px;
  text-align: center;
}

.floorplan-table td {
  vertical-align: top;
  width: 50%;
}

.floorplan-table a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1115;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.floorplan-table a:hover,
.floorplan-table a:focus-visible {
  border-color: color-mix(in srgb, var(--focus) 70%, white);
  box-shadow: 0 0 0 2px rgba(82, 214, 255, 0.2);
  transform: translateY(-2px);
}

.floorplan-table img {
  display: block;
  height: auto;
  width: 100%;
}

@media (max-width: 760px) {
  .site-header,
  .gallery-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-tools {
    padding: 16px;
  }

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

  .game-header,
  .game-showcase,
  .game-details {
    grid-template-columns: 1fr;
  }

  .screenshot-panel {
    max-height: min(640px, 72vh);
  }

  .game-hero__icon {
    width: 86px;
    height: 86px;
  }

  .festival-banner {
    aspect-ratio: 4 / 3;
  }

  .floorplan-table,
  .floorplan-table tbody,
  .floorplan-table tr,
  .floorplan-table th,
  .floorplan-table td {
    display: block;
    width: 100%;
  }

  .floorplan-table {
    border-spacing: 0;
  }

  .floorplan-table th {
    padding: 16px 0 8px;
  }

  .floorplan-table td + td {
    margin-top: 18px;
  }
}
