/* ═══════════════════════════════════════════
   فَرّه — صندوق الهدايا (Premium UI)
   ═══════════════════════════════════════════ */

.frh-gifts-body {
  --gift-luck-a: #a855f7;
  --gift-luck-b: #22d3ee;
  --gift-admin-a: #fbbf24;
  --gift-admin-b: #f472b6;
  --gift-glow-luck: rgba(168, 85, 247, 0.45);
  --gift-glow-admin: rgba(251, 191, 36, 0.4);
}

.frh-gifts-rays {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(168, 85, 247, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(34, 211, 238, 0.06), transparent 50%);
}

.frh-gifts-logo {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(251, 191, 36, 0.3));
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
}

.frh-gifts-shell {
  max-width: 540px;
  margin: 0 auto;
  padding-bottom: 56px;
  position: relative;
  z-index: 1;
}

/* ─── Hero ─── */
.frh-gifts-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 32px 20px 26px;
  text-align: center;
  border-color: rgba(168, 85, 247, 0.32);
  background: linear-gradient(165deg, rgba(88, 28, 135, 0.18) 0%, rgba(15, 23, 42, 0.85) 60%);
}

.frh-gifts-hero-aurora {
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 180deg, rgba(168, 85, 247, 0.22), transparent 25%, rgba(34, 211, 238, 0.15) 50%, transparent 75%, rgba(251, 191, 36, 0.1));
  animation: giftAuroraSpin 14s linear infinite;
  pointer-events: none;
}

.frh-gifts-hero-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.015) 2px, rgba(255, 255, 255, 0.015) 4px);
  pointer-events: none;
  opacity: 0.5;
}

.frh-gifts-hero-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.04) 50%, transparent 60%);
  animation: giftHeroShine 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes giftAuroraSpin {
  to { transform: rotate(360deg); }
}

@keyframes giftHeroShine {
  0%, 100% { transform: translateX(-30%) rotate(25deg); }
  50% { transform: translateX(30%) rotate(25deg); }
}

.frh-gifts-hero-inner {
  position: relative;
  z-index: 1;
}

.frh-gifts-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #e9d5ff;
  margin-bottom: 12px;
}

.frh-gifts-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 10px #22d3ee;
  animation: giftLivePulse 1.5s ease-in-out infinite;
}

@keyframes giftLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.frh-gifts-kicker {
  margin: 0 0 4px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #c4b5fd;
  opacity: 0.9;
}

.frh-gifts-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 6vw, 2.2rem);
  font-weight: 900;
  line-height: 1.15;
}

.frh-gifts-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #f0abfc, #67e8f9 40%, #fde68a 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.3));
}

