/* ============================================================
   Game Portal Theme v4 — light / fresh style
   Works on top of common.css; rem base follows common.js (750px => 100px)
   ============================================================ */

:root {
  --g-bg-0: #f4f8fd;
  --g-bg-1: #eaf1fb;
  --g-bg-2: #dce8f8;
  --g-surface: rgba(59, 130, 246, 0.05);
  --g-surface-2: rgba(59, 130, 246, 0.11);
  --g-border: rgba(59, 130, 246, 0.20);
  --g-border-strong: rgba(59, 130, 246, 0.45);
  --g-text: #15243d;
  --g-text-2: #486078;
  --g-text-3: #8396ac;
  --g-blue: #2563eb;
  --g-blue-2: #1d4ed8;
  --g-cyan: #0284c7;
  --g-indigo: #4f46e5;
  --g-gold: #0369a1;
  --g-grad-hot: linear-gradient(135deg, #38bdf8 0%, #3b82f6 55%, #6366f1 100%);
  --g-grad-cool: linear-gradient(135deg, #3b82f6 0%, #22d3ee 100%);
  --g-shadow: 0 0.1rem 0.28rem rgba(30, 64, 175, 0.14);
}

.gp {
  background: var(--g-bg-0);
  color: var(--g-text);
}

.gp * {
  box-sizing: border-box;
}

/* ---------- page background ---------- */
.gp-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1.8rem 1.8rem at 10% 4%, rgba(56, 189, 248, 0.16), transparent 70%),
    radial-gradient(1.5rem 1.5rem at 92% 18%, rgba(99, 102, 241, 0.13), transparent 70%),
    radial-gradient(1.4rem 1.4rem at 80% 82%, rgba(59, 130, 246, 0.12), transparent 70%),
    linear-gradient(160deg, #f8fbff 0%, #f4f8fd 55%, #eaf1fb 100%);
}
.gp-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.08) 1px, transparent 1px);
  background-size: 0.6rem 0.6rem;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

/* ---------- header ---------- */
.gp-header {
  position: relative;
  z-index: 30;
  padding: 0.22rem 0.3rem 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.72));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--g-border);
}
.gp-brand {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.14rem;
}
.gp-brand-mark {
  flex-shrink: 0;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 0.18rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--g-grad-hot);
  box-shadow: 0 0.06rem 0.18rem rgba(59, 130, 246, 0.35);
  font-size: 0.34rem;
  font-weight: 900;
  color: #fff;
  transform: rotate(-6deg);
}
.gp-brand-txt {
  min-width: 0;
  flex: 1;
}
.gp-brand-txt b {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.32rem;
  font-weight: 800;
  letter-spacing: 0.01rem;
  background: linear-gradient(90deg, #1e3a8a, #2563eb 55%, #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gp-brand-txt span {
  display: block;
  font-size: 0.16rem;
  color: var(--g-text-3);
  letter-spacing: 0.06rem;
  margin-top: 0.02rem;
}
.gp-search {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  height: 0.56rem;
  padding: 0 0.22rem;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px solid var(--g-border);
  color: var(--g-text-3);
}
.gp-search .iconfont {
  font-size: 0.28rem;
  color: var(--g-cyan);
}
.gp-search span {
  font-size: 0.2rem;
  white-space: nowrap;
}

/* ---------- shared section heading ---------- */
.gp-sec {
  margin: 0.34rem 0.3rem 0;
}
.gp-sec-hd {
  display: flex;
  align-items: center;
  gap: 0.12rem;
  margin-bottom: 0.22rem;
}
.gp-sec-bar {
  width: 0.06rem;
  height: 0.34rem;
  border-radius: 0.06rem;
  background: var(--g-grad-hot);
  box-shadow: 0 0 0.12rem rgba(59, 130, 246, 0.35);
}
.gp-sec-hd h2 {
  font-size: 0.32rem;
  font-weight: 800;
  letter-spacing: 0.01rem;
  color: var(--g-text);
}
.gp-sec-hd .gp-sec-en {
  font-size: 0.16rem;
  color: var(--g-text-3);
  letter-spacing: 0.08rem;
  margin-left: 0.04rem;
  text-transform: uppercase;
}
.gp-sec-more {
  margin-left: auto;
  font-size: 0.2rem;
  color: var(--g-text-2);
  display: flex;
  align-items: center;
  gap: 0.04rem;
}
.gp-sec-more::after {
  content: "›";
  font-size: 0.3rem;
  line-height: 1;
}

/* ---------- notice ---------- */
.gp-notice {
  display: flex;
  align-items: center;
  gap: 0.14rem;
  height: 0.62rem;
  margin: 0.24rem 0.3rem 0;
  padding: 0 0.2rem;
  border-radius: 0.5rem;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.14), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.28);
  overflow: hidden;
}
.gp-notice-tag {
  flex-shrink: 0;
  padding: 0.06rem 0.14rem;
  border-radius: 0.3rem;
  background: var(--g-grad-hot);
  color: #fff;
  font-size: 0.18rem;
  font-weight: 800;
}
.gp-notice-bd {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.gp-notice-bd p {
  display: inline-block;
  padding-left: 100%;
  font-size: 0.21rem;
  color: #1d4ed8;
  animation: gp-marquee 16s linear infinite;
}
@keyframes gp-marquee {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); }
}

