/* ============================================================================
   MARDIN PORTAL HUB — GAME CENTER (PORTAL STYLE + ANIMATED CARDS)
   ============================================================================ */

html body #page-hub {
  position: fixed;
  inset: 0;
  z-index: 42;
  background: radial-gradient(120% 80% at 50% 0%, #131622 0%, #0b0c10 58%, #07080b 100%) !important;
  color: #f8fafc;
  font-family: var(--font-sans, "Inter", system-ui, -apple-system, sans-serif);
  overflow: hidden;
  display: none;
}
html body #page-hub.active {
  display: block !important;
}
body.page-hub .cosmic-starfield {
  display: none !important;
}

html body #page-hub .hub-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(118px + env(safe-area-inset-bottom, 0px)) !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 1. Top Wallet Pills Row */
html body #page-hub .hub-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
html body #page-hub .hub-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
}
html body #page-hub .hub-pill.gold {
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.25);
  color: #fef08a;
}
html body #page-hub .hub-pill img {
  width: 17px;
  height: 17px;
  border-radius: 50%;
}
html body #page-hub .hub-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

/* 2. Hero Event Banner (Portal Style) */
html body #page-hub .hub-hero-banner {
  position: relative;
  border-radius: 22px;
  padding: 16px 18px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.28);
  background:
    radial-gradient(90% 130% at 85% 30%, rgba(168, 85, 247, 0.42) 0%, transparent 60%),
    linear-gradient(125deg, #10162d 0%, #1d1439 52%, #2b1647 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 98px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
html body #page-hub .hub-hero-skyline {
  position: absolute;
  inset: auto 0 0 0;
  height: 44px;
  opacity: 0.26;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    rgba(192, 132, 252, 0.45) 0 18px,
    transparent 18px 26px,
    rgba(192, 132, 252, 0.3) 26px 40px,
    transparent 40px 52px
  );
  mask-image: linear-gradient(to top, #000 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent 100%);
}
html body #page-hub .hub-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
html body #page-hub .hub-hero-copy h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
}
html body #page-hub .hub-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ec4899, #f43f5e);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.45);
  animation: hubPulseBadge 2.2s ease-in-out infinite;
}
html body #page-hub .hub-hero-art {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hubFloat 3.4s ease-in-out infinite;
}
html body #page-hub .hub-hero-art img {
  width: 66px;
  height: 66px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(250, 204, 21, 0.45));
}

/* Shared Card Badges */
html body #page-hub .hub-card-badges {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
}
html body #page-hub .hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(9, 11, 18, 0.56);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}
html body #page-hub .hub-badge.hot {
  background: linear-gradient(90deg, #f97316, #ef4444);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}
html body #page-hub .hub-badge.soon {
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
}
html body #page-hub .hub-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: hubPulseDot 1.8s ease-in-out infinite;
}

/* 3. Featured Full-Width ARENA Card (3-Way Diagonal Split + Animated Orbs) */
html body #page-hub .hub-arena-card {
  position: relative;
  width: 100%;
  min-height: 176px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  padding: 16px 18px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 46%, #f59e0b 46.2%, #eab308 72%, #ef4444 72.2%, #dc2626 100%);
  box-shadow: 0 16px 36px rgba(2, 132, 199, 0.28);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}
html body #page-hub .hub-arena-card:active {
  transform: scale(0.97);
}
html body #page-hub .hub-arena-card::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.18) 50%, transparent 65%);
  transform: translateX(-60%);
  animation: hubSheen 4.8s ease-in-out infinite;
  pointer-events: none;
}
html body #page-hub .hub-arena-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
html body #page-hub .hub-orb {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 2px 6px rgba(255, 255, 255, 0.45);
}
html body #page-hub .hub-orb.blue {
  width: 62px;
  height: 62px;
  left: 36%;
  bottom: 18px;
  background: radial-gradient(circle at 30% 30%, #38bdf8, #0369a1);
  border: 3px solid rgba(255, 255, 255, 0.35);
  font-size: 28px;
  animation: hubOrbA 3.2s ease-in-out infinite;
}
html body #page-hub .hub-orb.gold {
  width: 76px;
  height: 76px;
  left: 53%;
  top: 22px;
  background: radial-gradient(circle at 30% 30%, #fde047, #d97706);
  border: 3px solid rgba(255, 255, 255, 0.4);
  font-size: 34px;
  animation: hubOrbB 3.6s ease-in-out infinite;
}
html body #page-hub .hub-orb.red {
  width: 66px;
  height: 66px;
  right: 16px;
  bottom: 24px;
  background: radial-gradient(circle at 30% 30%, #fb7185, #b91c1c);
  border: 3px solid rgba(255, 255, 255, 0.35);
  font-size: 30px;
  animation: hubOrbC 2.9s ease-in-out infinite;
}
html body #page-hub .hub-card-title {
  position: relative;
  z-index: 3;
  margin: 0;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

