/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* 页面底色 + 轮胎纹理背景 */
body {
  background: #3a2ebd;
  background-image: url('../arts/BG/UI_BG_WheelPattern_01.png');
  background-size: cover;
  background-position: center;
  color: #fff;
}

/* ===== 页面布局 ===== */
#unity-page {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* ===== 手机外框 ===== */
#phone-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(160deg, #4a3fd4 0%, #3028a8 50%, #2a1f9c 100%);
  border-radius: 36px;
  padding: 10px;
  box-shadow:
    0 16px 48px rgba(0,0,0,0.45),
    0 0 0 2px rgba(255,255,255,0.08),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

/* 顶部刘海 */
#phone-notch {
  width: 80px;
  height: 5px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  margin: 2px auto 6px;
}

/* ===== 游戏容器 ===== */
#unity-container {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
}

/* ===== Canvas ===== */
#unity-canvas {
  display: block;
  background: #2048c8;
  border-radius: 24px;
}

/* ==================================
   自定义加载界面
   用 Loading/5.png 游戏原画做背景
   ================================== */
#loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  border-radius: 24px;
  z-index: 10;
  overflow: hidden;
  transition: opacity 0.8s ease, visibility 0.8s;
}
#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 加载背景图（游戏角色原画） */
#loading-bg {
  position: absolute;
  inset: 0;
  background: url('../arts/Loading/5.png') no-repeat center;
  background-size: cover;
  z-index: 0;
}

/* 底部渐变遮罩：让进度条区域可读 */
#loading-bottom {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 40px 24px 32px;
  background: linear-gradient(to top, rgba(20,10,60,0.92) 0%, rgba(20,10,60,0.7) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 游戏标题 */
#loading-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  margin-bottom: 20px;
}

/* 进度条外壳 */
#progress-bar-outer {
  width: 80%;
  max-width: 280px;
  height: 22px;
  background: rgba(0,0,0,0.35);
  border-radius: 11px;
  border: 2px solid rgba(255,255,255,0.15);
  overflow: hidden;
  position: relative;
}

/* 进度条填充 */
#progress-bar-inner {
  height: 100%;
  width: 0%;
  border-radius: 9px;
  background: linear-gradient(90deg, #4fc3f7, #42e695, #ffeb3b);
  box-shadow: 0 0 12px rgba(66,230,149,0.5);
  transition: width 0.3s ease;
  position: relative;
}
/* 进度条光泽 */
#progress-bar-inner::after {
  content: '';
  position: absolute;
  top: 2px; left: 4px; right: 4px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.45), transparent);
}

/* 百分比文字 */
#loading-percent {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* 提示文字 */
#loading-hint {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  animation: hintPulse 2s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}

/* 底部 Lingine logo */
#loading-logo {
  margin-top: 16px;
  height: 22px;
  opacity: 0.5;
}

/* 隐藏原始 Unity 加载条 */
#unity-loading-bar { display: none !important; }

/* ===== 底部工具栏 ===== */
#unity-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  margin-top: 6px;
  border-radius: 18px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 左侧 Lingine logo */
#footer-logo {
  height: 20px;
  opacity: 0.45;
  flex-shrink: 0;
}

#unity-build-title {
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  white-space: nowrap;
  margin: 0 10px;
  flex: 1;
  text-align: center;
}

/* 工具栏按钮 */
.toolbar-btn {
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 4px;
  position: relative;
}
.toolbar-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.toolbar-btn:active {
  transform: scale(0.92) translateY(0);
}
.toolbar-btn svg {
  width: 15px; height: 15px;
  fill: rgba(255,255,255,0.55);
  transition: fill 0.2s;
}
.toolbar-btn:hover svg {
  fill: #fff;
}

/* tooltip */
.toolbar-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.15s;
}
.toolbar-btn[data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ===== 警告 ===== */
#unity-warning {
  position: absolute;
  left: 50%; top: 12px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 20;
  display: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  max-width: 90%;
}

/* ===== 移动端 ===== */
.unity-mobile #phone-frame {
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
}
.unity-mobile #phone-notch { display: none; }
.unity-mobile #unity-container,
.unity-mobile #unity-canvas,
.unity-mobile #loading-overlay { border-radius: 0; }
.unity-mobile #unity-footer { display: none; }

/* ==================================
   Showcase 展示面板
   桌面端双侧游戏信息展示（三列布局）
   ================================== */

