/* ============================================================
   Games Center — hub06 + games hub + gomoku board
   Self-contained, no external assets. All visuals via CSS gradients.
   ============================================================ */

/* ───────── HUB 06 (气象 · 金融 中转页) ───────── */
/* Note: do NOT set position here. .page already gives position:absolute,
   and overriding via #hub06 (ID specificity) drops the page out of the
   absolute-positioned slide stack, producing a black screen on entry. */
#hub06 {
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  overflow: hidden;
}
#hub06::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(0,255,255,0.06), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(255,0,255,0.05), transparent 60%);
  pointer-events: none;
}
.hub06-wrap {
  position: relative;
  width: 100%;
  max-width: 900px;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 18px;
}
.hub06-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 6px;
  color: #f0f0f0;
  font-weight: 500;
  text-shadow: 0 0 20px rgba(0,255,255,0.18);
  margin: 0;
}
.hub06-tag {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: #888;
  font-size: 15px;
  letter-spacing: 2px;
  margin-bottom: 24px;
}
.hub06-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
}
.hub06-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 36px 28px 30px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2,0.8,0.2,1),
              border-color 0.35s, background 0.35s, box-shadow 0.35s;
}
.hub06-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(255,255,255,0.04));
  pointer-events: none;
}
.hub06-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.hub06-card--weather:hover { border-color: rgba(135,206,250,0.4); box-shadow: 0 16px 40px rgba(135,206,250,0.15); }
.hub06-card--finance:hover { border-color: rgba(240,185,11,0.4); box-shadow: 0 16px 40px rgba(240,185,11,0.15); }
.hub06-card-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.hub06-card h3 {
  font-family: 'Chakra Petch', sans-serif;
  color: #f0f0f0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 2px;
  margin: 0 0 8px;
}
.hub06-card p {
  font-family: 'Chakra Petch', sans-serif;
  color: #999;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1.7;
  margin: 0;
}
@media (max-width: 700px) {
  .hub06-cards { grid-template-columns: 1fr; }
  #hub06 { padding: 50px 18px; }
}