/* ---------- banner ---------- */
.gp-banner {
  margin: 0.24rem 0.3rem 0;
  position: relative;
}
.gp-banner .swiper-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 = 9 / 16 */
  border-radius: 0.28rem;
  overflow: hidden;
  box-shadow: 0 0.1rem 0.32rem rgba(30, 64, 175, 0.18), 0 0 0 1px var(--g-border-strong);
}
.gp-banner .swiper-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.gp-banner .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gp-banner .swiper-pagination {
  bottom: 0.12rem !important;
}
.gp-banner .swiper-pagination-bullet {
  width: 0.08rem;
  height: 0.08rem;
  background: rgba(255, 255, 255, 0.8);
  opacity: 0.65;
  margin: 0 0.04rem !important;
}
.gp-banner .swiper-pagination-bullet-active {
  width: 0.28rem;
  border-radius: 0.08rem;
  opacity: 1;
  background: var(--g-blue);
}

/* ---------- quick entries ---------- */
.gp-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.16rem;
  margin: 0.3rem 0.3rem 0;
}
.gp-quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  padding: 0.22rem 0 0.18rem;
  border-radius: 0.22rem;
  background: #fff;
  border: 1px solid var(--g-border);
  box-shadow: var(--g-shadow);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.gp-quick-item:active {
  transform: scale(0.95);
}
.gp-quick-logo {
  width: 0.88rem;
  height: 0.88rem;
  display: block;
  border-radius: 0.26rem;
  box-shadow: 0 0.06rem 0.16rem rgba(30, 64, 175, 0.18);
}
.gp-quick-item > span {
  font-size: 0.2rem;
  color: var(--g-text-2);
}

