* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #4a3a2a;
  background: linear-gradient(160deg, #fff3c4 0%, #ffd9e8 45%, #d8f0ff 100%);
  background-attachment: fixed;
  -webkit-user-select: none;
  user-select: none;
}

.hub {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 28px) 20px calc(env(safe-area-inset-bottom) + 28px);
}

.user-bar { width: 100%; max-width: 760px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ub-chip { border: none; background: #fff; color: #ff7a59; font-weight: 800; border-radius: 999px; padding: 8px 16px; font-size: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.1); cursor: pointer; }
.ub-actions { display: flex; gap: 8px; }
.ub-btn { text-decoration: none; background: #fff; color: #ff7a59; font-weight: 800; border-radius: 999px; padding: 8px 14px; font-size: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.ub-btn:active, .ub-chip:active { transform: scale(0.95); }

.overlay { position: fixed; inset: 0; background: rgba(40,30,20,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.overlay[hidden] { display: none; }
.ob-card { background: #fff; border-radius: 26px; padding: 28px 22px; width: 100%; max-width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,.18); text-align: center; }
.ob-logo { font-size: 22px; font-weight: 800; color: #ff7a59; text-shadow: 0 2px 0 #fff; margin-bottom: 16px; }
.ob-tip { color: #8a7a66; font-weight: 600; margin: 0 0 14px; }
.ob-card input { width: 100%; -webkit-appearance: none; appearance: none; box-shadow: none; border: 2px solid #ffd9c9; border-radius: 14px; padding: 14px; font-size: 17px; text-align: center; outline: none; }
.ob-card input:focus { border-color: #ff7a59; }
.ob-err { color: #e0524f; font-weight: 700; font-size: 14px; margin: 10px 0 0; }
.ob-btn { width: 100%; border: none; border-radius: 16px; padding: 15px; margin-top: 14px; background: #ff7a59; color: #fff; font-size: 17px; font-weight: 800; cursor: pointer; }
.ob-btn:active { transform: scale(0.97); }
.ob-btn.ghost { background: #fff; color: #ff7a59; border: 2px solid #ffd9c9; }
.ob-guide { color: #5a4a36; font-weight: 600; line-height: 1.7; background: #fff6ef; border-radius: 14px; padding: 14px; }
.ob-ic { font-size: 18px; }
.hub-logo {
  font-size: 56px; line-height: 1;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hub-title {
  margin: 8px 0 4px;
  font-size: 34px; font-weight: 800; letter-spacing: 1px;
  color: #ff7a59;
  text-shadow: 0 2px 0 #fff, 0 4px 10px rgba(255, 122, 89, 0.25);
}
.hub-sub { margin: 0; font-size: 15px; color: #8a7a66; font-weight: 600; }

.games {
  width: 100%;
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 14px;
  border-radius: 24px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10);
  border: 3px solid #fff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  min-height: 150px;
}
.game-card:active { transform: scale(0.96); }

.gc-emoji { font-size: 54px; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0,0,0,.15)); }
.gc-name { font-size: 20px; font-weight: 800; }
.gc-desc { font-size: 13px; color: #9a8a76; font-weight: 600; }

/* 彩色主题卡 */
.c-memory { background: linear-gradient(150deg, #fff, #ffe3ef); border-color: #ffc2dc; }
.c-chess  { background: linear-gradient(150deg, #fff, #e3efff); border-color: #bcd8ff; }
.c-puzzle { background: linear-gradient(150deg, #fff, #ede6ff); border-color: #cfc2ff; }
.c-sokoban { background: linear-gradient(150deg, #fff, #fff0db); border-color: #ffd9a8; }
.c-maze { background: linear-gradient(150deg, #fff, #e6f6d9); border-color: #c2e6a8; }
.c-spot { background: linear-gradient(150deg, #fff, #eafbe0); border-color: #cbe9b0; }
.c-gomoku { background: linear-gradient(150deg, #fff, #f6e6c8); border-color: #e6c98f; }
.c-snake { background: linear-gradient(150deg, #fff, #dff6e6); border-color: #a9e6bd; }
.c-sudoku { background: linear-gradient(150deg, #fff, #d9f3f3); border-color: #a3e0e0; }
.c-klotski { background: linear-gradient(150deg, #fff, #ffeccc); border-color: #f0cf9a; }
.c-dressup { background: linear-gradient(150deg, #fff, #ffe1dc 45%, #e2f2eb); border-color: #f2b3a7; }

.game-card.soon {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: none;
  cursor: default;
}
.game-card.soon .gc-emoji { filter: grayscale(0.4); opacity: 0.65; }
.game-card.soon .gc-name { color: #b3a692; }
.game-card.soon::after {
  content: "🔒"; position: absolute; top: 10px; right: 12px; font-size: 16px; opacity: 0.5;
}

.hub-foot { margin-top: 26px; font-size: 14px; color: #9a8a76; font-weight: 600; }

@media (min-width: 720px) {
  .games { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .hub-title { font-size: 40px; }
}
