@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300..700&display=swap');
* {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* General reset and centering */
body {
  margin: 0;
  padding: 10px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #f5f0eb; /* Soft cream fallback */
  
  /* I-load ang pattern.png at i-repeat ito nang walang katapusan */
  background-image: url('pattern.png');
  background-repeat: repeat;
  background-size: 17vh; 
  
  /* Napakabagal na takbo para maging sobrang soft at hindi nakakahilo */
  animation: movePattern 50s linear infinite; 
  
  font-family: "Fredoka", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  
  box-sizing: border-box;
  overflow-x: hidden;
}

/* --- DIAGONAL PATTERN MOVEMENT (67.5 deg) --- */
@keyframes movePattern {
  0% {
    background-position: 0px 0px;
  }
  100% {
    background-position: 149px -360px; 
  }
}

/* ========================================== */
/* TOP LAYER DECORATION                       */
/* ========================================== */

.card-deco-layer {
  position: absolute;
  
  /* I-force natin ang image na magsimula talaga sa pinaka-sulok ng card */
  top: -15px;
  left: -15px;
  width: calc(100% + 30px);
  height: calc(100% + 30px);
  
  object-fit: fill; 
  pointer-events: none; 
  
  /* Mas mababa dapat ito sa z-index ng avatar image para hindi nito matakpan ang sining mo */
  z-index: 5; 
}

/* Card Container - Base Size */
.card-container {
  width: 500px; 
  height: 320px;
  perspective: 1000px;
  position: relative;
  overflow: visible; 
}

/* The flipping card wrapper */
.card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible; 
}

/* Class to trigger via JS */
.card.is-flipped {
  transform: rotateY(180deg);
}

/* Common style for both faces */
.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  box-sizing: border-box;
  padding: 25px; 
  
  display: flex;
  flex-direction: column;
  justify-content: space-between; 
  overflow: visible; /* Pinapayagang lumampas ang dekorasyon sa gilid */
}

/* FRONT FACE BACKGROUND */
.card-front {
  background-image: url('card-base.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  color: #5a4b41;
}

/* BACK FACE BACKGROUND */
.card-back {
  background-image: url('card-base.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  transform: rotateY(180deg);
  color: #5a4b41;
}

/* FRONT DESIGN LAYOUT (40% / 60% Split with Gap adjustments) */
.profile-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 40px; 
}

/* Avatar Box: Ang frame lamang */
.avatar-box {
  width: calc(40% - 10px);
  aspect-ratio: 1 / 1; 
  flex-shrink: 0;
  border-radius: 12px;
  position: relative; 
  right: -20px;
  box-sizing: border-box;
  background-color: transparent; 
}

/* Pseudo-element para sa puting background sa loob LAMANG ng frame */
.avatar-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 10px;
  z-index: 1; 
}

/* Avatar Image */
.avatar-img {
  width: 110%;  
  height: auto; 
  object-fit: contain; 
  
  position: absolute;
  bottom: -5px;  
  left: 50%;     
  transform: translateX(-50%) scale(1.15); 
  transform-origin: bottom center; 
  
  z-index: 10; 
}

/* Info and Bio Text takes exactly 60% */
.info-text {
  width: calc(60% - 5px);
  flex-shrink: 0;
  box-sizing: border-box;
  position: relative;
  right: -15px;
  top: 10px;
}

.info-text h2.username {
  margin: 0 0 3px 0;
  font-size: 20px;
  color: #5a4b41;
  font-weight: bold;
}

.info-text .bio-line {
  margin: 0;
  font-size: 11px; 
  line-height: 1.3;
  color: #705d51;
  word-wrap: break-word; 
}

/* Divider Asset */
.divider-container {
  text-align: center;
  width: 100%;
}

.divider-img {
  width: 50%;
  height: auto;
  display: inline-block;
}

/* Socials Section */
.socials-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.find-on-text {
  font-size: 11px;
  font-style: italic;
  margin-bottom: 5px;
  color: #8c7b70;
  position: relative;
  top: -15px;
}

.social-icons {
  display: flex;
  gap: 14px;
  position: relative;
  top: -15px;
}

.icon-btn img {
  width: 32px;
  height: 32px;
  transition: transform 0.2s;
}

.icon-btn img:hover {
  transform: scale(1.15);
}

/* Flip Button Styling (May float animation) */
.flip-btn {
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 25px;
  transition: transform 0.2s;
  padding: 0;
  animation: floatButton 2s ease-in-out infinite; 
}

.flip-btn:hover {
  transform: scale(1.05);
}

.flip-btn img {
  width: 170px;
  display: block;
}

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


/* ========================================== */
/* BACK OF CARD LAYOUT                        */
/* ========================================== */

.back-content-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: 10px;
}

.illustration-box {
  width: 40%; 
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  right: -20px;
  z-index: 10;
}

.back-illustration {
  height: 85%; 
  width: auto;  
  object-fit: contain;
  display: block;
}

.discord-section {
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 10px;
}

.discord-tag {
    font-size: 11px; 
  line-height: 1.3;
  color: #705d51;
  word-wrap: break-word; 
  position: relative;
  top: -13px;
  
}
.discord-ticket-wrapper {
  position: relative;
  width: 100%;
}

