/* ════════════════════════════════════════════════
   MAIN STYLES — BloxGifts UI
   ════════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #030814;
  color: #0f2942;
  overflow-x: hidden;
  min-height: 100vh;
}

.root-container {
  position: relative;
  z-index: 20;
  max-width: 1400px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 60px 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

/* ════════════════════════════
   WINTER DECORATIONS
   ════════════════════════════ */
.winter-decor {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.winter-ornament {
  position: absolute;
  top: 0;
  left: 24px;
  width: 72px;
  height: auto;
  transform-origin: top center;
  animation: winter-swing 5s ease-in-out infinite;
}

.winter-crystal {
  position: absolute;
  top: 12px;
  right: 18px;
  width: 80px;
  height: auto;
  animation: winter-float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.5));
}

@keyframes winter-swing {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

@keyframes winter-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ════════════════════════════
   SNOWFLAKES
   ════════════════════════════ */
.snowflakes {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -30px;
  color: rgba(224, 242, 254, 0.9);
  opacity: 0.6;
  user-select: none;
  animation: snowfall linear infinite;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}

@keyframes snowfall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.2; }
}

/* ════════════════════════════
   HERO CARD
   ════════════════════════════ */
.hero-card {
  order: 2;
  position: relative;
  width: 500px;
  flex-shrink: 0;
  background: rgba(244, 249, 255, 0.97);
  border-radius: 24px;
  border: 1.5px solid rgba(56, 189, 248, 0.38);
  box-shadow: 0 0 60px rgba(56, 189, 248, 0.16),
              0 8px 32px rgba(0, 15, 40, 0.25);
  padding: 38px 30px 30px;
  text-align: center;
}

.mascot-wrapper {
  position: absolute;
  top: -80px;
  right: -14px;
  width: 118px;
  pointer-events: none;
}

.mascot-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(2, 132, 199, 0.35));
}

.hero-title {
  font-size: 26px;
  font-weight: 700;
  color: #0f2942;
  margin-bottom: 4px;
}

.hero-subtitle {
  font-size: 14px;
  color: #4b6b88;
  margin-bottom: 24px;
}

/* ── REWARD CARDS ── */
.reward-cards {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.reward-card {
  position: relative;
  width: 196px;
  height: 202px;
  background: #f0f7ff;
  border: 2px solid #bae6fd;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 12px;
  transition: all 0.2s ease;
  overflow: hidden;
  font-family: inherit;
}

.reward-card:hover {
  border-color: #38bdf8;
  background: #e6f3ff;
  transform: translateY(-2px);
}

.reward-card.selected {
  background: #e0f2fe;
  border-color: #0284c7;
  box-shadow: 0 0 22px rgba(2, 132, 199, 0.18);
}

.reward-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: #0284c7;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 22px;
}

.reward-card.selected .reward-check {
  display: flex;
}

.corner-frost {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.corner-flake {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 15px;
  color: #38bdf8;
  opacity: 0.65;
  pointer-events: none;
}

.reward-icon {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.reward-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f2942;
}

.reward-subtitle {
  font-size: 12px;
  color: #4b6b88;
}

/* ── USERNAME INPUT ── */
.username-section {
  display: none;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  animation: fadeSlideUp 0.3s ease;
}

.username-section.show {
  display: flex;
}

.username-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1.5px solid #bae6fd;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s;
}

.username-input-wrap:focus-within {
  border-color: #0284c7;
}

.user-icon {
  font-size: 14px;
  opacity: 0.55;
}

.username-input {
  width: 100%;
  padding: 10px 0;
  border: none;
  font-size: 13px;
  background: transparent;
  color: #0f2942;
  outline: none;
  font-family: inherit;
}

.username-input::placeholder {
  color: #7b9bb8;
}

.next-btn {
  width: auto;
  padding: 0 18px;
  white-space: nowrap;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.next-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.next-btn:not(:disabled) {
  background: linear-gradient(180deg, #0ea5e9 0%, #0369a1 100%);
}

.next-btn:not(:disabled):hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── CONFIRM PROFILE STEP ── */
.confirm-step {
  display: none;
  flex-direction: column;
  align-items: center;
  animation: fadeSlideUp 0.25s ease;
}

.confirm-step.show {
  display: flex;
}

.confirm-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #f8f4f0;
  border: 2px solid #efe3d7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 14px;
}

.confirm-avatar svg {
  width: 44px;
  height: 44px;
}

.confirm-name {
  font-size: 18px;
  font-weight: 700;
  color: #642c1c;
  line-height: 1.2;
}

.confirm-handle {
  font-size: 13px;
  color: #7a6a5e;
  margin-bottom: 18px;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.btn-confirm {
  min-width: 106px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, filter 0.15s;
}

.btn-confirm:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-no {
  background: #ef4444;
}

.btn-yes {
  background: #16a34a;
}

/* ── QUEST IFRAME STEP ── */
.quest-step {
  display: none;
  flex-direction: column;
  width: 100%;
  animation: fadeSlideUp 0.25s ease;
}

.quest-step.show {
  display: flex;
}

.quest-frame {
  width: 100%;
  height: 490px;
  border: none;
  border-radius: 14px;
  background: #fff;
}

/* ── ADBLUE OFFER STEP ── */
.offers-step {
  display: none;
  flex-direction: column;
  align-items: center;
  animation: fadeSlideUp 0.3s ease;
}

.offers-step.show {
  display: flex;
}

.offer-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.offer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f0f7ff;
  border: 1.5px solid #bae6fd;
  border-radius: 14px;
  text-decoration: none;
  color: #0f2942;
  transition: all 0.2s ease;
  animation: fadeSlideUp 0.35s ease both;
  cursor: pointer;
}

.offer-card:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.15);
}

