/* Gamebox V8 visual layer (BOX_VISUAL_BUILD_20261107; owner approved the 8-point drafts 11-07 00:43).
   Presentation only: home = full-bleed key-art carousel + one brand-gold button; market = the game's
   own quality frame and icon kept, only the well plate changes, plus a product banner on Chợ Ngày;
   member tiers = metal cards. Loaded after ui-v2.css (see the boot shim), same specificity, so this
   file wins on order. Removing the <link> restores the r20 look; app.js markup stays valid without it. */

:root {
  --v8-bg: var(--v2-bg, #0b0f1a);
  --v8-gold: #e8c27a;
  --v8-gold-hi: #f6dc9c;
  --v8-line: rgba(232, 194, 122, .16);
}

/* ---------- 1. home hero ---------------------------------------------------- */
html[data-v8-home-hero] body[data-view="home"] main,
html[data-v8-home-hero] body[data-view="home"] #view-home { overflow: visible; }

html[data-v8-home-hero]:not([data-v8-scrolled]) body[data-view="home"] .site-topbar {
  /* no border: a transparent border would repeat the gradient's dark top edge as a 1px line */
  border-bottom-width: 0;
  background: linear-gradient(180deg, rgba(7, 10, 20, .82) 0%, rgba(7, 10, 20, .45) 55%, rgba(7, 10, 20, 0) 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-v8-home-hero] body[data-view="home"] .site-topbar { transition: background-color .2s ease; }
html[data-v8-home-hero]:not([data-v8-scrolled]) body[data-view="home"] .brand-mark small { text-shadow: 0 1px 6px rgba(0, 0, 0, .75); }
html[data-v8-home-hero] body:not(.member-session) .site-shell::before { display: none; }

html[lang] #valueHero .v8-hero {
  position: relative;
  height: 560px;
  margin: calc(-72px - env(safe-area-inset-top, 0px)) calc(-1 * var(--shell-pad, 16px)) 0;
  overflow: hidden;
  background: var(--v8-bg);
}
html[lang] .v8-slides { position: absolute; inset: 0; }
html[lang] .v8-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; }
html[lang] .v8-slide.is-on { opacity: 1; }
html[lang] .v8-slide picture, html[lang] .v8-slide img { display: block; width: 100%; height: 100%; }
html[lang] .v8-slide img { object-fit: cover; object-position: 50% 0; }
html[lang] .v8-hero::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 15, 26, 0) 52%, rgba(11, 15, 26, .78) 74%, var(--v8-bg) 100%);
  content: "";
}
html[lang] .v8-hero-copy { position: absolute; right: 20px; bottom: 18px; left: 20px; z-index: 2; }
html[lang] .v8-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--v8-gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
}
html[lang] .v8-eyebrow::before { width: 18px; height: 1px; background: var(--v8-gold); opacity: .8; content: ""; }
html[lang] #valueHero .v8-hero h1 {
  margin: 8px 0 18px;
  color: #f4efe6;
  font: 800 31px/1.13 "Be Vietnam Pro", Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.02em;
  text-align: left;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .55);
}
html[lang] #valueHero .v8-hero h1 em {
  font-style: normal;
  background: linear-gradient(180deg, #fff0c2 10%, #f2c766 60%, #d9a24a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[lang] .v8-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  color: #2a1a05;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8e2a8 0%, #e8c27a 45%, #c9974a 100%);
  box-shadow: 0 10px 26px -10px rgba(232, 170, 80, .75), inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -2px 0 rgba(120, 70, 10, .25);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  cursor: pointer;
}
html[lang] .v8-cta:active { transform: scale(.98); }
html[lang] .v8-cta svg { width: 20px; height: 20px; }
html[lang] .v8-dots { display: flex; align-items: center; gap: 10px; padding: 12px 4px 0; color: var(--v2-muted, #9aa3b8); font-size: 11px; }
html[lang] .v8-dots button {
  width: 6px;
  height: 6px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, .22);
  transition: width .3s, background-color .3s;
  cursor: pointer;
}
/* a 6px dot is too small to hit: widen the target without changing the drawing */
html[lang] .v8-dots button { position: relative; }
html[lang] .v8-dots button::after { position: absolute; inset: -10px -4px; content: ""; }
html[lang] .v8-dots button.is-on { width: 22px; background: var(--v8-gold); }
html[lang] .v8-dots span { margin-left: auto; color: #f4efe6; font-weight: 600; }

/* game cards on the home page (the drawer behind data-detail is unchanged) */
html[lang] .home-game-list:has(.v8-game-card) { gap: 14px; }
html[lang] .home-game-row.v8-game-card {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 16px;
  background: #141b30;
}
html[lang] .v8-game-art { position: relative; display: block; aspect-ratio: 2.113 / 1; overflow: hidden; }
html[lang] .v8-game-art picture, html[lang] .v8-game-art img { display: block; width: 100%; height: 100%; }
html[lang] .v8-game-art img { object-fit: cover; object-position: 50% 30%; }
html[lang] .v8-game-art::after {
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(20, 27, 48, 0), rgba(20, 27, 48, .85));
  content: "";
}
html[lang] .v8-game-meta { display: flex; align-items: center; gap: 12px; padding: 12px 14px 14px; }
html[lang] .v8-game-meta > span { flex: 1; min-width: 0; }
html[lang] .v8-game-meta strong { display: block; font-size: 15px; font-weight: 700; }
html[lang] .v8-game-meta small { display: block; margin: 2px 0 0; color: var(--v2-muted, #9aa3b8); font-size: 11px; }
html[lang] .v8-game-meta > svg {
  width: 32px;
  height: 32px;
  padding: 8px;
  color: var(--v8-gold);
  border: 1px solid var(--v8-line);
  border-radius: 16px;
}

/* claim-code box + landing copy + perks, now below the game cards */
html[lang] .v8-code-slot { margin: 18px 0 16px; }
html[lang] .v8-code-slot .landing-code-card { margin: 0; }
html[lang] .v8-landing-copy {
  margin: 14px 6px 0;
  color: var(--v2-muted, #9aa3b8);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

/* ---------- 2. market: game quality frame + original icon stay; only the plate changes ---------- */
html[lang] #view-benefits .reward-icon-shell,
html[lang] .v2-slot-icon {
  border: 0;
  overflow: visible;
  background-color: #0b0f1c;
  background-image:
    radial-gradient(circle at 50% 42%, rgba(var(--rc), .62) 0%, rgba(var(--rc), .30) 52%, rgba(var(--rc), .12) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 46%);
  background-blend-mode: normal;
  box-shadow:
    0 0 0 1.5px rgba(var(--rc), .9),
    0 0 0 3px rgba(0, 0, 0, .55),
    0 0 18px -2px rgba(var(--rc), .65),
    inset 0 2px 0 rgba(255, 255, 255, .22),
    inset 0 -6px 12px rgba(0, 0, 0, .35);
}
/* gold corner brackets of a game bag cell (the ::before is the game's own quality frame) */
html[lang] #view-benefits .reward-icon-shell::after,
html[lang] .v2-slot-icon::after {
  position: absolute;
  inset: -3px;
  z-index: 2;
  pointer-events: none;
  opacity: .85;
  background:
    linear-gradient(#f6dc9c, #f6dc9c) left top / 12px 2px no-repeat,
    linear-gradient(#f6dc9c, #f6dc9c) left top / 2px 12px no-repeat,
    linear-gradient(#f6dc9c, #f6dc9c) right bottom / 12px 2px no-repeat,
    linear-gradient(#f6dc9c, #f6dc9c) right bottom / 2px 12px no-repeat;
  content: "";
}

/* Chợ Ngày header carries the product's key art (TDM detail art approved by the owner 2026-11-07 01:08) */
html[lang] .v2-market-head {
  margin: -12px -12px 0;
  min-height: 104px;
  padding: 14px 14px 12px;
  align-items: flex-end;
  border-bottom: 1px solid var(--v8-line);
  border-radius: var(--v2-radius, 12px) var(--v2-radius, 12px) 0 0;
  background:
    linear-gradient(90deg, rgba(11, 15, 28, .94) 0%, rgba(11, 15, 28, .7) 48%, rgba(11, 15, 28, .08) 100%),
    url("./assets/gamebox/v8/thvd-detail-v8.jpg") 60% 22% / cover no-repeat;
}
html[lang] .v2-market:has([data-market-product="TDM"].is-on) .v2-market-head {
  background:
    linear-gradient(90deg, rgba(11, 15, 28, .94) 0%, rgba(11, 15, 28, .7) 48%, rgba(11, 15, 28, .08) 100%),
    url("./assets/gamebox/v8/tdm-detail-v8.jpg") 60% 22% / cover no-repeat;
}
html[lang] .v2-market:has([data-market-product="CTTQ"].is-on) .v2-market-head {
  background:
    linear-gradient(90deg, rgba(11, 15, 28, .94) 0%, rgba(11, 15, 28, .7) 48%, rgba(11, 15, 28, .08) 100%),
    url("./assets/gamebox/v8/cttq-detail-v8.jpg") 60% 22% / cover no-repeat;
}
html[lang] .v2-market-head h3 { font-size: 21px; font-weight: 800; }
html[lang] .v2-market-head + .v2-gameswitch { margin-top: 12px; }

/* ---------- 3. member tiers: metal cards ------------------------------------ */
html[lang] .tier-list { gap: 9px; }
html[lang] .tier-list .tier-card[data-level] {
  position: relative;
  overflow: hidden;
  padding: 11px 16px 10px;
  color: #1b1710;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 12px 24px -14px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .25);
}
html[lang] .tier-list .tier-card[data-level]::before {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0 0 3px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .26em;
  opacity: .75;
  content: "CANDY GAMEBOX";
}
html[lang] .tier-list .tier-card[data-level]::after {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  opacity: .45;
  content: "0" attr(data-level);
}
html[lang] .tier-list .tier-card[data-level] > * { position: relative; z-index: 1; }
html[lang] .tier-list .tier-card[data-level] .tier-dot { display: none; }
html[lang] .tier-list .tier-card[data-level] .tier-card-head { margin-bottom: 0; padding-right: 38px; }
html[lang] .tier-list .tier-card[data-level] .tier-card-head > b { flex-basis: 100%; color: inherit; font-size: 22px; letter-spacing: -.01em; }
html[lang] .tier-list .tier-card[data-level] .tier-from { color: inherit; font-size: 10.5px; font-weight: 600; opacity: .8; }
html[lang] .tier-list .tier-card[data-level] .tier-flag { background: rgba(0, 0, 0, .2); color: inherit; }
html[lang] .tier-list .tier-card[data-level] .tier-perks { margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(0, 0, 0, .14); gap: 5px 12px; }
html[lang] .tier-list .tier-card[data-level] .tier-perks dt { color: inherit; font-size: 9.5px; font-weight: 600; opacity: .72; }
html[lang] .tier-list .tier-card[data-level] .tier-perks dd { color: inherit; font-size: 13px; font-weight: 800; }
html[lang] .tier-list .tier-card[data-level] .tier-perks dd small { color: inherit; opacity: .7; }
html[lang] .tier-list .tier-card.is-current[data-level] { box-shadow: 0 0 0 2px var(--v8-gold-hi), 0 12px 24px -14px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .55); }

/* the fine diagonal brushing + one soft sheen, layered over each tier's metal */
html[lang] .tier-list .tier-card[data-level] {
  --v8-brush: repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 7px);
  --v8-sheen: linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, .28) 30%, transparent 42%);
}
html[lang] .tier-list .tier-card[data-level="1"] {
  padding: 10px 16px;
  color: #e8ecf3;
  background: linear-gradient(135deg, #2c3242, #1d2230 60%, #262c3b);
}
html[lang] .tier-list .tier-card[data-level="1"]::before,
html[lang] .tier-list .tier-card[data-level="1"]::after { display: none; }
html[lang] .tier-list .tier-card[data-level="1"] .tier-card-head { padding-right: 0; }
html[lang] .tier-list .tier-card[data-level="1"] .tier-card-head > b { font-size: 15px; }
html[lang] .tier-list .tier-card[data-level="1"] .tier-card-head > b { flex-basis: auto; }
html[lang] .tier-list .tier-card[data-level="1"] .tier-perks { border-top-color: rgba(255, 255, 255, .12); }
html[lang] .tier-list .tier-card[data-level="2"] { background: var(--v8-sheen), var(--v8-brush), linear-gradient(135deg, #d99a6a, #a7663c 45%, #e2ad7f 70%, #8c522c); }
html[lang] .tier-list .tier-card[data-level="3"] { background: var(--v8-sheen), var(--v8-brush), linear-gradient(135deg, #f1f3f6, #b8bec8 45%, #e9ecf1 70%, #9aa1ad); }
html[lang] .tier-list .tier-card[data-level="4"] { background: var(--v8-sheen), var(--v8-brush), linear-gradient(135deg, #fbe7b0, #d8a94f 45%, #f6d993 70%, #b27f2a); }
html[lang] .tier-list .tier-card[data-level="5"] { background: var(--v8-sheen), var(--v8-brush), linear-gradient(135deg, #eef6f7, #a9c3c9 45%, #e1eff1 70%, #7f9ea6); }
html[lang] .tier-list .tier-card[data-level="6"] { background: var(--v8-sheen), var(--v8-brush), linear-gradient(135deg, #e6f0ff, #8fb2ea 40%, #dfe9ff 65%, #b9a2ec 85%, #7f8fd6); }
html[lang] .tier-list .tier-card[data-level="7"] {
  color: #f3d48f;
  background: var(--v8-brush), linear-gradient(135deg, #2a2112, #0f0c08 50%, #3a2c12);
  box-shadow: inset 0 0 0 1px rgba(243, 212, 143, .5), 0 12px 24px -14px rgba(0, 0, 0, .9);
}
html[lang] .tier-list .tier-card[data-level="7"] .tier-perks { border-top-color: rgba(243, 212, 143, .25); }
html[lang] .tier-list .tier-card.is-reached[data-level] { opacity: .78; }

@media (prefers-reduced-motion: reduce) {
  html[lang] .v8-slide, html[lang] .v8-dots button { transition: none; }
}