/* 默认显示，移动端隐藏 */
.sp-panel {
  display: flex;
  flex-direction: column;
  width: 360px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(25, 15, 70, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0 0 28px;
  box-shadow:
    0 12px 48px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
  flex-shrink: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.sp-panel::-webkit-scrollbar { width: 5px; }
.sp-panel::-webkit-scrollbar-track { background: transparent; }
.sp-panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

/* 右侧面板无 banner，需要顶部内边距 */
#showcase-right { padding-top: 28px; }

/* ── Banner 顶部横幅 ── */
.sp-banner {
  border-radius: 32px 32px 0 0;
  overflow: hidden;
  height: 220px;
  position: relative;
  flex-shrink: 0;
}
.sp-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}
.sp-banner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(25,15,70,0.85), transparent);
  pointer-events: none;
}

/* ── 头部 ── */
.sp-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 28px 0;
}
.sp-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.12);
}
.sp-title-area { flex: 1; min-width: 0; }
.sp-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.sp-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-tag {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.65);
  font-weight: 500;
}

/* ── 分割线 ── */
.sp-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  margin: 20px 28px;
}

/* ── 内容区块 ── */
.sp-section { padding: 0 28px; }
.sp-section-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
  position: relative;
  padding-left: 14px;
}
.sp-section-title::before {
  content: '';
  position: absolute;
  left: 0; top: 2px; bottom: 2px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #4fc3f7, #42e695);
}
.sp-desc {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255,255,255,0.6);
}
.sp-desc strong { color: rgba(255,255,255,0.88); }

/* ── 亮点卡片 ── */
.sp-highlights {
  display: flex;
  gap: 10px;
  padding: 20px 28px 0;
}
.sp-highlight-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  transition: all 0.25s;
  cursor: default;
}
.sp-highlight-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.sp-highlight-card img {
  width: 44px; height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.sp-highlight-card span {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-align: center;
}

/* ── 截图横向滚动 ── */
.sp-screenshots {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.sp-screenshots::-webkit-scrollbar { display: none; }
.sp-screenshots img {
  height: 320px;
  border-radius: 14px;
  scroll-snap-align: start;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid rgba(255,255,255,0.08);
}
.sp-screenshots img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}

/* ── 特色功能列表 ── */
.sp-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sp-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.25s;
  cursor: default;
}
.sp-feature:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.14);
  transform: translateX(4px);
}
.sp-feature img {
  width: 50px; height: 50px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.sp-feature strong {
  display: block;
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}
.sp-feature div > p {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
  line-height: 1.4;
}

/* ── 玩法步骤 ── */
.sp-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sp-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.sp-step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4fc3f7, #42e695);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(66,230,149,0.35);
}
.sp-step > p {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  padding-top: 4px;
}

/* ── 底部品牌（小号，左侧面板） ── */
.sp-footer {
  text-align: center;
  padding: 4px 28px 0;
}
.sp-footer-logo {
  height: 32px;
  opacity: 0.85;
  margin-bottom: 8px;
  transition: all 0.2s;
  background: rgba(255,255,255,0.75);
  padding: 6px 16px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.sp-footer-logo:hover {
  opacity: 1;
  background: rgba(255,255,255,0.9);
}
.sp-footer p {
  font-size: 10px;
  color: rgba(255,255,255,0.22);
  line-height: 1.6;
}

/* ── 品牌区（大号突出，右侧面板） ── */
.sp-brand {
  text-align: center;
  padding: 8px 28px 0;
}
.sp-brand-text {
  display: block;
  height: 44px;
  margin: 0 auto 14px;
  background: rgba(255,255,255,0.82);
  padding: 10px 28px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: all 0.2s;
}
.sp-brand-text:hover {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.sp-brand p {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  line-height: 1.6;
}

/* ── 入场动画 ── */
@keyframes spSlideLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes spSlideRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
#showcase-left  { animation: spSlideLeft  0.6s ease-out; }
#showcase-right { animation: spSlideRight 0.6s ease-out; }

/* ── 面板渐隐/渐现 ── */
.sp-panel.sp-hiding {
  opacity: 0 !important;
  pointer-events: none;
}
#showcase-left.sp-hiding  { transform: translateX(-40px); }
#showcase-right.sp-hiding { transform: translateX(40px); }

.sp-panel.sp-showing {
  opacity: 0 !important;
}
#showcase-left.sp-showing  { transform: translateX(-40px); }
#showcase-right.sp-showing { transform: translateX(40px); }

/* 超宽屏幕：面板更宽 */
@media (min-width: 1600px) {
  .sp-panel { width: 420px; }
  .sp-banner { height: 260px; }
  .sp-screenshots img { height: 380px; }
  .sp-brand-text { height: 50px; padding: 12px 32px; }
}

/* 移动端 */
.unity-mobile #unity-page { flex-direction: column; gap: 0; }
.unity-mobile .sp-panel { display: none !important; }
