/* 게임 사이트 전용 스타일. 블로그의 assets/style.css 위에 얹는다 (토큰을 같이 쓴다). */

.game-wrap { max-width: calc(64rem + var(--gutter) * 2); }

.game-header { padding-top: 2.5rem; }
.game-summary, .games-lead { margin: 0.75rem 0 0; color: var(--fg-muted); }

.game-stage {
  position: relative;
  margin: 1.75rem 0 0;
  background: #05070c;
  border: 1px solid var(--rule);
  aspect-ratio: 16 / 9;
}

.game-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  /* 핀치는 엔진의 확대 입력으로 보내고 브라우저가 스크롤을 가로채지 않게 한다. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.game-stage:fullscreen { border: 0; aspect-ratio: auto; width: 100%; height: 100%; margin: 0; background: #000; }
.game-stage:-webkit-full-screen { border: 0; width: 100%; height: 100%; margin: 0; background: #000; }

/* 화면 채우기: 브라우저 전체 화면이 안 되는 곳(iPhone Safari)에서 fullscreen.js 가 켠다. */
.game-stage.is-filled {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: auto;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  aspect-ratio: auto;
  background: #000;
}
html.game-filled, html.game-filled body { overflow: hidden; overscroll-behavior: none; }

.game-exit-fill {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
}
.game-exit-fill[hidden] { display: none; }
.game .game-exit-fill { padding: 0.2rem 0.55rem; font-size: 0.75rem; background: rgba(0, 0, 0, 0.5); color: #e6e3df; border-color: rgba(255, 255, 255, 0.3); opacity: 0.75; }

/* site 게임(kind: site)은 화면 전체를 쓰는 앱이라 16:9 대신 세로를 크게 잡는다. */
.game-stage-embed { aspect-ratio: auto; height: min(82vh, 54rem); min-height: 26rem; }
.game-stage-embed iframe { display: block; width: 100%; height: 100%; border: 0; background: #04040b; }

.game-open {
  font-size: 0.875rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--rule-strong);
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
}

.game-open:hover { border-color: var(--amber); color: var(--amber-text); }

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  color: #e6e3df;
  text-align: center;
}

.game-overlay[hidden] { display: none; }

.game-warn { max-width: 30rem; }
.game-warn-title { margin: 0 0 0.75rem; font-weight: 600; color: var(--amber); }
.game-warn ul { margin: 0 0 1.25rem; padding: 0; list-style: none; font-size: 0.875rem; line-height: 1.7; color: #b9b4ae; }

.game-progress {
  width: min(22rem, 70%);
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.game-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--amber);
  transition: width 0.2s linear;
}

.game button {
  font: inherit;
  font-size: 0.875rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--rule-strong);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

.game-overlay button { background: transparent; color: #e6e3df; border-color: rgba(255, 255, 255, 0.35); }

.game button:hover:not(:disabled) { border-color: var(--amber); color: var(--amber-text); }
.game-overlay button:hover:not(:disabled) { color: var(--amber); }
.game button:disabled { opacity: 0.45; cursor: default; }

#game-start:not(:disabled) { background: var(--amber); border-color: var(--amber); color: #000; font-weight: 600; }
#game-start:not(:disabled):hover { color: #000; }

.game-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

.game-status { font-family: var(--mono); font-size: 0.75rem; color: var(--fg-muted); }

.game-info {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0.5rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.game-info dt { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--fg-faint); padding-top: 0.2em; }
.game-info dd { margin: 0; }

.game-foot { display: flex; gap: 1.5rem; margin: 2rem 0 4rem; }

.games-notice {
  margin: 1.75rem 0 2.5rem;
  padding: 1rem 1.25rem 1rem 2.25rem;
  background: var(--bg-soft);
  border-left: 2px solid var(--amber);
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.game-list {
  list-style: none;
  margin: 0 0 4rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 2rem 1.5rem;
}

.game-list a { display: block; }
.game-list img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #05070c; border: 1px solid var(--rule); }
.game-list h2 { margin: 0.85rem 0 0; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; transition: color 0.2s ease; }
.game-list a:hover h2 { color: var(--amber-text); }
.game-list p { margin: 0.25rem 0 0; font-size: 0.875rem; line-height: 1.6; color: var(--fg-muted); }
.game-list .game-card-controls { font-size: 0.8125rem; color: var(--fg-faint); }
.game-list .game-card-size { font-family: var(--mono); font-size: 0.75rem; color: var(--fg-faint); }

.game-credits { border-top: 1px solid var(--rule); padding: 1rem 0 4rem; font-size: 0.875rem; }
.game-credits h2 { font-size: 1rem; }

@media (max-width: 30rem) {
  .game-info { grid-template-columns: 1fr; gap: 0.15rem; }
  .game-info dd { margin-bottom: 0.6rem; }
}