.offer-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.offer-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.offer-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f2942;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offer-desc {
  font-size: 11px;
  color: #4b6b88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offer-arrow {
  flex-shrink: 0;
  font-size: 18px;
  color: #0284c7;
  font-weight: 700;
  transition: transform 0.2s;
}

.offer-card:hover .offer-arrow {
  transform: translateX(4px);
}

.offer-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  color: #4b6b88;
  font-size: 14px;
}

.offer-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #bae6fd;
  border-top: 3px solid #0284c7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.offer-empty {
  text-align: center;
  padding: 30px 0;
  color: #4b6b88;
  font-size: 13px;
}

/* ════════════════════════════
   SECTION CARDS (Help, Chat)
   ════════════════════════════ */
.section-card {
  width: 390px;
  height: 540px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(244, 249, 255, 0.97);
  border-radius: 24px;
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 36px rgba(56, 189, 248, 0.12),
              0 4px 16px rgba(0, 15, 40, 0.2);
  padding: 22px;
}

.help-card {
  order: 1;
}

.chat-card {
  order: 3;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.card-header--chat {
  justify-content: space-between;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: #0284c7;
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
}

.chat-icon {
  font-size: 15px;
  background: #0284c7;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f2942;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 11px;
  color: #4b6b88;
  line-height: 1.2;
}

.active-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* ── FAQ ACCORDION ── */
.faq-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid #dbeafe;
  border-radius: 14px;
  padding: 4px 12px;
  overflow-y: auto;
}

.faq-list::-webkit-scrollbar {
  width: 5px;
}

.faq-list::-webkit-scrollbar-thumb {
  background: #bae6fd;
  border-radius: 3px;
}

.faq-item {
  border-bottom: 1px solid #eff6ff;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9.5px 2px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: #0f2942;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
  font-family: inherit;
}

.faq-question:hover {
  color: #0284c7;
}

.faq-arrow {
  font-size: 13px;
  transition: transform 0.3s;
  color: #4b6b88;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 150px;
  padding: 0 2px 10px;
}

.faq-answer p {
  font-size: 12px;
  color: #4b6b88;
  line-height: 1.45;
}

/* ── LIVE CHAT ── */
.active-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.active-count {
  font-size: 12px;
  color: #22c55e;
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid #dbeafe;
  border-radius: 14px;
  margin-bottom: 10px;
  scroll-behavior: smooth;
  font-family: 'JetBrains Mono', monospace;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #bae6fd;
  border-radius: 3px;
}

.chat-msg {
  font-size: 12px;
  line-height: 1.45;
  color: #3d2b22;
  animation: fadeIn 0.3s ease;
}

.chat-msg .chat-user {
  font-weight: 700;
  color: #7c3aed;
  text-decoration: underline;
  cursor: pointer;
}

.chat-msg.claim .chat-user {
  color: #16a34a;
}

.chat-msg.claim {
  color: #16a34a;
  font-weight: 600;
}

.chat-msg.nitro-claim {
  color: #8b5cf6;
}

.chat-msg.nitro-claim .chat-user {
  color: #8b5cf6;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: #fff;
  border: 1.5px solid #bae6fd;
  border-radius: 12px;
  opacity: 0.78;
}

.send-icon {
  font-size: 13px;
  color: #4b6b88;
}

.lock-icon {
  font-size: 13px;
  opacity: 0.7;
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #4b6b88;
  outline: none;
  font-family: inherit;
}



/* ════════════════════════════
   RESPONSIVE
   ════════════════════════════ */
@media (max-width: 960px) {
  .root-container {
    flex-direction: column;
    min-height: auto;
    padding: 70px 14px 70px;
  }

  .hero-card {
    order: 1;
    width: 100%;
    max-width: 440px;
    padding: 30px 20px 24px;
  }

  .help-card {
    order: 2;
    width: 100%;
    max-width: 440px;
    height: auto;
  }

  .chat-card {
    order: 3;
    width: 100%;
    max-width: 440px;
    height: 360px;
  }

  .faq-list {
    max-height: none;
  }

  .mascot-wrapper {
    width: 90px;
    top: -55px;
    right: -10px;
  }

  .hero-title {
    font-size: 22px;
  }

  .reward-cards {
    gap: 10px;
  }

  .reward-card {
    width: 125px;
    height: 140px;
  }

  .section-card {
    padding: 20px 18px;
  }

  .winter-ornament {
    width: 50px;
    left: 10px;
  }

  .winter-crystal {
    width: 44px;
    right: 10px;
  }
}
