/* css/tet.css */

.tet-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  pointer-events: none;
  z-index: 2000;
}

.tet-fixed img {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
}

.tet-lantern-left {
  left: 16px;
  top: 0;
  width: 150px;
}

.tet-lantern-right {
  left: auto;
  right: 16px;
  top: 0;
  width: 150px;
}

.tet-inner {
  transform-origin: top center;
}

.tet-wobble {
  animation: tetWobble 3.2s ease-in-out infinite;
}

@keyframes tetWobble {
  0%   { transform: rotate(-2.5deg) translateY(0); }
  50%  { transform: rotate(2.5deg) translateY(2px); }
  100% { transform: rotate(-2.5deg) translateY(0); }
}

/* ---------------------------
   Popup Happy New Year (image only)
   ✅ Làm thiệp to hơn bằng CSS variables
---------------------------- */
:root {
  --tet-popup-pad: 12px;
  --tet-panel-w: min(780px, 56vw);  /* ✅ tăng width mặc định */
  --tet-panel-h: 86vh;             /* ✅ tăng max-height */
}

.tet-popup {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: var(--tet-popup-pad);
  background: rgba(0, 0, 0, 0.45);
  animation: tetFadeIn 180ms ease-out both;
}

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

.tet-popup.is-hiding {
  animation: tetFadeOut 160ms ease-in both;
}

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

.tet-popup__backdrop {
  position: absolute;
  inset: 0;
}

.tet-popup__panel {
  position: relative;
  width: var(--tet-panel-w);       /* ✅ to hơn */
  max-height: var(--tet-panel-h);  /* ✅ cao hơn */
  border-radius: 18px;
  background: transparent;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
  overflow: visible;
  z-index: 1;
}

.tet-popup__imageWrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  max-height: var(--tet-panel-h);
}

.tet-popup__imageWrap img {
  display: block;
  width: 100%;
  max-height: var(--tet-panel-h);
  height: auto;
  object-fit: contain;
}

.tet-popup__close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 20px;
  line-height: 36px;
  text-align: center;
  z-index: 2;
}

.tet-popup__close:hover {
  background: rgba(0,0,0,0.75);
}

/* ---------------------------
   ✅ Responsive breakpoints (đã tăng size desktop)
---------------------------- */

/* Mobile nhỏ */
@media (max-width: 480px) {
  :root {
    --tet-popup-pad: 10px;
    --tet-panel-w: min(380px, 94vw);
    --tet-panel-h: 74vh;
  }

  .tet-lantern-left,
  .tet-lantern-right {
    width: 110px;
  }

  .tet-popup__close {
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 18px;
  }
}

/* Mobile lớn / Tablet dọc */
@media (min-width: 481px) and (max-width: 768px) {
  :root {
    --tet-panel-w: min(560px, 78vw);
    --tet-panel-h: 78vh;
  }
}

/* Tablet ngang / laptop nhỏ */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --tet-panel-w: min(720px, 88vw);
    --tet-panel-h: 82vh;
  }
}

/* Desktop */
@media (min-width: 1025px) {
  :root {
    --tet-panel-w: min(900px, 70vw); /* ✅ desktop: to hơn rõ */
    --tet-panel-h: 86vh;
  }
}

/* Desktop rất lớn */
@media (min-width: 1440px) {
  :root {
    --tet-panel-w: min(1020px, 51vw); /* ✅ màn hình lớn: lên ~1000px */
    --tet-panel-h: 88vh;
  }
}
