@font-face {
  font-family: "Inknut Antiqua";
  src: url("/static/fonts/Inknut_Antiqua/InknutAntiqua-Regular.ttf")
    format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inknut Antiqua";
  src: url("/static/fonts/Inknut_Antiqua/InknutAntiqua-Medium.ttf")
    format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inknut Antiqua";
  src: url("/static/fonts/Inknut_Antiqua/InknutAntiqua-Bold.ttf")
    format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Define Chinese font with its own family name */
@font-face {
  font-family: "XiQue YanShuTi";
  /* Use specific name */
  src: url("/static/fonts/喜鹊燕书体(简 繁体).ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --foreground: #fffde9;
  --background: #000000;
  /* Define font stack with English font first, then Chinese, then fallbacks */
  --font-stack: "Inknut Antiqua", "XiQue YanShuTi", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0a;
    --foreground: #fffde9;
  }
}

body {
  background: var(--background);
  color: var(--foreground);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url(../images/noise.png);
  background-size: 100px;
  background-repeat: repeat;
  background-position: 50% 50%;
  mix-blend-mode: overlay;
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}
body::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-image: url(../images/noise.png),
    repeating-linear-gradient(transparent, transparent 2px, #7070703d 3px);
  background-size: 100px, auto 100%;
  background-repeat: repeat, repeat;
  pointer-events: none;
  z-index: 2;
}

/* Ensure all body children are above the noise texture */
body > * {
  position: relative;
  z-index: 3;
}
html[lang="zh"] body {
  font-size: calc(1rem + 4px);
  line-height: 1.65;
}

html[lang="zh"] body :where(p) {
  letter-spacing: 0.02em;
  font-size: calc(0.8rem + 8px);
}
html[lang="zh"] body :where(a) {
  letter-spacing: 0.02em;
  font-size: calc(0.8rem + 8px);
}



/* 
html[lang="zh"] body :where(p, span, div, li, button, input, textarea) {
  letter-spacing: 0.02em;
  font-size: calc(0.8rem + 8px);
} */
/* Utility classes for Chinese typography adjustments */
/* html[lang="zh"] .zh-text-sm {
  font-size: 1.95em;
}

html[lang="zh"] .zh-text-base {
  font-size: 1.05em;
}

html[lang="zh"] .zh-text-lg {
  font-size: 1.15em;
}

html[lang="zh"] .zh-text-xl {
  font-size: 1.25em;
}

html[lang="zh"] .zh-tight {
  letter-spacing: 0.01em;
}

html[lang="zh"] .zh-loose {
  letter-spacing: 0.05em;
} */



a {
  color: inherit;
  text-decoration: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  box-sizing: border-box;
}

button {
  all: unset;
  cursor: pointer;
  box-sizing: border-box;
}

/* Slightly enlarge Chinese button text without affecting other locales */
html[lang="zh"] button,
html[lang="zh"] [role="button"],
html[lang="zh"] [data-component*="btn"],
html[lang="zh"] .btn {
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  font-family: "XiQue YanShuTi", "Inknut Antiqua", system-ui, sans-serif;
}

/* Custom styles for the upload circles */
.upload-circle {
  transition: all 0.3s ease;
}

.upload-circle:hover {
  transform: scale(1.02);
}

/* Dotted border animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.rotating-border {
  animation: rotate 20s linear infinite;
}

/* Styles for pages after agreeing to privacy */
body.agreed-style {
  background-color: #000000;
  color: #fffde9;
}

body.agreed-style::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url("/static/images/bg2.png");
  background-size: cover;
  background-position: center;
  opacity: 0.7;
  z-index: -1;
  /* Ensure it's behind other content */
}

/* Ensure content on agreed pages is above the background overlay */
body.agreed-style > * {
  position: relative;
  z-index: 1;
}

/* Reset specific elements that might override the body style */
body.agreed-style .bg-white,
body.agreed-style .bg-gray-100,
body.agreed-style .text-black,
body.agreed-style .text-gray-700 {
  background-color: transparent !important;
  /* Override existing backgrounds */
  color: #fffde9 !important;
  /* Override existing text colors */
}

/* Adjust panel background if needed */
body.agreed-style .left-panel,
body.agreed-style .right-panel {
  background-color: rgba(0, 0, 0, 0.6) !important;
  /* Semi-transparent black for panels */
  box-shadow: none !important;
  /* Remove shadow if desired */
}

.mask-radial-fading {
  mask-image: radial-gradient(circle, #fffde9 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle, #fffde9 20%, transparent 70%);
}

@layer utilities {
  .radial-fade {
    background-image: radial-gradient(circle, #fffde9 60%, transparent 70%);
  }

  .radial-fade-small {
    background-image: radial-gradient(circle, #fffde9 65%, transparent 70%);
  }

  /* 定义自定义属性用于动画 */
  @property --gradient-stop {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 65%;
  }

  .radial-fade-listener {
    --gradient-stop: 65%;
    background-image: radial-gradient(
      circle,
      #fffde9 var(--gradient-stop),
      transparent 70%
    );
    animation: breatheRadial 3s ease-in-out infinite;
  }

  @keyframes breatheRadial {
    0% {
      --gradient-stop: 65%;
    }
    50% {
      --gradient-stop: 50%;
    }
    100% {
      --gradient-stop: 65%;
    }
  }
}

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
}

/* Text Effect 4 - Hover Animation Styles */
.hover-effect .word {
  white-space: nowrap;
}

.hover-effect .char {
  position: relative;
}

.hover-effect {
  font-kerning: none;
  position: relative;
  white-space: nowrap;
}

.hover-effect--bg,
.hover-effect--bg-south {
  --anim: 0;
}

.hover-effect--bg::after,
.hover-effect--bg-south::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: calc(100% + 3px);
  top: 0;
  background-color: rgba(229, 222, 204, 0.1);
  mix-blend-mode: none;
  backdrop-filter: blur(5px);
  transform-origin: 0% 50%;
  transform: scaleX(var(--anim));
}

.hover-effect--bg-south::after {
  z-index: -1;
  left: -8px;
  right: -8px;
  top: -8px;
  bottom: -8px;
  border-radius: 2px;
  height: auto;
  width: auto;
  transform-origin: 50% 100%;
  transform: scaleY(var(--anim));
}

/* Guess页面媒体背景样式 */
.speaker-media-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
}

.speaker-media-background img,
.speaker-media-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.speaker-text-overlay {
  position: relative;
  z-index: 10;
  background: rgba(255, 253, 233, 0.85);
  border-radius: 50%;
  transition: opacity 0.3s ease;
}

/* 圆形点击提示 */
.circle-clickable {
  cursor: pointer;
  position: relative;
}

.circle-clickable::before {
  content: "Click to toggle";
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  color: #fffde9;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.circle-clickable:hover::before {
  opacity: 0.6;
}
