/* ============================================================
   دوئل — استایل بازی
   ============================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #070514;
  --ink: #f3f0ff;
  --dim: #a49ecb;
  --dim2: #746e9c;
  --p1: #ff5c9d;
  --p1b: #ffb0d1;
  --p2: #2ee6c8;
  --p2b: #a4f8ec;
  --gold: #ffd166;
  --panel: rgba(255, 255, 255, .055);
  --panel2: rgba(255, 255, 255, .085);
  --stroke: rgba(255, 255, 255, .11);
  --radius: 24px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Vazirmatn', Tahoma, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font-family: inherit; }

/* ---------------------------------------------------- پس‌زمینه‌ی زنده */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, #1a1046 0%, #0b0722 45%, #060411 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  will-change: transform;
}
.b1 {
  width: 62vw; height: 62vw; max-width: 520px; max-height: 520px;
  background: radial-gradient(circle, #ff3d8b 0%, rgba(255, 61, 139, 0) 68%);
  top: -12vh; right: -14vw;
  animation: drift1 18s ease-in-out infinite;
}
.b2 {
  width: 58vw; height: 58vw; max-width: 480px; max-height: 480px;
  background: radial-gradient(circle, #1fe0c0 0%, rgba(31, 224, 192, 0) 68%);
  bottom: -14vh; left: -12vw;
  animation: drift2 22s ease-in-out infinite;
}
.b3 {
  width: 70vw; height: 70vw; max-width: 560px; max-height: 560px;
  background: radial-gradient(circle, #7a3dff 0%, rgba(122, 61, 255, 0) 66%);
  top: 30vh; left: 20vw;
  opacity: .38;
  animation: drift3 26s ease-in-out infinite;
}
.grain {
  position: absolute;
  inset: 0;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

@keyframes drift1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-6vw, 8vh, 0) scale(1.12); }
}
@keyframes drift2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
  50% { transform: translate3d(7vw, -6vh, 0) scale(.92); }
}
@keyframes drift3 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-8vw, -5vh, 0) scale(1.15); }
}

#fx {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

/* ---------------------------------------------------- چیدمان کلی */
#app {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 calc(env(safe-area-inset-bottom) + 8px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 4px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.2px;
}
.brand-mark {
  font-size: 20px;
  filter: drop-shadow(0 0 10px rgba(255, 92, 157, .8));
}
.brand-text {
  background: linear-gradient(90deg, #fff, #c9b8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .15s, background .2s;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn.muted { opacity: .45; }
.top-actions { display: flex; align-items: center; gap: 8px; }

main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding: 8px 16px 20px;
}
.screen {
  display: none;
  width: 100%;
  max-width: 520px;
  margin-top: auto;
  margin-bottom: auto;
  animation: screenIn .45s cubic-bezier(.2, .9, .25, 1);
}
.screen.active { display: block; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------- کارت شیشه‌ای */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .09);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

/* ---------------------------------------------------- هیرو */
.hero {
  position: relative;
  text-align: center;
  padding: 6px 0 22px;
}
.hero-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 300px; height: 150px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(255, 92, 157, .45), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}
.title {
  position: relative;
  margin: 0;
  font-size: clamp(58px, 19vw, 86px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -3px;
  background: linear-gradient(175deg, #ffffff 8%, #ffb6d6 42%, #ff4f9a 72%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 30px rgba(255, 79, 154, .45));
  animation: titlePop .8s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes titlePop {
  from { opacity: 0; transform: translateY(16px) scale(.86); }
  to { opacity: 1; transform: none; }
}
.subtitle {
  position: relative;
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 13.5px;
  letter-spacing: -.1px;
}

/* ---------------------------------------------------- فرم */
.field-label {
  display: block;
  font-size: 12px;
  color: var(--dim);
  margin: 4px 2px 8px;
}
.input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 15px;
  border: 1px solid var(--stroke);
  background: rgba(8, 6, 22, .55);
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input::placeholder { color: var(--dim2); }
.input:focus {
  border-color: rgba(255, 92, 157, .65);
  box-shadow: 0 0 0 4px rgba(255, 92, 157, .13);
  background: rgba(8, 6, 22, .78);
}

.avatar-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
  margin: 0 0 18px;
}
.av-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 13px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .04);
  font-size: clamp(18px, 5.6vw, 24px);
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .16s cubic-bezier(.2, 1.4, .4, 1), border-color .2s, box-shadow .2s, background .2s;
}
.av-btn:hover { transform: translateY(-2px); }
.av-btn.on {
  border-color: var(--p1);
  background: rgba(255, 92, 157, .16);
  box-shadow: 0 0 20px -4px var(--p1), inset 0 0 12px -6px var(--p1);
  transform: translateY(-3px) scale(1.06);
}

