/* gift_modal.css — стили для модалки подарков, анимаций, праздничных эффектов */

.gift-modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 320px;
  min-height: 220px;
  /* Базовый градиент (по умолчанию) */
  background: linear-gradient(135deg, #23234a 0%, #3faaff 100%);
  box-shadow: 0 0 48px 0 #3faaff77, 0 2px 32px 0 rgba(0,0,0,0.22);
  border: 2.5px solid #fff3;
  filter: drop-shadow(0 0 24px #3faaff88);
  border-radius: 22px;
  padding: 2.2em 2em 2em 2em;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 520px;
  animation: card-fadein 0.5s cubic-bezier(.4,1.4,.6,1) both;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  border-radius: 16px !important;
  max-width: 480px !important;
  width: 96vw !important;
}
.gift-modal--rare {
  box-shadow: 0 0 48px 0 #a18fff77, 0 2px 32px 0 rgba(0,0,0,0.22);
  border-color: #a18fff99;
  background: linear-gradient(135deg, #4b2e4d 0%, #a18fff 100%);
  filter: drop-shadow(0 0 32px #a18fff88);
}
.gift-modal--legendary {
  box-shadow: 0 0 56px 0 #FFD70099, 0 2px 36px 0 rgba(0,0,0,0.22);
  border-color: #FFD700cc;
  background: linear-gradient(135deg, #4d3a1a 0%, #FFD700 100%);
  filter: drop-shadow(0 0 40px #FFD700cc);
}
.gift-modal--advice {
  background: linear-gradient(135deg, #2e4d2e 0%, #4fd17a 100%);
  box-shadow: 0 0 48px 0 #4fd17a77, 0 2px 32px 0 rgba(0,0,0,0.22);
  border-color: #4fd17a99;
  filter: drop-shadow(0 0 24px #4fd17a88);
}
.gift-modal--meme {
  background: linear-gradient(135deg, #1a2e4d 0%, #3faaff 100%);
  box-shadow: 0 0 48px 0 #3faaff77, 0 2px 32px 0 rgba(0,0,0,0.22);
  border-color: #3faaff99;
  filter: drop-shadow(0 0 24px #3faaff88);
}
.gift-modal--motivation {
  background: linear-gradient(135deg, #4d2e1a 0%, #ffb347 100%);
  box-shadow: 0 0 48px 0 #ffb34777, 0 2px 32px 0 rgba(0,0,0,0.22);
  border-color: #ffb34799;
  filter: drop-shadow(0 0 24px #ffb34788);
}
@keyframes card-fadein {
  0% { opacity: 0; transform: scale(0.95);}
  100% { opacity: 1; transform: scale(1);}
}
.gift-modal .gift-animation {
  margin-bottom: 1.5em;
  max-width: 200px;
  max-height: 160px;
  filter: drop-shadow(0 0 16px #3faaff55);
}
.gift-modal--rare .gift-animation {
  filter: drop-shadow(0 0 18px #a18fff88);
}
.gift-modal--legendary .gift-animation {
  filter: drop-shadow(0 0 22px #FFD700cc);
}
.gift-modal .gift-text {
  background: rgba(255,255,255,0.18);
  border-radius: 16px;
  padding: 1.1em 1.2em;
  color: #fff;
  text-shadow: 0 2px 8px #000a, 0 1px 0 #222, 0 0 6px #fff8;
  margin-bottom: 1.7em;
  margin-top: 0.7em;
  max-height: 45vh;
  overflow-y: auto;
  padding: 0.7em 0.5em 0.7em 0.5em;
  line-height: 1.7;
  position: relative;
  backdrop-filter: blur(2.5px);
  box-shadow: 0 2px 16px #fff2;
}
.gift-modal .gift-text--center {
  text-align: center;
}
@media (max-width: 600px) {
  .gift-modal .gift-text {
    font-size: 1.05em;
    text-align: center;
  }
}
.gift-text-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2.5em;
  background: linear-gradient(transparent, rgba(34,34,34,0.92));
  pointer-events: none;
  border-radius: 0 0 18px 18px;
}
.gift-modal .gift-close-btn {
  background: linear-gradient(90deg, #fff 0%, #a18fff 100%);
  color: #3a2e7a;
  border: none;
  box-shadow: 0 2px 12px #a18fff44, 0 0 0 2px #fff2 inset;
  border-radius: 1.2em;
  font-weight: 600;
  font-size: 1.18em;
  padding: 0.7em 2.2em;
  margin-top: 1.2em;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  filter: drop-shadow(0 0 8px #fff6);
  position: relative;
  overflow: hidden;
}
.gift-close-btn::before {
  content: '';
  position: absolute;
  left: -60%;
  top: 0;
  width: 220%;
  height: 100%;
  background: linear-gradient(90deg, #fff6, #ffe066 40%, #a18fff 60%, #fff6 100%);
  opacity: 0.45;
  transform: skewX(-18deg) translateX(-60%);
  transition: opacity 0.3s, transform 0.7s cubic-bezier(.4,1.4,.6,1);
  pointer-events: none;
}
.gift-close-btn:hover::before {
  opacity: 0.85;
  transform: skewX(-18deg) translateX(0%);
}
.gift-close-btn:hover, .gift-close-btn:focus {
  box-shadow: 0 4px 24px #a18fff99, 0 0 0 4px #fff3 inset, 0 0 16px #ffe06688;
  transform: scale(1.045);
  z-index: 1;
}
.gift-close-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px #a18fff55, 0 0 0 2px #fff2 inset;
}
.gift-modal .gift-close-btn--wide {
  width: 90% !important;
  max-width: 420px !important;
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
@media (max-width: 600px) {
  .gift-close-btn--wide {
    width: 98vw !important;
    max-width: 99vw !important;
  }
}

.gift-anim-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 260px;
  min-height: 220px;
  padding: 2em 1.5em 2em 1.5em;
}
.gift-anim-stage .gift-animation {
  max-width: 220px;
  max-height: 180px;
  margin-bottom: 1.2em;
}
.gift-anim-opening-text {
  color: #fff;
  font-size: 1.18em;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 2px 12px #000a;
  margin-top: 0.5em;
}

#gift-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1001 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.gift-type-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92%;
  max-width: 98%;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.18em;
  font-weight: 700;
  border-radius: 1.6em;
  padding: 0.48em 0;
  margin-bottom: 0.9em;
  margin-top: 0.2em;
  background: linear-gradient(90deg, #232b3a 60%, #2e3a4d 100%);
  color: #fff;
  box-shadow: 0 2px 16px #3faaff44, 0 0 0 4px #fff1 inset;
  letter-spacing: 0.01em;
  border: 2px solid #3faaff88;
  animation: badge-fadein 0.7s cubic-bezier(.4,1.4,.6,1) both;
  filter: drop-shadow(0 0 8px #3faaff55);
  transition: box-shadow 0.2s, filter 0.2s;
  border-radius: 16px !important;
}
@media (max-width: 600px) {
  .gift-type-badge {
    width: 100%;
    min-width: 0;
    font-size: 1.08em;
  }
}
.gift-type-badge:hover {
  box-shadow: 0 4px 24px #3faaff99, 0 0 0 6px #fff2 inset;
  filter: drop-shadow(0 0 16px #3faaffcc);
}
.gift-type-badge .emoji {
  font-size: 1.28em;
  margin-right: 0.3em;
}
.gift-type-badge--advice {
  background: linear-gradient(90deg, #2e4d2e 60%, #4fd17a 100%);
  border-color: #4fd17a99;
}
.gift-type-badge--poem {
  background: linear-gradient(90deg, #4b2e4d 60%, #a18fff 100%);
  border-color: #a18fff99;
}
.gift-type-badge--meme {
  background: linear-gradient(90deg, #3a2e1a 60%, #ffe066 100%);
  border-color: #ffe06699;
  color: #2e2e1a;
}
.gift-type-badge--riddle {
  background: linear-gradient(90deg, #2e3a4d 60%, #3faaff 100%);
  border-color: #3faaff99;
}
.gift-type-badge--compliment {
  background: linear-gradient(90deg, #4d2e2e 60%, #ffb347 100%);
  border-color: #ffb34799;
}
@keyframes badge-fadein {
  0% { opacity: 0; transform: translateY(-12px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.gift-modal-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(255,255,255,0.18);
  border-top: 4px solid #ff8c00;
  border-radius: 50%;
  margin: 1.1em auto 0.7em auto;
  animation: gift-modal-spin 0.9s linear infinite;
  box-shadow: 0 0 12px #ff8c0033;
}
@keyframes gift-modal-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.gift-text-shimmer {
  background: linear-gradient(90deg, #ff8ae2, #8aefff, #fff700, #ff8ae2 80%);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer-rainbow 2.5s linear infinite;
}
@keyframes shimmer-rainbow {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
} 
@keyframes fadein {
  0% { opacity: 0; transform: translateY(-12px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.gift-rarity--common, .gift-common-note {
  color: #fff !important;
  font-size: 0.89em !important;
  font-style: italic !important;
  opacity: 0.85 !important;
  text-align: center !important;
  margin: 0.7em 0 0.7em 0 !important;
  letter-spacing: 0.01em;
  font-weight: 400;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.gift-modal .gift-text {
  background: rgba(255,255,255,0.82) url('racoon_icon.svg') no-repeat right bottom !important;
  background-size: 48px auto !important;
  color: #23234a !important;
  box-shadow: 0 2px 16px #aee1ff33 !important;
  border: none !important;
  backdrop-filter: blur(3.5px) !important;
  text-shadow: none !important;
}
.gift-close-btn {
  position: relative;
  overflow: hidden;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s, transform 0.18s;
  border-radius: 16px !important;
}
.gift-close-btn:active::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, #aee1ff55 0%, #fffbe6 80%, transparent 100%);
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0.7;
  pointer-events: none;
  animation: ripple 0.5s linear;
}
@keyframes ripple {
  0% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.7); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
} 
.gift-common-note {
  color: #fff !important;
  font-size: 0.98em !important;
  font-style: italic !important;
  opacity: 0.72 !important;
  text-align: center !important;
  margin: 1.2em 0 0.2em 0 !important;
  letter-spacing: 0.01em;
  font-weight: 400;
}
.gift-modal .gift-text {
  width: 85% !important;
  max-width: 520px !important;
  padding: 1.5em 1.2em !important;
  border-radius: 20px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
@media (max-width: 600px) {
  .gift-modal .gift-text {
    width: 98vw !important;
    max-width: 99vw !important;
    padding: 1.1em 0.5em !important;
    border-radius: 14px !important;
  }
} 
/* --- FLEX layout для gift-modal --- */
.gift-modal {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  min-height: 320px;
  width: 96vw;
  max-width: 480px;
  justify-content: flex-start;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden; /* только один скролл */
}

/* --- FLEX-скроллируемый блок с текстом подарка --- */
.gift-modal-scrollbox {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1em 1.2em;
  background: rgba(255,255,255,0.13);
  border-radius: 14px;
  box-shadow: 0 1px 8px #aee1ff22;
  box-sizing: border-box;
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.gift-modal .gift-type-badge,
.gift-modal .gift-rarity {
  min-height: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08em;
  margin: 0.2em 0 0.7em 0;
  padding: 0.3em 1em;
  border-radius: 1.2em;
  background: linear-gradient(90deg, #fffbe6 0%, #aee1ff 100%);
  color: #3a2e7a;
  box-shadow: 0 2px 16px #aee1ff33;
}

.gift-modal .gift-text {
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* --- Фиксированная кнопка закрытия всегда внизу --- */
.gift-modal-close-fixed {
  display: block;
  width: 90%;
  margin: 0.7em auto 0.5em auto;
  position: static;
  background: linear-gradient(90deg, #fff 0%, #aee1ff 100%);
  color: #3a2e7a;
  border-radius: 16px;
  box-shadow: 0 2px 12px #aee1ff44;
  border: none;
  padding: 0.7em 2.2em;
  font-size: 1.08em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.gift-modal-close-fixed:hover {
  background: linear-gradient(90deg, #aee1ff 0%, #fff 100%);
}

@media (max-width: 500px) {
  .gift-modal-scrollbox {
    font-size: 0.93em;
    padding: 0.7em 0.5em;
    border-radius: 8px;
  }
  .gift-modal .gift-type-badge,
  .gift-modal .gift-rarity {
    font-size: 0.95em;
    padding: 0.2em 0.7em;
    border-radius: 0.9em;
  }
  .gift-modal-close-fixed {
    font-size: 0.98em;
    padding: 0.6em 1.2em;
  }
} 