/* ============================================
   Template t4: Memories & Love
   Multi-page: wish → heart gallery → wheel → music
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

body {
  --font-display: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Cormorant Garamond', Georgia, serif;
  --bg-primary: #0d0510;
  --accent: #d4567a;
  --accent-soft: rgba(212, 86, 122, 0.25);
  --t4-scale: 1.22;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d0510;
  font-family: var(--font-body);
  font-size: calc(1rem * var(--t4-scale));
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Background ---- */
.t4-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.t4-bg-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 50% 10%, rgba(212, 86, 122, 0.12) 0%, transparent 50%),
              radial-gradient(ellipse 80% 120% at 80% 90%, rgba(233, 30, 99, 0.08) 0%, transparent 45%),
              radial-gradient(ellipse at center, #1a0a18 0%, #0d0510 60%, #050208 100%);
}

.t4-bg-hearts {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Individual heart symbols – glow intensity set by JS from cursor distance */
.t4-bg-heart {
  position: absolute;
  --glow: 0;
  width: 30px;
  height: 30px;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  opacity: calc(0.06 + var(--glow) * 0.7);
  filter: drop-shadow(0 0 calc(var(--glow) * 12px) rgba(212, 86, 122, 0.9))
          drop-shadow(0 0 calc(var(--glow) * 6px) rgba(212, 86, 122, 0.6));
  transition: opacity 0.2s ease, filter 0.2s ease;
  color: #d4567a;
  animation: t4-heart-float 4s ease-in-out infinite;
}

@keyframes t4-heart-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-8px); }
}

.t4-bg-heart svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---- Horizontal slider: next = slide left (in from right), prev = slide right (in from left) ---- */
.t4-slider {
  position: relative;
  z-index: 1;
  width: 400vw;
  min-width: 400vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: visible;
  display: flex;
  transition: transform 0.6s cubic-bezier(0.35, 0.1, 0.25, 1);
  will-change: transform;
}

.t4-slider.t4-slide-1 { transform: translateX(0); }
.t4-slider.t4-slide-2 { transform: translateX(-100vw); }
.t4-slider.t4-slide-3 { transform: translateX(-200vw); }
.t4-slider.t4-slide-4 { transform: translateX(-300vw); }