/* ───────── GAMES HUB (游戏中心墙) ───────── */
#games {
  align-items: center;
  justify-content: flex-start;
  padding: 70px 24px 40px;
  overflow-y: auto;
}
.games-wrap {
  width: 100%;
  max-width: 1100px;
  display: flex; flex-direction: column;
  align-items: center;
}
.games-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 6px;
  color: #f0f0f0;
  font-weight: 500;
  text-shadow: 0 0 20px rgba(255,0,255,0.18);
  margin: 0;
}
.games-tag {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: #888;
  font-size: 15px;
  letter-spacing: 2px;
  margin: 10px 0 36px;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  width: 100%;
}
.game-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.2,0.8,0.2,1),
              border-color 0.35s, box-shadow 0.35s;
}
.game-card:not(.game-card--placeholder):hover {
  transform: translateY(-6px);
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
}
.game-card-thumb {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.game-card-thumb--gomoku {
  background:
    linear-gradient(180deg, #d4a574 0%, #b88550 100%);
  background-image:
    linear-gradient(rgba(80,40,15,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80,40,15,0.4) 1px, transparent 1px),
    linear-gradient(180deg, #d4a574 0%, #b88550 100%);
  background-size: 22px 22px, 22px 22px, 100% 100%;
  background-position: -1px -1px, -1px -1px, 0 0;
}
.game-stone {
  width: 38px; height: 38px;
  border-radius: 50%;
  position: absolute;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.5);
}
.game-stone--black {
  left: calc(50% - 22px);
  top: calc(50% - 22px);
  background: radial-gradient(circle at 35% 30%, #4a4a4a 0%, #1a1a1a 60%, #000 100%);
}
.game-stone--white {
  left: calc(50% - 16px);
  top: calc(50% - 14px);
  background: radial-gradient(circle at 35% 30%, #fff 0%, #e8e2d6 70%, #c0baad 100%);
}
.game-card-thumb--placeholder {
  background: rgba(255,255,255,0.04);
  color: #555;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  letter-spacing: 3px;
}
.game-card.game-card--placeholder { opacity: 0.45; cursor: default; }
.game-card h3 {
  font-family: 'Chakra Petch', sans-serif;
  color: #f0f0f0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 2px;
  padding: 16px 18px 4px;
  margin: 0;
}
.game-card p {
  font-family: 'Chakra Petch', sans-serif;
  color: #888;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 0 18px 18px;
  margin: 0;
  line-height: 1.6;
}

/* ───────── GOMOKU PAGE ───────── */
#gomoku {
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}
#gomoku::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 30%, rgba(120,80,40,0.15), transparent 65%),
    radial-gradient(circle at 90% 90%, rgba(0,0,0,0.4), transparent 60%);
  pointer-events: none;
}
.gomoku-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px 24px;
}

/* ── Setup screen ── */
.gomoku-setup {
  width: 100%;
  max-width: 480px;
  background: rgba(20, 14, 10, 0.6);
  border: 1px solid rgba(212, 165, 116, 0.18);
  border-radius: 16px;
  padding: 36px 32px 32px;
  backdrop-filter: blur(8px);
}
.gomoku-setup-title {
  font-family: 'Chakra Petch', sans-serif;
  color: #e8d5b0;
  font-size: 32px;
  letter-spacing: 6px;
  font-weight: 500;
  text-align: center;
  margin: 0 0 6px;
  text-shadow: 0 2px 12px rgba(212, 165, 116, 0.3);
}
.gomoku-setup-sub {
  font-family: 'Chakra Petch', sans-serif;
  color: #a89881;
  font-size: 12px;
  letter-spacing: 1px;
  text-align: center;
  margin: 0 0 26px;
}
.gomoku-setup-section { margin-bottom: 22px; }
.gomoku-setup-label {
  font-family: 'Chakra Petch', sans-serif;
  color: #c4b89e;
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.gomoku-setup-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.gomoku-opt {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212, 165, 116, 0.2);
  color: #b8a888;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.gomoku-opt:hover {
  background: rgba(212, 165, 116, 0.08);
  color: #e8d5b0;
  border-color: rgba(212, 165, 116, 0.4);
}
.gomoku-opt.is-active {
  background: linear-gradient(180deg, #d4a574, #b88550);
  color: #1a0e07;
  border-color: #d4a574;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}
.gomoku-start-btn {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #d4a574, #a87340);
  color: #1a0e07;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 4px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(212, 165, 116, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.gomoku-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(212, 165, 116, 0.4);
}
.gomoku-start-btn:active { transform: translateY(0); }
.gomoku-setup-hint {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 11px;
  color: #8a7a60;
  letter-spacing: 1px;
  margin-top: 8px;
  text-align: center;
  font-style: italic;
}
.gomoku-rules-link {
  display: block;
  margin: 14px auto 0;
  background: transparent;
  border: none;
  color: #a89881;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(168, 152, 129, 0.4);
}
.gomoku-rules-link:hover { color: #e8d5b0; }

/* ── Play screen ── */
.gomoku-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  width: 100%;
  height: 100%;
  max-width: 1100px;
}
.gomoku-board-wrap {
  position: relative;
  flex-shrink: 0;
}
.gomoku-canvas {
  display: block;
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(80,40,10,0.6),
    0 20px 50px rgba(0,0,0,0.6),
    inset 0 0 80px rgba(60,30,5,0.25);
  cursor: crosshair;
}
.gomoku-banner {
  position: absolute;
  top: 16px; left: 50%;
  transform: translate(-50%, -16px) scale(0.85);
  background: rgba(20,14,10,0.94);
  color: #e8d5b0;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 18px;
  letter-spacing: 3px;
  padding: 12px 26px;
  border: 1px solid rgba(212, 165, 116, 0.55);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.2,0.8,0.2,1.3), opacity 0.32s;
  text-align: center;
  white-space: nowrap;
  z-index: 5;
}
.gomoku-banner.is-show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.gomoku-banner-sub {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  color: #a89881;
  margin-top: 4px;
}

/* ── Sidebar ── */
.gomoku-side {
  width: 240px;
  display: flex; flex-direction: column;
  gap: 18px;
}
.gomoku-side-block {
  background: rgba(20,14,10,0.7);
  border: 1px solid rgba(212, 165, 116, 0.18);
  border-radius: 12px;
  padding: 16px 18px;
}
.gomoku-side-mode {
  font-family: 'Chakra Petch', sans-serif;
  color: #d4a574;
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(212, 165, 116, 0.15);
  text-transform: uppercase;
}
.gomoku-turn-row {
  display: flex; align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.gomoku-turn-stone {
  width: 18px; height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.3;
  transition: opacity 0.25s, box-shadow 0.25s;
}
.gomoku-turn-stone--black {
  background: radial-gradient(circle at 35% 30%, #5a5a5a 0%, #1a1a1a 60%, #000 100%);
}
.gomoku-turn-stone--white {
  background: radial-gradient(circle at 35% 30%, #fff 0%, #e8e2d6 70%, #c0baad 100%);
}
.gomoku-turn-stone.is-active {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(212, 165, 116, 0.5), 0 0 12px rgba(212, 165, 116, 0.4);
}
.gomoku-turn-text {
  font-family: 'Chakra Petch', sans-serif;
  color: #e8d5b0;
  font-size: 14px;
  letter-spacing: 1px;
  margin-left: 4px;
}
.gomoku-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.gomoku-stats > div {
  flex: 1;
  display: flex; flex-direction: column;
  gap: 4px;
}
.gomoku-stat-k {
  font-family: 'Chakra Petch', sans-serif;
  color: #8a7a60;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.gomoku-stat-v {
  font-family: 'Chakra Petch', sans-serif;
  color: #e8d5b0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
}
.gomoku-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.gomoku-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212, 165, 116, 0.2);
  color: #c4b89e;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.gomoku-btn:hover:not(:disabled) {
  background: rgba(212, 165, 116, 0.1);
  color: #e8d5b0;
  border-color: rgba(212, 165, 116, 0.4);
}
.gomoku-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.gomoku-btn--primary {
  background: linear-gradient(180deg, rgba(212, 165, 116, 0.3), rgba(168, 115, 64, 0.3));
  color: #f0e0c0;
  border-color: rgba(212, 165, 116, 0.5);
}
.gomoku-btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(212, 165, 116, 0.5), rgba(168, 115, 64, 0.5));
}
.gomoku-thinking {
  display: flex; align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(212, 165, 116, 0.08);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: 8px;
  color: #d4a574;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
}
.gomoku-thinking-dots {
  display: inline-flex;
  gap: 3px;
}
.gomoku-thinking-dots span {
  width: 6px; height: 6px;
  background: #d4a574;
  border-radius: 50%;
  animation: gomokuThinkPulse 1.2s ease-in-out infinite;
}
.gomoku-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.gomoku-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes gomokuThinkPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1.2); }
}

