/* ==========================================================================
   T4TEQ SOFTWARE SOLUTIONS - INTERACTIVE 3D POPUP MODAL (STANDALONE CSS)
   Drop this into your existing website. Fully scoped to prevent style conflicts.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@600;700;800;900&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --t4teq-modal-blue: #004494;
  --t4teq-modal-cyan: #00e5ff;
  --t4teq-modal-gold: #ffbe0b;
  --t4teq-modal-orange: #ff6a00;
  --t4teq-modal-radius: 14px;
}

/* Background Dimming & Blur when Modal is Open */
body.t4teq-modal-active {
  overflow: hidden !important;
}

/* Fullscreen Modal Shell */
#t4teq-surprise-modal.fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 14px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.45s ease;
  overflow: hidden;
  box-sizing: border-box;
}

#t4teq-surprise-modal.fullscreen-modal * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#t4teq-surprise-modal.fullscreen-modal.active {
  opacity: 1;
  visibility: visible;
}

/* Semi-Transparent Frosted Backdrop (Background Site Slightly Visible) */
#t4teq-surprise-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(8, 16, 32, 0.58) 0%, rgba(3, 7, 15, 0.76) 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1;
  cursor: pointer;
}

/* Cyber Particles Canvas */
#t4teq-surprise-modal .particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* Atmospheric Ambient Lights */
#t4teq-surprise-modal .ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 2;
  opacity: 0.35;
  transition: opacity 0.8s ease;
}

#t4teq-surprise-modal .ambient-cyan {
  width: 550px;
  height: 550px;
  background: #00d2ff;
  top: -80px;
  left: 20%;
}

#t4teq-surprise-modal .ambient-amber {
  width: 500px;
  height: 500px;
  background: #ff6a00;
  bottom: -80px;
  right: 15%;
}

/* Minimal Floating Close Button */
#t4teq-surprise-modal .floating-close-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  z-index: 1050;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  line-height: 1;
}

#t4teq-surprise-modal .floating-close-btn:hover {
  background: rgba(239, 68, 68, 0.7);
  border-color: #ef4444;
  transform: scale(1.1) rotate(90deg);
}

/* Arena Container */
#t4teq-surprise-modal .modal-arena-container {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
}

/* The Boy & 3D Notice Ensemble */
#t4teq-surprise-modal .boy-and-notice-ensemble {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: center;
  height: min(540px, 82vh, calc(95vw / 1.35));
  max-width: 98vw;
  margin: auto;
}

/* Left: Boy Character Holder */
#t4teq-surprise-modal .boy-holder-wrapper {
  position: relative;
  height: 100%;
  aspect-ratio: 615 / 1024;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  margin-right: -2px; /* Seamless physical grip on the board edge */
  z-index: 15;
  cursor: pointer;
}

#t4teq-surprise-modal .boy-img {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 100%;
  width: auto;
  object-fit: contain;
  opacity: 0;
  transform: translateY(0) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s ease;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 20px rgba(0, 229, 255, 0.25));
  pointer-events: none;
}

#t4teq-surprise-modal .boy-img.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#t4teq-surprise-modal .boy-holder-wrapper.reacting {
  animation: t4teqBoyNoticeReaction 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#t4teq-surprise-modal .boy-shadow-disc {
  position: absolute;
  bottom: -4px;
  left: 10%;
  width: 80%;
  height: 16px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.8) 0%, transparent 75%);
  filter: blur(5px);
  z-index: -1;
}

/* Right: 3D Notice Board */
#t4teq-surprise-modal .notice-board-wrapper {
  perspective: 1600px;
  height: 98%;
  aspect-ratio: 819 / 1024;
  position: relative;
  z-index: 12;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: var(--t4teq-modal-radius);
  transition: transform 0.25s ease-out;
}

#t4teq-surprise-modal .notice-flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform-origin: center center; /* In-place rotation - position does not shift */
  transition: transform 0.85s cubic-bezier(0.34, 1.25, 0.64, 1);
  border-radius: var(--t4teq-modal-radius);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 229, 255, 0.25);
  outline: none;
}