.frh-gifts-sub {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.frh-gifts-stats {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  max-width: 340px;
  margin: 0 auto;
}

.frh-gifts-stat {
  padding: 12px 10px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.frh-gifts-stat-val {
  font-size: 1.1rem;
  font-weight: 900;
  background: linear-gradient(135deg, #e9d5ff, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}

.frh-gifts-stat--timer .frh-gifts-stat-val {
  font-size: 0.72rem;
  font-weight: 800;
  background: none;
  color: #cbd5e1;
  -webkit-text-fill-color: #cbd5e1;
}

.frh-gifts-stat-lbl {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Loading ─── */
.frh-gifts-loading {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.frh-gifts-loading.hidden {
  display: none;
}

.gift-skeleton {
  height: 220px;
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  border-color: rgba(168, 85, 247, 0.15);
}

.gift-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: giftSkeletonShimmer 1.4s ease-in-out infinite;
}

@keyframes giftSkeletonShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ─── Auth gate ─── */
.frh-gifts-gate {
  text-align: center;
  padding: 36px 22px;
  border-color: rgba(168, 85, 247, 0.2);
}

.frh-gifts-gate-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  animation: giftGateFloat 3s ease-in-out infinite;
}

@keyframes giftGateFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.frh-gifts-section {
  margin-bottom: 22px;
}

.frh-gifts-section-title {
  margin: 0 0 14px;
  font-size: 0.85rem;
  font-weight: 900;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}

.frh-gifts-section-title::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #a855f7, #22d3ee);
}

.frh-gifts-section-title small {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: auto;
}

/* ─── Gift box card ─── */
.gift-boxes-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gift-box-card {
  position: relative;
  padding: 22px 18px 20px;
  border-radius: 24px;
  text-align: center;
  overflow: hidden;
  cursor: default;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: giftCardEnter 0.6s cubic-bezier(0.34, 1.2, 0.64, 1) both;
  animation-delay: calc(var(--gi, 0) * 0.1s);
}

@keyframes giftCardEnter {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gift-box-card--luck {
  background: linear-gradient(165deg, rgba(88, 28, 135, 0.42) 0%, rgba(15, 23, 42, 0.95) 55%, rgba(6, 78, 99, 0.15) 100%);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.gift-box-card--admin {
  background: linear-gradient(165deg, rgba(120, 53, 15, 0.35) 0%, rgba(15, 23, 42, 0.95) 55%, rgba(190, 24, 93, 0.1) 100%);
  border-color: rgba(251, 191, 36, 0.38);
  box-shadow: 0 0 60px rgba(251, 191, 36, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.gift-box-card--can-open {
  cursor: pointer;
}

.gift-box-card--can-open:hover {
  transform: translateY(-4px);
  transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.gift-box-card--luck.gift-box-card--can-open:hover {
  box-shadow: 0 12px 48px rgba(168, 85, 247, 0.28), 0 0 80px rgba(168, 85, 247, 0.12);
}

.gift-box-card--admin.gift-box-card--can-open:hover {
  box-shadow: 0 12px 48px rgba(251, 191, 36, 0.22), 0 0 80px rgba(251, 191, 36, 0.1);
}

.gift-box-card--opened {
  opacity: 0.55;
  filter: grayscale(0.3);
}

.gift-box-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.07) 50%, transparent 58%);
  transform: translateX(-120%);
  animation: giftCardShimmer 4s ease-in-out infinite;
  pointer-events: none;
}

.gift-box-card--can-open .gift-box-shimmer {
  animation-duration: 2.5s;
}

@keyframes giftCardShimmer {
  0%, 100% { transform: translateX(-120%); }
  50% { transform: translateX(120%); }
}

.gift-box-ribbon {
  position: absolute;
  top: 14px;
  left: -32px;
  transform: rotate(-38deg);
  padding: 5px 40px;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gift-box-card--luck .gift-box-ribbon {
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  color: #fff;
}

.gift-box-card--admin .gift-box-ribbon {
  background: linear-gradient(135deg, #fde68a, #f472b6);
  color: #1e1b4b;
}

.gift-box-platform {
  position: relative;
  width: 160px;
  height: 14px;
  margin: 0 auto 4px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.5), transparent 70%);
  filter: blur(2px);
}

/* 3D Gift scene */
.gift-box-scene {
  position: relative;
  width: 160px;
  height: 140px;
  margin: 0 auto 16px;
  perspective: 800px;
  transform-style: preserve-3d;
}

.gift-box-scene-inner {
  position: relative;
  width: 100%;
  height: 100%;
  animation: giftSceneFloat 4s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes giftSceneFloat {
  0%, 100% { transform: translateY(0) rotateY(-8deg); }
  50% { transform: translateY(-10px) rotateY(8deg); }
}

.gift-box-card.is-opening .gift-box-scene-inner {
  animation: giftSceneShake 0.5s ease-in-out 3;
}

@keyframes giftSceneShake {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-4px) rotate(-3deg); }
  75% { transform: translateY(-4px) rotate(3deg); }
}

.gift-box-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -40%);
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.6;
  animation: giftGlowPulse 2.5s ease-in-out infinite;
  pointer-events: none;
}

.gift-box-card--luck .gift-box-glow {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.7), rgba(34, 211, 238, 0.2) 50%, transparent 70%);
}

.gift-box-card--admin .gift-box-glow {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.65), rgba(244, 114, 182, 0.2) 50%, transparent 70%);
}

@keyframes giftGlowPulse {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -40%) scale(0.9); }
  50% { opacity: 0.85; transform: translate(-50%, -40%) scale(1.1); }
}

