.ranking-page .card {
  --card-accent: #b295ff;
  --card-image: url(harbour-night.jpg);
  --card-position: 72% 57%;
  background-image: linear-gradient(105deg,#131126ef 22%,#17112be3 68%,#25183ba6),var(--card-image);
  background-position: center,var(--card-position);
  background-size: cover;
  border-color: color-mix(in srgb,var(--card-accent) 51%,#292641);
}
.ranking-page .card:nth-child(3n+1) { --card-accent:#ffcc73; --card-position:90% 66%; }
.ranking-page .card:nth-child(3n+2) { --card-accent:#68eaff; --card-position:86% 75%; }
.ranking-page .card:nth-child(3n+3) { --card-accent:#ff84e7; --card-position:96% 86%; }
.ranking-page .card:nth-child(-n+3) {
  --card-image:url(harbour-stage.jpg);
  background-image:linear-gradient(160deg,#170e2a5e,#141124e8 73%),var(--card-image);
}
.ranking-page .card:nth-child(n+4) {
  background-image:linear-gradient(105deg,#131126ef 22%,#17112beb 67%,#25183ba9),var(--card-image);
}
.ranking-page .card:is(:hover,:focus-within) {
  border-color:var(--card-accent);
  box-shadow:0 0 25px color-mix(in srgb,var(--card-accent) 36%,transparent);
}
.ranking-page .card::after {
  content:"";
  position:absolute;
  pointer-events:none;
  inset:0 auto 0 0;
  width:2px;
  background:linear-gradient(180deg,transparent,var(--card-accent),transparent);
  opacity:.65;
}
.ranking-page .visit .button { transition:background .2s,box-shadow .2s,filter .2s; }
.ranking-page .visit .button:is(:hover,:focus-visible) { box-shadow:0 0 20px color-mix(in srgb,var(--card-accent) 55%,transparent); }
.ranking-page .logo[data-brand]:not(:has(img)) {
  background:url(platform-marks.png) var(--mark-x,0%) var(--mark-y,0%)/300% 300% no-repeat;
  border-color:#c1b2dd65;
}
.ranking-page .logo[data-brand]:not(:has(img))::before { content:none; }
.ranking-page .logo[data-brand="88TVB"] { --mark-x:50%; }
.ranking-page .logo[data-brand="852WIN"] { --mark-x:100%; }
.ranking-page .logo[data-brand="78HK"] { --mark-y:50%; }
.ranking-page .logo[data-brand="33ONE"] { --mark-x:50%; --mark-y:50%; }
.ranking-page .logo[data-brand="DGFUN"] { --mark-x:100%; --mark-y:50%; }
.ranking-page .logo[data-brand="BCBC8"] { --mark-y:100%; }
.ranking-page .logo[data-brand="BCBC6"] { --mark-x:50%; --mark-y:100%; }
.ranking-page .logo[data-brand="和信娛樂"] { --mark-x:100%; --mark-y:100%; }
.ranking-page footer {
  background:linear-gradient(105deg,#171128eb,#171128ce),url(harbour-stage.jpg) right 86%/cover;
  box-shadow:inset 0 1px #b57cff44;
  transition:border-color .25s;
}
.ranking-page footer:hover { border-color:#aa87d8; }
@media(prefers-reduced-motion:reduce) {
  .ranking-page .visit .button,.ranking-page footer { transition:none; }
}

/* Full-width black and gold landing page */
html:has(body.ranking-page), body.ranking-page {margin:0; background:#090807;}
body.ranking-page {color:#fff2d7;}
.ranking-page main {width:100%; max-width:none; margin:0; padding:0;}
.ranking-page main > .hero {
  position:relative; isolation:isolate; display:flex; flex-direction:column;
  justify-content:center; align-items:flex-start; overflow:hidden; box-sizing:border-box;
  min-height:clamp(490px,50vw,700px); gap:20px; margin:0; border:0; border-radius:0;
  padding:72px max(6vw,calc((100% - 1240px)/2)); text-align:left;
  background:#0b0906; box-shadow:none;
}
.ranking-page main > .hero::before {
  content:''; position:absolute; inset:0; z-index:-2; width:auto; height:auto;
  border:0; border-radius:0; opacity:1; box-shadow:none; transform:none; animation:none;
  background:url('harbour-stage.jpg') right center / cover no-repeat;
  filter:grayscale(1) sepia(1) saturate(1.75) contrast(1.12);
}
.ranking-page main > .hero::after {
  content:''; position:absolute; inset:0; z-index:-1; width:auto; height:auto; opacity:1;
  pointer-events:none; border:0; box-shadow:none; transform:none; animation:none;
  background:linear-gradient(0deg,#090807 0%,transparent 30%),linear-gradient(90deg,#090705 1%,#0a0806ed 26%,#110b05b8 48%,#140d0410 84%);
}
.ranking-page main > .hero h1 {
  position:relative; box-sizing:border-box; margin:0; width:auto; max-width:6.15em;
  font-size:clamp(3.45rem,7.2vw,7.3rem); font-weight:900; line-height:1.05;
  letter-spacing:-.045em; color:#ffe1a1; text-shadow:none;
  background:linear-gradient(175deg,#fff8df 3%,#ffe5a0 35%,#e6a63e 78%,#ffd982);
  background-clip:text; -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 4px 3px #130b03) drop-shadow(0 0 24px #ffbe493b);
}
.ranking-page main > .hero p {margin:0; padding:0; background:none; border:0; box-shadow:none; color:#f8e8c7; font-size:clamp(.84rem,1.4vw,1.12rem); text-shadow:0 2px 4px #000;}
.ranking-page main > .hero .hero-link,
.ranking-page .ranking .card:nth-child(n) .visit .button {
  box-sizing:border-box; border:1px solid #ffe3a6; border-radius:6px;
  color:#211404; background:linear-gradient(116deg,#c98b32,#ffe3a1 48%,#e8ad4c);
  font-weight:800; text-shadow:none; box-shadow:0 7px 25px #ea9f2f33;
}
.ranking-page main > .hero .hero-link {margin:8px 0 0; padding:14px 24px; animation:gold-opening-light 1.4s ease-out both;}
@keyframes gold-opening-light {0% {box-shadow:0 0 0 #ffc36700;} 50% {box-shadow:0 0 32px #ffc367a0;} 100% {box-shadow:0 7px 25px #ea9f2f33;}}
.ranking-page main > #platforms {box-sizing:border-box; width:min(1240px,calc(100% - 2 * max(24px,6vw))); margin:0 auto; padding:26px 0 12px; border-top:1px solid #b68135;}
.ranking-page #platforms .ranking {display:grid; width:100%; max-width:none; margin:0; padding:0; gap:12px; grid-template-columns:minmax(0,1fr); list-style:none;}
.ranking-page #platforms .ranking .card:nth-child(n) {
  box-sizing:border-box; grid-area:auto; display:grid; grid-template:none / 58px 65px minmax(0,1fr) minmax(138px,18%);
  align-items:center; justify-items:stretch; gap:18px; min-width:0; min-height:0; margin:0; padding:19px 22px;
  border:1px solid #65502c; border-radius:8px; background:linear-gradient(105deg,#251a0c,#14100c 35%,#0e0c09);
  box-shadow:none; transform:none; animation:none; --card-accent:#d1a151;
}
.ranking-page #platforms .ranking .card:nth-child(-n+3) {border-left:3px solid #e3aa51; padding-left:20px;}
.ranking-page #platforms .ranking .card:nth-child(n)::before,
.ranking-page #platforms .ranking .card:nth-child(n)::after {content:none;}
.ranking-page #platforms .ranking .card:nth-child(n) > * {position:static; grid-area:auto; align-self:center; justify-self:stretch; transform:none; min-width:0; margin:0;}
.ranking-page #platforms .ranking .card:nth-child(n) > .rank {display:grid; place-items:center; width:auto; height:auto; padding:0; border:0; background:none; box-shadow:none; color:#f2c66f; font-size:clamp(1.65rem,3vw,2.65rem); line-height:1; font-variant-numeric:tabular-nums;}
.ranking-page #platforms .ranking .card:nth-child(n) > .logo {display:grid; width:65px; height:65px; border:1px solid #977340; border-radius:8px; background:#100d09; box-shadow:none;}
.ranking-page #platforms .ranking .card:nth-child(n) > .info {padding:0; width:auto;}
.ranking-page #platforms .card .info h3 {margin:0 0 6px; color:#ffe3aa; font-size:1.28rem; overflow-wrap:anywhere;}
.ranking-page #platforms .card .info p {margin:0 0 7px; color:#e6d8bf;}
.ranking-page #platforms .card .tags span {color:#e6c485; border:1px solid #644c27; background:#20170c;}
.ranking-page #platforms .ranking .card:nth-child(n) > .visit {display:grid; width:auto; gap:7px; text-align:center;}
.ranking-page #platforms .card .visit small,.ranking-page main > footer {color:#d8c4a1;}
.ranking-page main > footer {width:min(1240px,calc(100% - 48px)); margin:22px auto; background:#120e09; border:1px solid #584120;}
@media(max-width:700px) {
  .ranking-page main > .hero {min-height:440px; padding:56px 22px; gap:14px;}
  .ranking-page main > .hero h1 {font-size:clamp(2.75rem,10vw,4.1rem);}
  .ranking-page main > .hero::before {background-position:63% center;}
  .ranking-page main > #platforms {width:calc(100% - 28px); padding-top:16px;}
  .ranking-page #platforms .ranking .card:nth-child(n) {grid-template-columns:42px 51px minmax(0,1fr); gap:12px; padding:13px;}
  .ranking-page #platforms .ranking .card:nth-child(n) > .logo {width:51px; height:51px;}
  .ranking-page #platforms .ranking .card:nth-child(n) > .visit {grid-column:1 / -1;}
}
@media(prefers-reduced-motion:reduce) {.ranking-page main > .hero .hero-link {animation:none;}}

.ranking-page #platforms .ranking .card:nth-child(n) > .logo {position:relative; overflow:hidden;}
.ranking-page #platforms .ranking .card:nth-child(n) > .logo img {display:block; position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#100d09;}

/* Preserve the horizontal proportions of the brand logos. */
.ranking-page #platforms .ranking .card:nth-child(n) {
  grid-template-columns:58px 152px minmax(0,1fr) minmax(138px,18%);
}
.ranking-page #platforms .ranking .card:nth-child(n) > .logo {
  width:152px; height:60px; border-color:#725b37;
}
.ranking-page #platforms .ranking .card:nth-child(n) > .logo img {
  box-sizing:border-box; padding:4px 6px;
}
@media(max-width:700px) {
  .ranking-page #platforms .ranking .card:nth-child(n) {
    grid-template-columns:36px minmax(0,1fr);
  }
  .ranking-page #platforms .ranking .card:nth-child(n) > .rank {grid-column:1;}
  .ranking-page #platforms .ranking .card:nth-child(n) > .logo {grid-column:2; width:min(152px,100%); height:56px;}
  .ranking-page #platforms .ranking .card:nth-child(n) > .info {grid-column:1 / -1;}
}

/* Compact masthead and distinct treatment for the first three ranks. */
.ranking-page main > .hero {
  min-height:clamp(230px,23vw,345px); padding-block:32px; gap:12px;
}
.ranking-page main > .hero::before {background-position:right 55%;}
.ranking-page main > .hero h1 {max-width:none; font-size:clamp(2rem,4.3vw,4.75rem); letter-spacing:-.035em;}
.ranking-page main > .hero .hero-link {margin-top:3px; padding:9px 17px;}
.ranking-page main > #platforms {padding-top:14px;}
.ranking-page #platforms .ranking .card:nth-child(-n+3) {
  border:1px solid var(--medal); border-left-width:4px; padding-left:19px;
  background:linear-gradient(100deg,var(--medal-shade),#16110d 53%,#100d0a);
  box-shadow:inset 0 1px var(--medal-shine),0 3px 16px var(--medal-glow);
}
.ranking-page #platforms .ranking .card:nth-child(1) {--medal:#efbc61; --medal-shade:#513411; --medal-shine:#ffe7a171; --medal-glow:#f7ae332b;}
.ranking-page #platforms .ranking .card:nth-child(2) {--medal:#c1c9d1; --medal-shade:#343c43; --medal-shine:#e7edf469; --medal-glow:#acbac01c;}
.ranking-page #platforms .ranking .card:nth-child(3) {--medal:#ce936b; --medal-shade:#48291c; --medal-shine:#ffc39a55; --medal-glow:#f7a87c20; margin-bottom:10px;}
.ranking-page #platforms .ranking .card:nth-child(-n+3) > .rank {
  width:52px; height:52px; justify-self:center; border:1px solid var(--medal);
  border-radius:50%; background:linear-gradient(145deg,var(--medal-shade),#110e0a);
  color:var(--medal); font-size:1.8rem; text-shadow:none; box-shadow:0 0 15px var(--medal-glow);
}
.ranking-page #platforms .ranking .card:nth-child(-n+3) .info h3 {font-size:1.42rem; color:var(--medal);}
.ranking-page #platforms .ranking .card:nth-child(n+4) > .rank {font-size:1.6rem; color:#c3a573; text-shadow:none;}
@media(max-width:700px) {
  .ranking-page main > .hero {min-height:205px; padding:24px 17px; gap:9px;}
  .ranking-page main > .hero h1 {font-size:clamp(1.65rem,6vw,2.7rem);}
  .ranking-page main > #platforms {padding-top:10px;}
  .ranking-page #platforms .ranking .card:nth-child(-n+3) {padding-left:11px;}
  .ranking-page #platforms .ranking .card:nth-child(-n+3) > .rank {width:35px; height:35px; font-size:1.17rem;}
}

/* Animated foil banners with readable live content. */
.ranking-page #platforms .ranking .card:nth-child(n) {
  isolation:isolate; overflow:hidden; --ribbon:#eab553;
  background:radial-gradient(ellipse at 14% 95%,#5d3817 0%,transparent 49%),linear-gradient(105deg,#211409,#100d0b 70%);
}
.ranking-page #platforms .ranking .card:nth-child(-n+3) {
  --ribbon:var(--medal);
  background:radial-gradient(ellipse at 17% 87%,var(--medal-shade),transparent 66%),linear-gradient(104deg,#231b14,#0f0c09 76%);
}
.ranking-page #platforms .ranking .card:nth-child(n)::before {
  content:''; position:absolute; inset:0; width:auto; height:auto; z-index:-1; opacity:.9; pointer-events:none;
  background:linear-gradient(112deg,transparent 21%,color-mix(in srgb,var(--ribbon) 18%,transparent) 36%,color-mix(in srgb,var(--ribbon) 72%,transparent) 46%,transparent 54%) -120% 0 / 58% 100% no-repeat;
  animation:foil-sweep 5.8s linear infinite; animation-delay:calc(var(--phase,0) * -.53s);
}
.ranking-page #platforms .ranking .card:nth-child(n)::after {
  content:''; position:absolute; inset:0; z-index:-1; pointer-events:none; width:auto; height:auto;
  background:linear-gradient(91deg,transparent,var(--ribbon),transparent) 0 0 / 100% 2px no-repeat,
    linear-gradient(91deg,transparent,var(--ribbon),transparent) 0 100% / 100% 2px no-repeat,
    radial-gradient(circle at 5% 18%,#fff9d8 0 1px,transparent 4px),radial-gradient(circle at 33% 81%,var(--ribbon) 0 1px,transparent 5px),radial-gradient(circle at 74% 28%,var(--ribbon) 0 2px,transparent 5px),radial-gradient(circle at 92% 84%,#fff9d8 0 1px,transparent 4px);
  animation:foil-glow 3.3s ease-in-out infinite alternate; animation-delay:calc(var(--phase,0) * -.36s);
}
.ranking-page #platforms .ranking .card:nth-child(3n+1) {--phase:1;}
.ranking-page #platforms .ranking .card:nth-child(3n+2) {--phase:3;}
.ranking-page #platforms .ranking .card:nth-child(3n) {--phase:5;}
.ranking-page #platforms .ranking .card:nth-child(n) > .logo {box-shadow:0 0 24px color-mix(in srgb,var(--ribbon) 31%,transparent);}
.ranking-page #platforms .ranking .card:nth-child(n) > .info {text-shadow:0 2px 5px #000;}
@keyframes foil-sweep {0% {background-position:-120% 0;} 63%,100% {background-position:270% 0;}}
@keyframes foil-glow {from {opacity:.30;} to {opacity:.94;}}
@media(prefers-reduced-motion:reduce) {
  .ranking-page #platforms .ranking .card:nth-child(n)::before,.ranking-page #platforms .ranking .card:nth-child(n)::after {animation:none; opacity:.42;}
}

/* Make the first three rows easy to compare at a glance. */
.ranking-page main > .hero {min-height:clamp(190px,18vw,265px);padding-block:22px;gap:9px;}
.ranking-page main > #platforms {padding-top:9px;}
.ranking-page #platforms .ranking-note {margin:0 0 8px;color:#d3c3a8;font-size:.79rem;line-height:1.4;}
.ranking-page #platforms .ranking {gap:9px;}
.ranking-page #platforms .ranking .card:nth-child(n) {gap:12px;padding-block:10px;}
.ranking-page #platforms .ranking .card .info h3 {margin-bottom:2px;}
.ranking-page #platforms .ranking .card .info p {margin-bottom:4px;font-size:.83rem;line-height:1.42;}
.ranking-page #platforms .ranking .card .info .offer {color:#f3d38b;font-size:.94rem;font-weight:760;overflow-wrap:anywhere;}
.ranking-page #platforms .ranking .card:nth-child(-n+3) .info .offer {color:var(--medal);font-size:clamp(.94rem,1.35vw,1.13rem);}
.ranking-page #platforms .offer small {font-size:.75rem;color:#c9b99e;font-weight:400;white-space:normal;}
.ranking-page #platforms .ranking .card:nth-child(n+4) {background:#15110c;box-shadow:none;}
.ranking-page #platforms .ranking .card:nth-child(n+4)::before,.ranking-page #platforms .ranking .card:nth-child(n+4)::after {content:none;animation:none;}
.ranking-page #platforms .ranking .card:nth-child(n+4) > .logo {box-shadow:none;}
.ranking-page #platforms .ranking .card:nth-child(n+4) .visit .button {background:#21190e;color:#e8c77f;border-color:#806335;box-shadow:none;}
.ranking-page #platforms .ranking .card:nth-child(-n+3)::before {background-size:58% 2px;}
.ranking-page #platforms .ranking .card:nth-child(-n+3)::after {background:linear-gradient(91deg,transparent,var(--ribbon),transparent) 0 100% / 100% 2px no-repeat;}
.ranking-page #platforms .ranking .card:nth-child(-n+3) > .logo {animation:foil-logo-light 3.4s ease-in-out infinite alternate;}
@keyframes foil-logo-light {from {box-shadow:0 0 5px var(--medal-glow);} to {box-shadow:0 0 19px color-mix(in srgb,var(--medal) 46%,transparent);}}
@media(max-width:700px) {
  .ranking-page main > .hero {min-height:175px;padding-block:18px;}
  .ranking-page #platforms .ranking .card:nth-child(n) {gap:8px;}
}
@media(prefers-reduced-motion:reduce) {
  .ranking-page #platforms .ranking .card:nth-child(-n+3) > .logo {animation:none;}
}

/* Keep the offer and brand legible against a consistent dark surface. */
.ranking-page main > .hero h1 {background-image:linear-gradient(175deg,#fff4d7,#e8c685);filter:drop-shadow(0 3px 6px #130b03);}
.ranking-page #platforms .ranking .card:nth-child(n) {background:#141210;}
.ranking-page #platforms .ranking .card:nth-child(-n+3) {background:#141210;border-color:#423b31;border-left-color:var(--medal);box-shadow:0 0 11px var(--medal-glow);}
.ranking-page #platforms .ranking .card:nth-child(n) .info h3 {color:#fff0d4;}
.ranking-page #platforms .ranking .card:nth-child(n) .info .offer {color:#ffe1a0;}
.ranking-page #platforms .ranking .card .info .platform-summary {margin:4px 0 0;color:#d2c6b6;}
.ranking-page #platforms .ranking .card:nth-child(n) .visit .button {background:#1d1811;color:#e9ca88;border-color:#8c6a37;box-shadow:none;}
.ranking-page #platforms .ranking .card:nth-child(n) .visit .button:is(:hover,:focus-visible) {background:#e8c37b;color:#211404;border-color:#ffe3a6;box-shadow:0 0 14px #ffc56848;}
