/* A frosted display well and a moving clear coat over the issuer artwork. */
.tdv-stage[data-tdv-stage] {
    --tdv-tint: #94acc0;
    --tdv-depth: #223649;
    --tdv-period: 10s;
    background:
        radial-gradient(ellipse at 6% 0%, #ffffffe8, transparent 47%),
        radial-gradient(ellipse at 80% 105%, #ffffff87, transparent 61%),
        linear-gradient(135deg, #e4e8ed -15%, var(--tdv-tint) 57%, var(--tdv-depth) 150%);
    box-shadow: inset 0 0 0 1px #ffffff91, inset 0 0 1.4rem #ffffff38;
}
.tdv-stage--motion[data-tdv-stage] { --tdv-tint: #b5a8c6; --tdv-depth: #645971 }
.tdv-stage--citi[data-tdv-stage], .tsc-stage[data-tdv-stage] { --tdv-tint: #9fbdce; --tdv-depth: #29516b }
.tdv-stage--cathay[data-tdv-stage] { --tdv-tint: #9dbfb5; --tdv-depth: #315d59 }
.tdv-stage--simply[data-tdv-stage] { --tdv-tint: #a6b3c8; --tdv-depth: #344261 }
.tdv-stage--fubon[data-tdv-stage] { --tdv-tint: #d1afa0; --tdv-depth: #654643 }
.tdv-stage[data-tdv-stage]::before {
    display:block; opacity:.4;
    background-image: radial-gradient(#fff9 .65px, transparent .9px);
    background-size:3px 3px;
    mask-image:linear-gradient(135deg,#000,transparent 50%,#000);
}
.tdv-stage[data-tdv-stage]::after {
    display:block;
    background:linear-gradient(122deg,transparent 8%,#ffffff36 20%,transparent 30% 63%,#ffffff29 71%,transparent 78%);
    box-shadow:inset 0 0 0 1px #fff6;
}
.tdv-stage[data-tdv-stage] .tdv-stage-floor {
    display:block; left:19%; right:19%; bottom:11%; height:8%; border:none;
    background:radial-gradient(ellipse at center,#18303b65,transparent 70%); box-shadow:none;
}
.hmof-art .tdv-stage[data-tdv-stage],
.tsc-feature-media .tdv-stage[data-tdv-stage] {
    background:transparent;box-shadow:none;
}
.hmof-art .tdv-stage[data-tdv-stage]::before, .hmof-art .tdv-stage[data-tdv-stage]::after,
.tsc-feature-media .tdv-stage[data-tdv-stage]::before, .tsc-feature-media .tdv-stage[data-tdv-stage]::after { display:none }
.tdv-stage[data-tdv-stage] .tdv-rotor {
    transform-style:preserve-3d;
    transform:translateY(-2%) rotateZ(-5deg) rotateX(8deg) rotateY(-16deg);
}
.tdv-stage[data-tdv-stage][data-spin] .tdv-rotor {
    animation:tdv-finish-turn var(--tdv-period) linear infinite;
}
/* The face dwells near the camera; the edge and editorial reverse pass more quickly. */
@keyframes tdv-finish-turn {
    0% {transform:translateY(-2%) rotateZ(-5deg) rotateX(8deg) rotateY(-16deg)}
    26% {transform:translateY(-3%) rotateZ(-3deg) rotateX(5deg) rotateY(18deg)}
    48% {transform:translateY(-2%) rotateZ(1deg) rotateX(7deg) rotateY(153deg)}
    64% {transform:translateY(-1%) rotateZ(2deg) rotateX(8deg) rotateY(200deg)}
    85% {transform:translateY(-2%) rotateZ(-3deg) rotateX(6deg) rotateY(322deg)}
    100% {transform:translateY(-2%) rotateZ(-5deg) rotateX(8deg) rotateY(344deg)}
}
.tdv-stage[data-tdv-stage] .tdv-face--front {
    box-shadow:inset 0 0 0 1px #fff8, 0 1px 0 #657179, 0 5px 11px #16232b35;
}
.tdv-stage[data-tdv-stage] .tdv-face--front::after,
.tdv-stage[data-tdv-stage] .tdv-face--back::after {
    content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
    background-image:linear-gradient(113deg,transparent 30%,#effdff18 40%,#ffffffe0 48%,#d9e8f454 49.5%,#ffffff1f 55%,transparent 63%);
    background-size:290% 100%; background-position:99% 50%; opacity:.63;
    box-shadow:inset 0 1px 1px #fff9,inset -1px -1px 1px #f3f7fb91;
}
.tdv-stage[data-tdv-stage][data-spin] .tdv-face::after {
    animation:tdv-finish-reflection var(--tdv-period) linear infinite;
}
@keyframes tdv-finish-reflection {
    0% {background-position:96% 50%;opacity:.55}
    26% {background-position:12% 50%;opacity:.63}
    45% {background-position:0% 50%;opacity:.24}
    62% {background-position:85% 50%;opacity:.55}
    83% {background-position:8% 50%;opacity:.43}
    100% {background-position:96% 50%;opacity:.55}
}
.tdv-stage[data-tdv-stage]:is([data-spin=paused],[data-offscreen=true]) .tdv-rotor,
.tdv-stage[data-tdv-stage]:is([data-spin=paused],[data-offscreen=true]) .tdv-face::after {
    animation-play-state:paused;
}
.tdv-stage[data-tdv-stage] .tdv-spin-control {display:none!important}

.hmof-row .tdv-stage[data-tdv-stage] {width:100%;aspect-ratio:.98;border-radius:9px}
.hmof-row .tdv-thumbnail-link {position:absolute;inset:0;z-index:1;border-radius:inherit}
.hmof-row .tdv-thumbnail-link:focus-visible {outline:2px solid #114a59;outline-offset:-2px}
.hmof-row .tdv-stage .tdv-face img {position:static;inset:auto;width:100%;height:100%;object-fit:contain;transform:none;filter:none}
.hmof-row .tdv-stage .tdv-face--back .tdv-reverse-logo {width:69%;height:69%}
/* A perforated foil ticket: text and face value always come from the offer. */
:is(span,div).tdv-voucher {
    display:inline-block; position:relative; isolation:isolate; box-sizing:border-box; max-width:100%;
    padding:.44em 1.9em .46em .8em; vertical-align:middle; overflow-wrap:anywhere;
    border:1px solid #c5a672; border-radius:4px; color:#503817;
    background:
        repeating-linear-gradient(119deg,transparent 0 7px,#ffffff30 7px 8px,transparent 8px 11px) right / 1.38em 100% no-repeat,
        linear-gradient(117deg,#f5e5bd 0%,#fff8e4 25%,#ead5a0 57%,#fff1ca 74%,#d8c29b 100%);
    box-shadow:inset 0 0 0 2px #fff7;
    font-family:inherit; font-weight:750; line-height:1.25; letter-spacing:.005em;
    -webkit-mask:radial-gradient(circle at 0 50%,transparent 3px,#000 3.7px),radial-gradient(circle at 100% 50%,transparent 3px,#000 3.7px);
    -webkit-mask-composite:source-in;
    mask:radial-gradient(circle at 0 50%,transparent 3px,#000 3.7px),radial-gradient(circle at 100% 50%,transparent 3px,#000 3.7px);
    mask-composite:intersect;
}
:is(span,div).tdv-voucher::before {
    position:absolute;content:"";pointer-events:none;right:1.37em;top:0;bottom:0;border-left:1px dashed #a4864f;
}
:is(span,div).tdv-voucher::after {
    position:absolute;content:"";right:.32em;top:50%;width:.72em;height:.72em;transform:translateY(-50%);
    background:conic-gradient(from 45deg,#926b38,#fff7ce,#9b7a44,#f9eab6,#926b38);
    clip-path:polygon(50% 0,60% 32%,84% 16%,67% 40%,100% 50%,67% 60%,84% 84%,60% 68%,50% 100%,40% 68%,16% 84%,33% 60%,0 50%,33% 40%,16% 16%,40% 32%);
}
.tdv-voucher b {font-weight:850;font-variant-numeric:tabular-nums;letter-spacing:-.025em}
.td-motion-award :is(span,div).tdv-voucher,.tdv-voucher.tdv-voucher--compact {font-size:.9em}
.tdv-voucher.tdv-voucher--featured {margin:.6em 0 .2em; padding:.7em 1.95em .75em .9em}
.tdv-voucher--featured .hmof-value,.tdv-voucher--featured .hmof-value-label {color:inherit;margin:0}
.tdv-voucher--featured .hmof-value {font-size:clamp(1.35rem,3vw,3.3rem);line-height:1.04;letter-spacing:-.04em}
.tdv-voucher--featured .hmof-value-label {margin-top:.18em;font-size:clamp(.82rem,1.2vw,1.13rem)}
@media (forced-colors:active) {
    :is(span,div).tdv-voucher {color:CanvasText;border:1px solid CanvasText;mask:none;background:Canvas}
    .tdv-stage .tdv-face::after {display:none}
}
@media print, (prefers-reduced-motion: reduce) {
    .tdv-stage[data-tdv-stage][data-spin] .tdv-rotor,.tdv-stage[data-tdv-stage][data-spin] .tdv-face::after {animation:none!important}
}

/* Make the card face the first visual on each offer. */
#home-offers.hmof,
#main > .ts-studio {
  width: min(1360px, calc(100% - clamp(24px, 6vw, 80px)));
}

#home-offers .hmof-grid {
  grid-template-columns: minmax(0, 1fr);
}

#home-offers .hmof-grid > .hmof-feature {
  width: 100%;
  max-width: none;
}

#home-offers .hmof-grid > .hmof-list,
#main .ts-studio .ts-deck {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: clamp(16px, 2vw, 28px);
  border: 0;
}

#home-offers .hmof-list .hmof-row,
#main .ts-studio .ts-item {
  --offer-pad: clamp(16px, 2vw, 28px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8d7d1;
  border-radius: 14px;
  background: #fffefa;
  box-shadow: none;
}

#home-offers .hmof-list .hmof-row > .hmof-thumb,
#main .ts-studio .ts-item > .tdv-stage[data-tdv-stage] {
  display: grid;
  flex: none;
  width: 100%;
  aspect-ratio: 1.95;
  max-height: 340px;
  border-radius: 0;
  margin: 0;
}

#home-offers .hmof-list .hmof-row > .hmof-copy,
#main .ts-studio .ts-item > .ts-item-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-self: stretch;
  align-items: stretch;
  min-width: 0;
  gap: 12px;
  padding: var(--offer-pad);
}

#home-offers .hmof-list .hmof-copy > h3,
#main .ts-studio .ts-item h2 {
  margin: 0;
  align-self: stretch;
  font-size: clamp(1.22rem, 1.95vw, 1.65rem);
  line-height: 1.28;
  overflow-wrap: anywhere;
}

#home-offers .hmof-list .hmof-copy > .hmof-reward,
#main .ts-studio .ts-item-reward {
  margin: 0;
  align-self: start;
  max-width: 100%;
}

#home-offers .hmof-copy .td-card-facts,
#main .ts-studio .ts-item-copy .td-card-facts {
  margin: 0;
  display: grid;
  gap: 8px;
}

#home-offers .hmof-copy .td-card-facts > div,
#main .ts-studio .ts-item-copy .td-card-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

#home-offers .hmof-copy .td-card-facts dt,
#main .ts-studio .ts-item-copy .td-card-facts dt {
  font-size: .85rem;
  color: #5c564f;
}

#home-offers .hmof-copy .td-card-facts dd,
#main .ts-studio .ts-item-copy .td-card-facts dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#home-offers .hmof-copy .tdv-clock,
#main .ts-studio .ts-item-copy .tdv-clock {
  margin-top: auto;
}

#home-offers .hmof-copy .tdv-clock {
  padding-top: 12px;
  border-radius: 0;
  border-top: 1px solid #dedbd3;
}

#home-offers .hmof-copy .tdv-clock-grid {
  gap: 4px 9px;
}

#home-offers .hmof-copy .tdv-unit b {
  font-size: 1rem;
}

#home-offers .hmof-copy .tdv-clock-date,
#main .ts-studio .tdv-clock-date {
  font-size: .84rem;
  line-height: 1.45;
}

#home-offers .hmof-list .hmof-row > .hmof-row-action {
  align-self: stretch;
  width: auto;
  max-width: none;
  margin: 0 var(--offer-pad) var(--offer-pad);
}

#home-offers .hmof-row-action .ts-apply,
#main .ts-studio .ts-item .ts-apply {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}

#home-offers .hmof-feature .hmof-art,
#main .ts-studio .tsc-feature-media {
  width: 100%;
}

#home-offers .hmof-feature .hmof-art .tdv-stage,
#main .ts-studio .tsc-feature-media .tdv-stage {
  width: 100%;
  aspect-ratio: 1.65;
}

/* Fit the face to both dimensions, including vertically oriented issuer artwork. */
:is(#home-offers, #main .ts-studio) .tdv-stage .tdv-studio {
  container-type: size;
}

:is(#home-offers, #main .ts-studio) .tdv-stage[data-tdv-stage] .tdv-rotor {
  width: min(80%, calc(41% * var(--tdv-ratio, 1.586)));
  width: min(86cqw, calc(83cqh * var(--tdv-ratio, 1.586)));
}

.tdv-stage[data-tdv-stage] .tdv-spin-control {
  display: none !important;
}

.tdv-stage[data-tdv-stage] {
  --tdv-period: 10s;
}

@media (prefers-reduced-motion: no-preference) {
  .tdv-stage[data-tdv-stage][data-spin] .tdv-rotor,
  .tdv-stage[data-tdv-stage][data-spin] .tdv-face::after {
    animation-duration: var(--tdv-period);
    animation-iteration-count: infinite;
  }
}

@media (prefers-reduced-motion: reduce), print {
  .tdv-stage[data-tdv-stage][data-spin] .tdv-rotor,
  .tdv-stage[data-tdv-stage][data-spin] .tdv-face::after {
    animation: none !important;
  }
}

@media (max-width: 759px) {
  #home-offers .hmof-grid > .hmof-list,
  #main .ts-studio .ts-deck {
    grid-template-columns: minmax(0, 1fr);
  }

  #home-offers .hmof-list .hmof-row > .hmof-thumb,
  #main .ts-studio .ts-item > .tdv-stage[data-tdv-stage] {
    aspect-ratio: 1.72;
    max-height: 330px;
  }

  #home-offers .hmof-feature .hmof-feature-main {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
  }

  #main .ts-studio .tsc-feature {
    grid-template-columns: minmax(0, 1fr);
  }

  #home-offers .hmof-feature .hmof-art,
  #main .ts-studio .tsc-feature-media {
    max-width: none;
  }

  #home-offers .hmof-feature .hmof-art .tdv-stage,
  #main .ts-studio .tsc-feature-media .tdv-stage {
    aspect-ratio: 1.85;
    max-height: 330px;
  }
}