/* 3D Flip State */
#t4teq-surprise-modal .notice-flipper.is-flipped {
  transform: rotateY(180deg);
  box-shadow: 0 25px 75px rgba(0, 0, 0, 0.85), 0 0 45px rgba(255, 106, 0, 0.4), 0 0 35px rgba(255, 190, 11, 0.35);
}

#t4teq-surprise-modal .notice-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--t4teq-modal-radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: #0b121e;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

/* Notice Back (Initial Cyber Lock View) */
#t4teq-surprise-modal .notice-back {
  transform: rotateY(0deg);
  border-color: rgba(0, 229, 255, 0.4);
  background-color: #060b14;
  box-shadow: inset 0 0 35px rgba(0, 229, 255, 0.2);
  position: relative;
  overflow: hidden;
}

#t4teq-surprise-modal .notice-back-artwork {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--t4teq-modal-radius);
  z-index: 1;
  display: block;
}

#t4teq-surprise-modal .holographic-glare {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35) 0%, rgba(0, 229, 255, 0.15) 30%, transparent 65%);
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: color-dodge;
  transition: opacity 0.3s;
  z-index: 3;
}

#t4teq-surprise-modal .notice-back-overlay {
  position: relative;
  z-index: 5;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 18px 16px;
  background: linear-gradient(
    180deg,
    rgba(3, 8, 18, 0.8) 0%,
    rgba(3, 8, 18, 0.2) 22%,
    rgba(3, 8, 18, 0) 50%,
    rgba(3, 8, 18, 0.2) 75%,
    rgba(3, 8, 18, 0.88) 100%
  );
  box-sizing: border-box;
}

#t4teq-surprise-modal .notice-top-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-top: 4px;
}

#t4teq-surprise-modal .notice-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(5, 15, 32, 0.88);
  border: 1px solid rgba(0, 229, 255, 0.45);
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
  backdrop-filter: blur(8px);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

#t4teq-surprise-modal .confidential-dot {
  width: 7px;
  height: 7px;
  background: #00e5ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #00e5ff;
  animation: t4teqPulse 1.5s infinite;
}

#t4teq-surprise-modal .notice-banner-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 229, 255, 0.6);
  text-transform: uppercase;
  line-height: 1.2;
}

#t4teq-surprise-modal .notice-bottom-action {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

#t4teq-surprise-modal .turn-notice-btn {
  background: linear-gradient(90deg, #0056b3, #00c6ff);
  color: #ffffff;
  padding: 11px 22px;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(0, 198, 255, 0.5), 0 0 15px rgba(0, 229, 255, 0.35);
  animation: t4teqPulseGlow 2s infinite;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  user-select: none;
}

#t4teq-surprise-modal .turn-hand-icon {
  font-size: 1.15rem;
  animation: t4teqTapBounce 1.5s infinite;
}

#t4teq-surprise-modal .turn-action-primary {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#t4teq-surprise-modal .turn-arrow-indicator {
  font-size: 1.1rem;
}

/* Notice Front (Revealed Offer Poster) */
#t4teq-surprise-modal .notice-front {
  transform: rotateY(180deg);
  border-color: rgba(255, 106, 0, 0.5);
  background-color: #034b9d;
}

#t4teq-surprise-modal .official-notice-artwork {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

#t4teq-surprise-modal .front-clickable-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.15) 30%, transparent 60%);
  z-index: 10;
  pointer-events: auto;
}

#t4teq-surprise-modal .small-claim-btn {
  background: linear-gradient(135deg, #ff6a00 0%, #ffbe0b 100%);
  color: #050b17;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 9px 20px;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(255, 106, 0, 0.5), 0 0 15px rgba(255, 190, 11, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: t4teqPulseGlow 2.2s infinite;
  cursor: pointer;
}

#t4teq-surprise-modal .small-claim-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 30px rgba(255, 106, 0, 0.7);
}

#t4teq-surprise-modal .revealed-border-burst {
  position: absolute;
  inset: 0;
  border: 2px solid #ffbe0b;
  border-radius: var(--t4teq-modal-radius);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#t4teq-surprise-modal .notice-flipper.is-flipped .revealed-border-burst {
  opacity: 1;
  box-shadow: inset 0 0 25px rgba(255, 190, 11, 0.4);
}