.ticket-bg {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================== */
/* CUTE BOTTLE SHAKE ANIMATION                */
/* ========================================== */

.bottle-shake {
  animation: jarShake 0.4s ease-in-out;
}

@keyframes jarShake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-6deg) translateX(-3px); }
  40% { transform: rotate(5deg) translateX(3px); }
  60% { transform: rotate(-4deg) translateX(-2px); }
  80% { transform: rotate(3deg) translateX(1px); }
}

/* ========================================== */
/* DISCORD POP-UP MODAL STYLE                 */
/* ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(43, 38, 35, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-image: url('discord-card.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  
  width: 380px; 
  height: 240px; 
  border: none;
  box-sizing: border-box;
  padding: 25px;
  
  display: flex;
  flex-direction: column;
  justify-content: center; 
  align-items: center;
  text-align: center;
  
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header h3 {
  margin-top: 0;
  margin-bottom: 5px;
  color: #5a4b41;
  font-size: 20px;
}

.modal-instruction {
  font-size: 12px;
  color: #8c7b70;
  margin-top: 0;
  margin-bottom: 15px;
}

.copy-box {
  position: relative;
  display: inline-block;
  padding: 10px 20px;
  border: 2px dashed #d1b44c;
  border-radius: 8px;
  cursor: pointer;
  background-color: #fffdf5;
  transition: background-color 0.2s, transform 0.1s;
}

.copy-box:hover {
  background-color: #fff9db;
  transform: translateY(-2px);
}

.copy-box:active {
  transform: translateY(0);
}

.discord-copy-tag {
  color: #d1b44c;
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.tooltip {
  visibility: hidden;
  position: absolute;
  width: 130px;
  background-color: #5a4b41;
  color: #fff;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
  bottom: 125%;
  left: 50%;
  margin-left: -65px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 11px;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #5a4b41 transparent transparent transparent;
}

.copy-box:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* ========================================== */
/* COZY CELESTIAL SHINY CARD EFFECT (FIXED!)  */
/* ========================================== */

/* 1. I-secure ang card faces nang hindi pinuputol ang decorations sa gilid */
.card-front, .card-back {
  position: absolute;
}

/* 2. Dito inilapat ang clipping mask at gradient animation para hindi lumampas */
.card-front::after, .card-back::after {
  content: '';
  position: absolute;
  
  /* Nakadikit nang saktong-sakto sa mismong anyo ng card nating 20px radius */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px; 
  pointer-events: none;
  
  /* Ito ang pumipigil sa kislap na lumampas sa kurbada ng card base */
  clip-path: inset(0 round 20px); 
  
  /* Ang mahiwagang holographic gradient brush natin */
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 253, 230, 0.4) 40%, /* Warm star glow */
    rgba(255, 255, 255, 0.7) 50%, /* Bright highlight */
    rgba(255, 253, 230, 0.4) 60%,
    rgba(255, 255, 255, 0) 70%
  );
  
  /* Ginawa nating 3x ang haba para ma-slide natin ang kulay nang hindi gumagalaw ang element */
  background-size: 300% 100%; 
  z-index: 3; /* Sa ibabaw ng profile details pero sa ilalim ng .card-deco-layer (z-index: 5) */
}

/* 3. Pag-trigger ng Animation para sa Harap at Likod */
.card-front::after {
  animation: autoShineFront 4s infinite ease-in-out;
}

.card-back::after {
  animation: autoShineBack 4s infinite ease-in-out;
}

/* --- EYE-SAFE PATTERN SHINE KEYFRAMES (Moving Background-Position Only!) --- */

/* Front Card Sweep: Mula kanan pakaliwa sa background */
@keyframes autoShineFront {
  0% {
    background-position: 150% 0;
  }
  62.5% { /* 2.5s sweep */
    background-position: -50% 0;
  }
  100% {
    background-position: -50% 0; /* 1.5s delay bago umulit */
  }
}

/* Back Card Sweep: Sabay pero swabe rin ang takbo */
@keyframes autoShineBack {
  0% {
    background-position: 150% 0;
  }
  62.5% {
    background-position: -50% 0;
  }
  100% {
    background-position: -50% 0;
  }
}

/* ========================================== */
/* REACTIVE LAYOUT (PORTRAIT & LANDSCAPE MOBILE) */
/* ========================================== */

@media (max-width: 520px) {
  .card-container {
    transform: scale(0.75); 
    transform-origin: center;
    margin-bottom: -40px; 
  }
  
  .flip-btn {
    transform: scale(0.85);
  }
  
  .modal-card {
    transform: scale(0.8) !important;
  }
}

@media (max-width: 380px) {
  .card-container {
    transform: scale(0.65);
    margin-bottom: -70px;
  }
  
  .flip-btn {
    transform: scale(0.75);
  }
  
  .modal-card {
    transform: scale(0.7) !important;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 5px;
    flex-direction: row; 
    gap: 20px;
  }
  
  .card-container {
    transform: scale(0.75);
    margin: 0;
  }
  
  .flip-btn {
    margin-top: 0;
    transform: scale(0.85);
  }
  
  .modal-card {
    transform: scale(0.75) !important;
  }
}
