/* Gift overlay + chat gift message card. Same jewellery-box language
   as css/gifts/picker.css: dark plum, champagne hairlines, serif names. */

.gift-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  pointer-events: none;
}
.gift-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  /* a CDN sheet (plyr and friends) paints bare <canvas> black */
  background: transparent !important;
}

.gift-overlay-banner {
  position: absolute;
  top: 9%;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 26px;
  background: rgba(52, 32, 125, .94);
  border-radius: 999px;
  box-shadow: 0 18px 50px rgba(52, 32, 125, .35);
  opacity: 0;
  white-space: nowrap;
}
.gift-overlay-banner.is-live {
  animation: gift-banner-in 3.2s cubic-bezier(.2, .9, .25, 1) forwards;
}
.gift-overlay-banner-who {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .75);
}
.gift-overlay-banner-who:empty { display: none; }
.gift-overlay-banner-what {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

@keyframes gift-banner-in {
  0% { opacity: 0; transform: translateX(-50%) translateY(-16px); }
  10% { opacity: 1; transform: translateX(-50%) translateY(0); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* mute toggle - the one interactive element on the overlay, visible
   only while a gift is playing */
.gift-overlay-sound {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(52, 32, 125, .9);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.gift-overlay.is-live .gift-overlay-sound {
  opacity: 1;
  visibility: visible;
}
.gift-overlay-sound:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

body.gift-overlay-shake {
  animation: gift-overlay-shake 440ms ease-in-out;
}
@keyframes gift-overlay-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-7px, 3px); }
  40% { transform: translate(6px, -4px); }
  60% { transform: translate(-4px, 2px); }
  80% { transform: translate(3px, -2px); }
}

@media (prefers-reduced-motion: reduce) {
  body.gift-overlay-shake { animation: none; }
  .gift-overlay-banner.is-live {
    animation: none;
    opacity: 1;
    transform: translateX(-50%);
  }
}

/* ---- chat gift message card (click to replay) ---- */

.gift-message-div { display: flex; }
.gift-msg {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 14px;
  padding: 12px 16px;
  max-width: 320px;
  background: #fff;
  border: 1px solid #e7e5ed;
  border-radius: 16px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.gift-msg:hover { border-color: #ec2a4a; box-shadow: 0 4px 14px rgba(236, 42, 74, .12); }
.gift-msg-own { margin-left: auto; }
.gift-msg-icon { flex: none; font-size: 28px; line-height: 1; }
.gift-msg-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gift-msg-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
  color: #34207d;
}
.gift-msg-meta { font-size: 12px; color: #7f7777; }
.gift-msg-replay {
  margin-left: auto;
  font-size: 16px;
  color: #ec2a4a;
  opacity: .5;
  transition: opacity .15s ease;
}
.gift-msg:hover .gift-msg-replay { opacity: 1; }

/* a played gift is a keepsake, not a button */
.gift-msg-played,
.gift-msg-played:hover {
  cursor: default;
  border-color: #e7e5ed;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .gift-msg, .gift-msg-replay { transition: none; }
}

/* dark mode (body.dark, tokens from darkmode33.css) */
body.dark .gift-msg {
  background: #2f2f38;
  border-color: #40424a;
}
body.dark .gift-msg:hover {
  border-color: #ec2a4a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
body.dark .gift-msg-played,
body.dark .gift-msg-played:hover {
  border-color: #40424a;
  box-shadow: none;
}
body.dark .gift-msg-name { color: #fff; }
body.dark .gift-msg-meta { color: #b8b5c4; }

/* ---- received-gift shelf on profiles ---- */

.gift-shelf {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}
.gift-shelf-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #f9f9fb;
  border: 1px solid #e7e5ed;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1.4;
}
.gift-shelf-item b {
  font-size: 12px;
  font-weight: 600;
  color: #7f7777;
}
body.dark .gift-shelf-item { background: #2f2f38; border-color: #40424a; }
body.dark .gift-shelf-item b { color: #b8b5c4; }

/* ---- gift button in the chat input toolbar ---- */

.gift-chat-button {
  border: 0;
  background: none;
  padding: 0 6px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  filter: grayscale(35%);
  transition: filter .15s ease, transform .15s ease;
}
.gift-chat-button:hover { filter: none; transform: translateY(-1px); }
.gift-chat-button:focus-visible { outline: 2px solid #e8c9a0; outline-offset: 2px; }