/* ---------------------------------------------------- دکمه‌ها */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 15px;
  padding: 0 18px;
  height: 46px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform .14s cubic-bezier(.2, 1.3, .4, 1), filter .2s, box-shadow .25s;
  overflow: hidden;
}
.btn:active { transform: scale(.965); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(120deg, #ff3d8b 0%, #ff5fa2 40%, #a855f7 100%);
  box-shadow: 0 10px 30px -10px rgba(255, 61, 139, .85), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-18deg);
  animation: sheen 3.4s ease-in-out infinite;
}
@keyframes sheen {
  0%, 62% { left: -60%; }
  92%, 100% { left: 130%; }
}
.btn-ghost {
  background: var(--panel);
  border: 1px solid var(--stroke);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--panel2); }
.btn-lg { width: 100%; height: 54px; font-size: 16px; border-radius: 17px; }
.btn-sm { height: 42px; font-size: 13.5px; flex: 1; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--dim2);
  font-size: 11.5px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--stroke), transparent);
}

.join-row { display: flex; gap: 8px; }
.code-input {
  text-align: center;
  letter-spacing: 6px;
  font-weight: 700;
  text-transform: uppercase;
  padding-left: 22px;
}
.join-row .btn { flex: 0 0 92px; height: 50px; }

.foot-note {
  text-align: center;
  color: var(--dim2);
  font-size: 12px;
  margin: 16px 0 0;
}

/* ---------------------------------------------------- اتاق انتظار */
.room-card { text-align: center; }
.room-label {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 1px;
}
.room-code {
  margin: 6px 0 2px;
  font-size: clamp(40px, 14vw, 54px);
  font-weight: 700;
  letter-spacing: 8px;
  padding-right: 8px;
  background: linear-gradient(120deg, #fff, #ffb0d1 55%, #a4f8ec);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 24px rgba(255, 92, 157, .45));
  cursor: pointer;
  user-select: all;
  transition: transform .2s;
}
.room-code:active { transform: scale(.97); }
.room-hint { color: var(--dim2); font-size: 12px; }

.room-btns {
  display: flex;
  gap: 8px;
  margin: 16px 0 20px;
}

.vs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.slot {
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  border-radius: 18px;
  border: 1px dashed var(--stroke);
  background: rgba(255, 255, 255, .03);
  transition: all .35s;
}
.slot.filled {
  border-style: solid;
  border-color: rgba(255, 92, 157, .5);
  background: rgba(255, 92, 157, .1);
  box-shadow: 0 0 28px -14px var(--p1);
}
.slot-av { font-size: 34px; line-height: 1.2; }
.slot.empty .slot-av {
  opacity: .35;
  animation: pulseFade 1.8s ease-in-out infinite;
}
.slot-name {
  font-size: 12px;
  margin-top: 4px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes pulseFade {
  0%, 100% { opacity: .25; transform: scale(.96); }
  50% { opacity: .6; transform: scale(1.04); }
}
.vs-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--dim2);
  letter-spacing: 1px;
}

.waiting-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--dim);
}
.dot-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--p2);
  box-shadow: 0 0 0 0 rgba(46, 230, 200, .6);
  animation: dotPulse 1.6s infinite;
}
@keyframes dotPulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 230, 200, .55); }
  70% { box-shadow: 0 0 0 12px rgba(46, 230, 200, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 230, 200, 0); }
}

/* ---------------------------------------------------- صحنه‌ی بازی */
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding: 0 4px;
}
.chip {
  font-size: 12px;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--stroke);
  padding: 7px 12px;
  border-radius: 99px;
  white-space: nowrap;
}
.chip-code { letter-spacing: 2px; font-weight: 700; color: var(--p1b); }

.timer {
  position: relative;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.timer svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
  width: 100%; height: 100%;
}
.timer circle { fill: none; stroke-width: 3; }
.t-bg { stroke: rgba(255, 255, 255, .1); }
.t-fg {
  stroke: url(#g) ;
  stroke: var(--p2);
  stroke-linecap: round;
  stroke-dasharray: 119.4;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .3s linear, stroke .4s;
  filter: drop-shadow(0 0 6px rgba(46, 230, 200, .7));
}
.timer.warn .t-fg { stroke: #ff4d6d; filter: drop-shadow(0 0 8px rgba(255, 77, 109, .9)); }
#timerNum {
  position: relative;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.timer.warn #timerNum { color: #ff9db0; animation: tick .8s infinite; }
@keyframes tick {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.16); }
}

