:root {
  --accent-color: #b2a5a5;
  --text-color: #ffffff;
  --bg-color: #080808;
  --card-opacity: 0.45;
  --card-blur: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  background: var(--bg-color);
  font-family: 'JetBrains Mono', monospace;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ================= بک‌گراند ویدیو ================= */
#bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: blur(2px) brightness(0.6);
  transition: filter 0.8s ease;
}

#bg-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 0%, rgba(0,0,0,.45) 75%, rgba(0,0,0,.75) 100%),
    linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.5) 100%);
  z-index: 1;
}

/* گرین/نویز ظریف روی کل صفحه برای حس سینمایی */
#bg-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ================= کانواس افکت‌های بک‌گراند (برف/باران) ================= */
#fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ================= افکت آرورا ================= */
body.fx-aurora #bg-overlay::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 1;
  background:
    radial-gradient(circle at 20% 20%, rgba(124,92,255,0.35), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(40,159,245,0.3), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(255,46,99,0.25), transparent 40%);
  mix-blend-mode: screen;
  filter: blur(40px);
  animation: auroraShift 14s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-4%, 3%) scale(1.08); }
  100% { transform: translate(3%, -2%) scale(1.03); }
}

/* ================= افکت تلویزیون قدیمی ================= */
body.fx-oldtv #bg-video {
  filter: blur(2px) brightness(0.55) grayscale(0.4) contrast(1.15);
}

body.fx-oldtv #bg-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.05) 0px,
    rgba(255,255,255,0.05) 1px,
    transparent 1px,
    transparent 3px
  );
  animation: oldtvFlicker 0.15s steps(2) infinite;
}

@keyframes oldtvFlicker {
  0%   { opacity: 0.9; }
  50%  { opacity: 1; }
  100% { opacity: 0.85; }
}

/* ================= صفحه Click to Enter ================= */
#enter-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050505;
  cursor: pointer;
  transition: opacity 0.6s ease;
}

#enter-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255,255,255,0.08), transparent 55%);
}

#enter-content {
  position: relative;
  text-align: center;
  color: #fff;
}

.enter-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  animation: ringPulse 2.2s ease-in-out infinite;
}

.enter-icon svg {
  animation: bounce 2.2s ease-in-out infinite;
}

#enter-text {
  font-size: 13px;
  letter-spacing: 5px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.18); }
  50% { box-shadow: 0 0 0 10px rgba(255,255,255,0); border-color: rgba(255,255,255,0.4); }
}

#enter-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ================= کارت پروفایل ================= */
#page {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

#profile-card {
  width: 320px;
  max-width: 88vw;
  padding: 40px 28px 32px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(26,26,29, var(--card-opacity)), rgba(14,14,16, var(--card-opacity)));
  border: 1px solid rgba(255,255,255,0.1);
  border-top-color: rgba(255,255,255,0.22);
  backdrop-filter: blur(var(--card-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(140%);
  text-align: center;
  box-shadow:
    0 24px 70px rgba(0,0,0,0.55),
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 0 0 1px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

#profile-card.show {
  opacity: 1;
  transform: translateY(0);
}

#profile-card.hidden {
  opacity: 0;
  transform: translateY(14px);
}

/* آواتار */
.avatar-wrap {
  width: 112px;
  height: 112px;
  margin: 0 auto 24px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0.05));
  animation: glow 3s ease-in-out infinite;
}

#avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid #131315;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: 0 0 26px rgba(255,255,255,0.18); }
}

/* اسم کاربری - افکت گلیچ */
#username {
  position: relative;
  font-family: 'Rubik Glitch', cursive;
  font-size: 30px;
  color: var(--text-color);
  letter-spacing: 1px;
  margin-bottom: 18px;
  line-height: 1;
}

#username::before,
#username::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  font-family: inherit;
}

#username::before {
  color: #ff2e63;
  animation: glitchTop 3.5s infinite linear;
  clip-path: inset(0 0 60% 0);
}

#username::after {
  color: #08f7fe;
  animation: glitchBottom 4.2s infinite linear;
  clip-path: inset(60% 0 0 0);
}

body.no-glow #username::before,
body.no-glow #username::after {
  display: none;
}

@keyframes glitchTop {
  0%, 92%, 100% { transform: translate(0,0); opacity: 0; }
  93% { transform: translate(-2px,-1px); opacity: 0.8; }
  95% { transform: translate(2px,1px); opacity: 0.8; }
  97% { transform: translate(-1px,0); opacity: 0; }
}

@keyframes glitchBottom {
  0%, 90%, 100% { transform: translate(0,0); opacity: 0; }
  91% { transform: translate(2px,1px); opacity: 0.8; }
  94% { transform: translate(-2px,-1px); opacity: 0.8; }
  96% { transform: translate(1px,0); opacity: 0; }
}

/* لوکیشن */
#location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--accent-color);
  font-size: 13px;
  letter-spacing: 0.5px;
  margin-bottom: 26px;
}

#location svg {
  opacity: 0.85;
  flex-shrink: 0;
}

/* توضیحات (اختیاری) */
#description {
  color: rgba(255,255,255,0.6);
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 22px;
}

/* شبکه‌های اجتماعی */
#socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.social-link:hover {
  transform: scale(1.08);
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.3);
}

body.colorful-icons .social-link[data-platform="telegram"]:hover {
  background: rgba(40, 159, 245, 0.16);
  border-color: rgba(40, 159, 245, 0.4);
  box-shadow: 0 0 20px rgba(40, 159, 245, 0.25);
}

body.colorful-icons .social-link[data-platform="instagram"]:hover {
  background: rgba(225, 48, 108, 0.16);
  border-color: rgba(225, 48, 108, 0.4);
  box-shadow: 0 0 20px rgba(225, 48, 108, 0.25);
}

body.colorful-icons .social-link[data-platform="discord"]:hover {
  background: rgba(88, 101, 242, 0.16);
  border-color: rgba(88, 101, 242, 0.4);
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.25);
}

body.colorful-icons .social-link[data-platform="twitter"]:hover {
  background: rgba(29, 161, 242, 0.16);
  border-color: rgba(29, 161, 242, 0.4);
  box-shadow: 0 0 20px rgba(29, 161, 242, 0.25);
}

@media (max-width: 380px) {
  #profile-card { width: 90vw; padding: 30px 18px 24px; }
  #username { font-size: 26px; }
}