.gift-box-body {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 78px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  z-index: 1;
}

.gift-box-card--luck .gift-box-body {
  background: linear-gradient(180deg, #8b5cf6 0%, #5b21b6 50%, #4c1d95 100%);
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(124, 58, 237, 0.45);
}

.gift-box-card--admin .gift-box-body {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 50%, #b45309 100%);
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(245, 158, 11, 0.4);
}

.gift-box-body::before,
.gift-box-body::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
}

.gift-box-body::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 14px;
  transform: translateX(-50%);
}

.gift-box-body::after {
  top: 50%;
  left: 0;
  right: 0;
  height: 14px;
  transform: translateY(-50%);
}

.gift-box-lid {
  position: absolute;
  top: 22px;
  left: 50%;
  width: 118px;
  height: 32px;
  transform: translateX(-50%);
  border-radius: 10px 10px 4px 4px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  transform-origin: bottom center;
  z-index: 2;
}

.gift-box-card--luck .gift-box-lid {
  background: linear-gradient(180deg, #c4b5fd, #7c3aed);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.gift-box-card--admin .gift-box-lid {
  background: linear-gradient(180deg, #fef3c7, #f59e0b);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.gift-box-bow {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  z-index: 4;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
  animation: giftBowWiggle 2.8s ease-in-out infinite;
}

@keyframes giftBowWiggle {
  0%, 100% { transform: translateX(-50%) rotate(-6deg) scale(1); }
  50% { transform: translateX(-50%) rotate(6deg) scale(1.08); }
}

.gift-box-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gift-box-sparkle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: giftBoxSparkle 2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  opacity: 0;
}

@keyframes giftBoxSparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 1; transform: scale(1.2); }
}

.gift-box-card.is-opening .gift-box-lid {
  animation: giftLidFly 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes giftLidFly {
  0% { transform: translateX(-50%) rotateX(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-90px) rotateX(-130deg) scale(0.8); opacity: 0; }
}

.gift-box-card.is-opening .gift-box-body {
  animation: giftBodyBurst 0.6s ease 0.25s both;
}

@keyframes giftBodyBurst {
  0% { transform: translateX(-50%) scale(1); filter: brightness(1); }
  40% { transform: translateX(-50%) scale(1.12); filter: brightness(1.4); }
  100% { transform: translateX(-50%) scale(1); filter: brightness(1); }
}

.gift-box-card.is-opening::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.35), transparent 55%);
  animation: giftFlashBurst 0.5s ease 0.3s both;
  pointer-events: none;
}

@keyframes giftFlashBurst {
  from { opacity: 0; }
  30% { opacity: 1; }
  to { opacity: 0; }
}

.gift-box-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.62rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.gift-box-card--luck .gift-box-type-pill {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #e9d5ff;
}

.gift-box-card--admin .gift-box-type-pill {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.gift-box-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.35;
}

.gift-box-desc {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.gift-box-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 900;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gift-box-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.gift-box-cta:hover::before {
  transform: translateX(100%);
}

.gift-box-cta:active {
  transform: scale(0.96);
}

.gift-box-card--luck .gift-box-cta {
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.45);
}

.gift-box-card--admin .gift-box-cta {
  background: linear-gradient(135deg, #fbbf24, #ec4899);
  color: #1e1b4b;
  box-shadow: 0 6px 24px rgba(251, 191, 36, 0.35);
}

.gift-box-opened-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
}

/* ─── Empty state ─── */
.gift-empty-state {
  text-align: center;
  padding: 36px 20px;
  border-radius: 22px;
  border: 1px dashed rgba(168, 85, 247, 0.25);
  background: rgba(0, 0, 0, 0.2);
}

.gift-empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
  animation: giftEmptyPulse 2s ease-in-out infinite;
}

@keyframes giftEmptyPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* ─── Pending ─── */
.gift-pending-card {
  position: relative;
  padding: 20px 18px;
  border-radius: 20px;
  border: 1px solid rgba(249, 115, 22, 0.4);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(0, 0, 0, 0.3));
  margin-bottom: 14px;
  overflow: hidden;
  animation: giftPendingGlow 2s ease-in-out infinite;
}

