/* 刮刮乐加载层 — 放在 custom/，Unity 导出不会覆盖 */

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #1a1a1a;
}

/* 勿覆盖 TemplateData 里的 position:absolute 居中布局 */
#tuanjie-container {
  overflow: hidden;
}

#tuanjie-viewport {
  position: relative;
}

#tuanjie-stage {
  position: relative;
}

#tuanjie-container.tuanjie-desktop {
  max-width: 100vw;
  max-height: 100vh;
}

#tuanjie-canvas {
  position: relative;
  z-index: 0;
  display: block;
}

#tuanjie-canvas.loading-active {
  pointer-events: none;
}

#loading-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  background: #1a1a1a;
  overflow: hidden;
}

#loading-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  background: #1a1a1a;
}

/* 加载中隐藏底部 footer */
#tuanjie-container.is-loading #tuanjie-footer {
  display: none;
}

#loading-overlay.hidden,
#tuanjie-container.game-ready #loading-overlay {
  display: none !important;
}

#tuanjie-container.game-ready #team-credits {
  display: none !important;
}

.tuanjie-mobile #loading-overlay {
  height: 100%;
}

#game-btn {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  padding: 8px 24px;
  font-size: 16px;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #fff;
  background: linear-gradient(180deg, #c9a227 0%, #8b6914 100%);
  border: 2px solid #f5e6b8;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  letter-spacing: 2px;
}

#game-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

#game-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

#guide-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

#guide-img.hidden {
  display: none;
}

#scratch-area {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

#scratch-area.active {
  display: flex;
}

#scratch-frame {
  position: relative;
  line-height: 0;
  max-width: 100%;
  max-height: 100%;
}

#prize-img {
  display: block;
  width: auto;
  height: auto;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

#scratch-canvas {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  cursor: crosshair;
  touch-action: none;
}

/* 进度条：页面正中 */
#tuanjie-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block !important;
  z-index: 40;
  pointer-events: none;
}

/* 团队信息卡片：底部居中 */
#team-credits {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(520px, 92%);
  padding: 14px 18px 16px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 10px;
  background: rgba(18, 16, 12, 0.9);
  color: #f5f0e6;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
  box-sizing: border-box;
  z-index: 45;
  pointer-events: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

#team-credits a,
.footer-team-contact a {
  color: #f0d78c;
  text-decoration: none;
}

#team-credits a:hover,
.footer-team-contact a:hover {
  text-decoration: underline;
}

.team-credits-headline {
  margin: 0 0 6px;
  font-size: 13px;
}

.team-credits-name {
  margin-left: 6px;
  font-weight: 700;
  color: #f0d78c;
}

.team-credits-list {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
}

.team-credits-list li {
  margin: 2px 0;
}

.team-credits-label,
.footer-team-item em {
  color: #c9a227;
  font-style: normal;
  margin-right: 4px;
}

.team-credits-note {
  color: #aaa;
  font-size: 11px;
}

.team-credits-members {
  margin: 0;
}

.team-credits-names {
  display: inline;
}

#footer-team-credits {
  clear: both;
  width: 100%;
  padding: 6px 10px 8px;
  border-top: 1px solid rgba(201, 162, 39, 0.25);
  color: #ddd;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  box-sizing: border-box;
}

.footer-team-row {
  margin: 0 0 4px;
}

.footer-team-row:last-child {
  margin-bottom: 0;
}

.footer-team-sep {
  margin: 0 6px;
  color: #666;
}

.tuanjie-mobile #team-credits {
  bottom: 10px;
  width: min(480px, 94%);
  padding: 10px 12px 12px;
  font-size: 11px;
}

/* 手机端：加载完成后右下角全屏按钮 */
#mobile-fullscreen-button {
  display: none;
}

#tuanjie-container.tuanjie-mobile.game-ready ~ #mobile-fullscreen-button {
  display: block;
  position: fixed;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 100000;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55) url("../TemplateData/fullscreen-button.png") no-repeat center;
  background-size: 28px 28px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#tuanjie-container.tuanjie-mobile.game-ready ~ #mobile-fullscreen-button:active {
  background-color: rgba(0, 0, 0, 0.72);
}

#tuanjie-container.tuanjie-mobile.game-ready ~ #mobile-fullscreen-button.is-fullscreen-active {
  background-color: rgba(201, 162, 39, 0.35);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.55);
}
