/* Gifts pages (gifts.php). Wild Rift, V5: segmented tabs (Skins / Passes / Keys), item cards with a rarity chip, the Hextech Keys stepper
   with its tier table. Every other game: the plain list (.nxgg-list). 2026-10-22 tidy: equal-height cards with the price and the button on
   one baseline, a lead card that fills the last row (no orphan, no dead cell), tabs that never wrap into a stair on phones, lighter borders.
   Mobile first, logical properties only (RTL twins), no layout shift: the active panel is chosen on the server (?type=) and every size is
   reserved. Panels are all visible without JS (noscript style in gifts.php). */
.nxwg {
  --nxwg-gold: #ffc642; --nxwg-epic: #b264ff; --nxwg-rare: #4ea2ff; --nxwg-common: #c4ccd8; --nxwg-pass: #45f882; --nxwg-keys: #5ccbff;
  --nxwg-line: rgba(255, 255, 255, .08); --nxwg-card: rgba(255, 255, 255, .025); --nxwg-accent: #45f882;
  margin-block: 16px 8px;
}
.nxwg-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--nxwg-line); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.nxwg-tab { flex: 1 1 0; min-inline-size: 0; display: flex; align-items: center; justify-content: center; gap: 8px; min-block-size: 44px; padding-inline: 8px; border-radius: 10px; color: rgba(255, 255, 255, .74); font-weight: 800; font-size: 14px; white-space: nowrap; text-decoration: none; transition: background .16s ease, color .16s ease; }
.nxwg-tab small { display: inline-grid; place-items: center; min-inline-size: 20px; block-size: 20px; padding-inline: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.nxwg-tab:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nxwg-tab.is-active { color: #07120b; background: var(--nxwg-accent); }
.nxwg-tab.is-active small { background: rgba(7, 18, 11, .16); }
.nxwg-tab:focus-visible, .nxwg-btn:focus-visible, .nxwg-chip:focus-visible, .nxwg-step:focus-visible, .nxwg-qty input:focus-visible, .nxgg-list .nxgg-card:focus-visible { outline: 2px solid var(--nxwg-accent); outline-offset: 2px; }

.nxwg-panel { display: none; margin-block-start: 16px; padding: 0 !important; } /* the legacy section{padding:70px!important} rule left a 70px hole above and below every tab panel */
.nxwg > .nxwg-panel { padding: 0 !important; } /* and the UI v2 :where(main section) padding (64px), which the line above ties with on specificity */
.nx-game-gifts .nxgg-page { padding-block: 8px 48px !important; } /* the page section: no 64px band between the game bar and the gift list */
.nxwg-panel.is-active { display: block; }
.nxwg-panel-title { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nxwg-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

/* Card: art + chip + name + one-line pitch, then price and button pinned to the bottom so every card in a row lines up. */
.nxwg-card { --nxwg-c: var(--nxwg-pass); position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: 1fr auto; grid-template-areas: "img body" "foot foot"; gap: 12px 16px; padding: 16px; border: 1px solid var(--nxwg-line); border-radius: 16px; background: var(--nxwg-card); transition: border-color .16s ease, background .16s ease; }
.nxwg-card:hover { border-color: color-mix(in srgb, var(--nxwg-c) 45%, transparent); background: rgba(255, 255, 255, .04); }
.nxwg-card[data-rarity="legendary"] { --nxwg-c: var(--nxwg-gold); }
.nxwg-card[data-rarity="epic"] { --nxwg-c: var(--nxwg-epic); }
.nxwg-card[data-rarity="rare"] { --nxwg-c: var(--nxwg-rare); }
.nxwg-card[data-rarity="common"] { --nxwg-c: var(--nxwg-common); }
.nxwg-card-img { grid-area: img; inline-size: 64px; block-size: 64px; border-radius: 12px; object-fit: cover; background: rgba(255, 255, 255, .04); box-shadow: 0 0 0 1px color-mix(in srgb, var(--nxwg-c) 50%, transparent); }
.nxwg-card-ico { display: grid; place-items: center; color: var(--nxwg-c); }
.nxwg-card-ico .nx-i { inline-size: 28px; block-size: 28px; }
.nxwg-card-body { grid-area: body; min-inline-size: 0; }
.nxwg-card-body h4 { margin: 8px 0 4px; color: #fff; font-size: 16px; line-height: 1.25; }
.nxwg-card-body h4 a { color: inherit; text-decoration: none; }
.nxwg-card-body h4 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.nxwg-card-body p { display: -webkit-box; margin: 0; overflow: hidden; color: rgba(255, 255, 255, .62); font-size: 13px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nxwg-badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: color-mix(in srgb, var(--nxwg-c) 15%, transparent); color: var(--nxwg-c); font-size: 10.5px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.nxwg-card-foot { grid-area: foot; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block-start: 12px; border-block-start: 1px solid var(--nxwg-line); }
.nxwg-price { color: #fff; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.nxwg-card .nxwg-btn { position: relative; z-index: 1; }

.nxwg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-block-size: 44px; padding-inline: 20px; border: 0; border-radius: 12px; background: var(--nxwg-accent); color: #07120b; font: inherit; font-size: 14px; font-weight: 900; text-decoration: none; cursor: pointer; transition: filter .16s ease, transform .16s ease; }
.nxwg-btn:hover { filter: brightness(1.08); color: #07120b; }
.nxwg-btn:active { transform: translateY(1px); }
.nxwg-btn--wide { inline-size: 100%; margin-block-start: 16px; }

/* Hextech Keys: one calm card, quick quantities on one row, the tier table as quiet rows with the active one tinted. */
.nxwg-keys { --nxwg-c: var(--nxwg-keys); padding: 16px; border: 1px solid var(--nxwg-line); border-radius: 16px; background: var(--nxwg-card); }
.nxwg-buy { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 16px; align-items: start; }
.nxwg-keys-img { inline-size: 80px; block-size: 80px; object-fit: contain; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.nxwg-buy-main h4 { margin: 0 0 12px; color: #fff; font-size: 17px; }
.nxwg-qty-label { display: block; margin-block-end: 8px; color: rgba(255, 255, 255, .62); font-size: 12px; font-weight: 700; }
.nxwg-qty { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; max-inline-size: 260px; }
.nxwg-qty input { inline-size: 100%; min-inline-size: 0; block-size: 44px; border: 1px solid var(--nxwg-line); border-radius: 10px; background: rgba(255, 255, 255, .05); color: #fff; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.nxwg-qty input::-webkit-outer-spin-button, .nxwg-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nxwg-step { block-size: 44px; border: 1px solid var(--nxwg-line); border-radius: 10px; background: rgba(255, 255, 255, .05); color: #fff; font-size: 20px; font-weight: 900; cursor: pointer; }
.nxwg-step:hover { border-color: var(--nxwg-accent); }
.nxwg-step:disabled { opacity: .35; cursor: default; }
.nxwg-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-block-start: 12px; max-inline-size: 360px; }
.nxwg-chip { min-block-size: 44px; padding-inline: 4px; border: 1px solid var(--nxwg-line); border-radius: 10px; background: rgba(255, 255, 255, .04); color: rgba(255, 255, 255, .82); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; }
.nxwg-chip:hover { border-color: var(--nxwg-accent); color: #fff; }
.nxwg-chip.is-on { border-color: var(--nxwg-accent); background: rgba(69, 248, 130, .12); color: #fff; }
.nxwg-per { margin: 16px 0 0; color: rgba(255, 255, 255, .62); font-size: 12.5px; font-weight: 700; }
.nxwg-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 0; }
.nxwg-sum div { min-block-size: 64px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.nxwg-sum dt { color: rgba(255, 255, 255, .62); font-size: 12px; font-weight: 700; }
.nxwg-sum dd { margin: 4px 0 0; color: #fff; font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }

.nxwg-tiers { margin-block-start: 24px; }
.nxwg-tiers h4 { margin: 0 0 8px; color: #fff; font-size: 14px; }
.nxwg-tiers table { inline-size: 100%; border: 0; border-collapse: separate; border-spacing: 0 4px; }
.nxwg-tiers th, .nxwg-tiers td { padding: 12px; border: 0; background: rgba(255, 255, 255, .03); color: rgba(255, 255, 255, .78); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: start; }
.nxwg-tiers thead th { padding-block: 0 4px; background: none; color: rgba(255, 255, 255, .55); font-size: 12px; }
.nxwg-tiers tbody th { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.nxwg-tiers tbody td { border-start-end-radius: 10px; border-end-end-radius: 10px; }
.nxwg-tiers td { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nxwg-here { display: none; padding: 2px 8px; border-radius: 999px; background: var(--nxwg-accent); color: #07120b; font-size: 10.5px; font-style: normal; font-weight: 900; }
.nxwg-tiers tr.is-active th, .nxwg-tiers tr.is-active td { background: rgba(69, 248, 130, .1); color: #fff; }
.nxwg-tiers tr.is-active .nxwg-here { display: inline-block; }
.nxwg-note { margin: 4px 0 0; color: rgba(255, 255, 255, .55); font-size: 12px; }
.nxwg-more { margin-block-start: 24px; }

/* The plain list (other games, and the extra Wild Rift services): the full name on two lines, the type as a chip, the price on the end. */
.nxgg-list .nxgg-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-block-size: 80px; }
.nxgg-list .nxgg-card-copy b { display: -webkit-box; overflow: hidden; white-space: normal; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nxgg-list .nxgg-card-copy small:not(:empty) { display: inline-block; margin-block-start: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .7); font-weight: 700; }
.nxgg-card-price { color: #fff; font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (min-width: 640px) {
  .nxwg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nxwg-tab { font-size: 15px; }
}
@media (min-width: 640px) and (max-width: 959px) {
  .nxwg-card[data-span2="2"] { grid-column: 1 / -1; grid-template-columns: 96px minmax(0, 1fr) auto; grid-template-rows: auto; grid-template-areas: "img body foot"; align-items: center; }
}
@media (min-width: 960px) {
  .nxwg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nxwg-card[data-span3="2"] { grid-column: span 2; }
  .nxwg-card[data-span3="3"] { grid-column: 1 / -1; }
  .nxwg-card:is([data-span3="2"], [data-span3="3"]) { grid-template-columns: 96px minmax(0, 1fr) auto; grid-template-rows: auto; grid-template-areas: "img body foot"; align-items: center; }
  .nxwg-keys { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 32px; align-items: start; padding: 24px; }
  .nxwg-keys .nxwg-buy, .nxwg-keys .nxwg-per, .nxwg-keys .nxwg-sum, .nxwg-keys .nxwg-btn--wide { grid-column: 1; }
  .nxwg-keys .nxwg-tiers { grid-column: 2; grid-row: 1 / span 4; margin-block-start: 0; }
}
/* The lead card, only at the width where it spans: larger art, the price and button stacked at the end. */
@media (min-width: 640px) and (max-width: 959px) {
  .nxwg-card[data-span2="2"] .nxwg-card-img { inline-size: 96px; block-size: 96px; }
  .nxwg-card[data-span2="2"] .nxwg-card-foot { flex-direction: column; align-items: flex-end; padding: 0; border: 0; }
}
@media (min-width: 960px) {
  .nxwg-card:is([data-span3="2"], [data-span3="3"]) .nxwg-card-img { inline-size: 96px; block-size: 96px; }
  .nxwg-card:is([data-span3="2"], [data-span3="3"]) .nxwg-card-foot { flex-direction: column; align-items: flex-end; padding: 0; border: 0; }
  .nxwg-card:is([data-span3="2"], [data-span3="3"]) h4 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .nxwg-tab, .nxwg-btn, .nxwg-card { transition: none; } }
