/* ============================================================
   modal.css — 游戏详情弹窗（主页 / 探索共用）
   ============================================================ */

.gmodal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gmodal[hidden] { display: none; }

.gmodal__mask {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 7, 0.72);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--base) var(--ease);
}
.gmodal.is-on .gmodal__mask { opacity: 1; }

.gmodal__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(88vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity var(--base) var(--ease), transform var(--base) var(--ease);
}
.gmodal.is-on .gmodal__panel { opacity: 1; transform: none; }

/* 关闭 */
.gmodal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 10, 12, 0.6);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.gmodal__close:hover { background: rgba(8, 10, 12, 0.88); color: #fff; }

/* 顶部大图 */
.gmodal__hero {
  position: relative;
  flex-shrink: 0;
  background: var(--surface-2);
}
.gmodal__cover {
  width: 100%;
  height: clamp(150px, 26vh, 232px);
  object-fit: cover;
  display: block;
}
.gmodal__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 14, 16, 0.55), rgba(12, 14, 16, 0) 60%);
  pointer-events: none;
}

/* 正文 */
.gmodal__body {
  padding: 18px 22px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.gmodal__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.gmodal__sub {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--text-3);
}

.gmodal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.gmodal__desc {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* 元信息：操作 / 上线 / 体积 */
.gmodal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 16px 0 0;
  padding: 13px 0 0;
  border-top: 1px solid var(--line);
}
.gmodal__meta > div { min-width: 96px; }
.gmodal__meta dt {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 2px;
}
.gmodal__meta dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

/* 截图 */
.gmodal__shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 4px;
}
.gmodal__shots:empty { display: none; }
.gmodal__label {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 2px;
}
.gmodal__shots img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.gmodal__shots figcaption {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}

/* 底部操作 */
.gmodal__foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.gmodal__fav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.gmodal__fav:hover { color: #fff; border-color: var(--line-3); background: var(--surface-2); }
.gmodal__fav[aria-pressed="true"] {
  color: #ff7b8c;
  border-color: rgba(255, 123, 140, 0.42);
}
.gmodal__fav[aria-pressed="true"] svg { fill: currentColor; }

.gmodal__play {
  margin-left: auto;
  height: 38px;
  padding: 0 22px;
  font-size: 13.5px;
}

.gmodal__hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

/* 移动端：接近底部抽屉 */
@media (max-width: 640px) {
  .gmodal { padding: 0; align-items: flex-end; }
  .gmodal__panel {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0;
  }
  .gmodal__cover { height: 150px; }
  .gmodal__body { padding: 15px 16px 2px; }
  .gmodal__title { font-size: 19px; }
  .gmodal__meta { gap: 8px 18px; }
  .gmodal__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .gmodal__play { flex: 1; margin-left: 0; }
  .gmodal__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gmodal__panel, .gmodal__mask { transition: none; }
}