@keyframes giftPendingGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(249, 115, 22, 0.1); }
  50% { box-shadow: 0 0 32px rgba(249, 115, 22, 0.25); }
}

.gift-pending-card::before {
  content: '⚠️';
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 1.2rem;
  opacity: 0.5;
}

.gift-pending-card h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: #fed7aa;
}

.gift-pending-card p {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: #fdba74;
  line-height: 1.5;
}

/* ─── History ─── */
.gift-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gift-history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.2s ease, transform 0.2s ease;
  animation: giftHistoryIn 0.45s ease both;
  animation-delay: calc(var(--hi, 0) * 0.05s);
}

@keyframes giftHistoryIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.gift-history-item:hover {
  border-color: rgba(168, 85, 247, 0.25);
  transform: translateX(-4px);
}

.gift-history-emoji {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.2);
  flex-shrink: 0;
}

.gift-history-meta strong {
  display: block;
  font-size: 0.84rem;
  margin-bottom: 2px;
}

.gift-history-meta span {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.gift-history-kind {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #c4b5fd;
  margin-right: auto;
  flex-shrink: 0;
}

/* ─── Reveal overlay ─── */
.gift-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gift-reveal-overlay.hidden {
  display: none;
}

.gift-reveal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  animation: giftFadeIn 0.35s ease;
}

.gift-reveal-rays {
  position: absolute;
  width: 200vmax;
  height: 200vmax;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, transparent 0deg, rgba(168, 85, 247, 0.08) 10deg, transparent 20deg);
  animation: giftRaysSpin 8s linear infinite;
  pointer-events: none;
}

@keyframes giftRaysSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.gift-reveal-rings {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.gift-reveal-rings span {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 2px solid rgba(168, 85, 247, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: giftRingExpand 1.2s ease-out forwards;
}

.gift-reveal-rings span:nth-child(1) { animation-delay: 0.1s; }
.gift-reveal-rings span:nth-child(2) { animation-delay: 0.25s; border-color: rgba(34, 211, 238, 0.35); }
.gift-reveal-rings span:nth-child(3) { animation-delay: 0.4s; border-color: rgba(251, 191, 36, 0.3); }

@keyframes giftRingExpand {
  to { width: 320px; height: 320px; margin: -160px 0 0 -160px; opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.gift-reveal-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.gift-reveal-stage {
  position: relative;
  width: min(100%, 360px);
  z-index: 2;
}

.gift-reveal-card {
  position: relative;
  text-align: center;
  padding: 32px 24px 24px;
  border-color: rgba(168, 85, 247, 0.35);
  overflow: hidden;
  animation: giftRevealCardIn 0.65s cubic-bezier(0.34, 1.5, 0.64, 1) 0.1s both;
}

@keyframes giftRevealCardIn {
  from { opacity: 0; transform: scale(0.5) rotateY(-15deg); }
  to { opacity: 1; transform: scale(1) rotateY(0); }
}

.gift-reveal-card-shine {
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: giftAuroraSpin 4s linear infinite;
  pointer-events: none;
}

.gift-reveal-emoji-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
}

.gift-reveal-emoji-glow {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.5), transparent 70%);
  animation: giftGlowPulse 1.5s ease-in-out infinite;
}

.gift-reveal-emoji {
  position: relative;
  font-size: 4rem;
  line-height: 100px;
  animation: giftEmojiPop 0.7s cubic-bezier(0.34, 1.6, 0.64, 1) 0.35s both;
}

@keyframes giftEmojiPop {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.gift-reveal-kind {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #e9d5ff;
  text-transform: uppercase;
}

.gift-reveal-card h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f0abfc, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gift-reveal-card p {
  margin: 0 0 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.gift-reveal-close {
  width: 100%;
}

.gift-reveal-overlay.is-ban .gift-reveal-card {
  border-color: rgba(239, 68, 68, 0.4);
}

.gift-reveal-overlay.is-ban .gift-reveal-card h2 {
  background: linear-gradient(135deg, #fca5a5, #f87171);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ─── Transfer modal ─── */
.gift-transfer-modal {
  position: relative;
  max-width: 400px;
  padding: 24px 20px 20px;
  text-align: center;
  border-color: rgba(168, 85, 247, 0.3);
  overflow: hidden;
}

.gift-transfer-modal-glow {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25), transparent 70%);
  pointer-events: none;
}

.gift-transfer-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  animation: giftBowWiggle 2s ease-in-out infinite;
}

.gift-transfer-modal h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.gift-transfer-modal > p {
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.gift-transfer-friends {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin: 16px 0;
  text-align: right;
}

.gift-transfer-friend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: right;
  width: 100%;
  color: inherit;
  font: inherit;
  transition: all 0.2s ease;
}

.gift-transfer-friend:hover {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.1);
  transform: translateX(-4px);
}

.gift-transfer-friend-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(34, 211, 238, 0.2));
  border: 2px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  flex-shrink: 0;
}

