/* The Finance island's glass over the world (finance/hud.js): the Sell screen, the brass words, the films' words. */

/* In a ride the whole screen is one button that sells. The world shows through; its edge glows banknote green. */
#fin-sell {
  position: fixed;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6), inset 0 0 90px 8px rgba(10, 138, 74, 0.42);
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

#fin-sell .label {
  position: absolute;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--rim), 0 0 0 3px rgba(10, 138, 74, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
}

#fin-sell .label b {
  font: 800 30px var(--font);
  letter-spacing: 0.01em;
  color: #0a8a4a;
  text-shadow: 0 1px 0 #fff;
}

#fin-sell:active .label {
  transform: translateX(-50%) scale(0.96);
}

/* While the Sell screen is up the stick, Jump, the use button and the gestures have nothing to do: the whole screen
   sells. */
:root[data-fin-sell] #use,
:root[data-fin-sell] #stick,
:root[data-fin-sell] #jump,
:root[data-fin-sell] #gesture,
:root[data-fin-sell] #gestures {
  visibility: hidden;
}

:root[data-touch="true"] #fin-sell .label {
  bottom: calc(40px + env(safe-area-inset-bottom));
  padding: 14px 36px;
}

/* The films and the brass words lie under the stick and the buttons, so on a phone nothing covers them. */
#fin-films,
#fin-words {
  position: fixed;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* What is printed on a bubble's film: its money, and under it the word, green to red as the film warms. */
.fin-film {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 11px 4px;
  border-radius: 14px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.62), rgba(214, 248, 255, 0.5) 40%, rgba(255, 226, 246, 0.48) 70%, rgba(255, 250, 214, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 #fff, 0 4px 14px rgba(0, 50, 90, 0.22);
  white-space: nowrap;
  will-change: transform;
  --heat: 0;
}

.fin-film b {
  font: 800 16px var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.fin-film i {
  font: 800 14px var(--font);
  font-style: normal;
  letter-spacing: 0.06em;
  color: color-mix(in oklab, #0a8a4a, #e0302a calc(var(--heat) * 100%));
}

.fin-film.mine b {
  font-size: 21px;
}

.fin-film.mine i {
  font-size: 15px;
}

.fin-film.fear i {
  color: #2d5f9a;
}

/* A brass word: it pops in where it happened, rises a little and fades. */
.fin-word {
  position: absolute;
  transform: translate(-50%, -50%);
  font: 900 36px var(--font);
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #e9b43c;
  background: linear-gradient(180deg, #fff8d2 8%, #ffd76a 38%, #d39a2c 62%, #9a6418 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px rgba(92, 56, 6, 0.75);
  filter: drop-shadow(0 2px 0 #6a4208) drop-shadow(0 6px 12px rgba(40, 20, 0, 0.35));
  animation: fin-word 1.3s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

.fin-word.far {
  font-size: 26px;
}

@keyframes fin-word {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  14% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.14);
  }
  24% {
    transform: translate(-50%, -50%) scale(1);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 42px)) scale(1);
  }
}

@media (max-width: 700px) {
  .fin-word {
    font-size: 30px;
  }
  .fin-word.far {
    font-size: 22px;
  }
}

/* After a pop the hall goes red for a moment: a wash at the edges of the view, under the glass. */
#fin-red {
  position: fixed;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 40, 30, 0.18) 30%, rgba(190, 10, 10, 0.55) 100%);
  mix-blend-mode: multiply;
}