/* ---------- tabs (精品 / 买断) ---------- */
.gp-tabs {
  position: relative;
  margin: 0.36rem 0.3rem 0;
}
.gp-tabs-hd {
  display: flex;
  padding: 0.06rem;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px solid var(--g-border);
}
.gp-tabs-hd .gp-tabs-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0.6rem;
  margin: 0 !important;
  text-align: center;
  line-height: 1;
  font-size: 0.24rem;
  color: var(--g-text-2);
  border-radius: 0.5rem;
  background: none;
  opacity: 1;
  vertical-align: middle;
  transition: color 0.2s, background 0.2s;
}
.gp-tabs-hd .gp-tabs-item.swiper-pagination-bullet-active {
  color: #fff;
  font-weight: 700;
  background: var(--g-grad-hot);
  box-shadow: 0 0.06rem 0.18rem rgba(59, 130, 246, 0.35);
}
.gp-tabs-bd {
  margin-top: 0.26rem;
}
.gp-grid {
  display: grid;
  /* minmax(0,1fr) prevents large images from stretching a column */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.2rem 0.16rem;
  /* breathing room so logo shadows aren't cut by swiper's overflow:hidden */
  padding: 0.06rem 0.1rem;
}
.gp-game {
  position: relative;
  min-width: 0; /* allow shrink inside grid track */
  text-align: center;
}
.gp-game-logo {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  height: 0;
  cursor: pointer;
}
.gp-game-logo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0.22rem;
  border: 1px solid var(--g-border);
  /* shadow lives on the rounded img so it isn't clipped by the container */
  box-shadow: 0 0.05rem 0.16rem rgba(30, 64, 175, 0.16);
}
.gp-game-badge {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.04rem 0.12rem;
  border-radius: 0.18rem 0 0.18rem 0;
  background: var(--g-grad-hot);
  color: #fff;
  font-size: 0.15rem;
  font-weight: 800;
}
.gp-game-name {
  margin: 0.1rem 0 0.12rem;
  font-size: 0.2rem;
  color: var(--g-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gp-game-btn {
  display: block;
  width: 100%;
  padding: 0.09rem 0;
  border-radius: 0.3rem;
  font-size: 0.18rem;
  color: var(--g-cyan);
  border: 1px solid rgba(2, 132, 199, 0.45);
  background: rgba(2, 132, 199, 0.08);
}
.gp-game-btn:active {
  color: #fff;
  background: var(--g-cyan);
}

/* ---------- ranked list ---------- */
.gp-rank-tabs {
  display: flex;
  gap: 0.3rem;
  margin: 0.38rem 0.3rem 0.22rem;
  border-bottom: 1px solid var(--g-border);
}
.gp-rank-tab {
  position: relative;
  padding: 0 0.02rem 0.16rem;
  font-size: 0.26rem;
  color: var(--g-text-3);
  font-weight: 700;
}
.gp-rank-tab.act {
  color: var(--g-blue);
}
.gp-rank-tab.act::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translateX(-50%);
  width: 0.36rem;
  height: 0.05rem;
  border-radius: 0.05rem;
  background: var(--g-grad-hot);
  box-shadow: 0 0 0.1rem rgba(59, 130, 246, 0.45);
}
.gp-rank-wrap {
  margin: 0 0.3rem;
}
.gp-item {
  position: relative;
  display: flex;
  gap: 0.22rem;
  align-items: center;
  padding: 0.22rem 0.2rem;
  margin-bottom: 0.16rem;
  border-radius: 0.22rem;
  background: #fff;
  border: 1px solid var(--g-border);
  box-shadow: var(--g-shadow);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.gp-item:active {
  transform: scale(0.985);
  border-color: var(--g-border-strong);
  background: var(--g-surface);
}
.gp-item-logo {
  flex-shrink: 0;
  width: 1.18rem;
  height: 1.18rem;
  border-radius: 0.18rem;
  overflow: hidden;
  background: var(--g-bg-2);
  border: 1px solid var(--g-border-strong);
  box-shadow: 0 0.08rem 0.18rem rgba(30, 64, 175, 0.14);
}
.gp-item-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gp-item-main {
  flex: 1;
  min-width: 0;
}
.gp-item-name {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.26rem;
  font-weight: 700;
  color: var(--g-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-item-tag {
  flex-shrink: 0;
  padding: 0.02rem 0.1rem;
  border-radius: 0.06rem;
  font-size: 0.15rem;
  font-weight: 700;
  color: #fff;
  background: var(--g-grad-hot);
}
.gp-item-tag.cool { background: var(--g-grad-cool); }
.gp-item-count {
  margin-top: 0.08rem;
  font-size: 0.18rem;
  color: var(--g-text-3);
}
.gp-item-count b {
  color: var(--g-gold);
  font-weight: 700;
}
.gp-item-desc {
  margin-top: 0.08rem;
  font-size: 0.18rem;
  color: var(--g-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-item-btn {
  flex-shrink: 0;
  min-width: 1.12rem;
  height: 0.6rem;
  padding: 0 0.2rem;
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  font-size: 0.22rem;
  font-weight: 700;
  color: #fff;
  background: var(--g-grad-hot);
  box-shadow: 0 0.06rem 0.18rem rgba(59, 130, 246, 0.32);
}
.gp-item-btn img {
  width: 0.24rem;
  filter: brightness(0) invert(1);
}
.gp-item-btn:active {
  filter: brightness(1.08);
}

/* ---------- load more ---------- */
.gp-more {
  display: flex;
  justify-content: center;
  padding: 0.3rem 0 0.5rem;
}
.gp-more label {
  padding: 0.14rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.22rem;
  color: var(--g-blue);
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: #fff;
  cursor: pointer;
}
.gp-more label:active {
  color: #fff;
  background: var(--g-blue);
}

/* ---------- footer ---------- */
.gp-footer {
  padding: 0.3rem 0.3rem 0.4rem;
  text-align: center;
  border-top: 1px solid var(--g-border);
  background: rgba(255, 255, 255, 0.55);
}
.gp-footer p {
  font-size: 0.18rem;
  line-height: 1.8;
  color: var(--g-text-3);
}
.gp-footer a {
  color: var(--g-text-3);
}
.gp-footer .gp-footer-logo {
  height: 0.26rem;
  vertical-align: middle;
}

/* ---------- helpers (existing overlays restyled) ---------- */
.mobile .add-screen {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--g-border);
  box-shadow: 0 0.1rem 0.4rem rgba(30, 64, 175, 0.2);
  color: var(--g-text);
}
.mobile .add-screen .text.android,
.mobile .add-screen .add-btn {
  color: var(--g-cyan);
}
.mobile .add-screen .add-btn {
  border-color: var(--g-cyan);
}

/* neutralise old container backgrounds so theme shows */
.gp .main-wrap,
.gp .main-body,
.gp .main-content {
  background: transparent !important;
}
/* hide legacy dark tile background on desktop */
.gp .bg-fixed {
  display: none !important;
}