#t4teq-surprise-modal .notice-shadow-disc {
  position: absolute;
  bottom: -6px;
  left: 5%;
  width: 90%;
  height: 18px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.85) 0%, transparent 75%);
  filter: blur(6px);
  z-index: -1;
}

/* Floating Persistent Reopen Trigger (Bottom Right) */
.t4teq-floating-reopen-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: rgba(8, 16, 32, 0.85);
  border: 1.5px solid rgba(0, 229, 255, 0.4);
  padding: 10px 18px;
  border-radius: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.25);
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, border-color 0.25s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #ffffff;
}

.t4teq-floating-reopen-btn:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: #00e5ff;
}

.t4teq-floating-gift {
  font-size: 1.3rem;
}

.t4teq-floating-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.t4teq-floating-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: #00e5ff;
}

.t4teq-floating-sub {
  font-weight: 700;
  font-size: 0.84rem;
  color: #ffffff;
}

/* Animations */
@keyframes t4teqPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes t4teqPulseGlow {
  0%, 100% { box-shadow: 0 6px 25px rgba(0, 198, 255, 0.45); }
  50% { box-shadow: 0 10px 35px rgba(0, 229, 255, 0.8), 0 0 20px rgba(0, 229, 255, 0.5); }
}

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

@keyframes t4teqBoyNoticeReaction {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-20px) scale(1.05); }
  50% { transform: translateY(-6px) scale(1.02); }
  75% { transform: translateY(-14px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

/* Mobile & Tablet Responsive */
@media (max-width: 1024px) {
  #t4teq-surprise-modal .boy-and-notice-ensemble {
    height: min(480px, 80vh, calc(95vw / 1.35));
  }
}

@media (max-width: 768px) {
  #t4teq-surprise-modal.fullscreen-modal {
    padding: 10px;
    justify-content: center;
  }
  
  #t4teq-surprise-modal .modal-arena-container {
    padding: 0;
  }
  
  #t4teq-surprise-modal .boy-and-notice-ensemble {
    height: min(400px, 75vh, calc(96vw / 1.35));
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: center;
  }
  
  #t4teq-surprise-modal .floating-close-btn {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  #t4teq-surprise-modal .notice-back-overlay {
    padding: 12px 10px;
  }
  
  #t4teq-surprise-modal .notice-banner-title {
    font-size: 1.05rem;
  }

  #t4teq-surprise-modal .notice-tag-badge {
    padding: 3px 8px;
    font-size: 0.6rem;
  }
  
  #t4teq-surprise-modal .turn-notice-btn {
    padding: 8px 14px;
    gap: 6px;
  }
  
  #t4teq-surprise-modal .turn-action-primary {
    font-size: 0.74rem;
  }
  
  #t4teq-surprise-modal .small-claim-btn {
    font-size: 0.8rem;
    padding: 8px 16px;
    gap: 6px;
  }

  .t4teq-floating-reopen-btn {
    bottom: 16px;
    right: 16px;
    padding: 8px 14px;
  }
}

@media (max-width: 420px) {
  #t4teq-surprise-modal .boy-and-notice-ensemble {
    height: min(340px, 72vh, calc(96vw / 1.35));
  }
  
  #t4teq-surprise-modal .notice-back-overlay {
    padding: 10px 8px;
  }

  #t4teq-surprise-modal .notice-banner-title {
    font-size: 0.92rem;
  }

  #t4teq-surprise-modal .notice-tag-badge {
    padding: 2px 7px;
    font-size: 0.54rem;
  }

  #t4teq-surprise-modal .turn-notice-btn {
    padding: 7px 11px;
    gap: 5px;
  }

  #t4teq-surprise-modal .turn-action-primary {
    font-size: 0.68rem;
  }

  #t4teq-surprise-modal .turn-hand-icon {
    font-size: 0.95rem;
  }
  
  #t4teq-surprise-modal .small-claim-btn {
    font-size: 0.74rem;
    padding: 7px 12px;
  }
}
