/* PRESENTE DIÁRIO — modal do topo (ícone Presente).
   A grade de 21 dias segue a referência: 7 por linha, dia no canto, ícone
   central, quantidade no canto inferior direito e selo VIP no topo. */

.daily-gift-overlay {
  z-index: 3400;
}

.daily-gift-box {
  width: min(720px, 96vw);
  max-height: 90vh;
  max-height: 90dvh;
  padding: 0;
  overflow: hidden auto;
  border: 1px solid rgba(64, 196, 255, 0.24);
  border-radius: 14px;
  background:
    radial-gradient(120% 95% at 12% 0%, rgba(31, 92, 150, 0.5), transparent 56%),
    radial-gradient(80% 50% at 100% 0%, rgba(12, 62, 100, 0.34), transparent 60%),
    linear-gradient(180deg, #14263c 0%, #0a111d 45%, #070b12 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  color: #dcebf7;
}

.daily-gift-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 10px;
  background: linear-gradient(105deg, rgba(15, 52, 88, 0.95), rgba(11, 25, 44, 0.34));
  border-bottom: 1px solid rgba(111, 232, 255, 0.08);
}

.dg-gift-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 211, 77, 0.2), transparent 68%);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}

.dg-gift-emoji {
  font-size: 34px;
  line-height: 1;
}

.dg-gift-star {
  position: absolute;
  top: 3px;
  right: 4px;
  color: #ffd75e;
  font-size: 15px;
  text-shadow: 0 0 8px rgba(255, 215, 94, 0.7);
  transform: rotate(12deg);
}

.dg-gift-star::after {
  content: '★';
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 8px;
  opacity: 0.8;
}

.dg-title {
  flex: 1;
  min-width: 0;
}

.dg-title-kicker {
  display: block;
  color: #6fe8ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.28em;
  line-height: 1;
}

.dg-title-main {
  margin: 3px 0 0;
  color: #f4fbff;
  font-size: clamp(20px, 4vw, 28px);
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 0 16px rgba(80, 200, 255, 0.32);
}

.daily-gift-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: flex-start;
  width: 30px;
  height: 30px;
  margin-top: -2px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(7, 14, 22, 0.7);
  color: #9fb3c8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.daily-gift-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.daily-gift-tierbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 2px;
}

.dg-tier-chip {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: #849bb0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dg-tier-chip.on {
  border-color: rgba(65, 200, 255, 0.65);
  background: rgba(65, 200, 255, 0.12);
  color: #8feaff;
  box-shadow: 0 0 12px rgba(65, 200, 255, 0.12);
}

.dg-level-now {
  margin-left: auto;
  color: #7f93a6;
  font-size: 10.5px;
  white-space: nowrap;
}

.daily-gift-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  padding: 10px 16px 8px;
}

