:root {
  --ink: #10211d;
  --muted: #62716d;
  --line: #dce5e1;
  --paper: #ffffff;
  --canvas: #f3f6f4;
  --emerald: #08785b;
  --emerald-dark: #05533f;
  --mint: #dff5eb;
  --coral: #ef624c;
  --gold: #d5a12b;
  --hero: #071713;
  --shadow: 0 12px 34px rgba(16, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2;
}

.portal-hero {
  position: relative;
  isolation: isolate;
  min-height: 78svh;
  max-height: 880px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: #fff;
  background-color: var(--hero);
  background-image: url("portal-hero.webp");
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.portal-hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(3, 16, 14, 0.5);
}

.public-header {
  position: relative;
  z-index: 5;
  width: min(1240px, calc(100% - 48px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #fff;
}

.public-brand span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 7px;
  background: var(--emerald);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.public-brand strong {
  font-size: 18px;
  line-height: 1;
}

.public-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-header nav a {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.public-header nav a:hover,
.public-header nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.public-header nav .public-login {
  margin-left: 4px;
  color: var(--ink);
  background: #fff;
}

.public-header nav .public-login:hover {
  color: var(--ink);
  background: var(--mint);
}

.hero-content {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 42px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.hero-kicker,
.demo-kicker,
.provider-band p,
.section-heading p {
  margin: 0;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 800;
}

.hero-kicker {
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  color: #d8fff1;
  background: rgba(4, 27, 22, 0.55);
}

.hero-content h1 {
  margin: 18px 0 8px;
  max-width: 680px;
  font-size: 72px;
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-content > p:not(.hero-kicker) {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 20px;
  line-height: 1.55;
}

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

.portal-button {
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 750;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.portal-button:hover {
  transform: translateY(-1px);
}

.portal-button.primary {
  background: var(--coral);
  color: #fff;
}

.portal-button.primary:hover {
  background: #d94d39;
}

.portal-button.secondary {
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
  background: rgba(3, 18, 15, 0.45);
}

.portal-button.secondary:hover {
  border-color: #fff;
  background: rgba(3, 18, 15, 0.72);
}

.hero-status {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto 22px;
  padding: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-status span {
  min-width: 0;
  padding: 0 22px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.hero-status span:first-child {
  padding-left: 0;
}

.hero-status span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-status b {
  margin-right: 5px;
  color: #fff;
  font-size: 18px;
}

.provider-band {
  padding: 26px 24px 30px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.provider-band > div {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.provider-band p,
.section-heading p {
  color: var(--emerald);
}

.provider-wordmarks {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.provider-wordmarks span {
  min-height: 52px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  border-left: 3px solid var(--emerald);
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  background: #f7faf8;
}

.provider-wordmarks svg {
  grid-row: 1 / 3;
  color: var(--emerald);
}

.provider-wordmarks small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.catalog-preview {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 70px;
}

.section-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: 0;
}

.section-heading > a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--emerald);
  font-size: 14px;
  font-weight: 750;
}

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

.preview-game {
  min-width: 0;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.preview-game:hover {
  border-color: #a7c7bb;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.preview-game img {
  width: 86px;
  height: 86px;
  display: block;
  object-fit: cover;
  background: #dce5e1;
}

.preview-game span {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.preview-game strong,
.preview-game small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-game strong {
  font-size: 14px;
}

.preview-game small {
  color: var(--muted);
  font-size: 12px;
}

.demo-page {
  --demo-bg: #0b0e0d;
  --demo-surface: #151918;
  --demo-surface-raised: #1b201e;
  --demo-line: #2d3431;
  --demo-text: #f1f5f2;
  --demo-muted: #99a59f;
  min-height: 100vh;
  color: var(--demo-text);
  background: var(--demo-bg);
  color-scheme: dark;
}

.demo-page > .public-header {
  position: sticky;
  top: 0;
  width: 100%;
  min-height: 66px;
  padding: 0 max(24px, calc((100% - 1240px) / 2));
  border-bottom: 1px solid var(--demo-line);
  background: rgba(11, 14, 13, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.demo-page .public-brand {
  color: var(--demo-text);
}

.demo-page .public-brand span {
  border-color: #3c8e72;
  background: #147356;
}

.demo-page .public-header nav a {
  color: var(--demo-muted);
}

.demo-page .public-header nav a:hover,
.demo-page .public-header nav a.active {
  color: #e8fff6;
  background: #1a2b25;
}

.demo-page .public-header nav .public-login {
  border: 1px solid #dfe6e2;
  color: #121615;
  background: #f1f5f2;
}

.demo-page .public-header nav .public-login:hover {
  color: #121615;
  background: #dce9e3;
}

.demo-main {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.demo-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.demo-kicker {
  color: #ff806b;
}

.demo-toolbar h1 {
  margin: 5px 0 6px;
  color: var(--demo-text);
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: 0;
}

.demo-toolbar > div:first-child > p:last-child {
  margin: 0;
  color: var(--demo-muted);
  font-size: 14px;
}

.demo-count {
  min-height: 48px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 2px solid #d3a63c;
}

.demo-count span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--demo-text);
  font-size: 13px;
  font-weight: 700;
}

.demo-count span svg {
  color: #53c398;
}

.demo-count strong {
  font-size: 18px;
}

.demo-count small {
  margin-top: 2px;
  color: var(--demo-muted);
  font-size: 11px;
}

.demo-error {
  margin-top: 20px;
  min-height: 48px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #6e342d;
  border-radius: 7px;
  color: #ffb5a8;
  background: #291713;
  font-size: 14px;
  font-weight: 650;
}

.provider-filter {
  margin: 30px 0 22px;
  padding-bottom: 2px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.provider-filter a {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--demo-line);
  border-radius: 7px;
  color: var(--demo-muted);
  background: var(--demo-surface);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.provider-filter a:hover {
  border-color: #4e6d61;
  color: #dff7ed;
  background: #1a2521;
}

.provider-filter a.active {
  border-color: #218462;
  color: #fff;
  background: #17684f;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.game-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--demo-line);
  border-radius: 8px;
  background: var(--demo-surface);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.game-card:hover {
  border-color: #52615b;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
  transform: translateY(-3px);
}

.game-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--demo-surface-raised);
}

.game-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 250ms ease;
}

.game-card:hover .game-cover img {
  transform: scale(1.025);
}

.game-cover span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: #fff;
  background: rgba(8, 12, 11, 0.82);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-info {
  min-height: 74px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.game-info > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.game-info strong,
.game-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-info strong {
  color: var(--demo-text);
  font-size: 13px;
  line-height: 1.25;
}

.game-info small {
  color: var(--demo-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.game-info form {
  margin: 0;
}

.game-info button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.game-info button {
  color: #fff;
  background: #eb674f;
}

.game-info button:hover {
  background: #c94a36;
}

.demo-player-page {
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  color: #f1f5f2;
  background: #080a09;
  color-scheme: dark;
}

.demo-player-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: 46px minmax(0, 1fr);
}

.demo-player-toolbar {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(38px, auto) minmax(0, 1fr) 36px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #2d3431;
  background: #111513;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
}

.player-back,
.player-fullscreen {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #343c38;
  border-radius: 7px;
  color: #dce5e0;
  background: #1a1f1d;
  cursor: pointer;
}

.player-back {
  padding: 0 12px;
  gap: 8px;
  justify-self: start;
  font-size: 13px;
  font-weight: 700;
}

.player-fullscreen {
  width: 34px;
  padding: 0;
  justify-self: end;
}

.player-back:hover,
.player-fullscreen:hover {
  border-color: #4f6d61;
  color: #e9fff6;
  background: #1b2a24;
}

.player-title {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.player-title strong,
.player-title small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-title strong {
  font-size: 13px;
}

.player-title small {
  color: #8f9b95;
  font-size: 9px;
}

.demo-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.demo-frame:fullscreen {
  width: 100vw;
  height: 100vh;
}

.demo-frame iframe {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

.demo-frame-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: #080a09;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.demo-frame-loader span {
  width: 34px;
  height: 34px;
  border: 3px solid #26312d;
  border-top-color: #53c398;
  border-radius: 50%;
  animation: demo-frame-spin 700ms linear infinite;
}

.demo-frame.is-ready .demo-frame-loader {
  visibility: hidden;
  opacity: 0;
}

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

@media (max-width: 1100px) {
  .provider-wordmarks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .hero-content h1 {
    font-size: 58px;
  }

  .demo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .demo-player-shell {
    grid-template-rows: 44px minmax(0, 1fr);
  }

  .portal-hero {
    min-height: 82svh;
    max-height: none;
    background-position: 64% center;
  }

  .public-header {
    width: min(100% - 28px, 1240px);
    min-height: 62px;
    gap: 10px;
  }

  .public-header nav {
    gap: 3px;
  }

  .public-header nav a {
    min-height: 36px;
    padding: 0 8px;
    font-size: 12px;
  }

  .public-header nav a:nth-child(2) {
    display: none;
  }

  .public-header nav .public-login {
    margin-left: 0;
  }

  .hero-content {
    width: min(100% - 32px, 1240px);
    padding: 34px 0 24px;
  }

  .hero-content h1 {
    margin-top: 14px;
    font-size: 48px;
  }

  .hero-content > p:not(.hero-kicker) {
    max-width: 420px;
    font-size: 16px;
  }

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

  .portal-button {
    min-height: 44px;
    padding: 0 14px;
  }

  .hero-status {
    width: min(100% - 32px, 1240px);
    margin-bottom: 16px;
    grid-template-columns: 1fr;
  }

  .hero-status span,
  .hero-status span:first-child {
    padding: 5px 0;
  }

  .hero-status span + span {
    border-left: 0;
  }

  .provider-band {
    padding: 24px 16px;
  }

  .provider-wordmarks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-preview {
    width: min(100% - 32px, 1240px);
    padding: 38px 0 50px;
  }

  .section-heading h2 {
    font-size: 26px;
  }

  .section-heading > a {
    font-size: 12px;
  }

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

  .demo-page > .public-header {
    padding: 0 14px;
  }

  .demo-main {
    width: min(100% - 28px, 1240px);
    padding: 28px 0 50px;
  }

  .demo-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .demo-toolbar h1 {
    font-size: 30px;
  }

  .demo-count {
    width: auto;
    padding: 0 0 0 14px;
    align-items: flex-start;
  }

  .provider-filter {
    margin-top: 22px;
  }

  .demo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .game-info {
    min-height: 68px;
    padding: 8px;
  }
}

@media (max-width: 460px) {
  .public-brand strong {
    display: none;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .portal-button {
    flex: 1 1 140px;
  }

  .provider-wordmarks {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading > a {
    margin-top: 18px;
  }

  .demo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-player-toolbar {
    gap: 6px;
  }

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

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

@media (max-height: 560px) {
  .demo-player-shell {
    grid-template-rows: 42px minmax(0, 1fr);
  }

  .player-back,
  .player-fullscreen {
    min-height: 32px;
  }

  .player-title small {
    display: none;
  }
}

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