/* آرنا */
.arena {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 6px;
  padding: 16px 10px 10px;
  border-radius: 26px;
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(255, 255, 255, .07), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), var(--shadow);
  overflow: hidden;
}
.arena::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 92, 157, .12), transparent 30%, transparent 70%, rgba(46, 230, 200, .12));
  pointer-events: none;
}
.arena.shake { animation: shakeHard .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes shakeHard {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-8px, 1px, 0); }
  40%, 60% { transform: translate3d(8px, -1px, 0); }
}

.fighter {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px 10px;
  min-width: 0;
}
.fighter.p1 { --c: var(--p1); --c2: #b23bff; }
.fighter.p2 { --c: var(--p2); --c2: #3b8dff; }

.aura {
  position: absolute;
  top: 2px;
  width: 108px; height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0%, transparent 68%);
  opacity: .34;
  filter: blur(14px);
  animation: auraPulse 3.2s ease-in-out infinite;
}
@keyframes auraPulse {
  0%, 100% { transform: scale(1); opacity: .3; }
  50% { transform: scale(1.14); opacity: .5; }
}

.avatar-wrap {
  position: relative;
  width: 88px; height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--c);
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .26), rgba(255, 255, 255, .02) 58%, transparent 72%),
    rgba(10, 8, 26, .9);
  box-shadow: 0 0 30px -8px var(--c), inset 0 0 26px -14px var(--c);
  animation: float 3.6s ease-in-out infinite;
  transition: transform .18s, box-shadow .3s;
  z-index: 2;
}
.fighter.p2 .avatar-wrap { animation-delay: -1.3s; }
.av {
  font-size: 46px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5));
  user-select: none;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

.pname {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--c);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(0, 0, 0, .6);
}

.bars {
  width: 100%;
  margin-top: 6px;
  padding: 0 2px;
}
.hpbar {
  position: relative;
  height: 12px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6);
}
.hpbar .ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff4d6d, #ff9d3d);
  opacity: .75;
  transition: width .95s cubic-bezier(.2, .7, .3, 1) .18s;
}
.hpbar .fill {
  position: absolute;
  inset: 0;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--c), var(--c2));
  box-shadow: 0 0 12px -2px var(--c);
  transition: width .42s cubic-bezier(.2, .8, .2, 1), background .3s;
}
.hpbar .fill::after {
  content: '';
  position: absolute;
  inset: 0 0 50% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .38), transparent);
  border-radius: 99px;
}
.hpbar.low .fill { background: linear-gradient(90deg, #ff4d6d, #ff8f3d); }
.hpnum {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
  letter-spacing: .3px;
}

.energy {
  position: relative;
  height: 5px;
  margin-top: 5px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .45);
  overflow: hidden;
}
.energy i {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffb347, var(--gold), #fff3c4);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.energy.full i {
  box-shadow: 0 0 14px 1px rgba(255, 209, 102, .9);
  animation: energyGlow 1.1s ease-in-out infinite;
}
@keyframes energyGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
}

/* حباب حرف زدن */
.bubble {
  position: absolute;
  top: -6px;
  right: 50%;
  transform: translate(50%, -100%) scale(.6);
  background: #fff;
  color: #1a1030;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 14px;
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .28s cubic-bezier(.2, 1.5, .4, 1);
  z-index: 20;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .8);
}
.bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 50%;
  margin-right: -6px;
  width: 12px; height: 12px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 2px;
}
.bubble.show {
  opacity: 1;
  transform: translate(50%, -100%) scale(1);
}

/* نشان انتخاب */
.pick-badge {
  position: absolute;
  top: 62px;
  right: calc(50% - 46px);
  transform: scale(0);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: rgba(10, 8, 26, .95);
  border: 1.5px solid var(--c);
  box-shadow: 0 0 16px -2px var(--c);
  opacity: 0;
  transition: transform .3s cubic-bezier(.2, 1.6, .4, 1), opacity .2s;
  z-index: 12;
}
.pick-badge.show { transform: scale(1); opacity: 1; }