.dg-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  aspect-ratio: 1.08;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(29, 45, 60, 0.92), rgba(13, 23, 32, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.dg-tile.future {
  opacity: 0.78;
}

.dg-tile.claimed {
  opacity: 0.52;
}

.dg-tile.claimed .dg-tile-icon {
  filter: grayscale(0.35);
}

.dg-tile.current {
  border-color: rgba(65, 200, 255, 0.9);
  background: linear-gradient(180deg, rgba(28, 73, 100, 0.95), rgba(12, 31, 47, 0.98));
  box-shadow:
    0 0 0 1px rgba(65, 200, 255, 0.3),
    0 0 20px rgba(65, 200, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dg-tile.current.ready {
  animation: dg-current-pulse 2.2s ease-in-out infinite;
}

@keyframes dg-current-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(65, 200, 255, 0.3),
      0 0 14px rgba(65, 200, 255, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(65, 200, 255, 0.55),
      0 0 26px rgba(65, 200, 255, 0.36);
  }
}

.dg-tile-icon {
  width: min(38px, 58%);
  height: min(38px, 58%);
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  pointer-events: none;
}

.dg-icon-fallback {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #8fb4cc;
  font-size: 9px;
  font-weight: 800;
}

.dg-day {
  position: absolute;
  left: 5px;
  bottom: 3px;
  color: #9fb3c8;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}

.dg-tile.current .dg-day {
  color: #8feaff;
}

.dg-count {
  position: absolute;
  right: 5px;
  bottom: 3px;
  color: #eaf6ff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}

.dg-check {
  position: absolute;
  top: 3px;
  left: 5px;
  color: #2ecc71;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 7px rgba(46, 204, 113, 0.65);
}

.dg-vip {
  position: absolute;
  top: 3px;
  right: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
}

.dg-vip.on {
  background: linear-gradient(180deg, #ffd75e, #c99a18);
  color: #2a1a00;
}

.dg-vip.locked {
  border: 1px solid rgba(255, 90, 90, 0.42);
  background: rgba(255, 90, 90, 0.14);
  color: #ff9a9a;
}

.dg-loading {
  grid-column: 1 / -1;
  padding: 42px 10px;
  color: #8fb4cc;
  font-size: 12px;
  text-align: center;
}

.dg-bonus {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(7, 16, 27, 0.7);
  color: #c7dceb;
  font-size: 11.5px;
  line-height: 1.45;
}

.dg-bonus-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
  image-rendering: pixelated;
}

.dg-bonus-icon:not([src]) {
  visibility: hidden;
}

.dg-bonus-text {
  min-width: 0;
}

.dg-bonus-strong {
  color: #ffd75e;
  font-weight: 800;
  white-space: nowrap;
}

.dg-bonus-unique {
  color: #ffd75e;
  font-weight: 700;
}

.dg-vip-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.4;
}

.dg-vip-note.dg-vip-on {
  border: 1px solid rgba(46, 204, 113, 0.28);
  background: rgba(46, 204, 113, 0.08);
  color: #a9e8c0;
}

.dg-vip-note.dg-vip-off {
  border: 1px solid rgba(255, 211, 77, 0.22);
  background: rgba(255, 211, 77, 0.06);
  color: #d9cba6;
}

.dg-vip-text {
  flex: 1;
  min-width: 0;
}

.dg-vip-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 4px 14px;
  border: 1px solid rgba(46, 204, 113, 0.6);
  border-radius: 5px;
  background: linear-gradient(180deg, #2ecc71, #1f9d57);
  color: #062518;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.dg-vip-btn:hover {
  filter: brightness(1.08);
}

.dg-note {
  margin: 0 16px 8px;
  color: #7f93a6;
  font-size: 10.5px;
  line-height: 1.4;
  text-align: center;
}

.dg-feedback {
  margin: 0 16px 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.dg-feedback.error {
  border: 1px solid rgba(248, 113, 113, 0.36);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

.dg-feedback.ok {
  border: 1px solid rgba(46, 204, 113, 0.32);
  background: rgba(46, 204, 113, 0.09);
  color: #a7f3c7;
}

.dg-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(7, 11, 18, 0.98);
  box-shadow: 0 -10px 24px rgba(7, 11, 18, 0.75);
}

.dg-timer {
  min-height: 15px;
  color: #8fa6ba;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.dg-timer.ready {
  color: #7de3b0;
}

.dg-claim {
  min-width: 210px;
  min-height: 44px;
  padding: 8px 28px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #37c7e8, #0e9fc4);
  box-shadow: 0 6px 18px rgba(55, 199, 232, 0.24);
  color: #04161f;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.dg-claim:hover:not(:disabled) {
  filter: brightness(1.08);
}

.dg-claim:focus-visible {
  outline: 2px solid #8feaff;
  outline-offset: 2px;
}

.dg-claim:disabled {
  filter: grayscale(0.45);
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
}

.dg-just-claimed {
  animation: dg-claim-flash 0.8s ease-out;
}

@keyframes dg-claim-flash {
  0% {
    filter: brightness(1.5);
  }
  100% {
    filter: brightness(1);
  }
}

/* O ponto vermelho no botão Presente da topbar. */
.daily-gift-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(7, 12, 18, 0.9);
  border-radius: 50%;
  background: #ff5a5a;
  box-shadow: 0 0 7px rgba(255, 90, 90, 0.8);
}

.daily-gift-dot[hidden] {
  display: none;
}

#daily-gift-btn {
  position: relative;
}

#daily-gift-btn.daily-gift-ready {
  color: #ffd75e;
  border-color: rgba(255, 215, 94, 0.4);
}

@media (max-width: 620px) {
  .daily-gift-box {
    width: min(96vw, 560px);
    max-height: 94dvh;
  }

  .daily-gift-head {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 10px 12px 8px;
    border-radius: 0;
    background: linear-gradient(105deg, rgba(15, 52, 88, 0.98), rgba(11, 25, 44, 0.98));
  }

  .dg-gift-art {
    width: 46px;
    height: 46px;
  }

  .dg-gift-emoji {
    font-size: 28px;
  }

  .daily-gift-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 12px 6px;
  }

  .dg-tile {
    aspect-ratio: 1.16;
  }

  .dg-bonus,
  .dg-vip-note,
  .dg-note,
  .dg-feedback {
    margin-inline: 12px;
  }

  .dg-level-now {
    display: none;
  }

  .dg-claim {
    width: 100%;
    min-width: 0;
  }
}

@media (max-height: 520px) {
  .daily-gift-box {
    max-height: 96dvh;
  }

  .daily-gift-head {
    padding-top: 8px;
    padding-bottom: 6px;
  }

  .dg-bonus,
  .dg-vip-note,
  .dg-note {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .dg-actions {
    padding-bottom: 10px;
  }
}
