/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Variables ──────────────────────────────────────── */
:root {
  --accent:  #00d4ff;
  --accent2: #7b2fff;
  --glow:    0 0 30px rgba(0, 212, 255, 0.7),
             0 0 80px rgba(0, 212, 255, 0.35);
  --glow2:   0 0 60px rgba(123, 47, 255, 0.8),
             0 0 140px rgba(0, 212, 255, 0.5);
}

/* ─── Body ───────────────────────────────────────────── */
body {
  height: 100vh;
  overflow: hidden;
  font-family: Tahoma, sans-serif;
  background: #000;
}

/* ─── GIF background ─────────────────────────────────── */
.gif-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: fill;
  z-index: 0;
}

/* ─── Overlay ────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    to left,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,10,0.55) 60%,
    rgba(0,0,20,0.82) 100%
  );
  z-index: 1;
}

/* ─── Top tab ────────────────────────────────────────── */
.tools-tab {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(5, 10, 30, 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-top: none;
  border-radius: 0 0 16px 16px;
  padding: 10px 28px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.12);
  transition: background 0.25s, box-shadow 0.25s, color 0.25s;
}

.tools-tab:hover {
  background: rgba(10, 20, 60, 0.85);
  box-shadow: 0 4px 32px rgba(0, 212, 255, 0.28);
  color: #fff;
}

/* ─── Wheel container ────────────────────────────────── */
/* دایره کامل — نیمه راست پنهانه پشت لبه صفحه */
.wheel-container {
  position: fixed;
  right: -340px;
  top: 50%;
  transform: translateY(-50%);
  width: 680px;
  height: 680px;
  z-index: 10;
  overflow: visible;
}

/* ─── Wheel (full circle that rotates) ───────────────── */
.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  transition: transform 1.1s cubic-bezier(0.77, 0, 0.18, 1);
  cursor: pointer;
}

.wheel.spinning {
  transform: rotate(180deg);
}

/* ─── Both halves ────────────────────────────────────── */
.half {
  position: absolute;
  width: 50%;
  height: 100%;
  top: 0;
  overflow: hidden;
}

/* ─── Front half (left side of circle = visible) ─────── */
.half-front {
  left: 0;
  border-radius: 340px 0 0 340px;
  background: rgba(5, 10, 30, 0.55);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1.5px solid rgba(0, 212, 255, 0.25);
  border-right: none;
  box-shadow: -8px 0 60px rgba(0, 212, 255, 0.15),
              inset 2px 0 30px rgba(0, 212, 255, 0.06);
  transition: box-shadow 0.35s, border-color 0.35s;
}

.half-front:hover {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: var(--glow),
              -8px 0 80px rgba(0, 212, 255, 0.25),
              inset 2px 0 40px rgba(0, 212, 255, 0.12);
}

/* accent line */
.half-front::after {
  content: '';
  position: absolute;
  top: 15%; left: 0;
  width: 2px;
  height: 70%;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent) 40%,
    var(--accent2) 60%,
    transparent
  );
  border-radius: 2px;
  opacity: 0.7;
  animation: line-glow 2.5s ease-in-out infinite alternate;
}

@keyframes line-glow {
  from { opacity: 0.4; box-shadow: none; }
  to   { opacity: 1;   box-shadow: 0 0 10px var(--accent); }
}

/* ─── Back half (right side = hidden) ────────────────── */
.half-back {
  right: 0;
  border-radius: 0 340px 340px 0;
  background: rgba(5, 10, 30, 0.55);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1.5px solid rgba(123, 47, 255, 0.3);
  border-left: none;
  box-shadow: 8px 0 60px rgba(123, 47, 255, 0.15),
              inset -2px 0 30px rgba(123, 47, 255, 0.07);
}

/* ─── Front content ──────────────────────────────────── */
.content-front {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 30px 40px 50px;
  text-align: center;
  color: #fff;
}

.icon {
  font-size: 56px;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 12px var(--accent));
  animation: float 3s ease-in-out infinite;
}

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

h1 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 0 18px rgba(0, 212, 255, 0.6);
  margin-bottom: 14px;
}

p {
  font-size: 12px;
  line-height: 1.8;
  opacity: 0.75;
  color: #c8e8ff;
}

/* ─── Pulse rings ────────────────────────────────────── */
.pulse-ring {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 212, 255, 0.35);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  animation: pulse-expand 3s ease-out infinite;
  pointer-events: none;
}
.pulse-ring.delay1 { animation-delay: 1.5s; }

@keyframes pulse-expand {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

/* ─── Light burst ────────────────────────────────────── */
.light-burst {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at 40% 50%,
    rgba(255,255,255,0.55) 0%,
    rgba(0, 212, 255, 0.35) 30%,
    transparent 70%
  );
}

.light-burst.active {
  animation: burst-fade 0.6s ease-out forwards;
}

@keyframes burst-fade {
  0%   { opacity: 1;   transform: scale(1); }
  40%  { opacity: 0.8; transform: scale(1.04); }
  100% { opacity: 0;   transform: scale(1); }
}

/* ─── Back content (counter-rotated) ─────────────────── */
.content-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 50px 40px 30px;
  text-align: center;
  color: #fff;
  gap: 12px;
  /* چون دایره ۱۸۰ درجه چرخیده، محتوا counter-rotate میشه */
  transform: rotate(-180deg);
}

.content-back h2 {
  font-size: 14px;
  font-weight: 700;
  color: #e0c8ff;
  text-shadow: 0 0 14px rgba(123, 47, 255, 0.7);
}

/* ─── Textarea wrapper ───────────────────────────────── */
.textarea-wrapper {
  position: relative;
  width: 100%;
}

.textarea-wrapper textarea {
  width: 100%;
  height: 130px;
  background: rgba(123, 47, 255, 0.12);
  border: 1px solid rgba(123, 47, 255, 0.45);
  border-radius: 10px;
  color: #fff;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  line-height: 1.8;
  padding: 10px 12px 26px 12px;
  resize: none;
  outline: none;
  direction: rtl;
}

.textarea-wrapper textarea::placeholder {
  color: rgba(200, 180, 255, 0.45);
}

.textarea-wrapper textarea:focus {
  border-color: rgba(123, 47, 255, 0.8);
  box-shadow: 0 0 12px rgba(123, 47, 255, 0.35);
}

/* ─── Char counter ───────────────────────────────────── */
.char-counter {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-size: 10px;
  color: rgba(200, 180, 255, 0.55);
  pointer-events: none;
  direction: ltr;
}

.char-counter.near-limit {
  color: #ffaa00;
}

.char-counter.at-limit {
  color: #ff4444;
}

/* ─── Send button ────────────────────────────────────── */
.send-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--accent2), #3d1a80);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: Tahoma, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.25s, opacity 0.25s;
}

.send-btn:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(123, 47, 255, 0.6);
}

.send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ─── Cancel link ────────────────────────────────────── */
.cancel-link {
  display: block;
  width: 100%;
  padding: 10px;
  background: rgba(180, 30, 30, 0.25);
  border: 1px solid rgba(255, 80, 80, 0.35);
  border-radius: 10px;
  color: rgba(255, 140, 140, 0.85);
  font-family: Tahoma, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s, box-shadow 0.25s;
}

.cancel-link:hover {
  background: rgba(180, 30, 30, 0.4);
  box-shadow: 0 0 16px rgba(255, 80, 80, 0.3);
  color: #ff9999;
