:root {
  --bg-dark: #090d16;
  --card-bg: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #090d16 100%);
  color: var(--text-main);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: env(safe-area-inset-top, 12px) 16px env(safe-area-inset-bottom, 14px) 16px;
  touch-action: manipulation;
}

/* 顶部大厅标题栏 */
.lobby-header {
  text-align: center;
  padding: 10px 0 4px 0;
  width: 100%;
  max-width: 440px;
}

.lobby-flower { flex: none; width: 44px; height: 44px; padding: 0; border: 0; background: none; font: inherit; -webkit-text-fill-color: initial; cursor: pointer; touch-action: manipulation; user-select: none; }
.lobby-flower:focus-visible { outline: 2px solid #f472b6; outline-offset: 2px; border-radius: 50%; }
.lobby-title {
  font-size: 1.55rem;
  font-weight: 900;
  background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lobby-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.page-counter-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: #38bdf8;
  font-weight: 700;
}

/* 翻页轮播容器 */
.carousel-container {
  width: 100%;
  max-width: 420px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 1000px;
  min-height: 0;
  margin: 10px 0;
}

.cards-track {
  width: 100%;
  height: 100%;
  max-height: 480px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 独立游戏卡片 */
.game-card {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%) scale(0.85);
  cursor: pointer;
  border: 2px solid transparent;
}

/* 卡片激活态 (居中显示) */
.game-card.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
  z-index: 10;
}

/* 卡片在左侧 */
.game-card.prev {
  opacity: 0.2;
  transform: translateX(-110%) scale(0.85);
  z-index: 5;
}

/* 卡片在右侧 */
.game-card.next {
  opacity: 0.2;
  transform: translateX(110%) scale(0.85);
  z-index: 5;
}

/* 卡片主题色：游戏 1 - 猜鸭子 */
.card-duck {
  background: linear-gradient(160deg, #7c2d12 0%, #1e293b 70%, #0f172a 100%);
  border-color: rgba(249, 115, 22, 0.4);
}

/* 卡片主题色：游戏 2 - 玩电脑 */
.card-computer {
  background: linear-gradient(160deg, #0f4c81 0%, #1e293b 70%, #0f172a 100%);
  border-color: rgba(56, 189, 248, 0.4);
}

/* 卡片内部各区域 */
.card-tag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-category-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  letter-spacing: 0.5px;
}

.card-order-tag {
  font-size: 0.8rem;
  font-weight: 900;
  opacity: 0.5;
}

.card-center-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px 0;
}

.big-game-icon {
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.card-game-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.card-game-desc {
  font-size: 0.85rem;
  color: #cbd5e1;
  text-align: center;
  line-height: 1.45;
  padding: 0 10px;
}

.card-features-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.chip-item {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

/* 进入游戏主按钮 */
.enter-game-btn {
  width: 100%;
  height: 52px;
  border-radius: 26px;
  border: none;
  outline: none;
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.enter-game-btn:active {
  transform: scale(0.97);
}

.btn-duck {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.45);
}

.btn-computer {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
}

/* 底部翻页控制器 (左右按键 + 轮播小点) */
.bottom-controls {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
  flex-shrink: 0;
}

.nav-buttons-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.nav-flip-btn {
  flex: 1;
  height: 48px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.15s ease;
}

.nav-flip-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.18);
}

/* 轮播圆点指示器 */
.dots-indicator-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
  cursor: pointer;
}

.dot.active {
  width: 24px;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
}

/* 🚀 全屏游戏容器 (iframe) & 顶部退出栏 */
.game-viewport-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #fffaf6;
  z-index: 9999;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.game-viewport-modal.show {
  display: flex;
  opacity: 1;
}

.game-iframe {
  min-height: 0;
  width: 100%;
  height: 100%;
  border: none;
  flex: 1;
  background: #fffaf6;
}