.gift-transfer-friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── Sparkles ─── */
.frh-gifts-sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.frh-gifts-sparkle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: giftSparkleDrift linear infinite;
}

@keyframes giftSparkleDrift {
  0% { opacity: 0; transform: translateY(0) scale(0); }
  8% { opacity: 1; }
  92% { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(-100vh) scale(1); }
}

@keyframes giftFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Gift page soft lock (forced transfer) */
body.gift-page-lock-active {
  overflow: hidden;
}

.gift-page-lock {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.gift-page-lock.hidden {
  display: none;
}

.gift-page-lock-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 12, 0.88);
  backdrop-filter: blur(16px);
  animation: giftFadeIn 0.35s ease;
}

.gift-page-lock-card {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 22px 22px;
  text-align: center;
  border-color: rgba(249, 115, 22, 0.35);
  box-shadow: 0 24px 80px rgba(249, 115, 22, 0.2);
  animation: giftRevealCardIn 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.gift-page-lock-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: giftBowWiggle 2.5s ease-in-out infinite;
}

.gift-page-lock-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #fed7aa;
  margin-bottom: 10px;
}

.gift-page-lock-card h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #fdba74, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gift-page-lock-card > p {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.gift-page-lock-amount {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 8px;
  color: #fde68a;
  text-shadow: 0 0 24px rgba(251, 191, 36, 0.35);
}

.gift-page-lock-balance {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.gift-page-lock-warn {
  font-size: 0.78rem;
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  margin-bottom: 12px;
}

.gift-page-lock-friends {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
  margin-top: 8px;
}

.gift-page-lock-friend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(249, 115, 22, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font: inherit;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
}

.gift-page-lock-friend:not([disabled]):hover {
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.1);
  transform: translateX(-4px);
}

.gift-page-lock-friend[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.gift-page-lock-friend-av {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(168, 85, 247, 0.15));
  border: 2px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  flex-shrink: 0;
}

.gift-page-lock-friend-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gift-page-lock-friend strong {
  display: block;
  font-size: 0.85rem;
}

.gift-page-lock-friend small {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.gift-page-lock-friend em {
  margin-right: auto;
  font-style: normal;
  font-size: 1.1rem;
}

.gift-page-lock-loading,
.gift-page-lock-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 16px;
}

body.gift-screen-shake {
  animation: giftScreenShake 0.4s ease;
}

@keyframes giftScreenShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.gifts-eliminated-lock {
  position: relative;
  margin: 24px auto;
  max-width: 420px;
  padding: 32px 24px;
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(165deg, rgba(100, 116, 139, 0.14), rgba(15, 23, 42, 0.85));
}

.gifts-eliminated-lock-aurora {
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at 50% 0%, rgba(148, 163, 184, 0.18), transparent 55%);
  pointer-events: none;
}

.gifts-eliminated-lock-icon {
  position: relative;
  z-index: 1;
  font-size: 2.8rem;
  display: block;
  margin-bottom: 12px;
}

.gifts-eliminated-lock h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 900;
  color: #e2e8f0;
}

.gifts-eliminated-lock p {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.55;
}