.t4-page {
  position: relative;
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.t4-page-inner {
  max-width: 520px;
  width: 100%;
  margin: auto;
  text-align: center;
}

/* Bounce-in physics when page enters (next/back) */
.t4-page-inner.t4-bounce-in {
  animation: t4-bounce-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes t4-bounce-in {
  0% {
    transform: scale(0.92) translateY(12px);
    opacity: 0.7;
  }
  55% {
    transform: scale(1.03) translateY(-4px);
    opacity: 1;
  }
  75% {
    transform: scale(0.98) translateY(2px);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.t4-page-1 .t4-page-inner {
  max-width: 660px;
}

/* ---- Page 1: Wish ---- */
@keyframes t4-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.t4-wish-spinning {
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: t4-fade-in 1.2s ease-out forwards;
}

.t4-wish-spinning img {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.t4-wish-title {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 30px var(--accent-soft);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  animation: t4-fade-in 1.2s ease-out 0.35s forwards, t4-title-wave 2.5s ease-in-out 1.6s infinite;
}

@keyframes t4-title-wave {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-4px); }
  50% { transform: translateY(2px); }
  75% { transform: translateY(-3px); }
}

.t4-wish-quote {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.6;
  color: #ffffff;
  margin: 0 auto 1.75rem;
  padding: 0 1.25rem;
  max-width: min(660px, 92vw);
  width: 100%;
  min-height: 1.6em;
}

.t4-quote-highlight {
  color: #ffb6c1;
  text-shadow: 0 0 20px rgba(255, 182, 193, 0.5);
}

.t4-wish-gif {
  margin-bottom: 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(212, 86, 122, 0.25);
}

.t4-wish-gif img {
  width: 100%;
  max-width: 240px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ---- Fixed nav: prev (bottom left), next (bottom right) ---- */
.t4-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  pointer-events: none;
  padding: 1.25rem 1.5rem;
}

.t4-nav button {
  pointer-events: auto;
  font-family: var(--font-display);
  font-size: 1.15rem;
  padding: 0.8rem 1.65rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease, visibility 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.t4-btn-prev {
  position: absolute;
  left: 1.5rem;
  bottom: 1.25rem;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-secondary, #fff);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.t4-btn-prev:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.04);
}

.t4-btn-next {
  position: absolute;
  right: 1.5rem;
  bottom: 1.25rem;
  background: linear-gradient(135deg, #d4567a 0%, #a03050 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(212, 86, 122, 0.4);
}

.t4-btn-next:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(212, 86, 122, 0.5);
}

.t4-nav button:active {
  transform: scale(0.98);
}

.t4-btn-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.t4-btn-next:hover .t4-btn-arrow {
  transform: translateX(4px);
}

.t4-btn-prev:hover .t4-btn-arrow {
  transform: translateX(-4px);
}

.t4-nav.t4-on-page-1 .t4-btn-prev {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.2s ease;
}

.t4-nav.t4-on-page-4 .t4-btn-next {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.2s ease;
}

/* ---- Page 2: Heart-shaped gallery ---- */
.t4-gallery-title {
  position: absolute;
  left: 1.5rem;
  top: 1.5rem;
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.9rem, 5vw, 2.45rem);
  font-weight: 700;
  color: #f0b8c8;
  text-align: left;
  margin: 0;
  padding: 0;
  text-shadow: 0 0 24px rgba(212, 86, 122, 0.35);
  animation: t4-gallery-title-in 1s ease-out forwards, t4-gallery-title-bounce 2.5s ease-in-out 1.1s infinite;
}

@keyframes t4-gallery-title-in {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes t4-gallery-title-bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-3px); }
  70% { transform: translateY(2px); }
}

.t4-heart-gallery {
  position: relative;
  width: 440px;
  height: 400px;
  margin: 0 auto 2.5rem;
}

 .t4-heart-frame {
  position: absolute;
  width: 132px;
  height: 132px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(212, 86, 122, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.t4-heart-frame img,
.t4-heart-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Heart shape positions (8 frames, no top center) */
.t4-heart-gallery .t4-heart-frame:nth-child(1)  { left: 22%;  top: 18%;  transform: translate(-50%, -50%); }
.t4-heart-gallery .t4-heart-frame:nth-child(2)  { left: 78%;  top: 18%;  transform: translate(-50%, -50%); }
.t4-heart-gallery .t4-heart-frame:nth-child(3)  { left: 8%;   top: 50%;  transform: translate(-50%, -50%); }
.t4-heart-gallery .t4-heart-frame:nth-child(4)  { left: 50%;  top: 38%;  transform: translate(-50%, -50%); }
.t4-heart-gallery .t4-heart-frame:nth-child(5)  { left: 92%;  top: 50%;  transform: translate(-50%, -50%); }
.t4-heart-gallery .t4-heart-frame:nth-child(6)  { left: 28%;  top: 78%;  transform: translate(-50%, -50%); }
.t4-heart-gallery .t4-heart-frame:nth-child(7)  { left: 72%;  top: 78%;  transform: translate(-50%, -50%); }
.t4-heart-gallery .t4-heart-frame:nth-child(8)  { left: 50%;  top: 99%;  transform: translate(-50%, -50%); }

@keyframes t4-frame-zoom-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.t4-page-2.t4-page-2-active .t4-heart-gallery .t4-heart-frame {
  animation: t4-frame-zoom-in 0.7s ease-out both;
  animation-delay: calc(0.12s * var(--i, 0));
}



/* Hover: scale + glow; !important so it overrides animation fill-mode */
.t4-page-2 .t4-heart-gallery .t4-heart-frame:hover {
  transform: translate(-50%, -50%) scale(1.08) !important;
  box-shadow: 0 8px 24px rgba(212, 86, 122, 0.4), 0 0 0 2px rgba(212, 86, 122, 0.4) !important;
}

/* Torn paper quote - bottom right of page 2 */
.t4-torn-paper-quote {
  position: absolute;
  right: 7rem;
  bottom: 11rem;
  max-width: 260px;
  margin: 0;
  padding: 1.1rem 1.35rem 1.35rem 1.5rem;
  background: linear-gradient(145deg, #f8f4ed 0%, #ebe3d5 100%);
  color: #2c2224;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: rotate(2deg);
  clip-path: polygon(
    0 0, 100% 0, 100% 88%, 97% 92%, 100% 95%, 96% 99%, 100% 100%,
    0 100%, 0 96%, 3% 92%, 0 88%, 2% 84%, 0 80%, 0 0
  );
  animation: t4-torn-paper-in 0.6s ease-out 0.4s backwards;
}

.t4-torn-paper-quote p {
  margin: 0;
}

@keyframes t4-torn-paper-in {
  from {
    opacity: 0;
    transform: rotate(2deg) translateY(12px);
  }
  to {
    opacity: 1;
    transform: rotate(2deg) translateY(0);
  }
}

/* Page 1: mobile view */
@media (max-width: 768px) {
  .t4-wish-title {
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    display: block;
    width: 100%;
  }

  .t4-heart-emoji {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
  }

  .t4-wish-quote {
    text-align: center;
  }
}

/* Page 2: mobile view */
@media (max-width: 768px) {
  .t4-gallery-title {
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
  }

  .t4-heart-gallery {
    width: 300px;
    height: 272px;
    margin-bottom: 1.75rem;
  }

  .t4-heart-frame {
    width: 90px;
    height: 90px;
    border-radius: 12px;
  }

  .t4-page-2 .t4-heart-gallery .t4-heart-frame:hover {
    transform: translate(-50%, -50%) scale(1.06) !important;
  }

  .t4-torn-paper-quote {
    right: 1rem;
    bottom: 6rem;
    max-width: 180px;
    padding: 0.75rem 1rem 1rem 1.1rem;
    font-size: 0.9rem;
  }
}

/* ---- Page 3: Wheel ---- */
.t4-wheel-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.5vw, 2.35rem);
  font-weight: 600;
  color: #ffe3f0;
  margin-bottom: 0.4rem;
}

.t4-wheel-hint {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

.t4-wheel-wrap {
  position: relative;
  width: 270px;
  height: 270px;
  margin: 0 auto 1.75rem;
}

.t4-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 4px rgba(212, 86, 122, 0.4), 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.t4-wheel.spinning {
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.t4-wheel-segment {
  position: absolute;
  width: 50%;
  height: 50%;
  left: 50%;
  top: 50%;
  transform-origin: 0% 0%;
  background: linear-gradient(135deg, rgba(212, 86, 122, 0.55) 0%, rgba(160, 48, 80, 0.65) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  clip-path: polygon(0 0, 100% 0, 70.7% 70.7%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.t4-wheel-segment:nth-child(1) { transform: rotate(0deg); }
.t4-wheel-segment:nth-child(2) { transform: rotate(45deg); }
.t4-wheel-segment:nth-child(3) { transform: rotate(90deg); }
.t4-wheel-segment:nth-child(4) { transform: rotate(135deg); }
.t4-wheel-segment:nth-child(5) { transform: rotate(180deg); }
.t4-wheel-segment:nth-child(6) { transform: rotate(225deg); }
.t4-wheel-segment:nth-child(7) { transform: rotate(270deg); }
.t4-wheel-segment:nth-child(8) { transform: rotate(315deg); }

.t4-wheel-label {
  position: absolute;
  top: 8%;
  left: 22%;
  font-size: 1rem;
  opacity: 0.95;
  transform: rotate(-22.5deg);
  pointer-events: none;
}

.t4-wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid #d4567a;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  z-index: 2;
  pointer-events: none;
}

.t4-wheel-reveal {
  min-height: 64px;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1.25rem;
  border-radius: 14px;
  background: rgba(212, 86, 122, 0.15);
  border: 1px solid rgba(212, 86, 122, 0.3);
}

.t4-wheel-quote {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 3.2vw, 1.35rem);
  font-style: italic;
  line-height: 1.5;
  color: #ffe3f0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.t4-wheel-reveal.revealed .t4-wheel-quote {
  opacity: 1;
}

.t4-btn-spin {
  font-family: var(--font-display);
  font-size: 1.25rem;
  padding: 0.75rem 1.85rem;
  background: linear-gradient(135deg, #d4567a 0%, #a03050 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(212, 86, 122, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 1rem;
  -webkit-tap-highlight-color: transparent;
}

.t4-btn-spin:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(212, 86, 122, 0.5);
}

.t4-btn-spin:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ---- Page 4: Music ---- */
.t4-music-title {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  font-weight: 700;
  color: #f0b8c8;
  text-shadow: 0 0 24px rgba(212, 86, 122, 0.35);
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
  animation: t4-quiz-title-bounce 2.3s ease-in-out 0.8s infinite;
}

.t4-music-sub {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.6;
  color: #ffffff;
  margin-bottom: 2.25rem;
}

.t4-music-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.25rem;
}

.t4-music-disc {
  position: relative;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffe3f0, #d4567a 45%, #3b1022 80%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 0 4px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.t4-music-visual.playing .t4-music-disc {
  animation: t4-music-spin 8s linear infinite;
}

.t4-music-disc-inner {
  width: 92%;
  height: 92%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.6);
}

.t4-music-disc-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.t4-music-disc-hole {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle, #111 0%, #444 60%, #000 100%);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.8), inset 0 0 4px rgba(255, 255, 255, 0.25);
}

@keyframes t4-music-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.t4-music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.t4-music-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: linear-gradient(135deg, rgba(212, 86, 122, 0.4) 0%, rgba(160, 48, 80, 0.5) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(212, 86, 122, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.t4-music-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(212, 86, 122, 0.4);
}

.t4-music-icon-pause,
.t4-music-icon-muted {
  display: none;
}

.t4-music-play.playing .t4-music-icon-play {
  display: none;
}

.t4-music-play.playing .t4-music-icon-pause {
  display: inline;
}

.t4-music-mute.muted .t4-music-icon-unmuted {
  display: none;
}

.t4-music-mute.muted .t4-music-icon-muted {
  display: inline;
}

.t4-music-note {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

/* ---- Page 3: Funny quiz ---- */
.t4-quiz-title {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  font-weight: 700;
  color: #f0b8c8;
  text-shadow: 0 0 24px rgba(212, 86, 122, 0.35);
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
  animation: t4-quiz-title-bounce 2.3s ease-in-out 0.8s infinite;
}

.t4-quiz-question {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.8vw, 1.6rem);
  font-weight: 500;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.4rem;
}

.t4-quiz-highlight {
  font-weight: 700;
  color: #ffe3f0;
}

@keyframes t4-quiz-title-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-4px);
  }
  65% {
    transform: translateY(2px);
  }
}

.t4-quiz-card {
  margin: 0 auto;
  margin-bottom: 1.75rem;
  padding: 1.1rem 1.25rem 1.4rem;
  max-width: 360px;
  border-radius: 18px;
  background: rgba(6, 1, 10, 0.7);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.t4-quiz-input-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.t4-quiz-input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
}

.t4-quiz-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.t4-quiz-input:focus {
  border-color: rgba(255, 227, 240, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 227, 240, 0.6);
}

.t4-quiz-submit {
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  border: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #d4567a 0%, #a03050 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.t4-quiz-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65);
}

.t4-quiz-submit:active {
  transform: translateY(0);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.55);
}

.t4-quiz-message {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 0.75rem 0;
  min-height: 1.2em;
}

.t4-quiz-gif-wrap {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0 0.9rem;
}

.t4-quiz-gif {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.7);
}

.t4-quiz-success {
  display: none;
  text-align: center;
}

.t4-quiz-success.is-visible {
  display: block;
}

.t4-quiz-success-gif {
  width: 300px;
  height: 180px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.75);
  margin-bottom: 1rem;
}

/* Arish client: Keep GIF always animating */
.arish-animated-gif {
  animation: none !important;
  will-change: auto;
  image-rendering: auto;
}

.arish-animated-gif:hover {
  animation: none !important;
}

.t4-quiz-success-text {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.2vw, 1.6rem);
  color: #ffe3f0;
  margin: 0;
}

.t4-quiz-card.t4-quiz-hidden {
  display: none;
}
