/* Tapp The Button - the show around the game (js/extras.js).
   Same line as tapp-2026.css: one ink, thick outlines, hard shadows. */

/* ----------------------------------------------------------- confetti */
.fx-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* ----------------------------------------------------- the ticket flight */
.fx-ticket {
  position: absolute;
  width: 112px;
  z-index: 61;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 0 rgba(44, 36, 22, .35)) drop-shadow(0 12px 18px rgba(0, 0, 0, .25));
  transform-style: preserve-3d;
  perspective: 600px;
}
.fx-ticket svg { display: block; width: 100%; height: auto; }
.fx-ticket-day {
  position: absolute;
  z-index: 62;
  pointer-events: none;
  transform: translate(-50%, 0);
  padding: 4px 12px 5px;
  border: 3px solid var(--ink, #2c2416);
  border-radius: 999px;
  background: #ffd34d;
  color: var(--ink, #2c2416);
  font-family: var(--shout, system-ui);
  font-size: 1rem;
  letter-spacing: .04em;
  box-shadow: 0 4px 0 var(--ink, #2c2416);
  white-space: nowrap;
}
.odds.fx-bump { animation: fx-bump .6s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes fx-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.35) rotate(-4deg); background: #ffd34d; }
  100% { transform: scale(1); }
}
.giveaway-bar.fx-flash { animation: fx-flash .9s ease-out; }
@keyframes fx-flash {
  0% { box-shadow: 0 0 0 3px var(--ink), 0 6px 0 3px var(--ink), 0 0 0 0 rgba(255, 211, 77, .9); }
  100% { box-shadow: 0 0 0 3px var(--ink), 0 6px 0 3px var(--ink), 0 0 0 18px rgba(255, 211, 77, 0); }
}

/* --------------------------------------------- the bar: ready, clock, crown */
.giveaway-bar { overflow: hidden; }
.giveaway-bar.is-ready::after {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 240, 180, .75) 48%, rgba(255, 255, 255, .9) 50%, rgba(255, 240, 180, .75) 52%, transparent 65%);
  background-size: 260% 100%;
  animation: fx-sweep 3.2s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: soft-light;
}
@keyframes fx-sweep { 0% { background-position: 130% 0; } 60%, 100% { background-position: -130% 0; } }