/* Give older in-app browser engines a stable card box without aspect-ratio or inset. */
@supports not (aspect-ratio: 1) {
  #home-offers .tdv-stage[data-tdv-stage],
  #main .ts-studio .tdv-stage[data-tdv-stage] {
    height: clamp(158px, 51vw, 300px);
  }

  .tdv-stage[data-tdv-stage] .tdv-studio,
  .tdv-stage[data-tdv-stage] .tdv-face,
  .tdv-stage[data-tdv-stage] .tdv-thumbnail-link {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }

  #home-offers .tdv-stage[data-tdv-stage] .tdv-rotor,
  #main .ts-studio .tdv-stage[data-tdv-stage] .tdv-rotor {
    width: min(80%, calc(41% * var(--tdv-ratio, 1.586)), calc(242px * var(--tdv-ratio, 1.586)));
  }

  .tdv-stage[data-tdv-stage] .tdv-rotor::before {
    content: "";
    display: block;
    padding-top: calc(100% / var(--tdv-ratio, 1.586));
  }
}

#main .ts-studio .ts-item .tdv-clock-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

#main .ts-studio .ts-item .tdv-unit {
  flex: none;
  min-width: 0;
}

#main .ts-studio .ts-item .tdv-unit:not(:last-child)::after {
  display: none;
}