.center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 2px 0;
  min-width: 64px;
}
.vs-mark {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  color: transparent;
  background: linear-gradient(180deg, #fff, #8b83b8);
  -webkit-background-clip: text;
  background-clip: text;
  opacity: .55;
}
.center-hint {
  font-size: 9.5px;
  color: var(--dim2);
  text-align: center;
  line-height: 1.5;
  max-width: 92px;
  transition: color .3s;
}

/* افکت‌ها روی فایتر */
.fighter.hit .avatar-wrap {
  animation: hitShake .42s cubic-bezier(.36, .07, .19, .97);
  box-shadow: 0 0 40px -4px #ff2d55, inset 0 0 30px -6px #ff2d55;
}
@keyframes hitShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(-9px) rotate(-6deg) scale(1.05); }
  35% { transform: translateX(7px) rotate(5deg) scale(.97); }
  55% { transform: translateX(-5px) rotate(-3deg); }
  75% { transform: translateX(3px) rotate(2deg); }
}
.fighter.lunge.p1 .avatar-wrap { animation: lungeL .45s cubic-bezier(.3, 1.4, .4, 1); }
.fighter.lunge.p2 .avatar-wrap { animation: lungeR .45s cubic-bezier(.3, 1.4, .4, 1); }
@keyframes lungeL {
  0% { transform: translateX(0) scale(1); }
  38% { transform: translateX(-24px) scale(1.12); }
  100% { transform: translateX(0) scale(1); }
}
@keyframes lungeR {
  0% { transform: translateX(0) scale(1); }
  38% { transform: translateX(24px) scale(1.12); }
  100% { transform: translateX(0) scale(1); }
}

.fighter.blocking .avatar-wrap {
  box-shadow: 0 0 44px 2px rgba(120, 190, 255, .85), inset 0 0 30px -6px #7cc4ff;
  animation: shieldPulse .6s ease-out;
}
@keyframes shieldPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.14); }
  100% { transform: scale(1); }
}
.shield-ring {
  position: absolute;
  top: 2px; left: 50%;
  width: 88px; height: 88px;
  margin-left: -44px;
  border-radius: 50%;
  border: 2px solid rgba(140, 200, 255, .9);
  opacity: 0;
  z-index: 3;
}
.shield-ring.go { animation: ringOut .7s ease-out; }
@keyframes ringOut {
  0% { opacity: .95; transform: scale(.7); }
  100% { opacity: 0; transform: scale(1.9); }
}

.fighter.special-glow .avatar-wrap {
  box-shadow: 0 0 60px 6px rgba(255, 209, 102, .95), inset 0 0 34px -4px var(--gold);
}

/* اعداد دمیج */
.dmg {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 45, 85, 1), 0 2px 6px rgba(0, 0, 0, .9);
  pointer-events: none;
  z-index: 30;
  animation: dmgFloat 1.05s cubic-bezier(.2, .8, .3, 1) forwards;
}
.dmg.heal { text-shadow: 0 0 16px rgba(46, 230, 200, 1); }
@keyframes dmgFloat {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.5); }
  22% { opacity: 1; transform: translateX(-50%) translateY(-6px) scale(1.25); }
  40% { transform: translateX(-50%) translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-52px) scale(.9); }
}

/* خط وضعیت */
.status-line {
  margin: 12px 4px 10px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.6;
  padding: 6px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: color .3s;
}
.status-line b { color: var(--ink); font-weight: 700; }

/* ---------------------------------------------------- دکمه‌های حرکت */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.act {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 12px 12px;
  border-radius: 17px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  color: var(--ink);
  text-align: right;
  cursor: pointer;
  transition: transform .14s, border-color .2s, box-shadow .25s, background .2s;
  overflow: hidden;
}
.act-ico {
  grid-row: 1 / span 2;
  font-size: 23px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .5));
}
.act-name { font-size: 14px; font-weight: 700; }
.act-desc { font-size: 10px; color: var(--dim2); margin-top: 1px; }
.act:active { transform: scale(.96); }
.act:hover { border-color: rgba(255, 255, 255, .25); background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .05)); }

.act.chosen {
  border-color: var(--p1);
  background: linear-gradient(180deg, rgba(255, 92, 157, .28), rgba(255, 92, 157, .1));
  box-shadow: 0 0 30px -10px var(--p1), inset 0 0 20px -12px var(--p1);
  transform: translateY(-2px);
}
.act.chosen::before {
  content: '✓';
  position: absolute;
  top: 6px; left: 8px;
  font-size: 12px;
  color: var(--p1b);
}
.act.dimmed { opacity: .38; }

