:root {
  color-scheme: dark;
  --ink: #f7f6f1;
  --muted: #adabb9;
  --canvas: #11111a;
  --surface: #1b1b28;
  --surface-bright: #242437;
  --line: rgba(247, 246, 241, 0.15);
  --violet: #9f7aea;
  --mint: #75edc0;
  --danger: #ff9a9a;
  --max-width: 1180px;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0%, rgba(159, 122, 234, 0.2), transparent 27rem),
    radial-gradient(circle at 0% 72%, rgba(117, 237, 192, 0.1), transparent 28rem),
    var(--canvas);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  color: #17131f;
  background: var(--mint);
  border-radius: 0.5rem;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer,
main {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.5rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: #161321;
  background: var(--mint);
  border-radius: 0.55rem 0.55rem 0.9rem 0.55rem;
  font-size: 1rem;
}

.site-nav {
  display: flex;
  gap: 1.4rem;
}

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

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.hero {
  max-width: 49rem;
  padding: clamp(5.5rem, 12vw, 10rem) 0 clamp(4.5rem, 9vw, 7rem);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--mint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.055em;
}

h1 {
  max-width: 13ch;
  margin-bottom: 1.45rem;
  font-size: clamp(3.1rem, 8vw, 6.5rem);
  line-height: 0.93;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
}

.hero__copy {
  max-width: 37rem;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.75;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button--primary {
  color: #161321;
  background: var(--mint);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: #b2ffda;
}

.button--outline {
  align-self: flex-start;
  color: var(--ink);
  border-color: var(--line);
}

.button--outline:hover,
.button--outline:focus-visible {
  border-color: var(--violet);
  background: rgba(159, 122, 234, 0.12);
}

.library {
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(5.5rem, 11vw, 8rem);
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.game-count {
  margin-bottom: 0.15rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.game-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: rgba(36, 36, 55, 0.74);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.game-card__thumbnail {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #29283a;
}

.game-card__thumbnail--empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(135deg, transparent 49.5%, rgba(247, 246, 241, 0.12) 50%, transparent 50.5%),
    #29283a;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.game-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.25rem;
}

.game-card h3 {
  margin-bottom: 0.55rem;
  font-size: 1.3rem;
}

.game-card p {
  flex: 1;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

.notice {
  grid-column: 1 / -1;
  margin: 0;
  padding: 2rem;
  color: var(--muted);
  background: rgba(36, 36, 55, 0.48);
  border: 1px dashed var(--line);
  border-radius: 0.9rem;
  text-align: center;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 6.5rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.83rem;
}

.brand--footer {
  color: var(--ink);
}

.status-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.status-page__content {
  width: min(100%, 38rem);
  text-align: center;
}

.status-page h1 {
  max-width: none;
  margin-bottom: 1.1rem;
  font-size: clamp(2.7rem, 7vw, 4.5rem);
}

.status-page__content > p:not(.eyebrow) {
  margin-bottom: 1.8rem;
  color: var(--muted);
}

/* Game wrapper template */
.game-page .site-header {
  width: min(calc(100% - 2rem), 1540px);
}

.game-page main {
  width: min(calc(100% - 2rem), 1540px);
}

.game-intro {
  padding: clamp(2rem, 5vw, 4rem) 0 1.5rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--mint);
  font-size: 0.9rem;
  font-weight: 700;
}

.game-intro h1 {
  max-width: 18ch;
  margin-bottom: 0.8rem;
  font-size: clamp(2.4rem, 5vw, 4.3rem);
}

.game-intro p {
  max-width: 45rem;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.game-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.game-frame {
  overflow: hidden;
  background: #050508;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.3);
}

.game-frame iframe {
  display: block;
  width: 100%;
  min-height: min(70vh, 50rem);
  border: 0;
  background: #050508;
}

.ad-slot {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  background: rgba(36, 36, 55, 0.48);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.ad-slot:empty::before {
  content: "광고";
  display: grid;
  min-height: 5rem;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.game-page .ad-slot[hidden] {
  display: none;
}

.ad-slot--side {
  min-height: 32rem;
}

.ad-slot--bottom {
  margin-top: 2rem;
}

.game-details {
  margin-top: 2.2rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--line);
}

.game-details h2 {
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
}

.game-details p {
  max-width: 48rem;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (min-width: 1440px) {
  .game-stage {
    grid-template-columns: minmax(160px, 1fr) minmax(640px, 960px) minmax(160px, 1fr);
    column-gap: 150px;
  }

  .game-frame {
    grid-column: 2;
    grid-row: 1;
  }

  .ad-slot--left {
    grid-column: 1;
    grid-row: 1;
  }

  .ad-slot--right {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    min-height: 4.75rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .site-footer p {
    margin: 0;
  }

  .site-nav {
    gap: 0.8rem;
  }

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

  .game-frame iframe {
    min-height: 65vh;
  }
}
