/* game_tgn_0007 — play_tgn_0001 专属主题（柔和紫 · 玻璃拟态） */

:root {
  --g07-primary: #5d5cde;
  --g07-primary-light: #8e8cf5;
  --g07-text: #2d3436;
  --g07-text-muted: #636e72;
  --g07-glass: rgba(255, 255, 255, 0.88);
  --g07-glass-border: rgba(255, 255, 255, 0.95);
  --g07-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  --g07-shadow-hover: 0 16px 36px -12px rgba(93, 92, 222, 0.28);
  --g07-radius-lg: 32px;
  --g07-radius-md: 20px;
  --g07-radius-pill: 999px;

  --color-primary: var(--g07-primary);
  --color-bg-primary: #fff;
  --color-bg-secondary: #f3f4ff;
  --color-bg-card: #fff;
  --color-border: rgba(93, 92, 222, 0.14);
  --color-text-secondary: var(--g07-text-muted);
  --radius-xl: var(--g07-radius-md);
  --radius-md: 12px;
  --radius-lg: var(--g07-radius-md);
  --radius-full: var(--g07-radius-pill);
  --transition-normal: 0.25s ease;
  --shadow-lg: var(--g07-shadow);
  --glow-cyan: var(--g07-shadow-hover);
}

/* —— 详情页 iframe 外壳 —— */
.detail-player {
  margin: 8px 0 24px;
  border-radius: var(--g07-radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(93, 92, 222, 0.12), var(--g07-shadow);
  background: #fff;
  border: 1px solid rgba(93, 92, 222, 0.08);
}

.detail-player__frame-wrap {
  position: relative;
  width: 100%;
  height: clamp(520px, 56vw, 680px);
  min-height: 520px;
  background: linear-gradient(145deg, #f8f9ff 0%, #eef0fa 100%);
}

.detail-player__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* —— play 页 / iframe 内全局 —— */
html.play-tgn-0001-page-active,
html.play-tgn-0001-page-active body,
html.play-tgn-0001-embed-active,
html.play-tgn-0001-embed-active body {
  font-family: 'Quicksand', system-ui, -apple-system, sans-serif;
  background: linear-gradient(145deg, #f8f9ff 0%, #eef2f5 100%);
  color: var(--g07-text);
}

.play-tgn-0001-page {
  background: linear-gradient(145deg, #f8f9ff 0%, #eef2f5 100%);
}

.play-tgn-0001-page__dialog,
.play-tgn-0001-embed {
  background: #fff;
}

.play-tgn-0001-page__dialog {
  border: none;
  box-shadow: none;
}

/* 顶栏 / 底栏 */
.play-tgn-0001__topbar,
.play-tgn-0001__bottombar {
  background: var(--g07-glass);
  backdrop-filter: blur(12px);
  border-color: rgba(93, 92, 222, 0.1);
}

.play-tgn-0001__topbar {
  border-bottom: 1px solid rgba(93, 92, 222, 0.1);
}

/* g07：详情页 iframe / play 页非全屏隐藏顶栏；浏览器全屏或移动端沉浸时显示关闭 */
html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page:not(.is-mobile-play) .play-tgn-0001-page__dialog > .play-tgn-0001__topbar,
html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page:not(.is-mobile-play) #playTgn0001PageDialog > .play-tgn-0001__topbar,
.play-tgn-0001-page:not(.is-mobile-play) #playTgn0001PageDialog:not(:fullscreen):not(:-webkit-full-screen) .play-tgn-0001__topbar {
  display: none !important;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page.is-mobile-play .play-tgn-0001-page__dialog > .play-tgn-0001__topbar,
html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page.is-mobile-play #playTgn0001PageDialog > .play-tgn-0001__topbar,
html.play-tgn-0001-page-active.play-tgn-0001-in-iframe #playTgn0001PageDialog:is(:fullscreen, :-webkit-full-screen) > .play-tgn-0001__topbar,
#playTgn0001PageDialog:is(:fullscreen, :-webkit-full-screen) .play-tgn-0001__topbar {
  display: flex !important;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 12;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe #playTgn0001PageDialog > .play-tgn-0001__topbar .play-tgn-0001__login,
#playTgn0001PageDialog .play-tgn-0001__login,
#playTgn0001PageDialog:is(:fullscreen, :-webkit-full-screen) .play-tgn-0001__login {
  display: none !important;
}

.play-tgn-0001__bottombar {
  border-top: 1px solid rgba(93, 92, 222, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 249, 255, 0.98) 100%);
}

/* —— 详情页 iframe 内：splash 铺满，消除上下留白 —— */
html.play-tgn-0001-page-active.play-tgn-0001-in-iframe,
html.play-tgn-0001-page-active.play-tgn-0001-in-iframe body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page {
  width: 100%;
  min-height: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page__dialog {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__frame-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f0f1fa;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash-card {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  max-height: none;
  min-height: 0;
  margin: 0;
  gap: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, transparent 55%, #f8f9ff 100%);
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash-poster {
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: auto;
  max-height: none;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #eef0fa;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash-card:hover .play-tgn-0001__splash-poster {
  border: none;
  box-shadow: none;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash-play {
  flex-shrink: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  min-width: min(220px, calc(100% - 48px));
  max-width: calc(100% - 32px);
  margin: 10px 16px 12px;
  padding: 13px 34px;
  border: none;
  border-radius: var(--g07-radius-pill);
  background: linear-gradient(135deg, #5d5cde 0%, #7b79ef 55%, #8e8cf5 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: none;
  box-shadow:
    0 6px 22px rgba(93, 92, 222, 0.38),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash-play::before {
  content: '\25B6';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash-play:hover {
  background: linear-gradient(135deg, #4f4ed0 0%, #6d6be8 55%, #7b79ef 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow:
    0 10px 28px rgba(93, 92, 222, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__bottombar {
  flex-shrink: 0;
}

/* Login */
.play-tgn-0001__login {
  border: 1.5px solid rgba(93, 92, 222, 0.35);
  border-radius: var(--g07-radius-pill);
  background: rgba(255, 255, 255, 0.9);
  color: var(--g07-primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(93, 92, 222, 0.08);
}

.play-tgn-0001__login:hover {
  background: var(--g07-primary);
  color: #fff;
  border-color: var(--g07-primary);
  box-shadow: var(--g07-shadow-hover);
  transform: translateY(-1px);
}

/* 关闭 */
.play-tgn-0001__close {
  width: 38px;
  height: 38px;
  border: none;
  background: rgba(248, 248, 252, 0.95);
  color: var(--g07-primary);
  box-shadow: 0 2px 8px rgba(93, 92, 222, 0.1);
}

.play-tgn-0001__close:hover {
  background: var(--g07-primary);
  color: #fff;
  transform: scale(1.05);
  box-shadow: var(--g07-shadow-hover);
}

/* 游戏区背景 */
.play-tgn-0001__frame-wrap {
  background:
    radial-gradient(ellipse at 15% 85%, rgba(93, 92, 222, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(255, 159, 135, 0.08) 0%, transparent 50%),
    #f0f1fa;
}

/* 封面 splash */
.play-tgn-0001__splash-poster {
  border-radius: var(--g07-radius-md);
  border: 2px solid rgba(93, 92, 222, 0.12);
  box-shadow: var(--g07-shadow);
}

.play-tgn-0001__splash-card:hover .play-tgn-0001__splash-poster {
  border-color: rgba(93, 92, 222, 0.35);
  box-shadow: var(--g07-shadow-hover);
}

.play-tgn-0001__splash-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: var(--g07-radius-pill);
  background: linear-gradient(135deg, var(--g07-primary) 0%, var(--g07-primary-light) 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow:
    0 6px 22px rgba(93, 92, 222, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.15) inset;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.play-tgn-0001__splash-play::before {
  content: '\25B6';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.play-tgn-0001__splash-play:hover {
  background: linear-gradient(135deg, #4f4ed0 0%, #7b79ef 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(93, 92, 222, 0.42);
}

/* 底栏信息 */
.play-tgn-0001__thumb {
  border-radius: 12px;
  border: 2px solid rgba(93, 92, 222, 0.15);
}

.play-tgn-0001__title {
  color: var(--g07-primary);
  font-weight: 800;
}

.play-tgn-0001__badge {
  color: var(--g07-text-muted);
  font-weight: 600;
}

/* 操作按钮 */
.play-tgn-0001__pill,
.play-tgn-0001__btn {
  border: none;
  background: rgba(248, 248, 252, 0.98);
  color: var(--g07-text);
  border-radius: var(--g07-radius-pill);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(93, 92, 222, 0.08);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.play-tgn-0001__pill:hover,
.play-tgn-0001__btn:hover {
  color: var(--g07-primary);
  background: #fff;
  box-shadow: 0 4px 12px rgba(93, 92, 222, 0.14);
  transform: translateY(-1px);
}

.play-tgn-0001__pill.is-active,
.play-tgn-0001__pill--like.is-active {
  color: var(--g07-primary);
  background: rgba(93, 92, 222, 0.12);
}

.play-tgn-0001__pill--dislike.is-active {
  color: #e17055;
  background: rgba(225, 112, 85, 0.12);
}

.play-tgn-0001__pill--fav.is-active {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.play-tgn-0001__divider {
  background: rgba(93, 92, 222, 0.15);
}

/* 弹层模式（若启用 PAGE_JS modal） */
.play-tgn-0001 {
  background: rgba(45, 52, 54, 0.45);
  backdrop-filter: blur(8px);
}

.play-tgn-0001__dialog {
  background: #fff;
  border: 1px solid rgba(93, 92, 222, 0.12);
  border-radius: var(--g07-radius-lg);
  box-shadow: 0 24px 64px rgba(93, 92, 222, 0.18);
}

/* Toast */
.play-tgn-0001__toast {
  background: #fff;
  border: 1px solid rgba(93, 92, 222, 0.18);
  color: var(--g07-text);
  border-radius: var(--g07-radius-md);
  box-shadow: var(--g07-shadow-hover);
}

/* 内联壳（PAGE_JS 挂载时） */
#gameDetails #playTgn0001InlineShell.play-tgn-0001-inline-shell {
  background: #fff;
  border: 1px solid rgba(93, 92, 222, 0.08);
  border-radius: var(--g07-radius-lg);
  box-shadow: 0 20px 60px rgba(93, 92, 222, 0.12);
  margin: 8px 0 24px;
}

#gameDetails.play-tgn-hide-login #playTgn0001InlineShell:not(.playing):not(.is-game-started) .hero-mask-frame--top {
  display: none !important;
}

#gameDetails.play-tgn-hide-login #playTgn0001InlineShell .hero-mask-login,
#gameDetails.play-tgn-hide-login #playTgn0001InlineShell .play-tgn-0001__login {
  display: none !important;
}

#gameDetails #playTgn0001InlineShell .hero-mask-frame,
#gameDetails #playTgn0001InlineShell .hero-mask-frame--top,
#gameDetails #playTgn0001InlineShell .hero-mask-frame--bottom {
  background: var(--g07-glass);
  border: none;
}

#gameDetails #playTgn0001InlineShell .game-launch-overlay {
  background: rgba(45, 52, 54, 0.42);
  backdrop-filter: blur(6px);
}

#gameDetails #playTgn0001InlineShell:not(.playing):not(.is-game-started) .hero-play-btn {
  background: transparent;
  border: none;
  box-shadow: none;
}

#gameDetails #playTgn0001InlineShell:not(.playing):not(.is-game-started) .hero-play-btn .hero-play-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--g07-primary);
  color: #fff;
  font-size: 40px;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.22);
}

#gameDetails #playTgn0001InlineShell:not(.playing):not(.is-game-started) .hero-play-btn:hover .hero-play-icon {
  background: #fff;
  color: var(--g07-primary);
  box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.32);
}

#gameDetails #playTgn0001InlineShell:not(.playing):not(.is-game-started) .hero-play-btn .launch-text {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

@media (max-width: 768px) {
  .detail-player {
    border-radius: var(--g07-radius-md);
  }

  .detail-player__frame-wrap {
    aspect-ratio: auto;
    height: clamp(320px, 92vw, 420px);
    min-height: 320px;
    max-height: none;
  }

  /* 详情页 iframe 内 splash：覆盖公共模板移动端居中/留白 */
  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page__dialog .play-tgn-0001__splash,
  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash {
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
  }

  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page__dialog .play-tgn-0001__splash-card,
  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash-card {
    width: 100%;
    max-width: none;
    gap: 0;
  }

  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page__dialog .play-tgn-0001__splash-poster,
  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash-poster {
    width: 100%;
    max-width: none;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    height: auto;
    max-height: none;
    flex: 1 1 auto;
    border-radius: 0;
  }

  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page__dialog .play-tgn-0001__splash-play,
  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash-play {
    min-width: min(200px, calc(100% - 40px));
    margin: 8px 14px 10px;
    padding: 12px 28px;
    font-size: 14px;
    border-radius: var(--g07-radius-pill);
  }

  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page__dialog .play-tgn-0001__splash-play::before,
  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__splash-play::before {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page__dialog .play-tgn-0001__bottombar,
  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__bottombar {
    padding: 10px 12px;
    min-height: 54px;
  }

  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001-page__dialog .play-tgn-0001__actions,
  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__actions {
    max-width: 100%;
    gap: 8px;
  }

  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__pill,
  html.play-tgn-0001-page-active.play-tgn-0001-in-iframe .play-tgn-0001__btn {
    height: 40px;
  }

  /* 详情页 iframe 内 play 页移动端全屏时，父级容器铺满视口 */
  .detail-player.is-mobile-immersive {
    position: fixed !important;
    inset: 0 !important;
    z-index: 11000;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden;
    background: #000;
  }

  .detail-player.is-mobile-immersive .detail-player__frame-wrap {
    height: 100dvh !important;
    min-height: 100dvh !important;
  }

  .detail-player.is-mobile-immersive .detail-player__frame {
    width: 100%;
    height: 100%;
    border: none;
  }

  body.detail-mobile-play-active {
    overflow: hidden !important;
  }

  body.detail-mobile-play-active .sidebar {
    display: none !important;
  }

  body.detail-mobile-play-active .app-container {
    padding-top: 0 !important;
  }

  /* 移动端 play 页 / 全屏：禁止圆角（覆盖主题 .play-tgn-0001__dialog） */
  .play-tgn-0001__dialog,
  .play-tgn-0001-page__dialog,
  html.play-tgn-0001-page-active .play-tgn-0001-page__dialog,
  #gameDetails #playTgn0001InlineShell.play-tgn-0001-inline-shell.is-mobile-play,
  #gameDetails #playTgn0001InlineShell.play-tgn-0001-inline-shell.is-immersive-play,
  #gameDetails #playTgn0001InlineShell.play-tgn-0001-inline-shell:is(:fullscreen, :-webkit-full-screen) {
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .play-tgn-0001__login span {
    display: none;
  }

  .play-tgn-0001__login {
    padding: 8px 12px;
  }

  .play-tgn-0001__btn span {
    font-size: 12px;
  }

  .play-tgn-0001__title {
    font-size: 13px;
  }

  #gameDetails #playTgn0001InlineShell:not(.playing):not(.is-game-started) .hero-play-btn .hero-play-icon {
    width: 72px;
    height: 72px;
    font-size: 28px;
  }

  #gameDetails #playTgn0001InlineShell:not(.playing):not(.is-game-started) .hero-play-btn .launch-text {
    font-size: 1.1rem;
  }
}