.act-special { border-color: rgba(255, 209, 102, .3); }
.act-special.ready {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(255, 209, 102, .26), rgba(255, 180, 71, .08));
  box-shadow: 0 0 34px -10px var(--gold), inset 0 0 22px -14px var(--gold);
  animation: specialPulse 1.6s ease-in-out infinite;
}
@keyframes specialPulse {
  0%, 100% { box-shadow: 0 0 30px -12px var(--gold); }
  50% { box-shadow: 0 0 42px -6px var(--gold); }
}
.lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 6, 22, .82);
  backdrop-filter: blur(2px);
  font-size: 11px;
  color: var(--dim);
  border-radius: 17px;
  transition: opacity .3s;
}
.act-special.ready .lock { opacity: 0; pointer-events: none; }

/* ---------------------------------------------------- کل کل */
.taunt-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 16px 6px;
  margin: 2px -16px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.taunt-row::-webkit-scrollbar { display: none; }
.taunt {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 99px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .05);
  color: var(--dim);
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s, background .2s, color .2s, border-color .2s;
}
.taunt:active { transform: scale(.93); }
.taunt:hover {
  background: rgba(255, 92, 157, .16);
  border-color: rgba(255, 92, 157, .5);
  color: #fff;
}

/* ---------------------------------------------------- نتیجه */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 3, 12, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.overlay-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
  padding: 28px 22px 22px;
  border-radius: 26px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .12);
  transform: translateY(18px) scale(.94);
  transition: transform .45s cubic-bezier(.2, 1.3, .4, 1);
}
.overlay.show .overlay-card { transform: none; }
.result-emoji {
  font-size: 62px;
  line-height: 1;
  animation: emojiPop .7s cubic-bezier(.2, 1.5, .4, 1);
  filter: drop-shadow(0 8px 24px rgba(255, 209, 102, .5));
}
@keyframes emojiPop {
  0% { transform: scale(0) rotate(-25deg); }
  70% { transform: scale(1.15) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}
.overlay-card h2 {
  margin: 12px 0 4px;
  font-size: 27px;
  font-weight: 700;
  background: linear-gradient(120deg, #fff, #ffd166 60%, #ff8fbf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.overlay-card p {
  margin: 0 0 16px;
  color: var(--dim);
  font-size: 13px;
}
.result-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.result-stats > div {
  flex: 1;
  padding: 10px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--stroke);
}
.result-stats .k { font-size: 10px; color: var(--dim2); }
.result-stats .v { font-size: 16px; font-weight: 700; margin-top: 2px; }
.overlay-card .btn { width: 100%; margin-bottom: 8px; }

/* راهنما */
.help-card { max-width: 380px; text-align: right; }
.help-card h2 {
  text-align: center;
  margin: 0 0 16px;
  font-size: 24px;
}
.tri {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}
.tri-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--dim);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--stroke);
  border-radius: 13px;
  padding: 9px 12px;
}
.tri-row span { font-size: 16px; line-height: 1; }
.tri-row i { color: var(--p1); font-style: normal; font-size: 13px; }
.rules {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rules li {
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.75;
  padding-right: 14px;
  position: relative;
}
.rules li::before {
  content: '•';
  position: absolute;
  right: 1px;
  color: var(--p1);
}
.rules li b { color: var(--ink); font-weight: 700; }

.hidden { display: none !important; }

/* ---------------------------------------------------- توست */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  max-width: calc(100% - 40px);
  text-align: center;
  transform: translate(-50%, 24px);
  background: rgba(20, 16, 40, .96);
  border: 1px solid var(--stroke);
  color: var(--ink);
  font-size: 12.5px;
  padding: 10px 18px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .3s cubic-bezier(.2, 1.3, .4, 1);
  z-index: 90;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .9);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------- ریسپانسیو */
@media (min-width: 720px) {
  .avatar-wrap { width: 104px; height: 104px; }
  .av { font-size: 54px; }
  .aura { width: 126px; height: 126px; }
  .shield-ring { width: 104px; height: 104px; margin-left: -52px; }
  .arena { padding: 22px 18px 14px; }
  .action-grid { gap: 12px; }
  .act { padding: 15px 16px; }
  .act-name { font-size: 15px; }
  .act-desc { font-size: 11px; }
  .screen { max-width: 560px; }
}

@media (max-height: 700px) {
  .hero { padding-bottom: 14px; }
  .title { font-size: 52px; }
  .avatar-wrap { width: 74px; height: 74px; }
  .av { font-size: 38px; }
  .aura { width: 90px; height: 90px; }
  .status-line { margin: 8px 4px 8px; min-height: 28px; font-size: 11.5px; }
  .act { padding: 10px 11px; }
  .taunt-row { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
