/* aigamer-shell.css — AigamerShell; .ag-* canonical, .gf-* legacy alias */
/* gf-shell.css — aigamer 统一游戏外壳（标题/暂停/结束/返回主页 + 中英切换 + 道具栏）
 * 单一共享文件，所有游戏引用 /games/shared/gf-shell.*；改这一份全站生效。 */
/* Logical viewport sized before Pixi createApp — avoids tiny title/howto flash */
.gf-shell-wrap, .ag-shell-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  width: min(100vw, 420px);
  max-width: min(100vw, calc(100vh * 420 / 740));
  aspect-ratio: 420 / 740;
  max-height: 100vh;
  background: #0a0a18;
}
.gf-shell-wrap canvas, .ag-shell-wrap canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 全屏叠层（标题/暂停/结束） */
.gf-overlay, .ag-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; box-sizing: border-box; padding: 28px;
  line-height: 1.5;
  font-family: -apple-system, "PingFang SC", system-ui, sans-serif;
  color: #eaf6ff;
  background: radial-gradient(ellipse at center, rgba(10,10,30,.86), rgba(3,4,12,.96));
  pointer-events: auto;
}
.gf-overlay[hidden], .ag-overlay[hidden] { display: none; }

.gf-title-ov .gf-title, .ag-title-ov .ag-title { color: #00e5ff; }
.gf-pause-title, .ag-pause-title { color: #ffe066 !important; }

.gf-over-ov, .ag-over-ov { gap: 10px; }
.gf-over-title.gf-win, .ag-over-title.ag-win { color: #ffe066 !important; text-shadow: 0 0 18px rgba(255,224,102,.7); }
.gf-over-title.gf-lose, .ag-over-title.ag-lose { color: #ff4d6d !important; }
.gf-over-level, .ag-over-level { font-size: 16px; color: rgba(234,246,255,.85); font-weight: 600; }
.gf-over-level[hidden], .ag-over-level[hidden] { display: none; }

/* 失败阻尼过渡叠层（统一共享组件）：红屏渐晕 + 中央「失败」脉冲，与暂停/结束同风格 */
.gf-fail-ov, .ag-fail-ov {
  background: radial-gradient(ellipse at center, rgba(40,6,18,.62), rgba(3,4,12,.92));
  pointer-events: none;
}
.gf-fail-title, .ag-fail-title {
  color: #ff4d6d !important;
  text-shadow: 0 0 22px rgba(255,77,109,.85);
  animation: gffailpulse 1.4s ease-out 1;
}
@keyframes gffailpulse {
  0% { opacity: 0; transform: scale(1.45); }
  18% { opacity: 1; }
  55% { transform: scale(0.96); }
  72% { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
.gf-fail-title, .ag-fail-title { animation: none; transform: none; }
}

.gf-level-bar, .ag-level-bar {
  position: absolute; top: 52px; left: 50%; transform: translateX(-50%);
  z-index: 5; pointer-events: none;
  box-sizing: border-box;
  /* Breathing room: pad ≥8px vertical; ban cramped text-to-border (HUD_CRAMPED). */
  padding: var(--gf-level-pad-y, 8px) var(--gf-level-pad-x, 18px);
  min-height: var(--gf-level-min-h, 32px);
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-family: -apple-system, "PingFang SC", system-ui, sans-serif;
  font-size: var(--gf-level-font-size, 12px);
  font-weight: 800;
  letter-spacing: .4px;
  line-height: var(--gf-level-line-height, 1.35);
  white-space: nowrap;
  /* Per-game theme via --gf-level-* (GDD ui.chrome). No fixed neon yellow. */
  color: var(--gf-level-fg, #eaf0ff);
  background: var(--gf-level-bg, rgba(28, 24, 48, 0.92));
  border: 1px solid var(--gf-level-border, rgba(160, 140, 200, 0.45));
  box-shadow: var(--gf-level-glow, 0 0 12px rgba(120, 100, 180, 0.28));
}
.gf-level-bar[hidden], .ag-level-bar[hidden] { display: none; }

/* 暂停页：轻量半透明压在局内定格画面上（无封面、无 howto 大卡） */
.gf-pause-ov, .ag-pause-ov {
  justify-content: center;
  align-items: center;
  padding: 20px 16px;
  gap: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.gf-pause-lite, .ag-pause-lite {
  background: radial-gradient(ellipse at center, rgba(6, 8, 20, .78), rgba(2, 3, 10, .88));
  gap: 18px;
}
.gf-pause-lite .gf-title, .ag-pause-lite .ag-title {
  text-shadow: 0 2px 16px rgba(0, 0, 0, .75);
}
.gf-pause-ov .gf-title, .ag-pause-ov .ag-title {
  font-size: clamp(22px, 5.5vw, 32px);
  margin: 0;
  flex-shrink: 0;
}
/* howto 卡仅标题页使用 */
.gf-title-ov .gf-pause-card, .ag-title-ov .ag-pause-card {
  width: min(92%, 340px);
  box-sizing: border-box;
  padding: 14px 16px 12px;
  border-radius: 14px;
  text-align: left;
  background: rgba(8, 10, 26, .92);
  box-shadow: 0 0 20px rgba(0, 229, 255, .18), inset 0 0 0 1px rgba(0, 229, 255, .22);
  max-height: min(56vh, 420px);
  overflow-y: auto;
  line-height: 1.55;
}
.gf-pause-card, .ag-pause-card {
  width: min(92%, 340px);
  box-sizing: border-box;
  padding: 14px 16px 12px;
  border-radius: 14px;
  text-align: left;
  background: rgba(8, 10, 26, .92);
  box-shadow: 0 0 20px rgba(0, 229, 255, .18), inset 0 0 0 1px rgba(0, 229, 255, .22);
  max-height: min(56vh, 420px);
  overflow-y: auto;
  line-height: 1.55;
}
.gf-pause-card .gf-pop-label, .ag-pause-card .ag-pop-label {
  display: block; font-size: 12px; color: #06ffa5; letter-spacing: 2px; margin-bottom: 10px;
}
.gf-pause-card .gf-pop-how, .ag-pause-card .ag-pop-how {
  font-size: 13px; display: flex; flex-direction: column; gap: 12px;
}
.gf-pause-card .gf-pop-ctl, .ag-pause-card .ag-pop-ctl {
  font-size: 12px; color: rgba(234,246,255,.62); margin-top: 12px;
  padding-top: 10px; border-top: 1px solid rgba(234,246,255,.12);
}
.gf-pause-ov .gf-row, .ag-pause-ov .ag-row { margin-top: 2px; flex-shrink: 0; }

/* 品牌启动 splash（Unity 式 loading） */
.gf-boot-ov, .ag-boot-ov {
  z-index: 40;
  gap: 10px;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(124, 92, 255, .28), transparent 55%),
    radial-gradient(ellipse at center, #14122a 0%, #07060f 72%);
  padding: 36px 28px;
}
.gf-boot-mark, .ag-boot-mark {
  width: 72px;
  height: 72px;
  margin-bottom: 4px;
  animation: gf-boot-pulse 1.6s ease-in-out infinite;
}
.gf-boot-mascot, .ag-boot-mascot { width: 100%; height: 100%; display: block; }
.gf-boot-eye, .ag-boot-eye {
  animation: gf-boot-blink 3.2s ease-in-out infinite;
}
.gf-boot-brand, .ag-boot-brand {
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #eaf6ff;
  text-shadow: 0 0 18px rgba(0, 229, 255, .35);
}
.gf-boot-presented, .ag-boot-presented {
  font-size: 14px;
  font-weight: 600;
  color: #a898ff;
  letter-spacing: 0.12em;
  margin-top: 2px;
}
.gf-boot-tagline, .ag-boot-tagline {
  font-size: 12px;
  color: rgba(234, 246, 255, .55);
  margin-bottom: 18px;
}
.gf-boot-bar, .ag-boot-bar {
  width: min(72%, 220px);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, .18);
}
.gf-boot-bar-fill, .ag-boot-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c5cff, #00e5ff);
  transition: width 0.25s ease-out;
}
.gf-boot-pct, .ag-boot-pct {
  font-size: 11px;
  color: rgba(234, 246, 255, .5);
  font-variant-numeric: tabular-nums;
  min-height: 1.2em;
}
@keyframes gf-boot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.92; }
}
@keyframes gf-boot-blink {
  0%, 92%, 100% { opacity: 1; }
  95% { opacity: 0.15; }
}

/* 玩法分区 */
.gf-how-sec, .ag-how-sec {
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gf-how-sec-play, .ag-how-sec-play {
  background: rgba(0, 229, 255, .06);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, .22);
}
.gf-how-sec-fail, .ag-how-sec-fail {
  background: rgba(255, 77, 109, .08);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, .35);
}
.gf-how-sec-hd, .ag-how-sec-hd {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}
.gf-how-sec-play .gf-how-sec-hd, .ag-how-sec-play .ag-how-sec-hd { color: #4deeea; }
.gf-how-sec-fail .gf-how-sec-hd, .ag-how-sec-fail .ag-how-sec-hd { color: #ff4d6d; }

.gf-how-line, .ag-how-line { line-height: 1.55; }
.gf-how-text, .ag-how-text { font-size: 13px; }
.gf-how-goal .gf-how-text, .ag-how-goal .ag-how-text { color: #ffe066; font-weight: 700; }
.gf-how-play .gf-how-text, .ag-how-play .ag-how-text { color: rgba(234,246,255,.95); }
.gf-how-score .gf-how-text, .ag-how-score .ag-how-text { color: #06ffa5; font-weight: 600; }
.gf-how-item .gf-how-text, .ag-how-item .ag-how-text { color: #4deeea; }
.gf-how-tip .gf-how-text, .ag-how-tip .ag-how-text { color: rgba(234,246,255,.72); font-size: 12px; }
.gf-how-fail .gf-how-text, .ag-how-fail .ag-how-text { color: #ff8fa3; font-weight: 600; }

.gf-how-swatches, .ag-how-swatches {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.gf-how-swatch, .ag-how-swatch {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, .45);
  font-size: 12px; font-weight: 700; color: #ffe0e6;
}
.gf-how-dot, .ag-how-dot {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  background: #ff4d6d;
  box-shadow: 0 0 8px rgba(255, 77, 109, .7), inset 0 0 0 1.5px rgba(255,255,255,.35);
  flex-shrink: 0;
}
.gf-how-swatch-lab, .ag-how-swatch-lab { line-height: 1.2; }

.gf-title, .ag-title {
  font-size: clamp(28px, 7vw, 44px); font-weight: 800; letter-spacing: 2px;
  color: #00e5ff; text-shadow: 0 0 18px rgba(0,229,255,.7);
}
.gf-best, .ag-best { font-size: 15px; color: #ffe066; }
.gf-score, .ag-score { font-size: 22px; color: #ff4d6d; font-weight: 800; }

.gf-hint, .ag-hint {
  margin-top: 6px; font-size: 13px; color: rgba(234,246,255,.55);
  animation: gfpulse 1.6s ease-in-out infinite;
}

.gf-row, .ag-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.gf-btn, .ag-btn {
  font: inherit; font-size: 16px; font-weight: 700; color: #06121a;
  background: #06ffa5; border: none; border-radius: 24px;
  padding: 12px 28px; cursor: pointer; letter-spacing: 1px;
  box-shadow: 0 0 16px rgba(6,255,165,.5); transition: transform .1s;
}
.gf-btn:active, .ag-btn:active { transform: scale(.96); }
.gf-btn.ghost, .ag-btn.ghost {
  background: transparent; color: #eaf6ff;
  box-shadow: inset 0 0 0 1.5px rgba(234,246,255,.4);
}

/* 悬浮按钮（右上暂停 / 左上 ⌂ · 语言） */
.gf-fab, .ag-fab {
  position: absolute; top: 10px;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.14); color: #eaf6ff;
  font-size: 16px; cursor: pointer; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.gf-fab[hidden], .ag-fab[hidden] { display: none; }
.gf-pause-btn, .ag-pause-btn { right: 10px; }
.gf-library-btn, .ag-library-btn { left: 10px; top: 10px; bottom: auto; font-size: 18px; }
.gf-lang-btn, .ag-lang-btn { left: 56px; font-size: 12px; font-weight: 700; }

/* 统一道具栏：右上、暂停下方；仅 play 显示 */
.gf-item-bar, .ag-item-bar {
  position: absolute; right: 8px; top: 56px; z-index: 5;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  pointer-events: auto;
}
.gf-item-bar[hidden], .ag-item-bar[hidden] { display: none; }
.gf-item-btn, .ag-item-btn {
  min-width: 72px; max-width: 96px;
  padding: 8px 10px; border-radius: 12px; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: -apple-system, "PingFang SC", system-ui, sans-serif;
  background: rgba(10, 18, 36, .82); color: #eaf6ff;
  box-shadow: inset 0 0 0 1.5px rgba(77, 238, 234, .55), 0 0 12px rgba(0, 229, 255, .2);
  backdrop-filter: blur(6px);
}
.gf-item-btn:active, .ag-item-btn:active { transform: scale(.96); }
.gf-item-btn:disabled, .ag-item-btn:disabled {
  opacity: .45; cursor: default;
  box-shadow: inset 0 0 0 1px rgba(170, 190, 210, .35);
}
.gf-item-btn.is-active, .ag-item-btn.is-active {
  box-shadow: inset 0 0 0 2px #ff4d6d, 0 0 14px rgba(255, 77, 109, .35);
}
.gf-item-btn .gf-item-label, .ag-item-btn .ag-item-label { font-size: 12px; font-weight: 800; letter-spacing: .5px; line-height: 1.2; }
.gf-item-btn .gf-item-cost, .ag-item-btn .ag-item-cost { font-size: 11px; font-weight: 700; color: #ffe066; }
.gf-item-btn.gf-item-cyan, .ag-item-btn.ag-item-cyan { box-shadow: inset 0 0 0 1.5px rgba(77, 238, 234, .7), 0 0 12px rgba(77, 238, 234, .25); }
.gf-item-btn.gf-item-purple, .ag-item-btn.ag-item-purple { box-shadow: inset 0 0 0 1.5px rgba(176, 107, 255, .7), 0 0 12px rgba(176, 107, 255, .25); }
.gf-item-btn.gf-item-pink, .ag-item-btn.ag-item-pink { box-shadow: inset 0 0 0 1.5px rgba(255, 45, 149, .7), 0 0 12px rgba(255, 45, 149, .25); }
.gf-item-btn.gf-item-gold, .ag-item-btn.ag-item-gold { box-shadow: inset 0 0 0 1.5px rgba(255, 224, 102, .7), 0 0 12px rgba(255, 224, 102, .22); }
.gf-item-btn .gf-item-icon, .ag-item-btn .ag-item-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.gf-item-btn .gf-item-icon img, .ag-item-btn .ag-item-icon img, .gf-item-btn .gf-item-icon svg, .ag-item-btn .ag-item-icon svg { width: 28px; height: 28px; display: block; }
/* compact：图标主导的小号道具按钮，充能数做右上角标 */
.gf-item-btn.gf-item-compact, .ag-item-btn.ag-item-compact {
  position: relative;
  min-width: 46px; max-width: 54px; padding: 5px 4px; gap: 1px; border-radius: 10px;
}
.gf-item-btn.gf-item-compact .gf-item-icon, .ag-item-btn.ag-item-compact .ag-item-icon { width: 26px; height: 26px; }
.gf-item-btn.gf-item-compact .gf-item-icon img,
.gf-item-btn.gf-item-compact .gf-item-icon svg, .ag-item-btn.ag-item-compact .ag-item-icon svg { width: 26px; height: 26px; }
.gf-item-btn.gf-item-compact .gf-item-label, .ag-item-btn.ag-item-compact .ag-item-label { font-size: 10px; }
.gf-item-btn.gf-item-compact .gf-item-cost, .ag-item-btn.ag-item-compact .ag-item-cost {
  position: absolute; top: -7px; right: -7px;
  background: #ff4d6d; color: #fff; border-radius: 999px;
  min-width: 17px; height: 17px; line-height: 17px; text-align: center;
  padding: 0 4px; font-size: 10px; font-weight: 800;
  box-shadow: 0 0 6px rgba(255, 77, 109, .55);
}
.gf-item-btn.gf-item-compact:disabled .gf-item-cost, .ag-item-btn.ag-item-compact:disabled .ag-item-cost { background: #5a6b82; box-shadow: none; }

/* 首次出现教练条：中上浮层，不挡右上道具栏与主点击区 */
.gf-coach-tip, .ag-coach-tip {
  position: absolute; left: 50%; top: 12%;
  transform: translateX(-50%);
  z-index: 4;
  width: min(86%, 300px);
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 12px;
  pointer-events: none;
  font-family: -apple-system, "PingFang SC", system-ui, sans-serif;
  font-size: 13px; font-weight: 700; line-height: 1.45;
  text-align: center; color: #eaf6ff;
  background: rgba(8, 12, 28, .88);
  box-shadow: 0 0 16px rgba(0, 229, 255, .22), inset 0 0 0 1px rgba(77, 238, 234, .45);
  animation: gfcoachIn .28s ease-out;
}
.gf-coach-tip[hidden], .ag-coach-tip[hidden] { display: none; }
.gf-coach-tip.gf-coach-warn, .ag-coach-tip.ag-coach-warn {
  color: #ffe0e6;
  box-shadow: 0 0 16px rgba(255, 77, 109, .28), inset 0 0 0 1.5px rgba(255, 77, 109, .55);
}
.gf-coach-tip.gf-coach-item, .ag-coach-tip.ag-coach-item {
  color: #d8fffb;
  box-shadow: 0 0 16px rgba(77, 238, 234, .3), inset 0 0 0 1.5px rgba(77, 238, 234, .65);
}
.gf-coach-tip.gf-coach-info, .ag-coach-tip.ag-coach-info {
  box-shadow: 0 0 14px rgba(255, 224, 102, .2), inset 0 0 0 1px rgba(255, 224, 102, .4);
}
.gf-coach-text, .ag-coach-text { pointer-events: none; }

@keyframes gfcoachIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes gfpulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* 自动暂停提示（PAUSE-TIP）：上暗下亮渐变遮罩，冻结场景仍可见（设计 §B） */
.gf-coach-scrim, .ag-coach-scrim {
  position: absolute; inset: 0; z-index: 7; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(rgba(3,4,12,.62), rgba(3,4,12,.30));
}
.gf-coach-scrim[hidden], .ag-coach-scrim[hidden] { display: none; }

/* PAUSE 模态卡片（覆盖默认顶部 toast 定位） */
.gf-coach-tip.gf-coach-modal, .ag-coach-tip.ag-coach-modal {
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(86%, 340px); max-height: 296px; overflow-y: auto;
  z-index: 8; pointer-events: auto;
  padding: 18px 20px 16px; border-radius: 14px;
  text-align: center;
  background: rgba(8,12,28,.94);
  box-shadow: 0 0 26px rgba(0,229,255,.30), inset 0 0 0 1.5px rgba(77,238,234,.5);
  animation: gfcoachIn .2s ease-out;
}
.gf-coach-tip.gf-coach-modal .gf-coach-text, .ag-coach-tip.ag-coach-modal .ag-coach-text { text-align: center; line-height: 1.5; }

/* 「知道了」按钮（PAUSE-TIP 唯一出口） */
.gf-coach-continue, .ag-coach-continue {
  display: block; margin: 14px auto 0;
  font: inherit; font-size: 15px; font-weight: 800; letter-spacing: 1px;
  color: #06121a; background: #06ffa5; border: none; border-radius: 22px;
  padding: 10px 30px; cursor: pointer;
  box-shadow: 0 0 14px rgba(6,255,165,.5); transition: transform .1s;
}
.gf-coach-continue[hidden], .ag-coach-continue[hidden] { display: none; }
.gf-coach-continue:active, .ag-coach-continue:active { transform: scale(.96); }

/* FLASH-TIP：左栏 chip（x8, y364），不遮挡中央热走廊、不暂停 */
.gf-coach-tip.gf-coach-flash, .ag-coach-tip.ag-coach-flash {
  left: 8px; top: 364px; transform: none; width: 122px;
  z-index: 4; pointer-events: none;
  padding: 6px 10px; border-radius: 10px;
  font-size: 12px; font-weight: 700; line-height: 1.3; text-align: left;
  background: rgba(8,12,28,.86);
  box-shadow: 0 0 12px rgba(0,229,255,.18), inset 0 0 0 1.5px rgba(77,238,234,.5);
  animation: gfcoachIn .2s ease-out;
}
.gf-coach-tip.gf-coach-flash.gf-coach-warn, .ag-coach-tip.ag-coach-flash.ag-coach-warn {
  color: #ffe0e6;
  box-shadow: 0 0 12px rgba(255,77,109,.26), inset 0 0 0 1.5px rgba(255,77,109,.55);
}
.gf-coach-tip.gf-coach-flash.gf-coach-item, .ag-coach-tip.ag-coach-flash.ag-coach-item {
  color: #d8fffb;
  box-shadow: 0 0 12px rgba(77,238,234,.3), inset 0 0 0 1.5px rgba(77,238,234,.65);
}
.gf-coach-tip.gf-coach-flash.gf-coach-success, .ag-coach-tip.ag-coach-flash.ag-coach-success {
  color: #d6ffe9;
  box-shadow: 0 0 12px rgba(6,255,165,.3), inset 0 0 0 1.5px rgba(6,255,165,.6);
}
