/* استایل‌های شاد، جذاب و کودکانه برای بازی شوتر اتاق اسباب‌بازی */
:root {
  --primary-color: #ff6b81;
  --secondary-color: #70a1ff;
  --accent-color: #ffa502;
  --mint-color: #2ed573;
  --bg-overlay: rgba(255, 255, 255, 0.88);
  --text-color: #2f3542;
  --card-bg: rgba(255, 255, 255, 0.95);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  background-color: #a4b0be;
  color: var(--text-color);
  direction: rtl;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* رابط کاربری روی صحنه سه‌بعدی */
.hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.hud-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  border: 3px solid #f1f2f6;
  transition: transform 0.2s ease;
}

.hud-card:hover {
  transform: translateY(-2px);
}

.hud-card.score {
  color: #ff4757;
}

.hud-card.timer {
  color: #2ed573;
}

.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  pointer-events: none;
  z-index: 15;
  display: none;
}

.crosshair::before, .crosshair::after {
  content: '';
  position: absolute;
  background: #ff4757;
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(255, 71, 87, 0.6);
}

.crosshair::before {
  top: 16px;
  left: 0;
  width: 36px;
  height: 4px;
}

.crosshair::after {
  top: 0;
  left: 16px;
  width: 4px;
  height: 36px;
}

.crosshair-dot {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 8px;
  height: 8px;
  background: #ffa502;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

/* کارت‌ها و پاپ‌آپ‌ها */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(47, 53, 66, 0.65);
  backdrop-filter: blur(6px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  width: 90%;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
  border: 4px solid #fff;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.game-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 8px;
  font-weight: 800;
  text-shadow: 2px 2px 0px #ffeaa7;
}

.game-subtitle {
  font-size: 1rem;
  color: #747d8c;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
  text-align: right;
}

.form-group label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 8px;
  font-weight: 600;
  color: #57606f;
}

.input-field {
  width: 100%;
  padding: 14px 18px;
  font-size: 1.1rem;
  font-family: inherit;
  border: 2px solid #ced6e0;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f1f2f6;
  text-align: center;
}

.input-field:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 4px rgba(112, 161, 255, 0.25);
  background: #fff;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 15px 24px;
  font-size: 1.2rem;
  font-weight: 800;
  font-family: inherit;
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 71, 87, 0.35);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: linear-gradient(135deg, #2ed573, #7bed9f);
  margin-top: 12px;
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(46, 213, 115, 0.35);
}

.btn-outline {
  background: transparent;
  border: 2px solid #70a1ff;
  color: #70a1ff;
  margin-top: 10px;
}

.btn-outline:hover {
  background: #70a1ff;
  color: #fff;
}

/* جدول رتبه‌بندی */
.leaderboard-table {
  width: 100%;
  margin-top: 18px;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 0.95rem;
}

.leaderboard-table th {
  padding: 8px 12px;
  color: #747d8c;
  font-weight: 600;
  border-bottom: 2px solid #f1f2f6;
}

.leaderboard-table td {
  padding: 10px 14px;
  background: #f8f9fa;
  font-weight: 600;
}

.leaderboard-table tr td:first-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  width: 15%;
}

.leaderboard-table tr td:last-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  color: #ff4757;
  font-weight: 800;
}

.instructions {
  background: #f1f2f6;
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: #57606f;
  line-height: 1.6;
  text-align: right;
}

.instructions ul {
  padding-right: 20px;
  margin-top: 6px;
}

/* نشانگر اثر شلیک / پیام امتیاز */
.score-toast {
  position: absolute;
  color: #ffa502;
  font-size: 1.5rem;
  font-weight: 900;
  pointer-events: none;
  animation: floatUp 0.8s ease-out forwards;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
  z-index: 20;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1.4);
  }
}