/* ── Rules modal ── */
.gomoku-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9500;
  backdrop-filter: blur(4px);
}
.gomoku-modal.is-show { display: flex; }
.gomoku-modal-card {
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  background: #1a140e;
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
}
.gomoku-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px;
  font-family: 'Chakra Petch', sans-serif;
  color: #e8d5b0;
  font-size: 16px;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(212, 165, 116, 0.18);
}
.gomoku-modal-close {
  background: transparent;
  border: none;
  color: #a89881;
  font-size: 24px;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.gomoku-modal-close:hover { background: rgba(212, 165, 116, 0.1); color: #e8d5b0; }
.gomoku-modal-body {
  padding: 22px;
  overflow-y: auto;
  font-family: 'Chakra Petch', sans-serif;
  color: #c4b89e;
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: 0.5px;
}
.gomoku-modal-body h4 {
  color: #d4a574;
  font-size: 14px;
  letter-spacing: 2px;
  margin: 16px 0 8px;
}
.gomoku-modal-body h4:first-child { margin-top: 0; }
.gomoku-modal-body b { color: #e8d5b0; }
.gomoku-rules-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
}
.gomoku-rules-list li {
  padding: 8px 12px 8px 20px;
  margin-bottom: 6px;
  background: rgba(212, 165, 116, 0.06);
  border-left: 3px solid #d4a574;
  border-radius: 4px;
}
.gomoku-rules-foot {
  font-size: 12px;
  color: #8a7a60;
  font-style: italic;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(212, 165, 116, 0.2);
}

/* ── Mobile / portrait layout ── */
@media (max-width: 900px) {
  /* Push content below the absolute back-btn (~24+42=66px) */
  .gomoku-shell { padding: 76px 12px 16px; align-items: flex-start; }
  .gomoku-play {
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }
  .gomoku-side {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
  }
  .gomoku-stats { gap: 4px; }
  .gomoku-stat-v { font-size: 14px; }
  .gomoku-banner { font-size: 16px; padding: 10px 20px; letter-spacing: 2px; }
  .gomoku-setup { margin-top: 0; }
}
@media (max-width: 480px) {
  .gomoku-setup { padding: 28px 22px 24px; }
  .gomoku-setup-title { font-size: 26px; letter-spacing: 4px; }
  .gomoku-opt { font-size: 12px; padding: 9px 8px; }
}