/* 4. Featured Full-Width TRADING Card (Emerald Matrix + Animated Candlesticks) */
html body #page-hub .hub-trade-card {
  position: relative;
  width: 100%;
  min-height: 176px;
  border-radius: 26px;
  padding: 16px 18px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  background:
    linear-gradient(rgba(34, 197, 94, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 197, 94, 0.08) 1px, transparent 1px),
    radial-gradient(110% 90% at 75% 25%, rgba(16, 185, 129, 0.35) 0%, transparent 65%),
    linear-gradient(160deg, #064e3b 0%, #052e23 55%, #021d17 100%);
  background-size: 22px 22px, 22px 22px, 100% 100%, 100% 100%;
  box-shadow: 0 14px 32px rgba(6, 78, 59, 0.42);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}
html body #page-hub .hub-trade-card:active {
  transform: scale(0.97);
}
html body #page-hub .hub-trade-card::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 35%, rgba(74, 222, 128, 0.14) 50%, transparent 65%);
  transform: translateX(-60%);
  animation: hubSheen 5.2s ease-in-out infinite 1.2s;
  pointer-events: none;
}
html body #page-hub .hub-candles {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  height: 98px;
  pointer-events: none;
}
html body #page-hub .hub-candle {
  position: relative;
  width: 14px;
  border-radius: 3px;
  background: linear-gradient(180deg, #4ade80, #16a34a);
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.55);
  animation: hubCandleWave 2.6s ease-in-out infinite;
}
html body #page-hub .hub-candle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -9px;
  bottom: -9px;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(134, 239, 172, 0.78);
  border-radius: 2px;
}
html body #page-hub .hub-candle.c1 { height: 22px; margin-bottom: 4px; animation-delay: 0s; }
html body #page-hub .hub-candle.c2 { height: 30px; margin-bottom: 14px; animation-delay: 0.25s; }
html body #page-hub .hub-candle.c3 { height: 38px; margin-bottom: 24px; animation-delay: 0.5s; }
html body #page-hub .hub-candle.c4 { height: 26px; margin-bottom: 36px; background: linear-gradient(180deg, #38bdf8, #0ea5e9); box-shadow: 0 0 14px rgba(56, 189, 248, 0.55); animation-delay: 0.75s; }
html body #page-hub .hub-candle.c5 { height: 48px; margin-bottom: 40px; animation-delay: 1s; }

/* 5. Floating Glassmorphic Bottom Portal Dock */
html body #page-hub .hub-dock-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}
html body #page-hub .hub-dock {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(18, 20, 28, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
html body #page-hub .hub-dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 66px;
  padding: 7px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
html body #page-hub .hub-dock-btn:active {
  transform: scale(0.94);
}
html body #page-hub .hub-dock-btn span:first-child {
  font-size: 16px;
  line-height: 1;
}
html body #page-hub .hub-dock-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Keyframes */
@keyframes hubFloat {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
@keyframes hubPulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes hubPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.82); }
}
@keyframes hubSheen {
  0%, 70% { transform: translateX(-65%); }
  100% { transform: translateX(120%); }
}
@keyframes hubOrbA {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.04); }
}
@keyframes hubOrbB {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(7px) rotate(4deg); }
}
@keyframes hubOrbC {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.05); }
}
@keyframes hubCandleWave {
  0%, 100% { transform: scaleY(1); filter: brightness(1); }
  50% { transform: scaleY(1.16); filter: brightness(1.18); }
}
@keyframes hubSpinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes hubPointerBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.08); }
}
