/* ==========================================================================
   Base Layout & Typography
   ========================================================================== */
body {
  font-family: 'Inter', sans-serif;
  background-color: #fff5d3;
  overscroll-behavior-y: none;
}

.amiri-regular { 
  font-family: "Amiri", serif; 
  font-weight: 400; 
  font-style: normal;
}

.amiri-bold { 
  font-family: "Amiri", serif; 
  font-weight: 700; 
  font-style: normal;
}

.amiri-regular-italic {
  font-family: "Amiri", serif;
  font-weight: 400;
  font-style: italic;
}

.amiri-bold-italic {
  font-family: "Amiri", serif;
  font-weight: 700;
  font-style: italic;
}

/* Red Serif Links & Headers */
.header-link, a.header-link {
  font-family: "Amiri", serif;
  color: #CC0000;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.header-link:hover, a.header-link:hover {
  opacity: 0.8;
}

.greeting {
  color: #CC0000;
  font-size: clamp(2.5rem, 6vw, 5rem);
  text-align: center;
  padding: 1rem;
  user-select: none;
}

.jp-text, .japanese-font {
  font-family: 'Inter', "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Meiryo", "Yu Gothic", sans-serif;
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */
.custom-scrollbar::-webkit-scrollbar { 
  width: 6px; 
}

.custom-scrollbar::-webkit-scrollbar-track { 
  background: rgba(0, 0, 0, 0.05); 
  border-radius: 8px; 
}

.custom-scrollbar::-webkit-scrollbar-thumb { 
  background: rgba(0, 0, 0, 0.2); 
  border-radius: 8px; 
}

/* ==========================================================================
   3D Flashcard & Perspective Styles
   ========================================================================== */
.perspective-1000 {
  perspective: 1000px;
}

.transform-style-3d {
  transform-style: preserve-3d;
}

.backface-hidden {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.rotate-y-180 {
  transform: rotateY(180deg);
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card-inner.is-flipped {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  box-sizing: border-box;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

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

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.animate-success {
  animation: successPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
   Pill Buttons
   ========================================================================== */
.pill-btn {
  transition: all 0.2s ease;
}

.pill-btn.active {
  background-color: #000000;
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pill-btn:not(.active) {
  background-color: #FFFFFF;
  color: #1F2937;
  font-weight: 600;
}

.pill-btn:not(.active):hover {
  background-color: #F3F4F6;
}

/* ==========================================================================
   Emoji Styles
   ========================================================================== */

   .emoji-outline {
      position: relative;
      color: transparent;
      text-shadow:
          -1px -1px 0 #cc0000,
          1px -1px 0 #cc0000,
          -1px -1px 0 #cc0000,
          1px -1px 0 #cc0000,
          1px -1px 0 #cc0000,
          1px  1px 0 #cc0000,
          -1px  1px 0 #cc0000,
          1px  0px 0 #cc0000;
  }
  .emoji-outline::before {
      position: absolute;
      content: attr(name);
      text-shadow: 0 0 0 #FFF8D6; /* ⬅︎ Set to parents background colour */
  }

  .emoji-filled {
      color: transparent;
      text-shadow: 0 0 0 #cc0000;
  }

  .login-emoji {
      font-size: 2rem;
  }