.gb-clock {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
}
.gb-clock svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.gb-clock-track { fill: #fff8ea; stroke: #f1e4c8; stroke-width: 4.5; }
.gb-clock-fill {
  fill: none;
  stroke: #ff9d3d;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  transition: stroke-dasharray .6s ease;
}
.gb-clock.is-full .gb-clock-fill { stroke: #ffc61a; }
.gb-clock.is-full { animation: fx-clock 1.6s ease-in-out infinite; }
@keyframes fx-clock { 50% { transform: scale(1.08); } }
.gb-clock-text {
  position: relative;
  font-family: var(--shout, system-ui);
  font-size: .62rem;
  color: var(--ink, #2c2416);
  letter-spacing: .02em;
}
html.embed .gb-clock { width: 30px; height: 30px; }
html.embed .gb-clock-text { font-size: .5rem; }

.gb-crown { display: inline-flex; width: 18px; margin-right: 4px; vertical-align: -2px; animation: fx-crown 2.4s ease-in-out infinite; }
.gb-crown svg { width: 100%; height: auto; }
.gb-crown[hidden] { display: none; }
@keyframes fx-crown { 50% { transform: translateY(-2px) rotate(-6deg); } }
#last-win:not([hidden]) {
  background: linear-gradient(90deg, var(--ink, #2c2416) 0%, #8a5a00 40%, #ffb300 50%, #8a5a00 60%, var(--ink, #2c2416) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fx-shine 5s linear infinite;
}
@keyframes fx-shine { from { background-position: 100% 0; } to { background-position: -200% 0; } }

/* ---------------------------------------------------------- Golden Tapp */
.fx-golden {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 40;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 300px;
  filter: drop-shadow(0 0 14px rgba(255, 210, 80, .85)) drop-shadow(0 6px 4px rgba(0, 0, 0, .25));
  -webkit-tap-highlight-color: transparent;
}
.fx-golden::before {
  content: "";
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 236, 150, .55) 0 12deg, transparent 12deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%);
  mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: fx-rays 6s linear infinite;
  pointer-events: none;
}
@keyframes fx-rays { to { transform: rotate(360deg); } }
.fx-golden-spin { position: relative; display: block; width: 100%; height: 100%; animation: fx-coinspin 1.4s linear infinite; transform-style: preserve-3d; }
.fx-golden-spin svg { width: 100%; height: 100%; display: block; }
@keyframes fx-coinspin {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg) scaleX(-1); }
  100% { transform: rotateY(360deg); }
}
.fx-golden:hover .fx-golden-spin { animation-duration: .6s; }
.fx-golden.is-caught { animation: fx-caught .5s ease-out forwards; }
@keyframes fx-caught { to { opacity: 0; filter: drop-shadow(0 0 40px #ffd34d); margin-top: -60px; } }
.fx-golden.is-gone { opacity: 0; transition: opacity .4s; }
.fx-pop {
  position: absolute;
  z-index: 62;
  transform: translate(-50%, -50%);
  font-family: var(--shout, system-ui);
  font-size: 1.4rem;
  color: #ffd34d;
  -webkit-text-stroke: 0;
  text-shadow: 0 3px 0 var(--ink, #2c2416), 2px 0 0 var(--ink, #2c2416), -2px 0 0 var(--ink, #2c2416), 0 -2px 0 var(--ink, #2c2416);
  pointer-events: none;
  animation: fx-popup 1.4s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes fx-popup {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); }
  20% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -220%) scale(1); }
}

.fx-frenzy {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 14px 9px;
  border: 3px solid var(--ink, #2c2416);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff3b0, #ffc61a);
  box-shadow: 0 4px 0 var(--ink, #2c2416), 0 0 24px rgba(255, 200, 40, .7);
  color: var(--ink, #2c2416);
  pointer-events: none;
  overflow: hidden;
  animation: fx-frenzy-in .4s cubic-bezier(.3, 1.6, .5, 1), fx-frenzy-glow 1s ease-in-out infinite alternate;
}
.fx-frenzy[hidden] { display: none; }
.fx-frenzy b { font-family: var(--shout, system-ui); font-size: 1.15rem; }
.fx-frenzy span { font-family: var(--pixel, monospace); font-size: .62rem; text-transform: uppercase; }
.fx-frenzy i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--ink, #2c2416); width: 100%; transition: width .2s linear; }
@keyframes fx-frenzy-in { from { transform: translateX(-50%) scale(.3); } }
@keyframes fx-frenzy-glow { to { box-shadow: 0 4px 0 var(--ink, #2c2416), 0 0 40px rgba(255, 200, 40, 1); } }
html.is-frenzy .stage { animation: fx-frenzy-sky 1.2s ease-in-out infinite alternate; }
@keyframes fx-frenzy-sky { to { filter: saturate(1.35) brightness(1.06); } }

/* --------------------------------------------------------------- awards */
.aw-head { display: flex; align-items: baseline; justify-content: space-between; }
.aw-head span { font-family: var(--pixel, monospace); font-size: .65rem; opacity: .7; }
.aw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; margin-bottom: 14px; max-height: 300px; overflow-y: auto; padding: 2px 2px 6px; }
.aw-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  border: 2.5px solid color-mix(in srgb, var(--ink, #2c2416) 25%, transparent);
  border-radius: 14px;
  background: rgba(255, 255, 255, .55);
}
.aw-row.is-won { border-color: var(--ink, #2c2416); background: #fff8ea; box-shadow: 0 3px 0 var(--ink, #2c2416); }
.aw-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.aw-text b { font-size: .7rem; line-height: 1.1; }
.aw-text span { font-size: .6rem; opacity: .75; }
.aw-bar { display: block; height: 6px; border-radius: 99px; background: #f1e4c8; overflow: hidden; border: 1.5px solid color-mix(in srgb, var(--ink, #2c2416) 45%, transparent); }
.aw-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #ffd34d, #ff9d3d); }

.aw-medal { width: 32px; height: 32px; flex: 0 0 32px; }
.aw-disc { fill: #d9d2c3; stroke: var(--ink, #2c2416); stroke-width: 3; }
.aw-inner { fill: #ece6d8; stroke: rgba(44, 36, 22, .25); stroke-width: 1.5; }
.aw-icon { fill: none; stroke: #9a9080; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aw-medal.is-won .aw-icon { stroke: var(--ink, #2c2416); }
.aw-medal.is-won.tier-1 .aw-disc { fill: #e3a46b; }
.aw-medal.is-won.tier-1 .aw-inner { fill: #f6c896; }
.aw-medal.is-won.tier-2 .aw-disc { fill: #b9c3cf; }
.aw-medal.is-won.tier-2 .aw-inner { fill: #e4ebf2; }
.aw-medal.is-won.tier-3 .aw-disc { fill: #f0b400; }
.aw-medal.is-won.tier-3 .aw-inner { fill: #ffe27a; }
.aw-medal.is-won.tier-4 .aw-disc { fill: #8e7bff; }
.aw-medal.is-won.tier-4 .aw-inner { fill: #d6ceff; }

.fx-award {
  position: absolute;
  z-index: 63;
  left: 50%;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 10px;
  border: 3px solid var(--ink, #2c2416);
  border-radius: 18px;
  background: #fff8ea;
  box-shadow: 0 5px 0 var(--ink, #2c2416), 0 18px 30px rgba(0, 0, 0, .25);
  transform: translateX(-50%);
  animation: fx-award-in .55s cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none;
  white-space: nowrap;
}
.fx-award .aw-medal { width: 46px; height: 46px; animation: fx-medal 1.2s ease-out; }
.fx-award div { display: flex; flex-direction: column; }
.fx-award small { font-family: var(--pixel, monospace); font-size: .55rem; text-transform: uppercase; opacity: .7; }
.fx-award b { font-family: var(--shout, system-ui); font-size: 1rem; font-weight: 400; }
.fx-award em { font-style: normal; font-size: .72rem; color: #8a5a00; font-weight: 700; }
.fx-award.is-out { animation: fx-award-out .5s ease-in forwards; }
@keyframes fx-award-in { from { transform: translateX(-50%) translateY(-120%) scale(.7); } }
@keyframes fx-award-out { to { transform: translateX(-50%) translateY(-140%); opacity: 0; } }
@keyframes fx-medal { 0% { transform: rotateY(0) scale(.4); } 60% { transform: rotateY(540deg) scale(1.15); } 100% { transform: rotateY(720deg) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .giveaway-bar.is-ready::after,
  .fx-golden::before,
  .fx-golden-spin,
  .gb-crown,
  .gb-clock.is-full,
  #last-win:not([hidden]),
  html.is-frenzy .stage { animation: none !important; }
}

/* The toast sits above the 3D canvas, which reaches up over the field. */
.toast { z-index: 64; }
