:root {
  --yellow: #FFD93D;
  --yellow-deep: #FFC300;
  --orange: #FF9F1C;
  --orange-deep: #FF6B35;
  --ink: #2B2118;
}

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

body {
  font-family: 'Vazirmatn', sans-serif;
  background: radial-gradient(circle at 50% 0%, #FFE979 0%, var(--yellow) 35%, var(--orange) 100%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 18px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* شناورها */
.floaties { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.floaty {
  position: absolute; top: -10%; font-size: 34px; opacity: 0.35;
  animation: fall 9s linear infinite;
}
@keyframes fall {
  0% { transform: translateY(-10vh) rotate(0deg); }
  100% { transform: translateY(115vh) rotate(360deg); }
}

/* هدر */
.header { text-align: center; margin-bottom: 12px; }
.title {
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  font-weight: 900;
  color: var(--ink);
  text-shadow: 3px 3px 0 rgba(255,255,255,0.7);
  letter-spacing: -1px;
}
.subtitle {
  font-size: clamp(0.95rem, 4vw, 1.2rem);
  font-weight: 700;
  color: #6b4a12;
  margin-top: 6px;
}
.wiggle { display: inline-block; animation: wiggle 1.5s ease-in-out infinite; }
@keyframes wiggle {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(12deg); }
}

/* گردونه */
.wheel-wrap {
  position: relative;
  width: 320px; height: 320px;
  margin: 18px 0 6px;
  display: flex; align-items: center; justify-content: center;
}
.wheel-svg {
  filter: drop-shadow(0 12px 25px rgba(0,0,0,0.25));
  transition: transform 4.2s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}
.pointer {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  font-size: 42px;
  color: var(--orange-deep);
  z-index: 5;
  text-shadow: 0 3px 4px rgba(0,0,0,0.3);
  filter: drop-shadow(0 0 2px #fff);
}
.wheel-hub {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%; background: var(--orange-deep);
  z-index: 6;
}
.wheel-center {
  position: absolute;
  width: 62px; height: 62px; border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25), inset 0 0 0 4px var(--yellow-deep);
  z-index: 4;
  pointer-events: none;
}

/* پیام چرخش */
.spin-msg {
  font-weight: 700; font-size: 1.05rem; color: #6b4a12;
  margin: 8px 0; animation: pulseMsg 1s ease-in-out infinite;
}
@keyframes pulseMsg { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }

/* دکمه بزرگ */
.big-btn {
  margin-top: 14px;
  font-family: inherit;
  font-size: clamp(1.3rem, 6vw, 1.7rem);
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--orange-deep), #FF4E00);
  border: none;
  border-radius: 999px;
  padding: 18px 40px;
  cursor: pointer;
  box-shadow: 0 8px 0 #c23a00, 0 12px 25px rgba(0,0,0,0.3);
  transition: transform 0.12s, box-shadow 0.12s;
  animation: breathe 2.2s ease-in-out infinite;
}
.big-btn:hover:not(.disabled) { transform: scale(1.05); }
.big-btn:active:not(.disabled) {
  transform: translateY(6px) scale(0.98);
  box-shadow: 0 2px 0 #c23a00, 0 5px 12px rgba(0,0,0,0.3);
}
.big-btn.disabled {
  opacity: 0.7; cursor: not-allowed; animation: none;
  background: linear-gradient(135deg, #b0865b, #94663b);
  box-shadow: 0 6px 0 #6b4a2b;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* کارت نتیجه */
.result-card {
  margin-top: 22px;
  width: 100%;
  background: #fff;
  border-radius: 28px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2), inset 0 0 0 5px var(--accent, var(--orange));
  animation: popIn 0.5s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}
.result-card.joke { background: #fff3cd; }
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.5) translateY(30px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.result-emoji { font-size: 72px; animation: bounceEmoji 1.2s ease infinite; }
@keyframes bounceEmoji {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.result-cat {
  font-size: 0.95rem; font-weight: 700; color: var(--accent, var(--orange));
  margin-top: 4px;
}
.result-dish {
  font-size: clamp(1.5rem, 7vw, 2rem); font-weight: 900; color: var(--ink);
  margin: 6px 0;
}
.result-phrase { font-size: 1.05rem; font-weight: 700; color: #7a6a55; }
.result-btns { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.sec-btn {
  font-family: inherit; font-size: 1rem; font-weight: 800;
  border: none; border-radius: 999px; padding: 12px 22px; cursor: pointer;
  transition: transform 0.1s;
}
.sec-btn:active { transform: scale(0.94); }
.sec-btn.again { background: var(--yellow-deep); color: var(--ink); box-shadow: 0 4px 0 #c99e00; }
.sec-btn.find { background: #43AA8B; color: #fff; box-shadow: 0 4px 0 #2e7a62; }

/* تاریخچه */
.history {
  margin-top: 26px; width: 100%;
  background: rgba(255,255,255,0.55);
  border-radius: 20px; padding: 14px 16px;
  backdrop-filter: blur(4px);
}
.history-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; color: #6b4a12; margin-bottom: 10px; font-size: 0.95rem;
}
.clear-btn {
  background: none; border: none; color: var(--orange-deep);
  font-family: inherit; font-weight: 700; cursor: pointer; font-size: 0.85rem;
  text-decoration: underline;
}
.history-list { display: flex; flex-wrap: wrap; gap: 8px; }
.history-item {
  background: #fff; border-radius: 999px; padding: 6px 12px;
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 0.85rem; color: var(--ink);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.h-emoji { font-size: 1.1rem; }

/* دکمه صدا */
.mute-btn {
  position: fixed; top: 14px; left: 14px;
  width: 46px; height: 46px; border-radius: 50%;
  border: none; background: #fff; font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 10;
  transition: transform 0.1s;
}
.mute-btn:active { transform: scale(0.9); }

/* فوتر */
.footer { margin-top: 34px; text-align: center; }
.footer p { font-weight: 700; color: #6b4a12; margin-bottom: 6px; font-size: 0.9rem; }
.footer a {
  color: #fff; background: var(--ink); padding: 8px 18px; border-radius: 999px;
  text-decoration: none; font-weight: 800; font-size: 0.85rem;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

/* کانفتی */
.confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -5%;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-5vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}